一。获取APK
1.由于手机中已经装了该应用,adb pull 到PC上
2.apktool d 发现报错,去网上下载更高版本的apktool_2.2.0.jar
java -jar apktool_2.2.0.jar d
成功生成smali文件夹
3.试下直接编译
java -jar apktool_2.2.0.jar b
报了N多错误,我4 * 500大小的缓冲区都放不下,
图中可看到res文件做了混淆
打开xml\y.xml,发现xmlns:android的值为http://schemas.android.com/apk/res-auto
我自己写的xml文件的xmlns:android为http://schemas.android.com/apk/res/android
修改一下,发现不报y.xml的错了,其他文件还是继续报错,看来要研究下xmlns:android
刚才的方法治标不治本,上网找了一下res-auto一般用在自定义控件的xml,在res/values/attrs.xml 添加
<declare-styleable name="Android">
<attr name="title" format="string"/>
</declare-styleable>
发现title的错不报了
<declare-styleable name="Android">
<attr name="btn_visibility" format="string"/>
<attr name="can_delete" format="boolean"/>
<attr name="defaultValue" format="boolean"/>
<attr name="dependency" format="string"/>
<attr name="empty_wording" format="string"/>
<attr name="key" format="string"/>
<attr name="icon" format="reference"/>
<attr name="layout" format="reference"/>
<attr name="persistent" format="boolean"/>
<attr name="summary" format="string"/>
<attr name="title" format="string"/>
<attr name="widgetLayout" format="reference"/>
</declare-styleable>
<declare-styleable name="mm">
<attr name="entryValues" format="reference"/>
<attr name="entries" format="reference"/>
<attr name="srcType" format="string"/>
</declare-styleable>
加了这些代码后不会报 No resource identifier found 的错了。
奇怪的是, mm明显是自定义的,不过竟然找不到,不知道是不是针对aptkool做的一些措施,隐藏了自定义的mm属性,还是编译的时候根本就没加到APK里面,那程序安装和运行的时候怎么不会报错呢,对res这块不熟,既然能跳过这部分,就等以后再研究了。
4.加了declare-styleable 后
这些报错大体意思是找不到style,打开res\values\styles.xml,发现都是混淆过的,然后layout里面的xml用style的时候都是明文显示
上面的疑问又来了,这个包是怎么编译出来的,运行的时候怎么没问题?
逆向某m-安卓APP记录
最新推荐文章于 2025-07-06 11:36:07 发布