zhangwenan / smali

Automatically exported from code.google.com/p/smali
0 stars 0 forks source link

After deodexing some functions are broken #75

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What seems to be the problem?

After deodexing the whole ROM, the Browser wont work correct. But I havent got 
any Errors while deodexing the Files.

If you want to scroll or zoom in browser it lags and dont shows the right 
content.

What is the exact smali/baksmali command that you ran?

java -jar baksmali-1.2.6.jar -d ../framework -c 
core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:
core-junit.jar:javax.obex.jar:twframework.jar:seccamera.jar:com.google.android.m
aps.jar -x browser.odex

What version of smali/baksmali are you using? What rom are you working
from?

SGS i9000 ROM: I9000XXJVQ

baksmali-1.2.6

Please provide any additional information below: error messages, symptoms,
etc.

The Problem is, there is NO error message by the baksmali tool. But the browser 
wont work.. Error could be in one from the .jars in framework and not in the 
app itself but i havent got any error in any file...

Original issue reported on code.google.com by xda.sphi...@googlemail.com on 20 Jul 2011 at 11:43

GoogleCodeExporter commented 9 years ago
in fact this is not baksmaling Browser.* that is breaking the stuff

this 'bug' is connected to baksmaling framework.odex

in fact deodexing produes 0 errors same as building back, but afterwards browser
is unusable, and that is the only prblem spotted i think :)

every change made to framework and infact baacksmaling and smaling back breaks 
the browser smoothness

help us help you to determine what is the source of this issue =)

Original comment by byczy...@gmail.com on 4 Aug 2011 at 11:49

GoogleCodeExporter commented 9 years ago
What is happening with the latest firmware from Samsung for both SGS S 
(GT-I9000) and SGS II (GT-I9100) is that backsmali is eliminating code from 
smali files.
See the following exemple on XXKG6 framework.odex:

when doing:

java -Xmx1024m -jar baksmali.jar -d ../ -c 
:pm.jar:sechardware.jar:services.jar:framework.jar:com.samsung.device.jar:sec_fe
ature.jar:android.policy.jar:seccamera.jar:com.google.android.maps.jar:com.yamah
a.android.media.jar:bmgr.jar:sqlite-jdbc.jar:core.jar:input.jar:bouncycastle.jar
:com.android.location.provider.jar:sec_platform_library.jar:javax.obex.jar:ext.j
ar:secmediarecorder.jar:am.jar:android.test.runner.jar:ime.jar:com.android.futur
e.usb.accessory.jar:libvtmanagerjar.jar:core-junit.jar:twframework.jar:svc.jar:m
onkey.jar -x ../framework.odex

On file out/android/content/pm/RegisteredServicesCache.smali in line 1070: 

    .line 469
    :try_start_23
    #Replaced unresolvable odex instruction with a throw
    throw v2
    #invoke-virtual-quick {v2}, vtable@0xc
    :try_end_26
    .catch Ljava/io/IOException; {:try_start_23 .. :try_end_26} :catch_27

    goto :goto_c

    .line 470
    :catch_27
    move-exception v8

    goto :goto_c

After we do:

java -Xmx1024m -jar smali.jar -o classes.dex out
aapt a ../framework.jar classes.dex

If we decomplie framework.jar, on the same file 
(out/android/content/pm/RegisteredServicesCache.smali) we have:

    .line 469
    :try_start_1
    throw v2
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0

    #Unreachable code
    #goto :goto_0

    .line 470
    :catch_0
    move-exception v8

    goto :goto_0

This is happening in several files when the deodex is preformed, so at the 
moment I am
questioning the safety of deodexing.

I hope this helps in any way.

Original comment by no.one.w...@gmail.com on 8 Aug 2011 at 12:50

GoogleCodeExporter commented 9 years ago
Note that this is normal functionality. It "should" only remove dead code that 
cannot be reached. If it removes code that *can* be reached, that would be a 
problem.

Although, it looks like there might be something fishy happening there, I'm not 
sure why the "goto" instruction is getting commented out when you run it 
through again.

Can you pastebin the deodexed version of that that smali file, and I'll take a 
look at it.

Original comment by jesusfreke@jesusfreke.com on 8 Aug 2011 at 2:25

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
hey jesus. those links might help you solve the issue

fixing 'the lag' on sgs2
http://forum.xda-developers.com/showthread.php?t=1208071

fixing 'the lag' on sgs1
http://forum.xda-developers.com/showthread.php?t=1212796

Original comment by byczy...@gmail.com on 11 Aug 2011 at 9:55

GoogleCodeExporter commented 9 years ago
I believe I've fixed the issue. However, I can't specifically test these roms 
as I don't have devices.

Would someone mind testing out the following version of baksmali, and verifying 
that deodexing works. (Please do a full deodex of everything, not just the 
framework.jar)

http://smali.googlecode.com/files/baksmali-1.2.7-dev-jar-with-dependencies.jar

Original comment by jesusfreke@jesusfreke.com on 13 Aug 2011 at 6:29

GoogleCodeExporter commented 9 years ago
I will test this and give you feedback.
Thank you ever so much for your time.

Best regards

Original comment by no.one.w...@gmail.com on 13 Aug 2011 at 8:45

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I just tested with my custom rom that I make for a Portuguese community and 
preformed the full deodex of the rom and I am glad to report that the Browser 
now works with hardware acceleration meaning that no function was broken as the 
result of the deodex.
This preliminary report seams promising and with more time I will investigate 
the other known file changes.
Once again, thank you ever so much for your time.

Best regards.  

Original comment by no.one.w...@gmail.com on 13 Aug 2011 at 1:17

GoogleCodeExporter commented 9 years ago
Do you need anymore testing done? If so please let me know and I will be more 
than happy to do it.

Thank you,

Best regards

Original comment by no.one.w...@gmail.com on 13 Aug 2011 at 1:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thanks! It sounds like the change is correct. I'm marking this issue as fixed :)

Original comment by jesusfreke@jesusfreke.com on 13 Aug 2011 at 8:25

GoogleCodeExporter commented 9 years ago
hey great! 1 week in holiday and the bug is gone!
will test it as soon as possible!

thanks for this ;)

Original comment by xda.sphi...@googlemail.com on 14 Aug 2011 at 7:35