[FIX] Updated: How to fix deodexed System Framework (slow Browser)

Search This thread

brightidea

Senior Member
May 8, 2011
226
224
43
Heart of Arabian Peninsula
Update 14th Aug 2011: JesusFreke has released a new version of baksmali (v1.2.7) which seems to have fixed the bug above
You may download it from here http://blog.jesusfreke.com/2011/08/smalibaksmali-127.html - Thank you JesusFreke for a great tool and support


Please feel free to report any bugs or issues with this tool here or on his blog.

-------------

Good news to all modders out there - I finally found the bug for real this time - unfortunately, it's in baksmali.jar" .. The fault occurs when it attempts to build deodex framework.jarodex from into smali files
specifically this file "android/view/SurfaceView.smali"


I believe baksmali (v1.2.6) just fails to realize that the class variable it wants to access belongs to the super (parent) class .. instead it simply accesses the local class variable.

But I have a work-around fix to the bug (guranteed to work as long as the order of class fields mLeft and mTop are the same in android/view/SurfaceView.smali as android/webkit/WebViewCore$ShowRectData.smali)

The solution:
1. replace
Code:
.method private super_mLeft()I
    .registers 2

    .prologue
    .line 911
    iget v0, p0, Landroid/view/SurfaceView;->mLeft:I

    return v0
.end method
with
Code:
.method private super_mLeft()I
    .registers 2

    .prologue
    .line 911
    iget v0, p0, [strike]Landroid/webkit/WebView;[/strike][COLOR="Red"]Landroid/view/View;[/COLOR]->mLeft:I

    return v0
.end method

2. and this
Code:
.method private super_mTop()I
    .registers 2

    .prologue
    .line 914
    iget v0, p0, Landroid/view/SurfaceView;->mTop:I

    return v0
.end method

with
Code:
.method private super_mTop()I
    .registers 2

    .prologue
    .line 914
    iget v0, p0, [strike]Landroid/webkit/WebView;[/strike][COLOR="Red"]Landroid/view/View;[/COLOR]->mTop:I

    return v0
.end method

