baksmali 和smali的新语法

Smali和baksmali的CLI在2.2版本中进行了更新,新增了用于列出dex/apk/oat文件信息的命令,并改进了deodexing oat文件的功能,支持从Nougat系统版本开始的oat文件反编译,同时修复了Marshmallow版本的bug。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

smali and baksmali now have a new CLI as of the 2.2 release

baksmali disassemble app.apk -o app
smali assemble app -o classes.dex

To get started, try baksmali help or smali help

A few things to note

  • You can specify individual entries in an apk or oat file as if the apk or oat was a directory. e.g.baksmali disassemble app.apk/classes2.dex. See baksmali help input for more information.
  • The options for specifying a bootclasspath/classpath when deodexing have changed a bit. For deodexing oat files, it works something like this: adb pull /system/framework framework && baksmali deodex app.odex -b framework/arm/boot.oat
  • baksmali now has a set of commands for listing various information from a dex/apk/oat file. e.g.
    • baksmali list dex boot.oat to list all the dex entries in an oat file (works with apks too)
    • baksmali list classes app.apk to list all classes in an apk/dex/etc.
    • baksmali list methods app.apk | wc -l to get a count of the number of methods currently used by the dex file
  • v2.2 supports deodexing oat files from Nougat, and includes a number of bugfixes for Marshmallow as well
  • There were a few breaking API changes in dexlib2, etc. So if you plan to upgrade your tool to dexlib2 v2.2, you can expect that you'll need to fix a few things.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值