实际上是动态调试 Smail文件
,一种逆向分析的方式,经过 jdwp
调试相关进程。 通常在作竞品分析时会用到相似的手段。Android studio支持apk分析,因此操做起来仍是比较简单的。android
正常状况下release包是不容许调试的,因此必须先让apk可调试,通常有两种方法:shell
apktool
工具反编译apk,修改 AndroidManifest.xml
文件,而后再重签名二次打包:<!-- application标签加上android:debuggable="true" -->
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:debuggable="true">
复制代码
运行后,在 Logcat
中能够找到对应进程便可。markdown
Android Studio 中 Smali Support
插件不支持 smali 断点,因此须要从新下载一个插件,具体操做能够参考:解决新版Android Studio 4.0+没法断点调试smali问题app
启动 Android Studio 或者 点击File 是否有 Profile or Debug APK
这个选项:tcp
若是没有找到,应该是
Android APK Support
这个插件没有启用,Settings中启用该插件便可。ide
运行下面命令,启动app:工具
adb shell am start -D -n 包名/.你要调试的界面 例如: adb shell am start -D -n com.francis.testxpose/.MainActivityoop
查看进程号:idea
adb shell ps | findstr 包名 例如: adb shell ps | findstr com.francis.testxposespa
使用 jdwp 转发端口:
adb forward tcp:调试端口号 jdwp:进程号 例如: adb forward tcp:8900 jdwp:12618
Profile or Debug APK
选项导入apk:remote
调试模式找到你想调试的代码下断点。