Jump to content

Help! framework.jar modification causes bootloop


Recommended Posts

Guest ClassicalDude
Posted (edited)

I appreciate the time you are taking to read this. I searched a lot, but could not find an answer to my problem. I also posted on xda-developers, so if this is your second time reading this - I apologize. I really need an answer.

I am trying to implement a recent patch to bidi text rendering that was created for CM rom and runs on Nexus 1. I downloaded the vanilla source code to 2.1, and compiled it with and without the patch. Then I disassembled framework.jar and compared the smali files, to discover that the following ones were modified:

android/graphics/Canvas.smali

android/graphics/Canvas$EdgeType.smali

android/graphics/Canvas$VertexMode.smali

android/text/Layout.smali

android/text/SpannableStringBuilder.smali

android/text/Styled.smali

android/widget/TextView$CharWrapper.smali

My idea was that if I run baksmali on the framework.jar file from my Desire, replace these files with the new ones, run smali on the result, repack it as framework.jar and upload it to the device - the fix will be implemented.

This actually worked very well for a previous fix, which involved only the file StaticLayout.smali. It worked without having to sign framework.jar; however, that fix did not change the file size, whereas the current one does change it - especially for Canvas.smali. I did not try to sign framework.jar - I don't really know how to and if it is necessary.

The result was a bootloop. Logcat showed that the device is unable to load a native library:

D/AndroidRuntime(  103): --- registering native functions ---

W/dalvikvm(  103): Unable to register: not native: Landroid/graphics/Canvas;.drawText (Ljava/lang/String;FFLandroid/graphics/Paint;)V

E/JNIHelp (  103): RegisterNatives failed for 'android/graphics/Canvas'

E/AndroidRuntime(  103): Unable to register all android natives

This is where I am stuck. What I really wanted to do was to create a script-based fix that would work on any device running 2.1. It was possible for the StaticLayout fix. Now I'll settle for figuring out how to make it work for the Desire.

I am attaching Canvas.smali, the file I think is responsible for the problem, in 2 forms: vanilla is compiled from source with no modification, patched is compiled from source after the patch. It seems that the other Canvas files were unchanged by the modification.

Thank you very much in advance!

Canvas.zip

Edited by ClassicalDude

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.