Closed GoogleCodeExporter closed 9 years ago
Thanks for the report. Normally, the "Replaced unresolvable odex instruction
with a throw" message is harmless - this is only used in places where the
object register is provably null, which makes it impossible to deodex - there
is no way to know the intended type of the register at that point.
In this case, it appears that it thinks p4 is null (see the const/4 p4, 0x0
shortly before). But in fact, I think it can be a ParcelFileDescriptor.
Can you deodex the original odex again, adding this option to the baksmali
invocation:
-r ARGS,DEST,FULLMERGE
and then attach the resulting smali file. This will add comments for each
instruction showing the types of registers at each point, which should help me
determine if it's getting the types wrong.
Original comment by bgruv@google.com
on 13 Sep 2012 at 5:52
Thank you for the quick answer. This time the command was : call java -jar
smali\baksmali.jar -a 10 -c
:core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar
:core-junit.jar:com.motorola.android.frameworks.jar:com.motorola.android.widget.
jar -d c:\___test\framework\ -x framework\services.odex -o framework\classout
-r ARGS,DEST,FULLMERGE
result attached (only the ActivityManagerService.smali).
Original comment by peter.pa...@gmail.com
on 13 Sep 2012 at 6:05
Attachments:
As far as I can tell, it is deodexed properly. The instruction that was
replaced with a throw should never be reachable. The value of p4 at that point
is always null, so the if-eqz just before it will always jump over it.
You do realize that you have to deodex/reodex everything else, when you modify
a framework odex, right? :). I believe you can also do some trickery with the
dex signature in the header, but depending on what you changed, that may or may
not cause problems.
What is the actual errors that you are seeing?
Original comment by jesusfreke@jesusfreke.com
on 15 Sep 2012 at 1:24
the error is bootlooping :) and yes, I'm copying the signature from the old
service.odex to the new one, which should prevent having to deodex/odex the
whole framework..
I just tried the following in my phone:
- baksmali the services.odex to classout (folder)
- smali the resulting classout (without any changes to the smali files) to
classes.dex
- inserting the new classes.dex to the original services.jar
- backup of old /system/framework/services*
- pushing the new services.jar to /system/framework
- creating new services.odex in /system/framework via
"/system/bin/dexopt-wrapper /system/framework/services.jar
/system/framework/services.odex $BOOTCLASSPATH"
- patching the sig in the new services.odex via "busybox dd
if=/system/framework/services.old.odex of=/system/framework/services.odex bs=1
count=20 skip=52 seek=52 conv=notrunc"
- reboot to recovery, wipe dalvik cache, reboot
- bootloop :)
the actual odexing/patching was however successful.
# sh ./dexopt-wrapper.sh
Root check passed
Found services.jar on currentdir.. good
Found dexopt-wrapper on currentdir.. good
Mounting /system as read-write
Copying dexopt-wrapper to /system/bin
Setting owner 0.2000 for /system/bin/dexopt-wrapper
Setting permissions 755 for /system/bin/dexopt-wrapper
Creating odex from jar
--- BEGIN '/system/framework/services.jar' (bootstrap=0) ---
--- waiting for verify+opt, pid=6440
--- would reduce privs here
--- END '/system/framework/services.jar' (success) ---
Patching signature
20+0 records in
20+0 records out
20 bytes (20B) copied, 0.001465 seconds, 13.3KB/s
Mounting /system read-only
I wish I could capture the logcat during the bootloop, but I can't :/
You said about deodexing/reodexing everything else - would that mean to
deodex/reodex every single file in the BOOTCLASSPATH, or even every file
(odex/apk) in /system/framework ?
Original comment by peter.pa...@gmail.com
on 15 Sep 2012 at 10:32
"bootlooping" is not an error. It is a symptom :)
Why can't you get logcat? It comes up early in the boot process. If nothing
else, just do a framework stop and start after replacing the odex, rather than
a full restart of the device.
Original comment by jesusfreke@jesusfreke.com
on 15 Sep 2012 at 11:08
ok, here the log of creating the new odex, replacing the stock one, stopping
and starting framework.
It rebooted the phone, this time without bootloop, and I tried to reboot one
more time, without a bootloop. I have to say, I'm clueless. But I'm pretty
confident now that your tool baksmali/smali is not the problem. I'll be out for
the next 10+ hours, but then I'll try to do this again, this time with .smali
code changes.
Attaching [log.txt] during and after the new services.odex creation/patching,
[log2.txt] after the next reboot (with the new services already)
Original comment by peter.pa...@gmail.com
on 15 Sep 2012 at 12:35
Attachments:
I would tend to agree. I'm not sure what's going on, but it doesn't seem like
it's a problem with baksmali :)
Original comment by jesusfreke@jesusfreke.com
on 15 Sep 2012 at 6:50
You actually pointed me into the right direction with looking at the log during
the framework restart .. I think I've got it now. Thank you for all the help
(and for the wonderful tools) :)
Original comment by peter.pa...@gmail.com
on 16 Sep 2012 at 12:22
I've just fallen into the same problem when trying to deodex my services.jar
separately. Would you please share what did you do to get it solved Peter? Any
helps would be appreciated.
Alex
Original comment by alex.donh
on 26 Dec 2014 at 5:06
Original issue reported on code.google.com by
peter.pa...@gmail.com
on 13 Sep 2012 at 5:32Attachments: