yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Themes and Apps] brightidea:
Can't wait to see how he did it - can you PM me the link for his libicuuc-arabic.so file?

I still don't understand how these two files wern't compatible :confused:

I was planning to try to rebuild it for you today but luckily reonano was faster and saved the day.

- Brightidea.
[Galaxy S II Themes and Apps] roenano:
I didn't do anything related to this file. According to the last log ellaia provided I realized there was some incompatibility between libiccuuc_arabic.so and arabicshaper.smali, that actually made sense since I was using an old version of madmack's patch. So I just put a bit more effort on merging it to work on MIUI and finally succeeded.

Actually I didn't notice libiccuuc_arabic.so was updated on newer Madmack's patches and that was the reason I failed updating MIUI's RTL to it (along another edits).

Thanks for your help!
[Galaxy S II Themes and Apps] aminfri:
on HTC Wildfire (jokerdroid 4.2) based on sense and 2.2.1 i have the following problems:

1. not being able to connect the phone to pc as usb flash drive, you select the option but then nothing happens

2. unable to refresh my gmail inbox. menu> refresh, nothing happens.

3. on first boot i couldn't type anything but after a reboot it worked just fine

4. something like phone.android was force closing after each reboot.

otherwise all text are shown correctly RTL and connected.

oh btw i couldnt flash the out file, so did the whole thing manually. flashing gave me error in line 5 and aborted.
[Galaxy S II Themes and Apps] madmack:
Hi,

Most likely these USB and phone.android FCs are caused by corrupt dalvik-cache. You'll need to clear your dalvik-cache (through recovery) or factory reset your device after applying my patch. I recommend the latter.

Otherwise, which version of my patcher did you use? Did you patch libwebcore.so as well? If so, what message did my patcher tell you while it was trying to patch that file? (for example, Arabic patch.. successful or failed).
[Galaxy S II Themes and Apps] aminfri:
thanks for the reply, i will try clearing the cache and let you know. otherwise i did not get any error messages everything with the patcher went smoothly. btw i didn't use the libwebscore.so since mine is not compatible, brightidea is looking into it.
[Galaxy S II Themes and Apps] madmack:
Hey man,

I can't help but notice that you're fiddling around with smali code. any particular reason for that?

I never do anything in smali, all my work is done in Java (and c++ for the custom libicuuc) and can be accessed at my github account.

the two methods that you've mentioned are different. One reorders then reshapes, and the other one just reshapes because the text already comes in order.

android is a little mess when it comes to textfields and painting text. At some APIs, the text is already ordered RTL, and some others its not. From my experience, modifications had to be done at the framework level to support the new arabic fonts that vary in size (given that they don't exactly behave like latin or hebrew.. u know, when u reshape, size of the letter changes) so measureText for example has to accommodate for these changes as well; something that only exists at the framework level.

you can always patch libskia. I have tried to do that, but in the browser for example, without patching libwebcore, your text will be shaped correctly but letters will not be in the correct RTL order. They'll just appear LTR and shaped.

In my github account, for example, you can see (in java) the source code for my custom ArabicShaper.java:

https://github.com/madmack/platform...core/java/android/text/util/ArabicShaper.java

and the corresponding native calls at:

https://github.com/madmack/platform...b78/common/android_text_util_ArabicShaper.cpp

If you still decide to go with that native patching route, I believe you could eventually get arabic shaped but the real challenge will be in getting text alignment and splitting to work correctly.

Let us know of your progress regardless :)

I really recommend getting used to git and github. You can easily diff my changes with android's AOSP to see what I've done. The files you've quoted are in the graphics package (Canvas and Paint). You'll need to patch some other files in the text package as well.

If I could be of any additional help, let me know.

Good luck !
[Galaxy S II Themes and Apps] brightidea:
I understand .. I think I am just "driven" by impulses that's why I work with the code at hand not in the github server. Cloning a github project would take time and then again I would need to remotely do it on my iMac (I usually work on my laptop which runs windows, the file system is not compatible with github, it's NTFS which is case insensitive). I will spend some time setting up the environment on my laptop - I found a hack on the net which makes it work on windows. I am going to try that.

Actually, I am having difficulty patching libskia.so for some non-obvious reason. Unlike all my other files I patched the system simply won't start with this one. Which is weird but I suspect that the system is trying to access some shared resource within the SO where I am successfully remapping only subroutines.

