yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] madmack:
Note to all users: If you have a problem with this patch, this is the place to post and ask. I will not answer Private Messages related to this patch because the questions are replicated and should all be addressed here.

To devs and ROM cooks. PLEASE do reference this thread and my work if you intend on providing the result CWM file in your thread.

To get the correct arabic shaping letters in Android. We need to patch two files, namely framework.jar and libwebcore.so

framework.jar takes care of rendering text in all android menus and input widgets. libwebcore.so takes care of shaping text correctly for the web browser and Gmail.

I've made this patch a while ago but thought I'd post my work here for those of you who aren't aware of it.

framework.jar & libwebcore.so

Requirements:

Your device needs to be rooted.

Your Android version is >= 2.1

Your ROM needs to be deodexed. To find out if your installed ROM is deodexed, navigate to /system/framework on your phone. If you see a file called framework.odex then this patch will NOT work for you. So yes, this means that any of these new ROMs or Themes can get arabic text rendered correctly :) I'm currently using Darky's 9.3 with R64 Blue theme and everything works beautifully.

Java must be installed.

Steps to apply the patch:

Moved to official blog. Please check the steps there

http://blog.devasque.com/?page_id=11

Note: This will not shape the letters in Gmail and the Browser correctly. If you want this, you’ll need to get the appropriate libwebcore.so for your system. Each Android device and ROM will need a separate one. v0.810 of my patcher does browser and Gmail fix as well now :D Taken from the great work of brightidea

Downloads

http://blog.devasque.com/?page_id=11

scroll all the way to the bottom

libwebcore.so

This should get arabic text rendered correctly for the browser, gmail and any app that uses this library. (You may not need to flash these manually if you are using my v0.810 universal patcher from above).

My universal patcher has integrated brightidea's work so this section is obsolete.

References:

Y6b – http://github.com/y6b

Dudyk – http://github.com/dudyk

The patching tool – http://iandroid.co.il/forum/topic5657.html

Brightidea's webkit patcher - http://xdaforums.com/showthread.php?t=1218960

I've also put up a website with the latest changes and source code. So if you're interested, http://blog.devasque.com
[Galaxy S I9000 Android Development] Darkyy:
Hey madmack,

A lot of people need an Arabic Patch based on XWJS5.

You can take my framework.jar and the needed libwebcore.so (if needed to update).

If you want to do it, feel free to contact me and update this topic here - I think a lot of people will appreciate it.

Best regards,

Joël
[Galaxy S I9000 Android Development] quadix:
this also correct Hebrew shaping? (this language require RTL to be displayed correct)
[Galaxy S I9000 Android Development] madmack:
Good idea. I'll get a deodexed JS5 and patch it up. create a flashable CWM zip file.

Now, lemme go and see how I can make my first update.zip file :D

Hebrew has shaping ? this is news to me :rolleyes:

I believe it should correct the alignment and RTL though. must give it a try for yourself :)

If you look at my references though, the original patcher was for Hebrew. So I believe using the original patch would fit your case better :)
[Galaxy S I9000 Android Development] zenosteam:
ok i have pull the framework.jar and put it in the subfloder double click in cmd.exe but the pop tell me can't ffind java ?? i do something wrong what problem please
[Galaxy S I9000 Android Development] aladin6:
I really need this topic, thank you thank you very very very much!

Now with any ROM i can have the arabic support :P !

THAAAAAAAAAAAAAAAAAAAAAAAAANKS :) .
[Galaxy S I9000 Android Development] kar200:
I know that you mentionned being for any rom but would this work for Gingerbread as well?

K.
[Galaxy S I9000 Android Development] madmack:
Yea, you need java.

https://cds.sun.com/is-bin/INTERSHO...ProductRef=jre-6u24-oth-JPR@CDS-CDS_Developer

