dexdump oatdump objdump 反汇编及生成oat文件

一. 反汇编:


1. dexdump -d Neg.apk > neg-dexdump.txt (-d后面可以是.dex、.jar、.apk和.odex)
2. oatdump --oat-file=data@app@Neg.apk@classes.dex --output=neg-oatdump.txt --instruction-set=mips (--oat-file参数只能是oat文件)
3. cd prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9/bin
./mips64el-linux-android-objdump -S/-D ~/android-test/data@app@Neg.apk@classes.dex > ~/android-test/neg-objdump.txt (-S后面可以是可执行文件或目标文件)


二. 生成oat文件


boot.oat文件:(有错误)
dex2oat --image=out/target/product/loongson3/data/dalvik-cache/mips/system@framework@boot.art --dex-file=out/target/product/loongson3/system/framework/core-libart.jar --dex-file=out/target/product/loongson3/system/framework/conscrypt.jar --dex-file=out/target/product/loongson3/system/framework/okhttp.jar --dex-file=out/target/product/loongson3/system/framework/core-junit.jar --dex-file=out/target/product/loongson3/system/framework/bouncycastle.jar --dex-file=out/target/product/loongson3/system/framework/ext.jar --dex-file=out/target/product/loongson3/system/framework/framework.jar --dex-file=out/target/product/loongson3/system/framework/telephony-common.jar --dex-file=out/target/product/loongson3/system/framework/voip-common.jar --dex-file=out/target/product/loongson3/system/framework/ims-common.jar --dex-file=out/target/product/loongson3/system/framework/mms-common.jar --dex-file=out/target/product/loongson3/system/framework/android.policy.jar --dex-file=out/target/product/loongson3/system/framework/apache-xml.jar --oat-file=system@framework@boot.oat --instruction-set=mips --instruction-set-features=smp,fpu32,-mips2 --base=0x30808000 --runtime-arg -Xms64m --runtime-arg -Xmx64m --compiler-filter=speed --android-root=out/host/linux-x86/bin --image-classes=out/target/product/loongson3/system/etc/preloaded-classes > e.log 2>&1


应用程序:(有错误,文件runtime/utils.cc中函数GetDalvikCache(...)内没有权限创建data/dalivik-cahce/mips/)
dex2oat --dex-file=out/target/product/loongson3/system/priv-app/Launcher2/Launcher2.apk --oat-file=system@priv-app@Launcher2@Launcher2.apk@classes.dex --instruction-set=mips --instruction-set-features=smp,fpu32,-mips2 --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --android-root=out/host/linux-x86/bin


ABI/EABI/OABI: http://blog.chinaunix.net/uid-25299072-id-3059614.html
MIPS软件标准: http://blog.sina.com.cn/s/blog_a78208d301016jm3.html
MIPS 架构上函数调用过程中的堆栈和栈帧: http://blog.csdn.net/do2jiang/article/details/5404566
浅谈Android系统开发中LOG的使用: http://blog.csdn.net/luoshengyang/article/details/6581828
android的Log输出: http://blog.csdn.net/alley_zhang/article/details/5713894
dex2oat程序参数总结: http://www.th7.cn/Program/Android/201512/719494.shtml

    推荐阅读