Android anti-compilation
Decompile the Odex file (for example, Framework.odex), and if you reverse-compile Dex, step 4th directly
1Because the Odex tool in the D:\Develop tools\android Anti-compilation tool \odex, in order to execute the command conveniently in the Odex folder,Create a new folder structure for the system and put all the packages referenced in the Odex in the corresponding directorySystem-----|-------App |-------Framework
2.Java-jar baksmali-2.0.3.jar-d./system/framework-x./system/framework/framework.odex-d Specifies Bootclasspath dir-x deodex the given Odex file. This option is ignored if the input file was not an Odex file-a--api-level <api_level>,the Numeric Api-level of The file being disassembled. If not specified, it defaults to (ICS). Many people on the Internet that the post is written by-a 12, no need
3After executing the above command, an out folder is generated in the Odex directory, which is the hierarchy structure.Note: Before executing the above command, it is possible to have an old out folder that has an out folder before it can cause the command to be executed below to throw an exception, so the older out folder is removed, the exception is as follows:
unexpected top-level EXCEPTION:
org.jf.util.ExceptionWithContext:Unsigned Short value
out of range:78281
At
Org.jf.dexlib2.writer.DexDataWriter.writeUshort (dexdatawriter.java:11
6)
At
org.jf.dexlib2.writer.InstructionWriter.write (Instructionwriter.java:
312)
At
Org.jf.dexlib2.writer.DexWriter.writeCodeItem (dexwriter.java:980)
At
Org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems (Dexwriter.java
: 759)
At
Org.jf.dexlib2.writer.DexWriter.writeTo (dexwriter.java:214)
At
Org.jf.dexlib2.writer.DexWriter.writeTo (dexwriter.java:192)
At
Org.jf.smali.main.main (main.java:229)
The last command to convert to Classes.dex:Java-xmx512m-jar Smali-2.0.3.jar out-o classes.dex
4The final step is to say classes.dex to the jar file, with the D2j-dex2jar command:d2j-dex2jar-f Classes.dex