My intention is to create a patch that doesn't require deodex is all :)

I am not on a hurry. I will try to take my time with this one especially that it seems troublesome.

- Brightidea.
[Galaxy S II Themes and Apps] madmack:
just wanted to suggest cygwin for your windows laptop :) I believe git should work over it and you'll retain case sensitivity.
[Galaxy S II Themes and Apps] brightidea:
Thank you for the suggestion :)

I was able to build the patch for libskia which does the shaping 100% natively. I am still having issues with the measuring of text size - which causes the rendered text to dance in the screen while scrolling ( I think I am not patching all functions, or maybe I am doing something wrong.. )

Anyway, this one works partially.. you'll get connected characters

http://www.multiupload.com/PNAYRCQTVY (for SGS2 KH3)

(u could use this with stock ROM - install the patch which is two files only libskia.so and lib__ia.so and see what happens)

Let me know what you think .. heh..

- Brightidea.
[Galaxy S II Themes and Apps] madmack:
great job man.

As i suspected though, you encountered measureText() issues which is also responsible for splitting up long strings into separate lines on our screens. I think these need to be handled at the framework side although I could be wrong.

Do you have any RTL alignment of text? I think this is handled at the framework in the "text" package as well which doesn't involve skia (directly anyways).

I've done libskia patching previously on an AOSP ROM, so I got a pretty good idea on what these two files do :) I'll give them a try still nevertheless.
[Galaxy S II Themes and Apps] brightidea:
Well I have been testing this for a few hours now but I find your patcj do much better than this of course. Problems in text alignment does exist just like you said.

Also, I noticed the text is reversed in gmail app's mailbox messages listing

Overall I think this needs a lot of improvement

- Brightidea
[Galaxy S II Themes and Apps] madmack:
Yea, I know about this problem as well. I think arabic letters in google maps will be reversed as well.

I explained why that is in my previous posts :) Not everything can be fixed at native code from my experience. Depending on the API used, you'll need to either do some massaging for the strings before sending them out, or you'll need to create new native JNI calls.

I realize native skia patching is great for those odexed ROMs out there, but man, it'll be so hard to get perfect alignment and RTL shaping across the board in Android given how messy their implementation with text really is. (Google gave word that honeycomb+ will have very different text APIs, so hopefully it won't be as problematic as it is now).

Maybe you can run a universal libskia.so patcher (even if its not really perfect) and have an app do that work. I know a lot of people have rooted devices but can't figure out how to deodex or run my universal patcher. (so for these guys, sell it for $2.00 in the market) lol :rolleyes:
[Galaxy S II Themes and Apps] roenano:
Hey Madmack,

Any Idea why google "refuses" to implement RTL built-in into their code?

Why not to write a latter (petition) and get every single RTL user to sign it online? I'm pretty sure We could get tens of thousands of users (or even more) to sign it...

Nothing to lose I think.
[Galaxy S II Themes and Apps] madmack:
I don't think they're really "refusing". They're actually pretty apologetic about it, lol. They had an oversight when they've implemented Android starting with 1.5+; its just that the framework today is really not meant to incorporate RTL text at all.

A guy named Tareq actually submitted a pretty good patch that handles RTL. They approved it but a senior Google dev said that RTL integration should be held off until Honeycomb+ comes out. I'm not really sure of anything yet but I expect ICS (Ice cream sandwich) to be more "friendly" with RTL code. If ICS itself doesn't support our languages, then I think we won't be waiting too long for it to happen.

I'm also afraid that most of our patches here will be obsolete once ICS hits the shelves :( Let's wait and see. I do know for a fact though that they're reworking the whole text implementation. Whether it will be in ICS or later versions remains to be seen.

We should hold our petition as well, given that Google is most likely beyond GB and Froyo in their development and road map.
[Galaxy S II Themes and Apps] BA_Tech:
new firmware

a new arabic ROM is just out (I9100JPKI1 - 2.3.4) do we expect now a more stable browser?
[Galaxy S II Themes and Apps] madmack:
Browser has been stable for a while now man :)
[Galaxy S II Themes and Apps] roenano:
You know, being apologetic but not doing anything to fix it (as for today) doesn't really help. This isn't a new issue the just discovered, it's been there since day one. So they can say what they want but bottom line, according to their actions, I feel they don't care...

You are right, GB it's probably a dead road to go, no much new development will go on it.

