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
Related
I have opened jf1.5 adp1 and removed the camera app from it how do I zip it back up so my phone will perform the update. I have already updated my phone to the unedited version of jf1.5 adp1 when I try to use the edited version it aborts the updated
quilobo said:
I have opened jf1.5 adp1 and removed the camera app from it how do I zip it back up so my phone will perform the update. I have already updated my phone to the unedited version of jf1.5 adp1 when I try to use the edited version it aborts the updated
Click to expand...
Click to collapse
it has to be signed .. read JFs info for his "Build Environment" .. very easy to do in linux .. you can't just modify the zip and be done .. files must be signed
thanks for your response
No need for the entire build environment. Just get the AndroidMod.zip file (google for dl sources) and run the modified update.zip through signapk. There is a readme included detailing how to use it.
I have the sign app but I can't figure out how to use it. I searched but I could not find a good set of instructions.
Open your command line, change directory to the signapk directory (also for convenience your update.zip file should be in this directory too) then type:
java -jar signapk.jar testkey.x509.pem testkey.pk8 update.zip update_signed.zip
That's it. The update_signed.zip file will be the finished file. If it gives you an error 'java' is not a valid executable, that is because you don't have JRE or JDK installed.
ok I did all that put the update.zip that is signed on my sd card with nothing else on it. started teh up date the phone verifies the file. then it starts installing as soon as it starts to install I get this error on my phone. "E:Can't find update script installation aborted.
Somehow you deleted the update-script. Check the zip file to see if its still present:
\META-INF\com\google\android\update-script
it is still there
quilobo said:
it is still there
Click to expand...
Click to collapse
Confusing.
it is only a 3k file. I found a 14k file in another update.zip I had
still says it can't find it
What archive creation program are you using to create the zip?
winzip what should I be using
Hm. Idk, I was just curious. It shouldn't make a difference really. Particularly if the signing tool worked fine. Maybe someone else can shed some light on this.
Try and re download your sources and then modify and resign.
Also be sure to check your sources after download and transfer (SHA1, MD5 etc)
ok I redownloaded the file and repeated the process and still get the same error. all I am trying to do is remove the camera app from the jf1.5adp1 build and put it on my phone .
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?
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?
Hello xda-developers!
I'm new to Android hacking, but I have a general background in programming...
I've been modding an application recently, unpacked the .apk file, done my changes and repacked it, signed it and everything works well...But when I run the program, and the program wants to play an mp3 file, which was located in res/raw before packing the .apk file, it gives an error: "Can't load audio file."...What is the possible cause of this problem and how to solve it? Are the IDs of the raw resource files changed everytime I unpack and repack the .apk file or what?
Thanks in advance...
Edit: Issue fixed by unpacking and repacking using Apktool instead of WinZip.