yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Themes and Apps] madmack:
the problem i'm concerned about is the errors you're getting at lines 150,151.

if you get any errors during the process, your phone will most likely not boot if you apply the generated files.

It seems the framework you're using wasn't extracted/decompiled correctly for some reason. Which version of java are you using?

I've tested v0.810 on a Win7 x64 setup and it works. Not entirely sure why you're getting these errors on your end.
[Galaxy S II Themes and Apps] lovidore:
Using the latest version of Java 6 (Update 26, downloaded today) but as I mentioned earlier it worked when I downloaded the x86 version. I even applied the flashed the CWM zip and it worked fine, so I wouldn't worry about that. Might be a problem with my system since it's working on your end.

What I'm more concerned about is the other framework.jar I mentioned. I wanted to use villainrom with a lagfixed browser and RTL capability. Maybe I can just patch the stock villainrom framework from your patcher and then use brightideas browserfix patch to fix the browser? I think I'll try that.
[Galaxy S II Themes and Apps] madmack:
let me know the results :)

from what you're saying, it does indeed seem like a problem with the new framework.jar file that you're trying to patch.
[Galaxy S II Themes and Apps] lovidore:
It seems that patching framework.jar required a odexing/deodexing procedure that's beyond my understanding for the time being. Gonna have to read up on that if I'm going to complete this little experiment. But that's going to be in some time as some things have come up. I'll keep you posted.

Thanks for the swift replies and all the work you've done. I would buy you some Morrocan green tea but PayPal and I aren't exactly getting along at the moment. Soon enough hopefully. :)
[Galaxy S II Themes and Apps] mabmed:
شكرا جزيلا أخي مادماك.. قمت بتجربة الباتش الجديد المطروح بمدونتك ولم يعمل معي.. فقط تظهر تلك الشاشة السوداء وتبقى لمدة طويلة دون أن يحدث شيء.. وإذا قمت بإقفالها تبدأ عملية الباتش وتظهر رسالة تنبئك بتمام العملية بنجاح.. وعندما قمت بتفليش تلك الملفات بقي الهاتف معلقا على شاشة البوت.. أرجو أن تجد حلا لهذه المشكلة وشكرا..
[Galaxy S II Themes and Apps] ringrover:
brother mad

Batista has realese new rom 3.7.1 XXKH3 and its deodex which patch can we used it with this rom ???
[Galaxy S II Themes and Apps] madmack:
I've used my latest patch with my own ROM and it looks like everything is in order. Wish I could help you. I'll take your framework.jar file and try to patch it and see if i get similar errors.

I wouldn't mind the Moroccan green tea, its been a while since I had any authentic one. Thanks :)

without any logs i can't help you. You'll need to copy and paste the content of the black screen so I can pinpoint the problem.

The good old universal patcher ;) should work with anything you throw at it except MIUI based ROMs.
[Galaxy S II Themes and Apps] lovidore:
Ok, so I've gained some background knowledge on performing baksmali on framework.jar (brightidea, JesusFreke <3) All I need to do is apply the fixes as per brightidea and performing smali to get classes.dex.

One quick question though, Do I baksmali usinsg version 1.2.6 and smali using 1.2.7? or do I just use 1.2.7 throughout? I used 1.2.7 for now.

But it's still beyond me how I'm going to push the fixed classes.dex back into framework.jar. I guess I'll have to leave that till tomorrow.

I'll keep you updated.
[Galaxy S II Themes and Apps] madmack:
if you're using brightidea's fix then use smali/baksmali 1.2.6 (i actually think it doesn't matter anyways).

you can then push back classes.dex using 7zip. framework.jar is simply a .zip file dressed in .jar extension.
[Galaxy S II Themes and Apps] ke3pup:
Hi guys,

I am using villainrom 2.4.2. I tried to follow the instructions on madmacks blog post put after executing command.exe but the first command prompt never closes (win7 64bit) . I tried the cw flashable zip posted by someone in villainrom thread but I still can't view arabic text as normal.

UPDATE:

I needed to apply the libwebcore.so patch (from first post) to see Arabic working in facebook/Dolphine/Gmail/Default Browser :-) sorry for confusion.