I'm just afraid we'll lose ICS train too and then it'll be too late. So may be it'll be a good idea trying to contact them and check if something is being done so we can act before it get's released. Do you know how to contact Android development team?

I don't really care about the patches being obsolete, I do it for the good of RTL community. So nothing will make me happier than having RTL built in into Android code.

BTW, is there any way to run the libpatcher.exe on linux? or just compile the code to do so?

Thanks
[Galaxy S II Themes and Apps] brightidea:
One may use Wine windows emulator or any HW Virtualization system (to start it under windows) but I would prefer that the developer just recompile it for linux. Even if acquiring the source maybe difficult I could create a similar tool as I fully understand how it patches libandroid_runtime.so

- Brightidea
[Galaxy S II Themes and Apps] roenano:
Found it!

I remembered that in one of my conversations with Erasmux (the guy wrote the patch) he pointed me to the a jar file that can be ran on any OS, and after some digging I finally found it and tested.

https://github.com/erasmux/AndLibUtils

the code to run it is:

java -jar AndLibUtils.jar JNI rename -v -o libandroid_runtime_fixed.so libandroid_runtime.so "drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V" native_drawText

What about your patch? how it should be ran under linux?
[Galaxy S II Themes and Apps] brightidea:
Interesting, looking at the code I find many similarities to my code (what a coincidence!) :) .. also, he implemented the patch the same way I was thinking of.

I could compile my program to work in x86/x64 linux. I am already providing users with a version compiled to work in ARM linux (on the device itself)

- Brightidea
[Galaxy S II Themes and Apps] roenano:
That would be great!

IMO is the last piece for a multiplatform RTL patch. I don't have much time now but it'll be great to build a UI based patch (java or c#) that can be ran on any OS!

regarding the "on device" patch, i'll be more than happy to test it on MIUI.
[Galaxy S II Themes and Apps] brightidea:
That'll be nice for sure.

Patching libandroid_runtime.so on-device doesn't seem like a good idea because at the same time framework.jar has to be patched which is a lengthy and error prone process that requires deodexed jar to be decompiled (dunno if smali.jar and baksmali.jar will work on the device itself) into smali files, patch applied and then recompiled and packaged into framework.jar again.

Anyway, I am talking about my Webkit patch which I already compiled to run on the device (starting v.3B) as it seemed like a safe option anyway. (the link can be found in my OP)

- Brightidea.
[Galaxy S II Themes and Apps] roenano:
I was talking about this one too :D

I'll have a look and let you know.
[Galaxy S II Themes and Apps] brightidea:
:) seems you missed out on much more than just that - I released my app which interfaces the in-device patcher in the android market. Just search for brightidea browser arabic patch

- Brightidea
[Galaxy S II Themes and Apps] roenano:
WOW!!! Works perfect.

Good job there!

I follow quite a lot of forums and administrate one by myself. It's pretty hard to stay updated on every thread.
[Galaxy S II Themes and Apps] madmack:
I myself vote for waiting until ICS released. Then we can open a bug report on their official google groups page and have all RTL speaking communities "star" it. The number of stars gives them priorities so hopefully it'll gain some traction.

I know that Android's support team is hard to reach, but that's the best way to do it afaik. ICS is just around the corner at this point.

My patcher can run under linux as the windows part in it uses MortScript to run the patching process which can easily be ported to a bash shell script. The only thing that requires windows is LibPatcher.exe which I haven't seen the source code for but it seems now that the dev did indeed release a java version, it should make this whole patching process OS independent.

I would love to have my patcher run on the device and have the RTL patch happen with a single click on any rooted deodexed device. But so far I haven't seen a method to run these baksmali/smali tools on the device itself. An interesting (and time consuming) idea would be to port these tools to C/C++ which can then be compiled to run in ARM archs just like brightidea's current patch.
[Galaxy S II Themes and Apps] TAMIM2007:
حبيب الشعب راجع الخاص :)
[Galaxy S II Themes and Apps] roenano:
I'll try to dig a little bit and see if RTL will be implemented or not.

I'm pretty familiar with your patch and the original one made by Ron (ClassicalDude), and I know the framework part can be done on any OS. I was actually asking Brigthidea about running his patch under linux (or MAC).

Googling a bit I came across THIS thread that seems to point to a way for making smali/baksamali run on a device. Unfortunately seems dx.exe was removed from android tools and I can't find it anywhere.

