Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,739,856 Members 46,323 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
brightidea
Old
(Last edited by brightidea; 14th August 2011 at 09:14 AM.) Reason: new tool released - issue closed
#1  
brightidea's Avatar
Senior Member - OP
Thanks Meter 227
Posts: 225
Join Date: May 2011
Location: Heart of Arabian Peninsula

 
DONATE TO ME
Cool [FIX] Updated: How to fix deodexed System Framework (slow Browser)

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/s...smali-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:
Select 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:
Select Code
.method private super_mLeft()I
    .registers 2

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

    return v0
.end method
2. and this
Code:
Select 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:
Select Code
.method private super_mTop()I
    .registers 2

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

    return v0
.end method
3. and
Code:
Select 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:
Select 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/webkit/WebView;Landroid/view/View;->mLeft:I

    move v7, v0

    add-int v7, v7, p4

    aput v7, v5, v6
4. and last peice
Code:
Select 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:
Select 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/webkit/WebView;Landroid/view/View;->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
The Following 43 Users Say Thank You to brightidea For This Useful Post: [ Click to Expand ]
 
ringrover
Old
#2  
ringrover's Avatar
Senior Member
Thanks Meter 48
Posts: 958
Join Date: Dec 2010
Location: Dubai
Thanks

But how we change the code
NeW RoM ....I cant stop
 
mostyle
Old
#3  
Senior Member
Thanks Meter 165
Posts: 380
Join Date: Nov 2006
Location: Augusta, Ga
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..
If you found this useful please say thanks!
Current device: Google Nexus 5 (running Cataclysm ROM with misc tweaks added)
Previous devices: AT&T Galaxy S4, AT&T Galaxy Note II running CARBON 1.7 with Bravia enabled, AT&T Galaxy S2 (Skyrocket)

Definition of development finally explained with visuals included.
 
BMWpokerAce
Old
#4  
BMWpokerAce's Avatar
Senior Member
Thanks Meter 580
Posts: 333
Join Date: Sep 2010
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.
If You like my work, buy me an Ice Cold Red Bull
with This Button
-------->
<---------> or just say Thank You with This Button ---------v
 
criskelo
Old
#5  
criskelo's Avatar
Recognized Developer
Thanks Meter 4925
Posts: 1,076
Join Date: Feb 2010
Location: Rosario

 
DONATE TO ME
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

If you like this rom, supports our site with your registration


 
BMWpokerAce
Old
#6  
BMWpokerAce's Avatar
Senior Member
Thanks Meter 580
Posts: 333
Join Date: Sep 2010
Quote:
Originally Posted by criskelo View Post
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
So if i understand u right, this mod makes no sense with deodexed ROM?
If You like my work, buy me an Ice Cold Red Bull
with This Button
-------->
<---------> or just say Thank You with This Button ---------v
 
mostyle
Old
#7  
Senior Member
Thanks Meter 165
Posts: 380
Join Date: Nov 2006
Location: Augusta, Ga
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:

Quote:
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.
If you found this useful please say thanks!
Current device: Google Nexus 5 (running Cataclysm ROM with misc tweaks added)
Previous devices: AT&T Galaxy S4, AT&T Galaxy Note II running CARBON 1.7 with Bravia enabled, AT&T Galaxy S2 (Skyrocket)

Definition of development finally explained with visuals included.
 
GanGs_KiD
Old
(Last edited by GanGs_KiD; 8th August 2011 at 11:04 PM.)
#8  
GanGs_KiD's Avatar
Senior Member
Thanks Meter 267
Posts: 120
Join Date: Sep 2010
Location: Riyadh
OMG

You are the MAN

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


Thank you


Edit: it worked for 5 min's and now keep FC
 
brightidea
Old
#9  
brightidea's Avatar
Senior Member - OP
Thanks Meter 227
Posts: 225
Join Date: May 2011
Location: Heart of Arabian Peninsula

 
DONATE TO ME
Quote:
Originally Posted by criskelo View Post
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
Old
#10  
brightidea's Avatar
Senior Member - OP
Thanks Meter 227
Posts: 225
Join Date: May 2011
Location: Heart of Arabian Peninsula

 
DONATE TO ME
Quote:
Originally Posted by GanGs_KiD View Post
OMG

You are the MAN

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


Thank you


Edit: it worked for 5 min's and now keep FC
Sorry to disappoint - but I am still working on the fix.

- Brightidea.

Tags
baksmali, browser, bug, lag, slow
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes