[PC-UTIL] [Discontinued] [Source Opened] Android RTL Auto-Patcher + ProTools (v.1.5)

Search This thread

Ambious

Senior Member
May 11, 2008
1,828
478
Haifa
Discontinuation Notice + Source Opened!

This project is now discontinued, as I have moved on to Android 4.X (ICS) which has perfect built-in RTL support.
I will still provide basic support as much as I can, but if your device has it, I recommend you move on to ICS as well.

If you wish to continue working on this project and improving, you have my blessing (as long as you credit me, of course).
Source code is available here, but be-ware: it's an undocumented, unorganized mess.


Android RTL Auto-Patcher
Version 1.5

The Problem

It's a well known fact that while Android has Hebrew and Arabic fonts, it has a problem with Right-To-Left alignment. The problem: It doesn't exist.
Sure, MOST programs display text correctly, but mix text and numbers in the same line and you'll get reverse numbers (123 appears as 321), and in SOME Google apps (like Gmail and Maps) the words themselves are reverse (so 'apple' appears as 'elppa').

The Old Solution

There is a solution for this, however you have to create a separate patch for every build, because the patch changes files in the build's framework. It's a relatively easy process, but for people who change builds constantly, it can get tiresome.

This Program

This program detects if a build is compatible with the patch, and if so - creates it almost automatically and install it back to the phone. A process that took about 10 minutes to complete before and required some knowhow, now takes only seconds and requires almost no prior experience!

rtl01.png


ProTools
The ProTools are a collection of tools that will allow you to patch ROMs manually either directly to ZIP files, to the phone, or to framework files. It will also allow you to push, pull, extract and manipulate files to and from ROMs of all kinds, with great flexibility and ease!

rtl02.png




Compatibility
This program is intended for use with custom DEODEXED roms of Android versions 2.1 and above. The program will inform you if your build is not deodexed.
The program will allow you to either push the fix directly to the device or flash via recovery.
WARNING: Some 'squashedFS' builds have been reported not to be compatible, and the program can not - at the moment - detect those!

Warnings
This program is in Beta stage!
Many features have not been thoroughly tested and error handling is far from perfect.
It may give some errors, crash or stall - at which point I ask that you please send me your log.txt (to find it, click 'About' and then 'Locate Log') or as an upload in this thread.

I do request - however - that you try to be as specific as possible regarding your build, your computer, and what caused the problem.
Also, if you include the log here, please enclose it in 'code' tags.

Requirements
  • You MUST have Microsoft .Net Framework 4 installed for this to work.
  • You will also need the latest Java Runtime Environment
  • You must also have the ADB drivers already installed:
    • In Windows Vista/7, just connect the phone and let Windows Update do it's thing.
    • In Windows XP, you need to manually install the drivers available here.
  • ADB itself comes with the program, so you don't need that.
How to use
  • If available, boot into recovery (recommended for non-rooted devices!)
  • Connect your phone to USB and make sure the computer recognizes it
  • Run the program, and select 'Test Connection'
  • After connection has been made, if the build is compatible - select the correct Sense version. The program WILL attempt to auto-detect, but it's not 100% reliable, so please confirm that the program detected correctly
  • Select distribution method:
    • Push to Device (Recommended) - does simply that, the program will attempt to automatically patch the phone for you.
    • Create ZIP - creates a ZIP file that's flashable through Recovery (Clockwork Recovery Mod). Will also offer you to save the ZIP on the SD card (doesn't even require mounting USB).
    • Show File - will just show you the patched 'framework.jar' so you can do whatever you want with it.
  • Select any additional options you might be interested in (Gingerbread keyboard, for example - is a fixed Gingerbread keyboard with fixed Hebrew RTL that is compatible with the patch the program installs. It should work on 2.2 devices as well, and replaces the stock Android keyboard).
  • GO GO GO!

Reporting bugs
Please be sure to provide the name and type of your build when giving feedback or reporting bugs. For better bug-squashing, please also provide your log.txt file, which you will find in the application's directory.

Also, even if you experienced no bugs, your logs will be appreciated.

Finally, if you put the the log content in your post, PLEASE encode it with 'code' tags.​

If you have any additional non-bug-related questions, feel free to ask them in this thread. I will do my best to improve this program as time goes by.
Thank you, and good luck!

Download
Always available here:
 

Attachments

  • RTLAutoPatcher-1.5.rar
    4.7 MB · Views: 14,513
Last edited:

Ambious

Senior Member
May 11, 2008
1,828
478
Haifa
Changelog, Known Issues and Planned Features

Changelog

1.5 - 14/08/2011
  • Advanced build numbers to 1.5 due to massive advances in the program.
  • Added global error handling - might not solve ALL problems, but will hopefully help avoid unlogged crashes.
  • When "Install Gingerbread Keyboard" and "Create Zip" are both selected, it will now also install the keyboard on the Zip.
  • The program will now also try to mount sd-ext in addition to system before patching (as will the flashable Zip).
  • When patching fails, the program will offer you to save the patched file to your computer for use with ProTools.
  • In the 'About' window, added the option to find the log file on your computer (for easier error reports).
  • Other minor undocumented improvements.
  • Completely overhauled the ProTools:
    • Offline Patching: Allows patching ROM Zips or 'framework.jar' files directly.
    • Manual Operations: Pretty much what ProTools was before, except with an easier straight-forward interface and with the option to operate on a ROM Zip file, from your phone, or directly from a 'framework.jar' file.
    • Added the option to manually push or pull anything to or from anywhere (with specific buttons for 'framework.jar', 'framework-res.apk' (for theming) and 'build.prop'.
    • Added the option to manually patch the Keyboard to the phone or the a ROM Zip.

1.1.2 - 20/07/2011 - minor update
  • Improved Sense 3.0 Detection
  • Updated build detection strings
1.1.0 - 14/06/2011
  • Fixed critical interface bug that caused the operation compelte / restart prompt not to appear if 'Push' was selected.

1.1.0 - 14/06/2011
  • Removed support for SD/SDRAM based builds
  • Instead, created three distribution methods: Push file, Create flashable zip or just Display file
  • Flashable zip will be flashable via recovery, and will attempt to push itself to the device's SD card.

Version 1.0.0 Beta
  • Build Detection:
    • Improved build properties detection
    • Vastly improved Sense detection mechanism
    • Sense versions now distinct by Sense version
    • Added Sense 2.1 (Gingerbread) support
  • 'Pro Tools' (Beta) - Every single function of the patcher can now be called on seperately and manually.
  • Changed versioning scheme. Version 1.0.0 to be assigned.
  • Updated core framework files (fixed a lot of stability issues in Sense2.0 builds)

Planned Features

  • I plan to seriously improve the RTL fix itself in the near future, but since I lack the knowledge to do so myself, I'm waiting for some new methods currently under development by the excellent devs at iAndroid.co.il to be released.
  • I do plan to release to program's source code eventually, it's just such a mess at this point that I'm more ashamed of it than anything else.
  • I also plan to include a logcat monitor. Because the patch causes the phone to rebuild dalvik cache, first boot after patching often takes a VERY LONG time, and some users wrongfully assume their phone is frozen. I plan to include a logcat monitor that will hopefully know to differentiate between bootloops, errors, and dalvik rebuilding, so users can tell if their phone is actually frozen or just working. If this works, I might release this as an actual separate program.

Known Issues

  • Build 1.1.0 - If 'Push' is selected, when patching process finishes, no message is displayed and the program doesn't prompt to restart. - fixed in 1.1.1
  • There is hardly any error handling in the ProTools section. If they are called with no device available, it MAY freeze/crash the program. Will be fixed in upcoming release.
  • Fixes for Squashed filesystem roms do not work! Mostly.
  • Error handling is STILL utter ****e, may give unexpected errors (or not at all and just fail altogether).
  • If HTC Sync is installed and active, stuff may go nuts all around (as of 0.0.5 this is detected by the program and warns user).
Credits

Program and Graphics created by Elad Avron using Visual Studio 2010 Express.

ZIP Functions created by Elad Avron using free libraries from the IC#Code group, available at http://www.icsharpcode.net/opensource/sharpziplib/

Special thanks:
From HTCAddicts.com: Ronenpg, Ohect.
From XDA-Developers.com: TheAgent1982, silverbluem, mdeejay and the entire HD2 dev crew
From iAndroid.co.il: Classicaldude (Original fix, the hero of RTL!), Dudyk (Original fix), rasmux (Modified fix), Liavk1 (partial SenseHD fix), Avicohh (Gingerbread Keyboard), N1Man (RTL fix for Gingerbread Keyboard).

Keyboard fix by Avicohh and N1Man (from iAndoird.co.il)
 
Last edited:

jaguaralani

Senior Member
Aug 3, 2007
2,233
634
50
Perth
jaguaralani-pda.forumms.net
:D

Just tried it V 001 , successfully connected + fetched framework+modified then pushed classes back....
log attached


PC - Win7 + net 4
LeoAndroid - Desire Z ....

Device restarted, passed the first splash (hTC) screen, took very long on the animation one, then started !

Changes :

1-No right side line alignement..
2-Numbers are still wrongly placed..
 

Attachments

  • log.zip
    1.3 KB · Views: 220
  • Like
Reactions: Ambious

Voffchik

Senior Member
Apr 26, 2009
238
19
Tel-Aviv
Tested and it workes!
Got an error in middle of the prosses but in the end it did what it was supposed to do.

Sent from my HTC HD2 using XDA App
 

Ambious

Senior Member
May 11, 2008
1,828
478
Haifa
I appreciate your efforts

reverse numbers problem still exits

big thanks

Can I get build type and log file please?
Thank you :)

