To work with Pāli on an ongoing basis it’s helpful to have a suitable unicode font capable of rendering all the diacritical markings as well as a unicode keyboard for inputing text.
For the HTC Thunderbolt Android smartphone the process is fairly straightforward. Given a laptop running Linux this procedure has been successful.
- Download and install the Android SDK
- wget http://dl.google.com/android/android-sdk_r16-linux.tgz
- tar xzvf android-sdk_r16-linux.tgz
- execute ./android-sdk-linux/tools/android and install recommended components
- Connect the HTC Thunderbolt to the computer via USB cable
- On the phone go into Settings -> Applications -> Development and mark the checkbox to enable ‘USB debugging’
- Check /var/log/messages and there should be an entry about the phone having connected. ‘Android Phone’ being they key phrase to search out
- Download fre3vo (http://tinyw.in/1lI)
- Download the Arial Unicode MS font from Microsoft (http://bit.ly/zYEAoV) or any other Pāli friendly font such as Gentium (although Arial Unicode MS is recommended)
- Edit the script below and place the font and temporary root exploit files in the appropriate locations
#!/bin/sh # Quick hack to install unicode font to HTC Thunderbolt # by Charles Stevenson # # Note: if you've rooted your phone you won't need this. # # Requires: Android Debug Bridge (adb) to be installed # adb comes bundled within Android SDK # Assumes: # 1. fre3vo is located in $HOME/Downloads folder # 2. Arial Unicode MS font in $HOME/pali/fonts/arialuni.ttf # Restart adb server just to be certain sudo su - -c 'adb kill-server' sudo su - -c 'adb start-server' # Copy temporary root exploit onto device # and attempt to exploit adb push $HOME/Downloads/fre3vo /data/local/tmp adb shell chmod 777 /data/local/tmp/fre3vo adb shell /data/local/tmp/fre3vo -debug -start f0000000 -end ffffffff # Sample output: # # fre3vo by #teamwin # Please wait... # ... # Scanning region f9e70000... # Potential exploit area found at address f9f0d800:800. # Exploiting device... echo "Sleeping for 5 seconds..." sleep 5 # Remount the device read-write adb remount # Copy the unicode font! adb push $HOME/pali/fonts/arialuni.ttf /system/fonts/DroidSansFallback.ttf
All told the output should resemble this:
$ adb shell $ htcsh * daemon not running. starting it now on port 5037 * * daemon started successfully * 216 KB/s (9796 bytes in 0.044s) fre3vo by #teamwin Please wait... Attempting to modify ro.secure property... fb_fix_screeninfo: id: msmfb smem_start: 2fd00000 smem_len: 300000 type: 0 type_aux: 0 visual: 2 xpanstep: 0 ypanstep: 1 line_length: 1920 mmio_start: 0 accel: 0 fb_var_screeninfo: xres: 480 yres: 800 xres_virtual: 480 yres_virtual: 1600 xoffset: 0 yoffset: 0 bits_per_pixel: 32 activate: 16 height: 94 width: 56 rotate: 0 grayscale: 0 nonstd: 0 accel_flags: 0 pixclock: 0 left_margin: 0 right_margin: 0 upper_margin: 0 lower_margin: 0 hsync_len: 0 vsync_len: 0 sync: 0 vmode: 0 Frame Buffer handle: 4 Buffer offset: 002ee000 Buffer size: 8192 Potential exploit area found at address f9f0d800:800. Exploiting device... Sleeping for 5 seconds... remount succeeded 2861 KB/s (23275812 bytes in 7.943s) done # cd /system/fonts # ls -l DroidSansFallback.ttf -rwxrwxrwx root root 23275812 2010-11-29 08:44 DroidSansFallback.ttf
Caveat: Temporary Root vs Permanent Root
Unfortunately, because the font will not persist due to a trick used by the HTC developers the new font isn’t actually being written to the disk (at least not on the phone tested). Basically, it’s not a good method for a lasting Pāli capable phone.
Therefore, a more permanent level of root access and so-called S-OFF will be necessary. For this we can use a combination of fre3vo followed immediately by a tool called Revolutionary.
- Download Revolutionary for Linux (http://revolutionary.io/revolutionary-0.4pre4.tgz), registration as a beta tester is required which grants a token used when running the application
- Extract the binary tar -xzvf revolutionary-0.4pre4.tgz
- Download su-188.8.131.52-efgh-signed.zip and save to the phone’s sdcard storage from the phone browser or by connecting the phone as a USB drive
- Next, we need to gain temporary root with fre3vo and then execute revolutionary.
- The temporary root exploit won’t work twice in a row so a fresh restart of the phone is a good precaution before moving on
- After a restart, with the phone connected to the computer via USB, run fre3vo as in the script above, it should still be on your phone, adb shell /data/local/tmp/fre3vo -debug -start f0000000 -end ffffffff
- After successful exploitation run Revolutionary ./revolutionary
- Now you can continue… enter your beta key in the program
- After it confirms the beta key it will start the s-off process
- Once it is done it will ask you if you would like to flash recovery
- Choose yes
- This will install Clockworkmod recovery
- Once it is done you will see a nice S-Off with the words REVOLUTIONARY up on top; And a custom recovery
- Now you will still be at the bootloader screen…
- Press Power to enter the recovery screen.
- Push volume down to highlight recovery and push power once again to select it and boot into recovery.
- Now you can use the recovery and install su-184.108.40.206-efgh-signed.zip to get root.
- Use the volume up and down keys to navigate within the recovery and the power button to select the highlighted option.
- Choose install zip
- Choose Zip To Flash
- Then select su-220.127.116.11-efgh-signed.zip
- Reboot after it is done flashing and that’s it…
Manual Installation of Unicode Font
Now that we have a permanent root access we can install the Pāli font and have it persist.
- Copy the arialuni.ttf to the phone’s sdcard storage or adb push the file to /data/local/tmp (I had trouble pushing directly to /system/fonts or remounting the phone as read-writeable after the s-off and root process with revolutionary and su).
$ adb push arialuni.ttf /data/local/tmp 2718 KB/s (23275812 bytes in 8.360s)
- Install a file management program like Root Explorer
- Navigate to /data/local/tmp
- Touch and hold on the arialuni.ttf file
- Choose to ‘Move’ the file
- Navigate to /system/fonts
- Paste the file
- Navigate to /system/fonts and remount the driver as read-write
- Rename the DroidSansFallback.ttf to something like DroidSansFallback.bak
- Rename the arialuni.ttf to DroidSansFallback.ttf
- Remount the disk read-only
App Installation of Unicode Fonts
Finally, we installed the two keyboards. Thumb Keyboard and Unicode Keyboard. By default we use Thumb Keyboard and switch to Unicode Keyboard as needed by touching and holding in a text input area, selecting input method, and toggling back and forth. Unicode Keyboard has configurable preset buttons that I’ve loaded with common romanized Pāli letters.
Restoring Original Fonts
I goofed and didn’t backup my fonts initially. I was able to get the original fonts in entirety (there may be other ways) by downloading AndroidPolice full 441MB backup and extracting everything, and then mounting the system.img as a loopback. The original contents of the /system/fonts folder and MD5 values:
9e94decf013d3e2c9adcc0b97cc5ce44 fonts/DroidSans.ttf 72d8a7bd726dcb180dcc5efcecc1eec0 fonts/ARDJ-KK.ttf 1f5dc2bf62705a7d09533b1538c9c173 fonts/DroidSerif-BoldItalic.ttf 7225b2564c779d0f0c61bd960b7b0337 fonts/DroidSansArabic.ttf 78c0de8abf66567262ee5e4e653fc11c fonts/DroidSansMono.ttf 8d5c58cd7f6f87922227c91edca1a1b3 fonts/ucsh00d_c.ttf 3b6c3214b028debd9f175b63f71508e0 fonts/DroidSerif-Bold.ttf 939889bec9cda51381a5065df3a3bbfd fonts/DroidSansFallback.ttf 610ce61898ee8fdc727e85d4f0a5b198 fonts/HelveticaNeueOTS.ttf e18165ce2b700b1b4daca82e276fcac5 fonts/DroidSerif-Regular.ttf 6467be15f37d86a9356f6b20d83075b0 fonts/DroidSansThai.ttf 1262ad9a9f243ef2e7c80c0bb5f0060d fonts/DroidSerif-Italic.ttf 14a38022f582ef53f856830b54c91f23 fonts/Clockopia.ttf 2471e017e0bae8d66cadb9d7355a65b7 fonts/DroidSansHebrew.ttf 3c0f650c88f1dd66abf4e2d86b2789b8 fonts/DroidSans-Bold.ttf c2d299c9272b95d75091208c7d5245e1 fonts/HelveticaNeueLTPro35Th.ttf afc3c579305f3235446863136537c405 fonts/gcsh00d-hkscs.ttf