Anyway, I believe a multiplatform UI based patcher with ADB and rom zip patching capabilities should be the goal now.

I know Eran (Erasmux) started working on something like that but at some stage put the project aside. I'll contact him and ask if he can handle me the WIP code.
[Galaxy S II Themes and Apps] brightidea:
you should be able to find dx.jar in the Android SDK

under platforms/android-x/tools/lib

also a batch file which invokes the jar is found here platforms/android-x/tools

to use just type: dx.bat --dex --output=classes.dex smali.jar

you could start it by issuing the command: java -jar .....lib/dx.jar filename

- Brightidea
[Galaxy S II Themes and Apps] madmack:
I got your pm I'm just a bit busy nowadays so I didn't have the time to pinpoint the exact location of the code you asked about.

Give me sometime :) I'm busy traveling this week but I don't leave my pms unanswered (unless explicitly stated not to contact me via my thread's OPs).
[Galaxy S II Themes and Apps] TAMIM2007:
Thank you You are a wonderful man Take what you want from the time

:-)
[Galaxy S II Themes and Apps] zabihjan:
my phone just got update to ki4

does this work with ki4
[Galaxy S II Themes and Apps] mariotme:
If its deodexed it should work
[Galaxy S II Themes and Apps] zabihjan:
no it is odexed

i tried it i had to restore my phone again cuz it doesnt work
[Galaxy S II Themes and Apps] mariotme:
If you read the OP you wouldn't have done it.

This is for deodexed rom only
[Galaxy S II Themes and Apps] alsafady89:
can anyone please make an rtl patch for VR 2.5? Thanks
[Galaxy S II Themes and Apps] lovidore:
You can use madmacks parcher and it will work with vr2.5 no problems. Its based on brightideas universal patcher. I'm using vr2.5 and it works fine with rtl.
[Galaxy S II Themes and Apps] hamad2:
there is a problem with spacing within the words in vr 2.5.0 it shown like this

عزيزي$العميل$نود$أن$نعلمك

$=weird character

any ideas ??
[Galaxy S II Themes and Apps] madmack:
looks like a font problem. Try to change the fonts and see if that works out for you.
[Galaxy S II Themes and Apps] lovidore:
Just copied this from my tweetcaster app. I'm afraid I have a similar problem.

عزيزي المشترك, فاتورتك عن66 بقيمة

What course of action do you suggest I take ? Where do you suggest I get fonts to exchange ?

I'm running vr2.5.
[Galaxy S II Themes and Apps] lion9t:
hi there .. I can't find system/framworke folder .. wher I find it?
[Galaxy S II Themes and Apps] brightidea:
i am testing vr 2.5( ki4 )as well - my font which i usually use had a problem with in-word alef lam which appears as lamalef with this ROM. testing with your font i had the same problem described by our friend above.

replacing DroidSansArabic.ttf with the one from al jazeera folder produced the best results although some alignment issues are still visible and of course it broke shaping in firefox

- beightidea
[Galaxy S II Themes and Apps] mariotme:
hey Madmack

i guess you've heard about KI3 2.3.5 leak.

I was just wondering if your patcher still works with that new android leaked firmware.

regards
[Galaxy S II Themes and Apps] MAJED.y:
Yes, it does work, but you have to deodexed the rom first.

or use KI3 DarkyRom instead and patch the files.
[Galaxy S II Themes and Apps] bu2askoor:
I'll try it on vr 3.0, hope all goes well.
[Galaxy S II Themes and Apps] mariotme:
I've already tried it and everything is running great! Zero issues
[Galaxy S II Themes and Apps] lovidore:
Does that include the resolution of the aforementioned alef-lam/lam-alef issue that me and brightidea experienced in VR2.5?
[Galaxy S II Themes and Apps] bu2askoor:
then can u post the flashable, if u don't mind? Thanks
[Galaxy S II Themes and Apps] mariotme:
I just sent myself a arabic sms and it seemed ok. Not sure if the problem you asking is therr. Sry
[Galaxy S II Themes and Apps] mariotme:
Sure give me some time to get to my pc ;)

Edit:

here you go m8 CWM flashable RTL for VR 3.0

but note that i didnt include Browser/Gmail Patch.

You can search the market for brightidea and donwload his tool to arabise the browser and gmail app. But it needs root access.