thank you for your fantastic work.
[Galaxy S II Themes and Apps] madmack:
glad you got it working but I'm wondering which command prompt window refused to close? A screenshot would be helpful.

Did you actually manage to flash the cwm file that was generated or you still don't have letters connected correctly in SMS/Contacts for example?

I can't replicate that stuck black window on my machine, so if you guys have that problem please post screenshots so i get a better idea.
[Galaxy S II Themes and Apps] designgears:
Can't even get a bootloop with KH3, just errors

08-21 00:12:40.785: WARN/dalvikvm(2760): ERROR: Unable to find decl for native Landroid/graphics/Canvas;.native_drawText:(Ljava/lang/String;FFLandroid/graphics/Paint;)V
08-21 00:12:40.785: ERROR/JNIHelp(2760): RegisterNatives failed for 'android/graphics/Canvas'
08-21 00:12:40.785: ERROR/AndroidRuntime(2760): Unable to register all android natives
[Galaxy S II Themes and Apps] tuvi123:
seems that it does not work well on KH3, but it's a simple fix..

btw- you can use other RTL fix's which works just fine on KH3, but I always prefer madmack work.
[Galaxy S II Themes and Apps] madmack:
thanks.

seems like libandroid_runtime.so wasn't patched successfully. any errors during the patching process ?
[Galaxy S II Themes and Apps] lovidore:
Back with some good news. Patch successful. RTL works fine (as per your patched framework) and brightideas tweaks also now work like a charm. I now have RTL + a deodexed lagfixed browser on villainrom 2.4.2. YAY!

Thanks a heap for all the help you've given me madmack, and thanks again to brightidea for his awesome lagfix. <3

I replaced framework.jar in the CWM flashable zip from your patcher with the one I modded for anyone who has villainrom and wants to try this tweak out.

As usual please do a nandroid backup incase your phone goes into bootloops.
[Galaxy S II Themes and Apps] designgears:
nope, said everything was fine.
[Galaxy S II Themes and Apps] madmack:
anybody else tried applying my patcher to any deodexed KH3 ROM with failure?

I'm a bit too lazy to flash a new rom on my device but I tried putting libandroid_runtime.so through the hex editor (in my patch) and it didn't complain.

designgears, make sure you do actually move the patched libandroid_runtime.so to /system/lib

which version of my patcher are you using btw?
[Galaxy S II Themes and Apps] designgears:
I used your cwm flashable to apply

v0.810
[Galaxy S II Themes and Apps] xoltrix2000:
I dont know why, but .810 just sits at the first command prompt window indefinitely. 0.804 works flawlessly on the other hand. I tried running it as admin, but still sitting there 30 minutes later.

Running Batista 3.7.1 (KH3).
[Galaxy S II Themes and Apps] MAJED.y:
Confirmed with KH3 "Exynos Extreme"
[Galaxy S II Themes and Apps] madmack:
try v0.804, see if that helps.

I've tested v0.804 on a winxp x86 setup with a KH3 ROM that I've deodexed manually and it doesn't get stuck at that black screen.

Can you guys download baksmali 1.2.6, replace the file in my patcher and rename it to match the 1.2.7 that already exists and see if that helps?

I'm thinking baksmali 1.2.7 might have broke something in their new release so it seems like java doesn't like that file anymore in win7 x64.
[Galaxy S II Themes and Apps] xoltrix2000:
Used the baksmali 1.2.6 from 0.804, ran successfully. I haven't tested the cwm yet, but I feeling it will work just fine.

Thanks madmack.
[Galaxy S II Themes and Apps] madmack:
thanks for letting me know.

seems they messed up baksmali 1.2.7 :confused:
[Galaxy S II Themes and Apps] madmack:
all right everybody. I just upped two new Deodexed ROMs. KDD and KE1. Both are optimized (compressed properly) and should not give us Force Closes in any app.