:D

Just tried it V 001 , successfully connected + fetched framework+modified then pushed classes back....
log attached


PC - Win7 + net 4
LeoAndroid - Desire Z ....

Device restarted, passed the first splash (hTC) screen, took very long on the animation one, then started !

Changes :

1-No right side line alignement..
2-Numbers are still wrongly placed..

The log indicates that you did everything right and experienced no errors, so there are two things I'd like you to try:
  1. In the 'Toolbox' dir in the app dir, the leftover files from the creation process are left. Try pushing framework.jar manually to the device.
  2. If that doesn't work, try putting 'classes_new.dex' in 'framework.jar', renaming it to 'classes.dex' (thus replacing the old one), and repeat step 1.
  3. If that doesn't work something went wrong in the patching process itself, i.e. my source files aren't good for your build (they should be), the compression failed, or any step in between. Let me know if the leftover framework.jar and classes_new.dex solve the problem, and we'll try to isolate the problem from there.

Thank you all for helping :)
 
Last edited:
  • Like
Reactions: Igr1

NSider

Senior Member
Apr 16, 2007
160
5
Khobar
The alignment works great for Arabic, but the thing with Arabic is that letters need to be connected with each other when they are in one word. From what I gather, this means needing to change stuff in libskia.so and libwebcore.so (both in /system/lib/).

For more info, you can check out the efforts to add Arabic support for many Android devices at http://ardoid.com/
 
  • Like
Reactions: Ambious

Ambious

Senior Member
May 11, 2008
1,828
478
Haifa
The alignment works great for Arabic, but the thing with Arabic is that letters need to be connected with each other when they are in one word. From what I gather, this means needing to change stuff in libskia.so and libwebcore.so (both in /system/lib/).

For more info, you can check out the efforts to add Arabic support for many Android devices at http://ardoid.com/

Yes, I understand it's a problem with a lot of software, not only Android.
I will try to implement patching of Arabic characters in the future, once the program has a more solid base.
 
  • Like
Reactions: Igr1

Sup3r

Member
Apr 4, 2006
49
34
jeddah
this is my log

my build is : MDJ's gingerbread CyanogenMod 7 v. 2.1 [A2SD+][GRH78][RMNET][Kernel: MDJ S10.2 OC