I should put that in the prereq :cool:
[Galaxy S I9000 Android Development] madmack:
For it to work on JV1, I'll need Samsung to release the source code first. So until then, I think we'll have to wait. (although if someone has sometime, it'll probably be worth it to change the AOSP files of 2.3.3_r1 to support my patch from github and then redo the patcher with these new files).

For CM7, well.. lets say that it already has some kind of shaping supported although not the best out there. I'll try to make a patcher just for that version given that we're blessed with the source code.
[Galaxy S I9000 Android Development] taha_e:
great work, sure many people looking for this patch, Samsung is always late for latest releases of galaxy in middle east and many people also like the taste of custom roms,this patch will help a lot
[Galaxy S I9000 Android Development] ragin:
Will it work for Hindi too?
[Galaxy S I9000 Android Development] madmack:
I don't think it will :confused:

its supposed to correct right-to-left languages' alignment + shape Urdu + Farsi + Arabic texts.
[Galaxy S I9000 Android Development] alfrqan:
waww'Great Thaankx

Hope some one will do for 2.3

thankx
[Galaxy S I9000 Android Development] zenosteam:
thannnnnnnnnnnnnnnnnnnnnnnks madmack for this update you save the community work properly
[Galaxy S I9000 Android Development] almuhajir:
thanx madmack

great work
[Galaxy S I9000 Android Development] madmack:
for those of you who are interested in getting CM7 arabized correctly (it currently doesn't shape words correctly, adds spaces, duplicates some other..) I've ported my files to CM7 and here is a CWM file that you can flash to get arabic working correctly everywhere including browser + gmail.

Get it at OP.

I've patched the latest version (20110309b) so be careful not to apply this to any other version even though it might work. I just don't want to hold responsibility if its applied to some other versions.
[Galaxy S I9000 Android Development] taha_e:
dear madmack could you add 4 additional characters for farsi language?
[Galaxy S I9000 Android Development] madmack:
That's not going to be an easy job because I use ICU4J's libraries to reshape and they seem to have that bug in them. My source code is up on github, if any of you can find the problem, just let me know and I'll patch it up :)
[Galaxy S I9000 Android Development] goodwill4u1:
Thanks you so much Madmack!!!

Wishing you a good luck in everything.

Thank you again
[Galaxy S I9000 Android Development] wanam:
Good job madmack.

جزاك الله خيراً
[Galaxy S I9000 Android Development] quadratic:
.789 worked for me. I did notice a few things though:

This one is self-explanatory. I don't know if it's a framework issue or a CM7 issue.

Note the letter order in the dictionary suggestions. This may very well be a Smart Keyboard issue. I've never used it before, so I have no idea.
[Galaxy S I9000 Android Development] madmack:
the first one is a CM7 issue. You'll need to rotate the device once to get it fixed.

the other one is a smart keyboard pro issue. in the settings, untick the option that says something like "RTL suggestion for Hebrew and Arabic". Thing is, smart keyboard pro reverses the letters but my patch already does that, hence the problem.
[Galaxy S I9000 Android Development] quadratic:
Rotating didn't fix the CM7 issue for me, but it's really minor so I'm not going to worry about it. I unchecked the RTL option for Smart Keyboard PRO and it's working perfectly now.

Thanks yet again! You should enable the donate button for your account :)

PS: The first post here still links to an older version of the patcher.
[Galaxy S I9000 Android Development] madmack:
thanks. fixed

i won't have to update a gazillion page when I update the next time :rolleyes:
[Galaxy S I9000 Android Development] quadratic:
Thanks for this. I tried this font, but found it incomplete. It changed the main body font, but headings and other text used whatever font you installed over. I downloaded a Saudi X10 system image and extracted the font directory from it.

Here is a comparison between your font package (left, installed over the Aljazeera font) and this font package (right):

It's an easy to read font, but unfortunately the bold either doesn't work or just isn't particularly bold.

xperia x10 arabic fonts.zip (2.61 MB)
[Galaxy S I9000 Android Development] jaikat:
Great news

madmack..

i tried the libwebcore.so you compiled from the Droid Eris webkit on a Eris rom ported to the Hero, and it worked like a charm...

i also patched framework.jar using 2.2/2.2.1 from the .785 version-yes i'm still using that one :) ...

i now have a fully functioning/arabized Sense rom for the Hero...

thanks and keep it up...

request:

would it be possible to offer a patching system that works on linux/ubuntu.. i can only use Windows at work, and so making more tests takes time..

ps: i guess you can post the Droid Eris libwebcore.so on your blog, i think it works for both Eris roms made for the Eris and for the Hero...
[Galaxy S I9000 Android Development] madmack:
This is awesome ! thanks for letting me know. wonderful news ;)

you should contact HTC to release the webkit for your HERO as well. they're obliged to do it.
[Galaxy S I9000 Android Development] madmack:
a post made by mammalio, a new guy who was not privileged to post in the dev section:

Don't use the CWM file to patch Darky's. This CWM file is made only for pure stock unmodified frameworks. Extract framework.jar from Darky's 9.5, patch that with my patcher, then update your phone with that one.