They're in the OP.
[Galaxy S II Themes and Apps] em4all:
ok so just a shot in the dark from a noop ... i flash the ke1 as a karnel ? and kdd in csc ?
[Galaxy S II Themes and Apps] madmack:
no, you can actually have either a deodexed KE1 or a deodexed KDD version.

If you have the KDD version in your phone, use the deodexed KDD files (again, this topic is a bit advanced. there are no files that you can just "flash" at the moment due to lack of recovery).

If you installed KE1 ROM (new version, installable via Odin), then you can override and deodex your rom using my files in the OP.
[Galaxy S II Themes and Apps] em4all:
thanks man i found your other post in ce4arab

trying it now

thanks again
[Galaxy S II Themes and Apps] saudsaif:
Gents,

Is the Arabization include Arabic Keyboard?

Regards,
[Galaxy S II Themes and Apps] salamt:
It shouldn't. Not a big deal, Just search the market for Arabic Keyboard.
[Galaxy S II Themes and Apps] saudsaif:
Thanks I will do, once I get my SG2, I just ordered it.
[Galaxy S II Themes and Apps] kdahri:
Mr. Madmack

You are the MAN

I just finished the updated process and files and now I am reading and writing in Arabic.

Once Again "You are the MAN "

Thanks
[Galaxy S II Themes and Apps] MoFsaD:
there One question if u don't mind

is the arabic writing form right to lift

i meen ( المحاذاة ) could't translate it :P

and by the way is ur phone there yet

mine is stuck in Customs :(
[Galaxy S II Themes and Apps] madmack:
yes it is.

mine is not here yet either. should be here sometime soon hopefully
[Galaxy S II Themes and Apps] MAJED.y:
Great work madmack.

one thing left, browser is unstable!, try aljazeera site and scroll then tilt the phone.
[Galaxy S II Themes and Apps] madmack:
if u get an FC, need a logcat
[Galaxy S II Themes and Apps] MAJED.y:
no FC.

browser become unresponsive then went back to main screen i have to close it via task manager to be able to use it again as browser took like 44% of processing 'red'

test:just scrolling browser hang 48%'red' and i have to close.
[Galaxy S II Themes and Apps] madmack:
hmmm.. i see. its most likely due to the fact that i used the korean source code to compile it. hopefully it won't be too long before samsung releases the european sources and i can diff them and see if there are any changes.

i'll definitely figure out what the exact cause is once i get my phone..

darn customs !!!!!
[Galaxy S II Themes and Apps] MAJED.y:
^^

I believe you are right.

hope you got ur phone soon, what a nice phone you gonna have. :)
[Galaxy S II Themes and Apps] kdahri:
There is only one problem the default browser is freezing after applying the steps. however when I use Firefox it worked perfectly.
[Galaxy S II Themes and Apps] Humma78:
Great work already. Just one question, would it be possible to use a nicer arabic font?
[Galaxy S II Themes and Apps] madmack:
yea, theoretically possible.. but i have no idea the SGSII is a bit picky with the fonts. I have tried to place the CM7 arabic fonts in but I got weird filled spaces when using arabic fonts. so yea, try to replace files in /system/fonts and see their effects after a reboot. YMMV.
[Galaxy S II Themes and Apps] madmack:
some good news and bad ones..

lets start with the good one, i got my sgs 2 this morning !!!! :D:D

and the 2nd bad news.. is that samsung's i9100 source code matches the korean version. meaning there isn't anything wrong with the sources i used to compile libwebcore.so. I've tried replacing that file and got the same thing when viewing aljazeera.net and scrolling around. It seems its a memory leak of some sort which leads to believe the problem is either or both of these two:

1) samsung's sources are incomplete (ain't nothing i can do about that one)

2) my build config for crespo is broken. i understand that samsung might have changed the build config, however they don't give the sources to that bit. the libwebcore.so that I compiled uses crespo's (nexus s) and the strange thing about it is that it loads perfectly fine.

in build config you get some variables that i have no idea how to fill like:

BOARD_USES_HGL := true

BOARD_USES_OVERLAY := true

ARCH_ARM_HAVE_TLS_REGISTER := true

DEFAULT_FB_NUM := 2

BOARD_NAND_PAGE_SIZE := 4096 -s 128

I believe one of them is the culprit or I'm missing some new variables that were introduced in the new s5p210 board. i just have no idea what to do at this point.

I've verified that the problem is indeed not caused by the arabic patch (I've recompiled libwebcore without the patch and got the same ANR issues in Browser.apk on aljazeera.net)

I don't think samsung changed the arch variant: TARGET_ARCH_VARIANT := armv7-a-neon although that could be a problem as well. (the fact that my libwebcore runs speaks differently though).

anyways, thats a little update from my side.

i've also successfully installed the theme that gives the CM7 battery percentage and the green/gray status bar with CRT effects, so thats cool.
[Galaxy S II Themes and Apps] nechmadi:
will this rtl work with hebrew too?
[Galaxy S II Themes and Apps] wanam:
Also on Batista Rom, stuck at :

java -Xms256m -Xmx512m -jar baksmali-1.2.7.jar -o classes classes.dex

It works with baksamali 1.2.6, you are right they messed the new version :D.
[Galaxy S II Themes and Apps] JesusFreke:
Can you try it with the -m option using baksmali 1.2.7? If it's the same issue that I'm thinking it is, that is already fixed (but not released).

Also, I find it bizarre to find people talking about baksmali issues on xda - and yet, no-one tells me about it? If you suspect something in baksmali is broken, please let me know so I can fix it! :p
[Galaxy S II Themes and Apps] madmack:
Its great to see you here JesusFreke. :D

Unfortunately I can't replicate that issue myself but to those who have the black screen freeze issue, open up the file "bat/baksmali.bat" in my patcher and add an "-m" to the the line. see if the problem is fixed?

the file contains the following line:

java -Xms256m -Xmx512m -jar baksmali-1.2.7.jar -o classes classes.dex

change it to:

java -Xms256m -Xmx512m -jar baksmali-1.2.7.jar -m -o classes classes.dex

JesusFreke, are you going to release a new version?

Good job with these tools and thanks for maintaining them. If I do face a problem with them, I'll make sure I post something on your "issues" page there on google code.
[Galaxy S II Themes and Apps] xoltrix2000:
Great success. The script works all the way. I started from a fresh zip of 0.810 just to be sure.

Thanks guys.
[Galaxy S II Themes and Apps] madmack:
Wow, thanks man. that was quick.

I'm going to upload a new version with that little flag set. Hopefully JesusFreke will take care of that issue in the next baksmali release :)

Thanks again JesusFreke :)

Edit: and v0.811 is out to take care of it.
[Galaxy S II Themes and Apps] INebilim:
Hello Brothers,

Finally got this to work on my Evo 3D. thanks!

I am digging the arabic :D
[Galaxy S II Themes and Apps] madmack:
Will do it now :)

Please note that MIUI is not supported by my patcher. (note to self: add that info on the blog).

Where do you get this? in CWM?
[Galaxy S II Themes and Apps] madmack:
update:

v0.812 is out.
[Galaxy S II Themes and Apps] MAJED.y:
Greeting Madmack

I need your advice here, on Stock Rom XXKH3 i used these methods [HOW TO][Windows] Manually Deodex and Odex back to Deodexing Framework then Applying your arabic patch then Odexing back.

the result is no boot, hang on the 1st logo of samsung, to be sure I did it again without the patch and it does boot!. and tested it with a Deodexed rom and it does boot. the problem is when Odexing the Framework back!.

So, did i do something wrong Or your patch will never work at this way!

I was looking for Clean Odexed Rom + Arabic!. :rolleyes:
[Galaxy S II Themes and Apps] madmack:
Probably a signature mismatch. make sure you patch the framework.odex file after odexing it back.

I haven't really dont any of that personally but I see no reason for it not to work. Make sure you use the latest baksmali/smali tools to do that conversion.

