Browsing Posts in UNIX

    polish english 

    So, i went to Google Developer Day 2009 last tuesday and got free HTC Magic GDD2009 phone – limited edition.
    It’s very cool toy, has everything i need, but as usual here, MMS/Mail does not work when using normal cellphone SIM card.

    The Story:

    Here, in Japan, people use E-mails to communicate (more popular than SMS), but these are not ‘real’ emails – these are MMS’s converted to emails on the fly by provider.
    So, by sending email to addres xx@softbank.ne.jp, their server will find who is recipient and convert it to MMS, sending to this person.
    Vice-versa, by sending email from phone, it actually is MMS that you send, and provider will convert it to e-mail outside the network.

    The way MMS receiving works: special SMS comes to the phone, it contains first 1024 bytes of message and some data instructing it to download the rest – this remaining part is being downloaded via standard HTTP protocol, but this is when problem starts – Softbank blocks HTTP User-Agent of unknown phones (not being sold by them).

    Another (and the most annoying) problem i encountered, is the android device itself, the edition i have, does not support sending MMS at all.

    Solutions:

    Step 1:

    Make backup of your current device (you can skip it if you’re too lazy or confident ;-) ):

    Please follow these instructions: http://android-dls.com/wiki/index.php?title=Magic_Rooting

    (You can download fastboot from HTC page given in step 2).

    You just need to download Magic modified recovery image,

    http://www.droiddeveloper.com/hrbuilds/recovery-new.img.zip

    unzip it, copy to device and boot your device using it:

    adb push recovery-new.img /sdcard/recovery-new.img
    adb shell sync

    Then, once you have the file on SD card, reboot your android, and while it starts keep “BACK” and “POWER” pressed – android will enter fastboot mode, then type:

    fastboot boot recovery-new.img

    Your android will run this recovery image which allows you few things, like update from sdcard, make backup etc.

    Choose the option to backup nandroid.
    It will place backup of your current device onto the SD card – might be worth keeping :-).

    YOU DO NOT need to ‘root the magic’ or do any other steps from this instructions – these steps are for other purposes, not applicable here.

    Step 2:

    Making android support MMS (if your provider does not block user agent this is the only and final step):

    This will flash your device to the same version as Google IO event, you get few features like Voice synthesis (voice search and voice dial), Amazon MP3 access – these are not present in Japanese version.
    But, the drawback is – You will not have Japanese language support anymore.

    First, make sure you really need to enable MMS, go to Messaging application, start typing, and press menu, if you DO NOT have options lile ‘add subject’, ‘attach’ – then you DO need it.

    -

    Flash it using these instructions from HTC website: http://www.htc.com/www/support/android/google-io-device.html

    You DO NOT need worry that instructions is for Google IO edition and not GDDC09 – these phones are in fact different but there are ways around it.

    I recommend using fastboot method (its not at all hard),

    You will need to downlaod fastboot binary (available at HTC), and 2 of these images: Radio Image and System Image.

    Follow instructions for Radio Image installation, most likely your device will boot after it completes but you will get permanent android starting logo,
    please have your USB cable connected and adb showing logging – you will see that it tries to boot all over again – THIS IS OK – no need to panic.

    Place radio image onto your card by typing:

    adb push <radio-image-package>.zip /sdcard/update.zip
    adb shell sync

    Boot into recovery mode by holding HOME while it reboots, Then choose ALT+s on the screen, next HOME+BACK, device should reboot, it might not start at this point by just showing you android logo – this is ok, no need to panic…

    Once you have radio package downloaded and flashed , time to flash it with system image – this is little tricky:

    Push the image onto SD card:
    adb push <system-image-package>.zip /sdcard/update.zip
    adb shell sync
    Boot into Fastboot (BACK+POWER while you start it) – MAKE NOTE OF ‘hboot’ version – you will need it very shortly.

    You can safely try to flash system image, but it will fail due to incompatible HBOOT version (they require 1.33.3004, and you have probably 1.33.3005).
    No need to worry here, we can make it happen :-).

    So, what you need to do, is to UNPACK your system image to a folder, edit the file android-info.txt, change the require version-bootloader to your hboot version (1.33.3005 most likely), save it, and compress all the files in this directory into new zip file (all of them need to be in the ‘root’ of zipfile).

    So, now you have compatible system image that will work well on your device, try flashing it now, DO NOT FORGET to select options to clean userdata and cache – this is required, without it, your device will boot only to android logo and keep hanging there.

    Step 3:

    Modifying User-Agent string in the MMS client (this *MAY* be enough to complete only this step and it might as well make your device support MMS’s – i have done all steps though):
    (GGDC09 version has MMS disabled, and i am not sure whether just changing MMS app is enough to enable this).

    Geeky version:

    Download android source, follow instructions to compile it, apply this patch:

    --- packages/apps/Mms/src/com/android/mms/transaction/HttpUtils.java  2009-06-12 23:56:28.000000000 +0900
    +++ packages/apps/Mms/src/com/android/mms/transaction/HttpUtils.java  2009-06-12 23:47:20.000000000 +0900
    @@ -220,7 +220,7 @@
    
         private static AndroidHttpClient createHttpClient() {
             AndroidHttpClient client
    -                = AndroidHttpClient.newInstance("Android-Mms/0.1");
    +                = AndroidHttpClient.newInstance("SoftBank/1.0/705NK/NKJ002/SN001 Android-Mms/0.1 Profile/MIDP-2.0 Configuration/CLDC-1.1");
             HttpParams params = client.getParams();
             HttpProtocolParams.setContentCharset(params, "UTF-8");
             return client;
    

    (It will only change your User-Agent string reported to MMS gateway, will not touch the one in web browser).

    Compile the source again, and install new Mms app using adb:

    adb install -r ./out/target/product/generic/system/app/Mms.apk

    Lazy version:

    Download this file, and install using adb:

    adb install -r Mms.apk

    Do not forget to configure your APN (you will find instructions and passwords on the internet), remember NOT TO set apn type to “mms” – didn’t work for me this way.

    All the files you need, are also mirrored Here:http://kuba.fm/filez/

    Useful links:

    Rooting HTC Magic – creating backup

    HTC Google IO device support page

    Android source

    Further work: change more of android source, to have nice settings under MMS app, to edit UserAgent :-D.

    Enjoy :-)

    ——-

    UPDATE!!!

    Thanks to Roberto Jung Drebes , now i know that there’s no need to flash GGDC09 with anything to get MMS working, all it takes is to use my MMS.app (or compile your own) – just the way i suspected.

    Also, he found that setting apn type as ‘mms’ – doesn’t work unless you already have other apn with type ‘default’ – this way it works very well. Good way to ensure you don’t end up with huge phone bill due to data transfer…

    polish english 

    Tulips, but not yet from Holland :-)

    Not long ago we had firm hanami party in Showa Kinen park – very big place, next to emperors garden probably the biggest in tokyo, it’s very cool to be in such big place, especially after living in concrete jungle all the time…

    Img 0498

    Img 0500

    Img 0510

    Img 0518

    Img 0522

    Img 0530-1

    Img 0544

    Img 0547

    Img 0552

    Img 0560

    Yes, that’s im^H^Hpossible, although sybase has not been designed to run on intel macs (yet), and is only available for powerPC i made it.

    Quick recipe (for pretty advanced geeks):

    Download Developer Edition (i did not check other versions), install as normal, it will get installed but will not work (as expected), also none of visual tools will work.

    Now geeky part,

    Now, we need to create database, so please run this command (if it complains about env vars, then go down and set all of those SYBASE* vars before):

    LANG=C /Applications/Sybase/System/ASE-12_5/bin/dataserver -e/Applications/Sybase/System/ASE-12_5/install/kuba_tyszkos_computer_BACKUP.log -d /Applications/Sybase/System/ASE-12_5/master.dat -c /Applications/Sybase/System/ASE-12_5/SYBASE.cfg -b100M

    in file SYBASE.cfg i had to adjust 2 settings: stack size = 131072 and stack guard size = 131072 (with default values server crashed with error “Stack overflow detected: limit: 0×0x02262960, sp: 0×0x02262784″ and “*** Stack guardword corrupted”).

    You may also have to edit “interfaces” file to suit your needs – first run of serer will tell you which record is missing from interface file (in my case it was just “SYBASE”), also, it need resolveable hostname (may need to add your local ip address into /etc/hosts).

    Now, create file that will be actually running our database.

    export SYBASE=/Applications/Sybase/System
    export SYBASE_OCS=OCS-12_5
    export PATH=$SYBASE/$SYBASE_OCS/bin:$PATH
    export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:$SYBASE:$SYBASE/$SYBASE_OCS/lib:$SYBASE/locales

    LANG=C /Applications/Sybase/System/ASE-12_5/bin/dataserver -e/Applications/Sybase/System/ASE-12_5/install/kuba_tyszkos_computer_BACKUP.log -d /Applications/Sybase/System/ASE-12_5/master.dat -c /Applications/Sybase/System/ASE-12_5/SYBASE.cfg

    ###EOF

    (as you can see the only difference is lack of parameter “-b100M” which tells the server to create database of size 100MB)

    Change its permission and run it – should start database server.

    To test (you need all four statements exported to your env):

    LANG=C isql -SSYBASE -Usa

    (press enter when prompted for password)

    And it’s ready ;-)

    Because of lack of time i didn’t have time to check anything more, so i have no idea how stable it is, or does it actually really work..

    Have fun…

    Update,

    after some testing i encountered following problem – i was able to login to database but it didn’t contain anything (only few system tables, but none of system procedures etc), even when creating new master device shows you “creating table…” etc etc, don’t trust it, you will find that even sp_help is missing…

    I recreated database with “-b400M” parameter, restarted system, ran script:

    LANG=C isql -Usa -P -i /Applications/Sybase/System/ASE-12_5/scripts/installmaster

    And encountered another problem “All future modifications to this database will be suspended until the log is successfully dumped and space becomes available” – that was easy, i had to extend log segment issuing “alter database tempdb log on master = 100″ – this resized log segment to 100MB, and after running script again all went fine.
    Now i have fully working database.

    polish 

    Czyli po japonsku “Toookyooo motaaa sioooo”

    Img 7199
    Img 7215
    Img 7268-1
    Img 7276

    Img 7395
    Img 7410
    Img 7420
    Img 7426