as a side note guys, some new guy has published a new arabic shaping patch to Cyanogenmod 7 that is under review right now. I tried it with CM7 on the Galaxy S and its superb (no spaces after LAMALEF). The only problem it has is that mappings from cursor to strings are not accurate. so if you type text, then click somewhere in the middle to edit.. well, the new typed letters were appear at unexpected locations. otherwise its working good, and i think i'll incorporate it into my general patch here because it also doesn't break hebrew RTL. basically we get a global RTL patch for both languages.

it'll be a while before i publish that because I'm a little busy now, but here is the new patch that I applied to the latest CM7 (build 26/3/2011) for the Galaxy S. You're free to use it and test it. It'll probably get approved and be merged into the official CM7 repo sometime soon.

http://www.multiupload.com/BWR54C8FQE
[Galaxy S I9000 Android Development] j_h3000:
Hello madmack

once again i want to say thanks for your superb work

I have finaly been able to use your patcher to patch framework.jar and it worked but when i tried to replace the patched libwebcore and framework.jar in MIUI rom the device got stuck at boot screen

is there a specific way to get that done on MIUI ? thx
[Galaxy S I9000 Android Development] madmack:
nope. unfortunately libwebcore.so is different for every ROM build out there. so it all depends on what your rom is based on.

if you give MIUI's source code, I'll patch and upload an arabized version. Unfortunately, I don't think they released the code for it. (at least from what I concluded based on my 5 min research).
[Galaxy S I9000 Android Development] j_h3000:
thanks for your fast reply

it's just that i thought it shares the same libwebcore with CM7

ok then can i just use framework.jar? i just want to be able to read/write SMS and read .epub books
[Galaxy S I9000 Android Development] madmack:
yea, nobody tested it with MIUI roms yet, but I don't see why it shouldn't work.

in any case, if it didn't work, just drop me a logcat so I can have a look at it.
[Galaxy S I9000 Android Development] goodwill4u1:
Hey madmack

do you think this will work for GB 2.3.3 xxjvk ?

thank you always
[Galaxy S I9000 Android Development] mariotme:
as far as I remember madmack said that patching the framework works on jvk, and I can confirm it. I patched mine on doc's v1.2 beta and all running great. But patching the libcore won't work coz jvk source codes aren't out yet. You can search the past 3-4 pages I already asked that and madmack replied :)

Goodluck
[Galaxy S I9000 Android Development] goodwill4u1:
Did you tried libwebcore?:rolleyes:

or didn;t took that risk, lol
[Galaxy S I9000 Android Development] wanam:
Please can we have an update of the cwm patch for cm 7 0331.
[Galaxy S I9000 Android Development] madmack:
have you tried extracting framework.jar manually and patching it with my patcher ? it should work.
[Galaxy S I9000 Android Development] wbsoul:
C7 gets an official Arabic (RTL) support

there have been a lot of patches lately related to RTL support on the Cyanogen Mod 7, I installed the 35 build and her you go ... full support to Arabic :)

this is the change log:

http://cm-nightlies.appspot.com/?device=bravoc

hope that they are using the library that have the better performance.
[Galaxy S I9000 Android Development] madmack:
Yep. I've been following this work since the patcher submitted it to the review board of CM. I've patched my SGS copy of CM7 with it and its pretty impressive. everything in it works (alignments are perfect as well). and he also gets rid of the space after lamalef. The only problem I've encountered was that if you would type some text in arabic, and then go back with your cursor anywhere in the middle to delete or add more text, well.. lets just say that whatever you delete or add won't be at the cursor. Its basically missing some more tweaking but whenever I get sometime, I'll experiment with porting this bad boy to AOSP. Then we can have our ROMs arabized with the same version that CM7 has.

At least I won't have to worry about arabizing CM7 from now on ;)
[Galaxy S I9000 Android Development] saftazeen:
this ma logcat.txt i hope u can find the working framework for this rom:

http://xdaforums.com/showthread.php?t=926507
[Galaxy S I9000 Android Development] madmack:
these errors are not related to my patch. Something is wrong with your method. make sure the file produced is significantly larger than the original. be certain that you've overrode the previous file, and that your rom is deodexed !

I've already got confirmations that my patch works with that rom in particular, so it should work for you.
[Galaxy S I9000 Android Development] qaliza:
Thank you for this great work

One question

which files should I use for desire HD TELUS 1.84 froyo 2.2.1?
[Galaxy S I9000 Android Development] madmack:
go to the blog and get version 0.788 (its the most robust one). when a menu comes up, choose 2.2.x

