odex 转 dex

步骤1:odex 转 smail

命令:

java -jar baksmali-2.2.4.jar deodex PackageInstaller.odex -d framework/arm64

命令说明:

baksmali-2.2.4.jar 文件下载地址:https://bitbucket.org/JesusFreke/smali/downloads/

PackageInstaller.odex:需要反编译的odex文件,该文件来自系统android 系统文件/system/privapp/PackageInstaller/oat/arm64/PackageInstaller.odex

framework/arm64 来自android系统文件 /system/framework/arm64

步骤2:smail 转 dex

命令:

java -jar smali-2.2.4.jar assemble out 

命令说明:

smali-2.2.4.jar 文件下载地址:https://bitbucket.org/JesusFreke/smali/downloads/
out : 需要转化的smail所在文件夹

备注:

java -jar baksmali-2.2.4.jar -x PackageInstaller.odex -d framework 

会导致以下异常,正确用法看步骤一:

Exception in thread "main" com.beust.jcommander.MissingCommandException: Expected a command, got -x
at com.beust.jcommander.JCommander.parseValues(JCommander.java:725)
at com.beust.jcommander.JCommander.parse(JCommander.java:304)
at com.beust.jcommander.JCommander.parse(JCommander.java:287)
at org.jf.baksmali.Main.main(Main.java:90)

baksmali-xxx.jar smali-xxx.jar 版本变化可能会导致使用方法变更,执行:

java -jar baksmali-x.x.x.jar --help  

来获得正确使用姿势

你可能感兴趣的:(odex 转 dex)