Need development help: DexOpt mismatch signature

shaftenberg

Senior Member
Jul 31, 2010
690
738
0
Cologne
Hi there,
I deodexed stock 4.4.2 for XT1052 successfully and wanted to mod android.policy.jar for the skip music with volume button mod. I did this several times for Jelly Bean ROMs and even for the Nexus 5 running on KitKat 4.4.0

baksmali and smali the classes.dex works fine with no errors but after pushing the file to /system/framework I got stuck in a black screen.
Logcat says DexOpt: mismatch dep signature for android.policy.jar - I googled but didn't find a solution.

Any dev here who can help? Is this a 4.4.2 or even MotoX issue?
 

flashallthetime

Senior Member
May 27, 2012
4,866
2,005
253
Richmond Hill
Hi there,
I deodexed stock 4.4.2 for XT1052 successfully and wanted to mod android.policy.jar for the skip music with volume button mod. I did this several times for Jelly Bean ROMs and even for the Nexus 5 running on KitKat 4.4.0

baksmali and smali the classes.dex works fine with no errors but after pushing the file to /system/framework I got stuck in a black screen.
Logcat says DexOpt: mismatch dep signature for android.policy.jar - I googled but didn't find a solution.

Any dev here who can help? Is this a 4.4.2 or even MotoX issue?
There's a xposed module that works perfectly called xposed additions.

Sent on my Gummy running Lenoto X
 

Q9Nap

Senior Member
Feb 13, 2009
1,013
1,874
143
Hi there,
I deodexed stock 4.4.2 for XT1052 successfully and wanted to mod android.policy.jar for the skip music with volume button mod. I did this several times for Jelly Bean ROMs and even for the Nexus 5 running on KitKat 4.4.0

baksmali and smali the classes.dex works fine with no errors but after pushing the file to /system/framework I got stuck in a black screen.
Logcat says DexOpt: mismatch dep signature for android.policy.jar - I googled but didn't find a solution.

Any dev here who can help? Is this a 4.4.2 or even MotoX issue?
you could try signing all apks (including framework-res.apk) with test signature and then zipaligning. be sure to exclude any market updatable apps in the test signing process though as this will cause failure to upgrade those apps through play store. dsixda's kitchen makes batch signing and zipaligning very easy.
 

Q9Nap

Senior Member
Feb 13, 2009
1,013
1,874
143

Q9Nap

Senior Member
Feb 13, 2009
1,013
1,874
143
I appreciate your help, but can't I say that this was no solution? :)
sorry i woke up on the wrong side of the bed that day apparently, it happens. anyway, i think i've gained some insight on the issue. all apks and jars have classes.dex files on 4.4+, even odexed ones. this means there is no need to manually deodex, just delete all the odex files.
the existing classes.dex files are different from the classes.dex files generated from the odex files. i think they contain a signature of some kind, because when i tried to install a manually deodexed build, i got force closes on many of the moto apps. once i discovered that all apks and jars have classes.dex files, i removed all odex files and everything was fine.
so try editing the existing classes.dex files rather than the ones generated from the odex files.
hope this helps...

btw, i think this dual classes.dex/odex setup has something to do with ART, so removing odex files will probably break ART capability. not sure yet, just throwing that out there.
 
Last edited:
  • Like
Reactions: shaftenberg

shaftenberg

Senior Member
Jul 31, 2010
690
738
0
Cologne
Whoa, this was very helpful indeed, that explains almost everything...
Just a side note: I didn't know that, so I deodexed my system the standard way and I don't have any FCs.

Modding framework-res.apk worked though, even with creating new arsc and dex.

[edit] sure it works. framework is already deodexed in stock systems.
 
Last edited:

Q9Nap

Senior Member
Feb 13, 2009
1,013
1,874
143
Whoa, this was very helpful indeed, that explains almost everything...
Just a side note: I didn't know that, so I deodexed my system the standard way and I don't have any FCs.

Modding framework-res.apk worked though, even with creating new arsc and dex.

[edit] sure it works. framework is already deodexed in stock systems.
yeah kinda crazy, just realized that late last night and redumped the system.img to be sure i wasn't tripping lol.
 

TERRY72763

New member
Oct 11, 2014
4
0
0
DEXOPT Invocation Test

Hi there,
I deodexed stock 4.4.2 for XT1052 successfully and wanted to mod android.policy.jar for the skip music with volume button mod. I did this several times for Jelly Bean ROMs and even for the Nexus 5 running on KitKat 4.4.0

baksmali and smali the classes.dex works fine with no errors but after pushing the file to /system/framework I got stuck in a black screen.
Logcat says DexOpt: mismatch dep signature for android.policy.jar - I googled but didn't find a solution.

Any dev here who can help? Is this a 4.4.2 or even MotoX issue?
''ANY CHANGES TO THE DEVICE COULD RESULT IN UNDESIRABLE USE. AND MAY HAVE CONSEQUENCE. AND MAY VOID WARRANTY. USE IS USERS SOLE RESPONSIBILITY''
You may want to try a test of dexopt.
I came across something, (while surfing the web for midget love making) That you may find useful.. this will test and show you the dexopt conditions of your installation.
netmite.com/android/mydroid/build/tools/dexpreopt/dexopt-wrapper/DexOptWrapper.cpp

P.S. just a thought CmeL8r
 
Last edited:

TERRY72763

New member
Oct 11, 2014
4
0
0
DEXOPT mismatches...

environmental variables can be overridden with explicit assignment.
Then you can use command line makefile assignment:
$ make showcommands WITH_DEXPREOPT=false
ANY CHANGES TO THE DEVICE COULD VOID WARRANTY.
AND MAY CAUSE UNDESIRABLE CONSEQUENCE OF SYSTEM.
USE IS USERS SOLE DISCRETION, RESPONSIBILITY.
Hope this helps you to call up current files, with variables allocating instructions for device to, Stop Driving You CRAZY....
Just a thought CmeL8r