3. and
Code:
   iget-object v0, v0, Landroid/view/SurfaceView;->mLocation:[I

    move-object v5, v0

    const/4 v6, 0x0

    move-object/from16 v0, p0

    iget v0, v0, Landroid/view/SurfaceView;->mLeft:I

    move v7, v0

    add-int v7, v7, p4

    aput v7, v5, v6
with
Code:
   iget-object v0, v0, Landroid/view/SurfaceView;->mLocation:[I

    move-object v5, v0

    const/4 v6, 0x0

    move-object/from16 v0, p0

    iget v0, v0, [strike]Landroid/webkit/WebView;[/strike][COLOR="Red"]Landroid/view/View;[/COLOR]->mLeft:I

    move v7, v0

    add-int v7, v7, p4

    aput v7, v5, v6

4. and last peice
Code:
    iget-object v0, v0, Landroid/view/SurfaceView;->mLocation:[I

    move-object v5, v0

    const/4 v6, 0x1

    move-object/from16 v0, p0

    iget v0, v0, Landroid/view/SurfaceView;->mTop:I

    move v7, v0

    add-int v7, v7, p5

    aput v7, v5, v6

    .line 439
with
Code:
    iget-object v0, v0, Landroid/view/SurfaceView;->mLocation:[I

    move-object v5, v0

    const/4 v6, 0x1

    move-object/from16 v0, p0

    iget v0, v0, [strike]Landroid/webkit/WebView;[/strike][COLOR="Red"]Landroid/view/View;[/COLOR]->mTop:I

    move v7, v0

    add-int v7, v7, p5

    aput v7, v5, v6

    .line 439

*NOTE* please keep my nickname in references for this solution.


Happy Modding,

- Brightidea
 
Last edited:

mostyle

Senior Member
Nov 13, 2006
491
236
Langley, SC
Assuming you have a deodex'd rom, baksmali browser.apk make the listed change and re-smali the code.

If you asking how to bakssmali etc, thats more drawn out..
 

BMWpokerAce

Senior Member
Sep 3, 2010
341
579
www.sysprofile.de
I cant wait to try this, later this evening :)

I m just wondering how, just this one line can fix the laggy browser?
But anyway if this realy works, i m happy.

Thank you for sharing your work.
 

criskelo

Inactive Recognized Developer
Feb 24, 2010
1,091
4,947
Rosario
xdaforums.com
I think these misguided
the problem is in the framework.jar
example:
if you use a rom with the folder system / framework ODEX
and system / app deodex
The browser deodex not lose acceleration
but if you, deodex framework.jar, lose acceleration
 

mostyle

Senior Member
Nov 13, 2006
491
236
Langley, SC
He's saying that the fix wont work. It isn't an issue in the smali code of the Browser but rather an issue in the deodexed framework.

Also, the OP edited the original post:

I have found out that this approach is not the "real" solution to the bug. So, I am back in the lab trying to figure it out. Meanwhile, you may still use it as to my knowledge it doesn't do any harm.
 

GanGs_KiD

Senior Member
Sep 24, 2010
120
248
Riyadh
OMG :eek: :eek: :eek: :eek:

You are the MAN :D

It works ....works .....works


Thank you :rolleyes:


Edit: it worked for 5 min's and now keep FC :(
 
Last edited:

brightidea

Senior Member
May 8, 2011
226
224
43
Heart of Arabian Peninsula
I think these misguided
the problem is in the framework.jar
example:
if you use a rom with the folder system / framework ODEX
and system / app deodex
The browser deodex not lose acceleration
but if you, deodex framework.jar, lose acceleration

You're partly right - I found problems in the deodexed Browser that I am going to share after I fix the bugs in framework.

I am currently digging it up - hope to find the glitch soon.
 

brightidea

Senior Member
May 8, 2011
226
224
43
Heart of Arabian Peninsula
Do not know if it was understood
I say look in framework.jar

The problem is framework.jar

I found the bug for real this time - unfortunately, it's in smali.jar .. :(
and you were right. The fault occurs when it attempts to build framework.jar from smali files
specifically this file "android/view/SurfaceView.smali"

But I have a work-around (guranteed to work as long as the order of class fields mLeft and mTop are the same in android/view/SurfaceView.smali as android/webkit/WebViewCore$ShowRectData.smali)

Go to the first post in the thread to get the solution.

- Brightidea
 
  • Like
Reactions: mccune

intronauta

Senior Member
Aug 29, 2009
281
106
HAHA you did it!!

Works like a charm!

Maybe would be interesting to report this issue to jesusfreeke ;)

very good job.

why isn't thist threat in "Original Android development" subforum????
 
Last edited:

criskelo

Inactive Recognized Developer
Feb 24, 2010
1,091
4,947
Rosario
xdaforums.com
I found the bug for real this time - unfortunately, it's in smali.jar .. :(
and you were right. The fault occurs when it attempts to build framework.jar from smali files
specifically this file "android/view/SurfaceView.smali"

But I have a work-around (guranteed to work as long as the order of class fields mLeft and mTop are the same in android/view/SurfaceView.smali as android/webkit/WebViewCore$ShowRectData.smali)

Go to the first post in the thread to get the solution.

- Brightidea

Well actually works
 

Top Liked Posts

  • There are no posts matching your filters.
  • 43
    Update 14th Aug 2011: JesusFreke has released a new version of baksmali (v1.2.7) which seems to have fixed the bug above
    You may download it from here http://blog.jesusfreke.com/2011/08/smalibaksmali-127.html - Thank you JesusFreke for a great tool and support


    Please feel free to report any bugs or issues with this tool here or on his blog.

    -------------

    Good news to all modders out there - I finally found the bug for real this time - unfortunately, it's in baksmali.jar" .. The fault occurs when it attempts to build deodex framework.jarodex from into smali files
    specifically this file "android/view/SurfaceView.smali"


    I believe baksmali (v1.2.6) just fails to realize that the class variable it wants to access belongs to the super (parent) class .. instead it simply accesses the local class variable.

    But I have a work-around fix to the bug (guranteed to work as long as the order of class fields mLeft and mTop are the same in android/view/SurfaceView.smali as android/webkit/WebViewCore$ShowRectData.smali)

    The solution:
    1. replace
    Code:
    .method private super_mLeft()I
        .registers 2
    
        .prologue
        .line 911
        iget v0, p0, Landroid/view/SurfaceView;->mLeft:I
    
        return v0
    .end method
    with
    Code:
    .method private super_mLeft()I
        .registers 2
    
        .prologue
        .line 911
        iget v0, p0, [strike]Landroid/webkit/WebView;[/strike][COLOR="Red"]Landroid/view/View;[/COLOR]->mLeft:I
    
        return v0
    .end method

    2. and this
    Code:
    .method private super_mTop()I
        .registers 2
    
        .prologue
        .line 914
        iget v0, p0, Landroid/view/SurfaceView;->mTop:I
    
        return v0
    .end method

    with
    Code:
    .method private super_mTop()I
        .registers 2
    
        .prologue
        .line 914
        iget v0, p0, [strike]Landroid/webkit/WebView;[/strike][COLOR="Red"]Landroid/view/View;[/COLOR]->mTop:I
    
        return v0
    .end method

    3. and
    Code:
       iget-object v0, v0, Landroid/view/SurfaceView;->mLocation:[I
    
        move-object v5, v0
    
        const/4 v6, 0x0
    
        move-object/from16 v0, p0
    
        iget v0, v0, Landroid/view/SurfaceView;->mLeft:I
    
        move v7, v0
    
        add-int v7, v7, p4
    
        aput v7, v5, v6
    with
    Code:
       iget-object v0, v0, Landroid/view/SurfaceView;->mLocation:[I
    
        move-object v5, v0
    
        const/4 v6, 0x0
    
        move-object/from16 v0, p0
    
        iget v0, v0, [strike]Landroid/webkit/WebView;[/strike][COLOR="Red"]Landroid/view/View;[/COLOR]->mLeft:I
    
        move v7, v0
    
        add-int v7, v7, p4
    
        aput v7, v5, v6

    4. and last peice
    Code:
        iget-object v0, v0, Landroid/view/SurfaceView;->mLocation:[I
    
        move-object v5, v0
    
        const/4 v6, 0x1
    
        move-object/from16 v0, p0
    
        iget v0, v0, Landroid/view/SurfaceView;->mTop:I
    
        move v7, v0
    
        add-int v7, v7, p5
    
        aput v7, v5, v6
    
        .line 439
    with
    Code:
        iget-object v0, v0, Landroid/view/SurfaceView;->mLocation:[I
    
        move-object v5, v0
    
        const/4 v6, 0x1
    
        move-object/from16 v0, p0
    
        iget v0, v0, [strike]Landroid/webkit/WebView;[/strike][COLOR="Red"]Landroid/view/View;[/COLOR]->mTop:I
    
        move v7, v0
    
        add-int v7, v7, p5
    
        aput v7, v5, v6
    
        .line 439

    *NOTE* please keep my nickname in references for this solution.


    Happy Modding,

    - Brightidea
    12
    FYI: I've released a new official version of smali/baksmali with this fix (v1.2.7)

    http://blog.jesusfreke.com/2011/08/smalibaksmali-127.html

    Big Kudos to brightidea for figuring out the problem :)
    6
    I have some fixes for baksmali that I'm relatively sure will fix the problem. However, I want to make sure that it doesn't introduce any *new* problems, but I don't have a device to test this on :)

    Would someone mind giving the new version of baksmali a go on this rom. When you do, please do a full de-odex of everything, not just framework.jar. Please flash and boot into the de-odexed rom, and do a quick smoke test of basic functionality, as a quick test to make sure that nothing else broke :)

    You can download the new (beta) version at http://smali.googlecode.com/files/baksmali-1.2.7-dev-jar-with-dependencies.jar

    On behalf of the android development community I thank you for the fixes.

    This version has really fixed the bug in the class android.view.SurfaceView
    but the problems in com.android.internal.telephony.gsm.stk.CommandParamsFactory are still there (it's not able to determine the type of certain object references so it's just replacing the calls with "throw"'s which causes the GSM debugging screen to fail at certain commands)

    I came up with fixes to these throw operations but there are many of them (attached).

    Wierd thing is baksmali replaced some instructions with throws only in deodexing two files services.jar and framework.jar

    - Brightidea
    5
    Thank you guys for the compliments; I am glad that you found my work useful.

    Actually, I had to spend a lot of time and effort in order to reach this solution and now my eyes burn like hell and my wife won't talk to me anymore :eek:

    Anyway, smali.jar needs to be fixed - I am going to attempt to create my own version which addresses this issue; just wish me good luck

    - Brightidea.

    PLEASE. Don't create you're own version. I happily accept patches ;) In fact, if you want to chat with me about the issue, I would be happy to code up the fix in smali (unless you want to, which is certainly your prerogative, since you figured this one out). Feel free to email me or catch me in #smali on freenode :)
    4
    Thank you guys for the compliments; I am glad that you found my work useful.

    Actually, I had to spend a lot of time and effort in order to reach this solution and now my eyes burn like hell and my wife won't talk to me anymore :eek:

    Anyway, smali.jar needs to be fixed - I am going to attempt to create my own version which addresses this issue; just wish me good luck

    - Brightidea.