Otherwise, I'll need a logcat of the bootloop to tell you the exact cause.
[Galaxy S II Themes and Apps] MAJED.y:
Here's my steps.

Odexed FW -> Deodexed ->Arabic Patch "Work". "Deodexed ROM"

Odexed FW -> Deodexed -> Odexed Again "Work. "Odexed Rom"

Odexed FW -> Deodexed -> Arabic Patch -> Odexed Again "Don'ts Work" "Odexed Rom"

So i think the signature mismatch problem doesn't apply here because I copied the signature from original odex file to patched one as the last steps.

Will do the logcat and get back to you later.

thank you Madmack,
[Galaxy S II Themes and Apps] MAJED.y:
Logcat attached.

hope this will help!.
[Galaxy S II Themes and Apps] madmack:
you forgot to replace libandroid_runtime.so :)
[Galaxy S II Themes and Apps] MAJED.y:
Hemm!!, I did the patch for both!! i'm sure i did replace the file!

That's Odd!, Ok i will Do it again now and see the result and will come back again.

Thank you :rolleyes:

-----

I did copy the file manual like this

C:\s>adb shell
$ su
su
# stop
stop
# mount -o rw,remount -t ext4 /dev/block/mmcblk1p21 /system
mount -o rw,remount -t ext4 /dev/block/mmcblk1p21 /system
# cp /sdcard/0/go/framework/* /system/framework/
cp /sdcard/0/go/framework/* /system/framework/
# cp /sdcard/0/go/lib/* /system/lib/
cp /sdcard/0/go/lib/* /system/lib/
# chmod 644 /system/framework/*
chmod 644 /system/framework/*
# chmod 644 /system/lib/*
chmod 644 /system/lib/*

still no go!!
[Galaxy S II Themes and Apps] madmack:
well, your logcat is complaining about your unpatched libandroid_runtime.so :rolleyes:

I don't know what the exact problem is, but either a) file isn't getting patched correctly (if no errors, you shouldn't worry about this) or b) you haven't copied it over correctly.

oh yea, and chmod 644 /system/lib/* is a bad idea. stay away from setting permissions on all libs. some require different permissions than 644

another thing, why r u remounting mmcblk1? I think what you need is mmcblk0p9

The best way is to patch, odex it back, then put your odex and jar files in my cwm_flashable.zip file and replace whatever is in there. Then flash it in CWM.
[Galaxy S II Themes and Apps] MAJED.y:
Okay, here's my last chance to give up!

Now I passed the Samsung Logo, good but enterd a loop!

here's my logcat!.

Thank you madmack for your help :)
[Galaxy S II Themes and Apps] madmack:
looks like a permission problem with your /system/lib/

It doesn't seem like a problem with my patcher. unfortunately i haven't worked on this odexing back method so i cant' pinpoint the problem for you. but if i was you, i'd start from scratch and only do permissions on the files that i've moved/overwritten.
[Galaxy S II Themes and Apps] brightidea:
The only way for partial deodex/odex this to work is by deodexing all dependancies (any odex file dependant on framework.odex along with the framework.odex itself) and then odex them all back. Meaning, if you want to use the arabic patch you'll need to deodex all framework/app files except three files. core.odex, ext.odex, and bouncycastle.odex (all other files include framework.odex in their dependancies and thus must be deodexed/odexed back)

The issue with working with odexed files isn't security related. That's only the easy part of the problem but the main issue is that odexed files are preoptimized by removing named references to objects/classes and then by replacing these references with their indexes (those are having a high probability of changing especially that you're adding new methods and classes to framework by applying the patch). So even if smali recompiles the package (classes) in the same order it was before deodex the additional definitions will break it. (I mean dependant odexed files will definitely fail)

- Brightidea.
[Galaxy S II Themes and Apps] madmack:
Thanks for chiming in.

I'm wondering though, how was it that people were able to deodex android.policy.jar, modify it, and then odex the thing back with a patched signature and have it boot up correctly?

Aren't you updating these hard references when you odex the file back with a bootclasspath of your intact odexed files? or is the problem from the dependent files, which perhaps android.policy.jar has none of?
[Galaxy S II Themes and Apps] brightidea:
Well, I didn't mean it's impossible to get the program to work - but i'd say that this might happen much by luck :)

Dalvik VM when it preoptimizes the file would attempt to optimize instructions that deal with objects by replacing them with their (instruction*)-quick counterparts (those only have indexes, no named references). In other words, Only those that get "optimized" would lose their named references.

I would guess that either those system programs that depend on android.policy.jar didn't really have their instructions preoptimized that way for some reason (very slim chance). Or when smali rebuild android.policy.jar it kept the same order of internal classes/objects and maintained the same indexes (by coincidence).

I am sure that those who have applied changes to android.policy.jar before odexing it again didn't add new (classes, methods, class variables) in the file. because that's the proven way of breaking this.

- Brightidea.
[Galaxy S II Themes and Apps] MAJED.y:
No i didn't, i start from scratch and change only the 2 files.

Thank you madmack.

Thank you brightidea for your input, that's explain every thing.

It's a hard way to do it twice for all the app/framework manually, so let it as it be for now!.
[Galaxy S II Themes and Apps] ellaia:
yes, i get it from CWM.

why MIUI is not supported ? :( :(

i tried roenano script, but, the lancher keep crashing. here is the logcat logfile, if you can help.
[Galaxy S II Themes and Apps] brightidea:
According to the log your device doesn't support opcode @ PC 00056ba4 (in libicuuc-arabic.so). It seems the execution flow has gone out of order somewhere. What is the size of libicuuc-arabic.so file that you have?

I downloaded the RTL script v3 by reonano and I found the problem. (the version of libicuuc-arabic.so is not supported by your device)

Use this version of libicuuc-arabic.so which should work fine on your device http://www.multiupload.com/9A5T0C5RHL

- Brightidea.
[Galaxy S II Themes and Apps] madmack:
its closed source (illegally, mind you). that's why it gets no love from me.

you can use wanam's modified files in a thread that he created here in the dev sgs2 forums.
[Galaxy S II Themes and Apps] INebilim:
ista3mal had thread, ray akhdem ma3a MIUI

c'est un thread marocain :) enjoy

http://xdaforums.com/showthread.php?t=1210138
[Galaxy S II Themes and Apps] ellaia:
i understand. thanks.
[Galaxy S II Themes and Apps] roenano:
Have you tried the file (libicuuc-arabic.so) Brightidea gave you?

(check one page before this)
[Galaxy S II Themes and Apps] ellaia:
thanks :) but it still crashing :(

however, this time, the launcher crash with an message (attached image).

here is the logfile generated (as reported to MIUI)

extracted from logfile :

W/dalvikvm( 2320): ERROR: Unable to find decl for native Landroid/text/util/ArabicShaper;.reshapeArabicText:([C[CII)I

W/dalvikvm( 2320): JNI_OnLoad returned bad version (-1) in /system/lib/libicuuc-arabic.so 0x0 W/dalvikvm( 2320): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Landroid/text/util/ArabicShaper; D/AndroidRuntime( 2320): Shutting down VM W/dalvikvm( 2320): threadid=1: thread exiting with uncaught exception (group=0x40015568) E/AndroidRuntime( 2320): FATAL EXCEPTION: main E/AndroidRuntime( 2320): java.lang.ExceptionInInitializerError
[Galaxy S II Themes and Apps] brightidea:
Apparently these two libicuuc-arabic.so files are indeed incompatible. I don't have the source for it to recompile it to match your architecture. Perhaps Madmack has the source?

- Brightidea
[Galaxy S II Themes and Apps] madmack:
indeed I do as im the author of it and its publicly available on my github account :)
[Galaxy S II Themes and Apps] ellaia:
Hi,

roenano has found the solution.. now, it work :)

i think he will update his post to publish his patch.

thank you all.. Brightidea, madmack , roenano..

it's a fabulous day. :)