you can also experiment with a browser patch that I've developed lately for the desire HD. Get it from the blog as well.
[Galaxy S I9000 Android Development] qaliza:
Thank you I'll try it
[Galaxy S I9000 Android Development] bmw_rav4:
Dear.

Thank you very much for this help. But i have tried your patch with the latest version from darky v10 rc3 even i have tried for jewus version 3.1 and it dose not work. But the arabic dose not show for writing and the rom dose not support arabic reading still.

Any idea?
[Galaxy S I9000 Android Development] valmer:
Dear Madmack

I have been trying to replace the framework.jar for my desire through Root Explorer but it won't work as I keep getting the message " there wan not enough free disk space to complete the paste operation "

I tried your suggestion to delete some apps from the folder " /system/app " but the problem is persistent

how can I solve this issue?

many thanks
[Galaxy S I9000 Android Development] quadratic:
Have you tried to adb push it?
[Galaxy S I9000 Android Development] madmack:
yea, just adb push it or delete more apps. the new framework is about 500k or (1mb, depending on which patch version you used). so that amount of memory has to be freed before you can replace your framework.
[Galaxy S I9000 Android Development] madmack:
0.800 released. Much faster rendering and scrolling, (possibly fixing persian characters). and space after LAMALEF is fixed.

Please check the new steps (procedure) on my blog because they changed slightly.

Tested it on Gingerbread JVK, CM7 (before it was natively patched) and JS8. Works
[Galaxy S I9000 Android Development] bmw_rav4:
nice to hear that from you madmack. its great job what you have done. but i want to know is there anyone tried this on android 2.3.3 ( darky RC3 or Jewues Rom's )??

mate, i have tried juwe's rom but also dose not worked with him!!! any help
[Galaxy S I9000 Android Development] madmack:
its probably because juwe's doesn't have clockworkmod as recovery ? I haven't really tested the recovery file extensively, but if you follow the manual procedure it should work.

i tested it personally on JVK and it worked, so any gingerbread sgs rom out there should work with it too.

as always, if you provide a logcat I can actually see myself if its really indeed the patch itself that is causing the problem. (but i doubt that, specially in this case)
[Galaxy S I9000 Android Development] bmw_rav4:
sorry mate,

i have just refalsh my device, and it seems it can read arabic in contacts and some apps, but not browers, ( original and doplphie ),

also is there any way to write arabic as well ?
[Galaxy S I9000 Android Development] madmack:
browser will have to wait until samsung releases sources for GB. you can use opera or firefox meanwhile.

to write arabic, just download smart keyboard pro and enable arabic from the menu.
[Galaxy S I9000 Android Development] qaliza:
Followed all your instructions

Worked perfectly on GB sense & Nexus builds on HD2

But for DHD TELUS 1.84 bootloops at the boot screen..used 78,79 & 80

Any help with that...

Thank you

Regards
[Galaxy S I9000 Android Development] madmack:
yea, give me a logcat when it bootloops and I'll see what I can do
[Galaxy S I9000 Android Development] qaliza:
Thanks a lot man really appreciate your help

Logcat for

Desire HD (RAM) on HD2

TELUS 1.84

Froyo 2.2.1

http://www.multiupload.com/1LKVBF8XLH
[Galaxy S I9000 Android Development] madmack:
try using the sense gingerbread patch instead. it seems they're using the gingerbread sense framework.jar set of classes.
[Galaxy S I9000 Android Development] qaliza:
ok I'll try and report back
[Galaxy S I9000 Android Development] qaliza:
Thank you so much my friend, the GB sense patch worked great on the DHD build..:)
[Galaxy S I9000 Android Development] madmack:
I'm glad I could help :)
[Galaxy S I9000 Android Development] qaliza:
Hello again

The arabic is really clean and smooth tried it on DHD and Desire S builds, works like charm.

Just one observation concerning XDA premium app

After applying the patched framework, the xda premium app

opens normally

logged in using my username and password

browsed through forums

but when starting to type a reply for example, it FC

Its not really a big deal for me since I use tapatalk which works perfectly, I just thought I bring this up in case this issue happens in other apps and if you could find a fix for it in future updates.

Other than that everything works perfectly.

Keep up the good work

Regards
[Galaxy S I9000 Android Development] madmack:
please give me the logcat of the FC.

I just tried it on my device and it works without a problem. Make sure you're using my latest patch.
[Galaxy S I9000 Android Development] qaliza:
Update