wating the Arabic characters fix


thanks :0
 

Attachments

  • log.txt
    7.8 KB · Views: 19
  • Like
Reactions: Ambious

Ambious

Senior Member
May 11, 2008
1,828
478
Haifa
I sent it yesterday via PM
I sent the log file + screenshot
U said u'll look in to it

Sent from my HTC HD2 using XDA App

Right, sorry, my bad :p
I worked around your reported error in v.0.0.2, it was a little oversight I had in interface design.
Thank you for the report :)

Sent from my Android HTC HD2 using XDA App
 
Last edited:

Ambious

Senior Member
May 11, 2008
1,828
478
Haifa
my build is : MDJ's gingerbread CyanogenMod 7 v. 2.1 [A2SD+][GRH78][RMNET][Kernel: MDJ S10.2 OC

wating the Arabic characters fix


thanks :0

Thank you for the log.
From the log it seems like there were no errors and that everything went as planned. I'm using the same build as you, so I know it's compatible.
What I'd like you to try, if it's not too much hassle, is this:

In the 'toolbox' dir in the app dir, there are leftover files from the process. Push 'frameowkr.jar' to your device's "/system/framework/" using:
Code:
adb push framework.jar /system/framework/
and reboot.
If that solves it, the issue was with the push command (I currently have no method to actually detect if it was successful or not, I hope to fix that in future version).
If even that doesn't solve it, open 'framework.jar' using any zip/rar program, delete 'classes.dex' from it, insert 'classes_new.dex' (from the toolbox dir) into the 'framework.jar' file, and rename to 'classes.dex'. Push to the device, restart, and try again.

If you don't mind doing those things, it would help me greatly to detect where the patching process failed.
Thank you so much, and I promise to include Arabic fix as soon as the program structure is solid enough!
 

Ambious

Senior Member
May 11, 2008
1,828
478
Haifa
Tried V 002

PC - Win7 + net 4
LeoAndroid - Desire Z ....



Log attached


changes

Nothing :confused:

Yeah, well, v002 changes nothing in the process, only the interface.
I'd like you to try, if not too much hassle - to push the framework file manually and reboot.
If that doesn't work, try to put 'classes_new.dex' into 'framework.jar' and rename it to 'classes.dex' and push framework.jar again.
If any of that works then I can narrow down the issue.
On another note, I got reports from other people using DesireZ that the process worked for them, so I know it's compatible, it's just a localized issue.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 35
    Discontinuation Notice + Source Opened!

    This project is now discontinued, as I have moved on to Android 4.X (ICS) which has perfect built-in RTL support.
    I will still provide basic support as much as I can, but if your device has it, I recommend you move on to ICS as well.

    If you wish to continue working on this project and improving, you have my blessing (as long as you credit me, of course).
    Source code is available here, but be-ware: it's an undocumented, unorganized mess.


    Android RTL Auto-Patcher
    Version 1.5

    The Problem

    It's a well known fact that while Android has Hebrew and Arabic fonts, it has a problem with Right-To-Left alignment. The problem: It doesn't exist.
    Sure, MOST programs display text correctly, but mix text and numbers in the same line and you'll get reverse numbers (123 appears as 321), and in SOME Google apps (like Gmail and Maps) the words themselves are reverse (so 'apple' appears as 'elppa').

    The Old Solution

    There is a solution for this, however you have to create a separate patch for every build, because the patch changes files in the build's framework. It's a relatively easy process, but for people who change builds constantly, it can get tiresome.

    This Program

    This program detects if a build is compatible with the patch, and if so - creates it almost automatically and install it back to the phone. A process that took about 10 minutes to complete before and required some knowhow, now takes only seconds and requires almost no prior experience!

    rtl01.png


    ProTools
    The ProTools are a collection of tools that will allow you to patch ROMs manually either directly to ZIP files, to the phone, or to framework files. It will also allow you to push, pull, extract and manipulate files to and from ROMs of all kinds, with great flexibility and ease!

    rtl02.png




    Compatibility
    This program is intended for use with custom DEODEXED roms of Android versions 2.1 and above. The program will inform you if your build is not deodexed.
    The program will allow you to either push the fix directly to the device or flash via recovery.
    WARNING: Some 'squashedFS' builds have been reported not to be compatible, and the program can not - at the moment - detect those!

    Warnings
    This program is in Beta stage!
    Many features have not been thoroughly tested and error handling is far from perfect.
    It may give some errors, crash or stall - at which point I ask that you please send me your log.txt (to find it, click 'About' and then 'Locate Log') or as an upload in this thread.

    I do request - however - that you try to be as specific as possible regarding your build, your computer, and what caused the problem.
    Also, if you include the log here, please enclose it in 'code' tags.

    Requirements
    • You MUST have Microsoft .Net Framework 4 installed for this to work.
    • You will also need the latest Java Runtime Environment
    • You must also have the ADB drivers already installed:
      • In Windows Vista/7, just connect the phone and let Windows Update do it's thing.
      • In Windows XP, you need to manually install the drivers available here.
    • ADB itself comes with the program, so you don't need that.
    How to use
    • If available, boot into recovery (recommended for non-rooted devices!)
    • Connect your phone to USB and make sure the computer recognizes it
    • Run the program, and select 'Test Connection'
    • After connection has been made, if the build is compatible - select the correct Sense version. The program WILL attempt to auto-detect, but it's not 100% reliable, so please confirm that the program detected correctly
    • Select distribution method:
      • Push to Device (Recommended) - does simply that, the program will attempt to automatically patch the phone for you.
      • Create ZIP - creates a ZIP file that's flashable through Recovery (Clockwork Recovery Mod). Will also offer you to save the ZIP on the SD card (doesn't even require mounting USB).
      • Show File - will just show you the patched 'framework.jar' so you can do whatever you want with it.
    • Select any additional options you might be interested in (Gingerbread keyboard, for example - is a fixed Gingerbread keyboard with fixed Hebrew RTL that is compatible with the patch the program installs. It should work on 2.2 devices as well, and replaces the stock Android keyboard).
    • GO GO GO!

    Reporting bugs
    Please be sure to provide the name and type of your build when giving feedback or reporting bugs. For better bug-squashing, please also provide your log.txt file, which you will find in the application's directory.

    Also, even if you experienced no bugs, your logs will be appreciated.

    Finally, if you put the the log content in your post, PLEASE encode it with 'code' tags.​

    If you have any additional non-bug-related questions, feel free to ask them in this thread. I will do my best to improve this program as time goes by.
    Thank you, and good luck!

    Download
    Always available here:
    12
    Changelog, Known Issues and Planned Features

    Changelog

    1.5 - 14/08/2011
    • Advanced build numbers to 1.5 due to massive advances in the program.
    • Added global error handling - might not solve ALL problems, but will hopefully help avoid unlogged crashes.
    • When "Install Gingerbread Keyboard" and "Create Zip" are both selected, it will now also install the keyboard on the Zip.
    • The program will now also try to mount sd-ext in addition to system before patching (as will the flashable Zip).
    • When patching fails, the program will offer you to save the patched file to your computer for use with ProTools.
    • In the 'About' window, added the option to find the log file on your computer (for easier error reports).
    • Other minor undocumented improvements.
    • Completely overhauled the ProTools:
      • Offline Patching: Allows patching ROM Zips or 'framework.jar' files directly.
      • Manual Operations: Pretty much what ProTools was before, except with an easier straight-forward interface and with the option to operate on a ROM Zip file, from your phone, or directly from a 'framework.jar' file.
      • Added the option to manually push or pull anything to or from anywhere (with specific buttons for 'framework.jar', 'framework-res.apk' (for theming) and 'build.prop'.
      • Added the option to manually patch the Keyboard to the phone or the a ROM Zip.

    1.1.2 - 20/07/2011 - minor update
    • Improved Sense 3.0 Detection
    • Updated build detection strings
    1.1.0 - 14/06/2011
    • Fixed critical interface bug that caused the operation compelte / restart prompt not to appear if 'Push' was selected.

    1.1.0 - 14/06/2011
    • Removed support for SD/SDRAM based builds
    • Instead, created three distribution methods: Push file, Create flashable zip or just Display file
    • Flashable zip will be flashable via recovery, and will attempt to push itself to the device's SD card.

    Version 1.0.0 Beta
    • Build Detection:
      • Improved build properties detection
      • Vastly improved Sense detection mechanism
      • Sense versions now distinct by Sense version
      • Added Sense 2.1 (Gingerbread) support
    • 'Pro Tools' (Beta) - Every single function of the patcher can now be called on seperately and manually.
    • Changed versioning scheme. Version 1.0.0 to be assigned.
    • Updated core framework files (fixed a lot of stability issues in Sense2.0 builds)

    Planned Features

    • I plan to seriously improve the RTL fix itself in the near future, but since I lack the knowledge to do so myself, I'm waiting for some new methods currently under development by the excellent devs at iAndroid.co.il to be released.
    • I do plan to release to program's source code eventually, it's just such a mess at this point that I'm more ashamed of it than anything else.
    • I also plan to include a logcat monitor. Because the patch causes the phone to rebuild dalvik cache, first boot after patching often takes a VERY LONG time, and some users wrongfully assume their phone is frozen. I plan to include a logcat monitor that will hopefully know to differentiate between bootloops, errors, and dalvik rebuilding, so users can tell if their phone is actually frozen or just working. If this works, I might release this as an actual separate program.

    Known Issues

    • Build 1.1.0 - If 'Push' is selected, when patching process finishes, no message is displayed and the program doesn't prompt to restart. - fixed in 1.1.1
    • There is hardly any error handling in the ProTools section. If they are called with no device available, it MAY freeze/crash the program. Will be fixed in upcoming release.
    • Fixes for Squashed filesystem roms do not work! Mostly.
    • Error handling is STILL utter ****e, may give unexpected errors (or not at all and just fail altogether).
    • If HTC Sync is installed and active, stuff may go nuts all around (as of 0.0.5 this is detected by the program and warns user).
    Credits

    Program and Graphics created by Elad Avron using Visual Studio 2010 Express.

    ZIP Functions created by Elad Avron using free libraries from the IC#Code group, available at http://www.icsharpcode.net/opensource/sharpziplib/

    Special thanks:
    From HTCAddicts.com: Ronenpg, Ohect.
    From XDA-Developers.com: TheAgent1982, silverbluem, mdeejay and the entire HD2 dev crew
    From iAndroid.co.il: Classicaldude (Original fix, the hero of RTL!), Dudyk (Original fix), rasmux (Modified fix), Liavk1 (partial SenseHD fix), Avicohh (Gingerbread Keyboard), N1Man (RTL fix for Gingerbread Keyboard).

    Keyboard fix by Avicohh and N1Man (from iAndoird.co.il)
    2
    2 questions man: 1 on-topic and 1 off-topic:

    1- Do you think this patcher will work on MIUI builds?!

    2- Do you know how to edit libwebcore.so file?! How to compile it?! How to patch it to have arabic support?! Coz MIUI builds still dont have a arabic-patched library libwebcore.so file!!! And this is so frustrating! Maybe you can help wit it :rolleyes:

    Thanks man:)

    1. I have no idea, I have never tried or even examined MIUI builds. I'm guessing if they're based on either Nexus, Evo or Desire, they should IN THEORY be compatible, but I can't know for sure without testing.

    2. I don't know yet, I was planning to learn the process and add it as an option for the next version. Theoretically - again - it SHOULD be compatible, but I won't know for sure without further testing.
    1
    If it will work man i'll give you a real big THANKS! :D
    1
    <IGNORE>Well, i do have the JDK installed, so it should have JRE inside.
    the log is attached </IGNORE>

    Well forget about that, i've installed JRE, and it patches just find, my assumption about the JDK probably was not correct.

    And it's working! Thanks!