I'm trying to deodex the stock HC rom and I've run into a few issues. First, I know that there are deodex'ed HC roms out there, but I'm doing this for my own edumacation. I've deodex'ed a donut and gingerbread rom and they work just fine, but honeycomb is giving me issues.
I'm using roach's patched baksmali jar that he fixed for HC. I'm using the 8.6.5.13 as a starting point. Here's my process in a nutshell:
I use baksmali without -x on all odex files (and jar/apk files without an odex file). This gives me all class paths. I wrote a script that puts them all into neat and tidy folders.
Then I baksmali the odex/jar files from framework using the BOOTCLASSPATH from my transformer.
Next, I baksmali the apk files using the BOOTCLASSPATH, plus whatever other jar it looks like it needs. This is the step that is giving me issues.
Most of the apps decompile/compile just fine, but a handful of them are referencing classes and superclasses that don't show up anywhere.
Is there something that I am missing? Is there something wrong with with my process? I did the exact same thing with a donut rom on my g1 and a gingerbread rom on my g2, and everything is working swell with those roms. Just for giggles, I added all the jars to the boot class path and I still got the same errors. Is this a case of a class that isn't used?
Here's a taste of my half-baked rom... the excerpt from the log file shows the apk and the bootclass path that I used.
Code:
AWS.apk -c core.jar:apache-xml.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:core-junit.jar
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find superclass Ljavax/servlet/http/HttpServlet;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadSuperclass(ClassPath.java:784)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:668)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:280)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:163)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.java:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:111)
at org.jf.baksmali.main.main(main.java:282)
Error while loading class Lcom/ecareme/http/RedirectServlet; from file /android/hc_work/deodex_hc/system/app/AWS.odex
Error while loading ClassPath class Lcom/ecareme/http/RedirectServlet;
Dictionary.apk -c core.jar:apache-xml.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:core-junit.jar
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find superclass Ljava/awt/event/WindowAdapter;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadSuperclass(ClassPath.java:784)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:668)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:280)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:163)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.java:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:111)
at org.jf.baksmali.main.main(main.java:282)
Error while loading class Lorg/htmlparser/beans/BeanyBaby$1; from file /android/hc_work/deodex_hc/system/app/Dictionary.odex
Error while loading ClassPath class Lorg/htmlparser/beans/BeanyBaby$1;
NVIDIATegraZone.apk -c core.jar:apache-xml.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:core-junit.jar
Error while disassembling method Lcom/github/droidfu/http/BetterHttpRequest$2;->retryRequest(Ljava/io/IOException;ILorg/apache/http/protocol/HttpContext;)Z. Continuing.
org.jf.dexlib.Code.Analysis.ValidationException: class Loauth/signpost/OAuthConsumer; cannot be resolved.
at org.jf.dexlib.Code.Analysis.ClassPath$UnresolvedClassDef.unresolvedValidationException(ClassPath.java:535)
at org.jf.dexlib.Code.Analysis.ClassPath$UnresolvedClassDef.getClassDepth(ClassPath.java:543)
at org.jf.dexlib.Code.Analysis.ClassPath.getCommonSuperclass(ClassPath.java:383)
at org.jf.dexlib.Code.Analysis.RegisterType.merge(RegisterType.java:275)
at org.jf.dexlib.Code.Analysis.AnalyzedInstruction.mergeRegister(AnalyzedInstruction.java:185)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.propagateRegisterToSuccessors(MethodAnalyzer.java:444)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.setPostRegisterTypeAndPropagateChanges(MethodAnalyzer.java:409)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.setDestinationRegisterTypeAndPropagateChanges(MethodAnalyzer.java:396)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeIgetWideObject(MethodAnalyzer.java:2605)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:777)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:208)
at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:370)
at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:292)
at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:132)
at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:323)
at org.jf.baksmali.Adaptors.ClassDefinition.writeVirtualMethods(ClassDefinition.java:308)
at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:137)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:201)
at org.jf.baksmali.main.main(main.java:282)
opcode: iget-object
CodeAddress: 96
Method: Lcom/github/droidfu/http/BetterHttpRequest$2;->retryRequest(Ljava/io/IOException;ILorg/apache/http/protocol/HttpContext;)Z
OK, I tried it with the -I option for the offending apks and I didn't have any errors after that. Smali was fine with ignoring the missing classes. The rom seems to be OK. I don't get any force closes, but I didn't test out everything too thoroughly, especially the bloatware. Make me wonder why I bother deodexing it in the first place?
I would still like to know how these missing classes get there in the first place?
Related
I've been looking for information on how to resign apks and update.zip files.
So far i've found a lot of tools for windows, the problem is that i use linux ubuntu.
I went ahead and tried JF's jar but i get this error
"Failed to load Main-Class manifest attribute from
testsign.jar"
Would like to know if anyone out there could guide me through the process or point me in the right direction as i've only found information regarding resigning under windows.
Thanks in advance,
Check whether you are running the correct version of Java.
What is the whole output of the Java back trace?
Cheesebaron said:
Check whether you are running the correct version of Java.
What is the whole output of the Java back trace?
Click to expand...
Click to collapse
I have Sun-JDK 6, openJDK and other java stuff installed... don't know if i need to remove or add anything...
This is what i've tried so far:
xxx:$ java testsign.jar Launcherr
Exception in thread "main" java.lang.NoClassDefFoundError: testsign/jar
Caused by: java.lang.ClassNotFoundException: testsign.jar
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
Could not find the main class: testsign.jar. Program will exit.
xxx:~/Desktop/testsign(2)(2)$
============================================================
xxx:~/Desktop/testsign(2)(2)$ sudo java -jar testsign.jar Launcherr
Failed to load Main-Class manifest attribute from
testsign.jar
xxx:~/Desktop/testsign(2)(2)$
try this:
java -classpath testsign.jar testsign input.zip output.zip
Deicist said:
try this:
java -classpath testsign.jar testsign input.zip output.zip
Click to expand...
Click to collapse
Worked perfectly with a zip file... heres the output =)
xxx:~/Desktop/testsign(2)(2)$ java -classpath testsign.jar testsign hero.zip
xxx:~/Desktop/testsign(2)(2)$
Now... when i have the apk extracted in a folder and modify it I assume i have to make the folder an APK file again and then try java -classpath testsign.jar testsign bla.apk... i think it might work, what i need to know is how do i make the folder an apk file... is it possible to make it a .zip file and then change the extension to .apk? will that work or I need a tool to make the apk?
EDIT1: Ok... i made a zip file from the folder, changed the extension to APK and resign... i will try to unpack an aplication and install it via ASTRO... let's see how that goes...
EDIT2: ok... edit1 method didn't work... tried installing with ASTRO didnt work, tried pushing it to the phone via adb... didn't work either... HEEEEEELP! hehe..
FIGURED IT OUT: ok... i figured it out... =) making a zip file and renaming the extension to apk and signing DOES work... i was making a mistake, while packing the zip file using archiver and the folder structure was changed... i did it manually and worked perfectly... now i know how to make apks and resign them... thanks to everybody who cooperated for the patience and support... =)
pep1t0 said:
I've been looking for information on how to resign apks and update.zip files.
So far i've found a lot of tools for windows, the problem is that i use linux ubuntu.
I went ahead and tried JF's jar but i get this error
"Failed to load Main-Class manifest attribute from
testsign.jar"
Would like to know if anyone out there could guide me through the process or point me in the right direction as i've only found information regarding resigning under windows.
Thanks in advance,
Click to expand...
Click to collapse
Hey any chance you could point me to the windows programs used to resign apk files, and do you know of any good walk throughs for resigning.
Thanks
pep1t0 said:
Worked perfectly with a zip file... heres the output =)
Click to expand...
Click to collapse
Now when you've learned how, could you make a "How to" for others?
the java testsign tool should work with windows, i think all you have to do is install the java sdk... the text line should be the same java -classpath testsign.jar testsign nameofthefile.apk/nameofthefile.zip
The zip files are... just zip files, can be made with 7zip (in windows) after you make the .zip if you want to make it an apk all you have to do is change the extension... maybe this works in cmd "copy zipedfile.zip newapkfile.apk"... if not... put it in the sdcard and do it via adb shell...
"adb shell /sdcard/nameofthezipfile.zip /sdcard/nameofthenewapk.apk"
I don't really have much time to make a tutorial and try things right now... i will try next week, in the meantime try these things... good luck...
Hi all,
i've tryed to de-odex my LG P500 files in system/app and system/framework with "xUltimate-2.2.2". It works for the most of files, but MoviePlayer.odex doesn't deodex because of an error: "Error occured while loading boot class path files." and so the xUltimate application stops complete
Code:
After this, a stacktrace follows:
[code]
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find int
erface Lcom/nextreaming/NexSubtitle$IListener;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadAllImplementedInte
rfaces(ClassPath.java:819)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:
675)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:280
)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:16
3)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.j
ava:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:105)
at org.jf.baksmali.main.main(main.java:278)
Error while loading class Lcom/wise/movie_player/movie_player$23; from file .\or
igi_app\MoviePlayer.odex
Error while loading ClassPath class Lcom/wise/movie_player/movie_player$23;
Can anyone help me please or give a tip, to deodex my system?
Thanks
Problems are now solved: we can't use xUltimate here, because we must apply some class pathes for deodexing the odex-files.
All files are now copied to the phone, it boots now in deodexed format, but two apps are crashing:
com.android.phone and com.android.settings
Any suggestions ???
can you please tell that how it worked. i wanna deodex samsung galaxy 3.
with xultimate settings are not deodexed , everything does.
so if i keep the settings as it is and deodex everything else and put to phone, would it work..???
is this ICS or Gingerbread?
Move to Q+A Please
Having a tough time with deodexing Mms.apk from the new Rodgers build.
I simply wanted to figure out how to deodex a file so I can use it in Pinnacle(learning), I downloaded baksmali and loaded it up pointed to the framework directories and tried to deodexing and that didn't work.
So I copied the all the /app and /framework folders from the mounted image to a local project folder /home/dan/project tried it that way too and this is now the error I get:
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Util.ExceptionWithContext: ./services.odex: file too short
at org.jf.dexlib.Util.ExceptionWithContext.withContext(ExceptionWithContext.java:54)
at org.jf.dexlib.Code.Analysis.ClassPath.loadBootClassPath(ClassPath.java:220)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:145)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPathFromOdex(ClassPath.java:110)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:104)
at org.jf.baksmali.main.main(main.java:282)
Caused by: java.lang.RuntimeException: ./services.odex: file too short
at org.jf.dexlib.Util.FileUtils.readFile(FileUtils.java:103)
at org.jf.dexlib.DexFile.<init>(DexFile.java:293)
at org.jf.dexlib.Code.Analysis.ClassPath.loadBootClassPath(ClassPath.java:216)
... 4 more
Error while reading boot class path entry "services.odex".
Click to expand...
Click to collapse
Anyone have any ideas?
Running RHEL 6.1 x64
im trying to convert .class to .dex using dx but im gtting an error
Code:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.cf.iface.ParseException: class name (com/dummy/sprite/BuildConfig
) does not match path (BuildConfig.class)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:
520)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:4
06)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary
(DirectClassFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.jav
a:251)
at com.android.dx.command.dexer.Main.processClass(Main.java:704)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
at com.android.dx.command.dexer.Main.access$300(Main.java:83)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.j
ava:170)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java
:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:632)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
...while parsing BuildConfig.class
1 error; aborting
Noobdead said:
im trying to convert .class to .dex using dx but im gtting an error
Code:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.cf.iface.ParseException: class name (com/dummy/sprite/BuildConfig
) does not match path (BuildConfig.class)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:
520)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:4
06)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary
(DirectClassFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.jav
a:251)
at com.android.dx.command.dexer.Main.processClass(Main.java:704)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
at com.android.dx.command.dexer.Main.access$300(Main.java:83)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.j
ava:170)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java
:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:632)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
...while parsing BuildConfig.class
1 error; aborting
Click to expand...
Click to collapse
Did you install Java 1.6?
And add it to environment path?
BTW, you could have continued it here: http://forum.xda-developers.com/general/help/compile-source-code-t3119485/post60993620
Don't create new threads unnecessarily
I have set java alright I think I know my problem see my steps
There is a folder which contain decompiled code just like apktool but it has java it like the following Downloads/Compressed/source/src/com/dummy/sprite/BuildConfig.class
I copy the class file where DX is located and run the command
I found a link which explains this but I'm noob so I can't fully understand please help http://stackoverflow.com/questions/...e-processing-class-name-and-path-do-not-match
Sent from my One X using XDA Free mobile app
Solved by using --nostrict option
Sent from my One X using XDA Free mobile app
Hello,
Maybe is a very noob question, but I don't know about java programming.
I'm trying to make Sony Album app to work on OmniRom without use the patched version of App, but the log shows like a class doesn't exist. I've extracted that class from the Sony framework.jar and I've recompiled it on a new jar file. I've pushed that new jar file to framework folder but the App still saying that doesn't exists, so my question is: What I've to do to load that class in framework without modify the framework.jar file?.
I've list the jar file class list and it show how the class is there, but I'm sure that I've forgoten something.
Also I've tried to decompile another class file where the App is searching for, add the class that fails and recompile, but it still without work.
The class I'm trying to add is com.sonyericsson.provider.SemcMediaStore$ExtendedFile and I want to do it to create a systemless package for magisk. I've tried to search some info but I'm not able to find it, so maybe I'm not using the right words.
Thanks and greetings!!