If you tap a text box that is not empty the application FC, if the text box is empty then you can tap normally. This occurs in all apps
[Galaxy S I9000 Android Development] qaliza:
This is a logcat when trying to type in the message app, recipient text box when not empty
[Galaxy S I9000 Android Development] madmack:
you're absolutely right. you have a Layout.smali file that I have not encountered yet and it seems HTC also changed that one differently than whatever it did in its other Gingerbread Sense version.

I'm going to apply the global solution for the next version imported from the brilliant guys at iAndroid. They have a java utility which patches this file manually meaning you'll get to keep all these functions that HTC added and have a fully working Layout.smali.

If all of that didn't make any sense, never mind. In other words I'll work on releasing a new version that will take care of that problem for you. It'll just have to wait for now because I've also been notified than CyanogenMod 7 has just released a new patch which solves some of the reversing problems released in the earlier patch. so look forward to a new patch folks.
[Galaxy S I9000 Android Development] qaliza:
Thank you so much for your co-operation

Looking forward to that new update, take your time with it.

Before reading this post I tried it on GB sense ROM (Desire S) and had no problems at all. The problem seems to be on the DHD builds. I think this confirms what you said.

Good luck
[Galaxy S I9000 Android Development] qaliza:
If I send you the "layout.smali" from the framework.jar of the official arabic release of DHD 1.83, will it be of any help?
[Galaxy S I9000 Android Development] madmack:
we're not relying on anything officially arabic. it'll most likely break things instead of fix them.

if you want the FCs to stop temporarily before I release the new patch, you'll need to go to files\gb_sense and delete or move layout.smali

you'll lose some alignments but it'll work on that particular rom. just wait til the new version comes out and it'll all be good out of the box.

if you decide to do what I told you, make sure you still select gingerbread sense when the selection menu comes up.
[Galaxy S I9000 Android Development] Fishawy:
Hello,

Nothing for Sense/Gingerbread yet?
[Galaxy S I9000 Android Development] madmack:
:eek:

you really need to get to my blog and do some reading buddy.

actually, just reading only the posts above yours will answer your question
[Galaxy S I9000 Android Development] Fishawy:
Yea, and the moral is: Don't XDA when you're awake for 37 hours .. Gonna re-read the whole thing tomorrow.

Thanks & good night.
[Galaxy S I9000 Android Development] madmack:
New version out guys. 0.801. Go to blog for detailed change log
[Galaxy S I9000 Android Development] qaliza:
Coooool :cool: That was fast

Thank you man.
[Galaxy S I9000 Android Development] madmack:
got some free time yesterday night so I occupied my time with that ;)
[Galaxy S I9000 Android Development] D69K:
just came here to say thank you again :)

the .801 version is awesome :)

the reversing fix is wonderful :)

every thing works as it should :D

God bless your kind soul.
[Galaxy S I9000 Android Development] aboad20:
in the last version , is it arabize the browser too ?
[Galaxy S I9000 Android Development] madmack:
I just wanted to let everbody know that libwebcore.so for Gingerbread ROMs on our beloved SGS (Web browser and Gmail) have been arabized successfully for those who're interested.

http://www.multiupload.com/KOVYHAU011
[Galaxy S I9000 Android Development] mariotme:
Omg thank you sooooooo much madmack.

100% working with zero issues? :)
[Galaxy S I9000 Android Development] madmack:
Yup :D running it myself on JVB
[Galaxy S I9000 Android Development] xfox:
amazing work as always, keep it up
[Galaxy S I9000 Android Development] mariotme:
just wanted to inform you running great as always thanks madmike :)
[Galaxy S I9000 Android Development] abu2x:
thanks you sir, work perfect on XXJVK :D :)

جزاك الله خير
[Galaxy S I9000 Android Development] goodwill4u1:
Thank you madmack!!!
[Galaxy S I9000 Android Development] alammori:
Can't wait for Arabic on Ginger Sense . Please keep us updated and thank you for your efforts.
[Galaxy S I9000 Android Development] madmack:
version 0.801 arabizes ginger sense roms already. Its just that the browser and gmail are currently not supported until HTC releases some sources.
[Galaxy S I9000 Android Development] zizo-88:
I know im lazy and maybe it's written somewhere :p

but how do i do the 1st step, that is pulling the framework file from my phone ... im a noob here so bare with me... and what option in the recovery mode do i choose to flash a file... i know this question seems stupid, but im just being overly cautious and nooby:p... and thanks for all your efforts...