http://www.multiupload.com/Q6X0AUV8O8

Edit 2:

ofcourse all credits goes to Madmack and Brightidea for making RTL possible for our SGS II
[Galaxy S II Themes and Apps] bu2askoor:
Thank you so much :) Just to confirm this is for VR 3.0 correct?
[Galaxy S II Themes and Apps] mariotme:
anytime man :)

yup thats for VR 3.0 Ki3 2.3.5
[Galaxy S II Themes and Apps] Mujodroid:
Hi every one could any one of you guys help a NEW kids in the block :p

Cwm flashable framework for VR2.5

Thanks in advance
[Galaxy S II Themes and Apps] madmack:
missing symbols.. :rolleyes:

we need to come up with a one-for-all font sort of thing. I tried my best to insert the missing symbols in that font on the OP but it seems that it's still not enough.

Have you considered changing the entire /system/fonts folder with one from a previous 2.3.4 european rom? I think Sammy changed the fonts in their latest edition so the missing symbols could actually be in another font file.
[Galaxy S II Themes and Apps] madmack:
The text that you've copied looks perfectly fine on the desktop. So the patcher is doing its job as its not distorting text. The problem is in what you see in your phone which is rendered by the font.

You tried the font I attached in the OP? If not, you can try this one:

http://www.multiupload.com/9UIKZ5YP06

I know I might be too late in that suggestion if you've already updated to KI3, but just thought I'd through that in here for anyone else who faces any font problems.

I also got an interesting pm from uTh who is suggesting that the dancing letters in whatsapp are caused by this UNICODE char:

'RIGHT-TO-LEFT MARK' (U+200F)

He/she can't post here yet given his low post count but thought I'd let you guys know in case anyone wants to chime in.
[Galaxy S II Themes and Apps] Dark_Lord0122:
how to apply the "fix" for the dancing characters in whatsapp?

i am on 2.3.5 applying the theme soon

thanks in advance.
[Galaxy S II Themes and Apps] madmack:
No fix yet. I need sometime to work on the code and see what I can do given that uTh is probably right about the UNICODE char.
[Galaxy S II Themes and Apps] brightidea:
He is 100% right - I have tested a little hack - which simply replaces that character with space right before shaping (as per this link http://www.multiupload.com/TA7JP2D3RW ) and guess what.. it worked!!

This solution is only a Proof of concept and is not final - it slows text processing too much ! :/

- Brightidea.
[Galaxy S II Themes and Apps] madmack:
you're friggin' fast man ! :eek:

we need to place this somewhere in my patcher that would make it efficient. I believe some alignment char processing (non printing chars is what it's called I believe) is already happening in Layout.java (read my github and diff with original AOSP) so I think this should be the location for little modification.

Wish I had time to look into it :(. Brightidea, if you do get around to implementing something efficient, kindly give us the modified bits or preferably, request a pull on github so that I can integrate it.
[Galaxy S II Themes and Apps] lovidore:
I don't think that will be necessary. I flashed VR 3.0 and font rendering works perfectly there. It seems the issue persists only with VR 2.5, and it seems VR 3.0 will be preferred amongst most, rendering the whole problem moot.
[Galaxy S II Themes and Apps] madmack:
The problem exists for all roms and devices with my patch. I'm sure VR3.0 has it as well as my rom v2.0 is based on the same KI3 sources and has that problem. You can't really see it in most apps but its definitely there with some WhatsApp messages.

Anyways folks. I think I've fixed it. I need some testers before I can update my universal patcher to 0.813 :D

http://www.multiupload.com/WB949X7MJF

Get this file, then place it in /system/lib and reboot. We shouldn't be taken a significant hit on performance given that this fix is happening in C++ as opposed to the Java framework.

I can optimize it further by modifying the ICU library's shaping function but I really don't have time to dig into it so that should do for now :)

Let me know guys.
[Galaxy S II Themes and Apps] Dark_Lord0122:
it works!!:eek:

i normally get the dancing letters if the sender uses a blackberry phone or copied from a blackberry phone :P i now works perfect ( i don't type in arabic didn't test that but i can read my current whatsapp messages perfectly )

thanks !
[Galaxy S II Themes and Apps] madmack:
Thanks for checking in.

I had the same issue. Problem seems to be coming from messages originating in BBs.

We have uTh to thank for this great finding :) Let me know if you discover any slowdowns due to this new patch.