The previous introduction to the use of IDA Dynamic debugging Smali, this method is easy to set up, do not need to re-package, easy to use, but if the variable type setting error will immediately exit debugging, this is a bad place, and using Android Studio will not. 0x01 Tool
The latest version of ①android Studio.
②apktool try to use the latest version.
③ideasmali plugin. Https://github.com/JesusFreke/smali/wiki/smalidea
0x02 Concrete Steps
Install the Ideasmali plugin, select File->settings->plugins, and install the Ideasmali plugin before downloading.
Start the app in debug state
To view ports via DDMS:
PS can be executed with adb shell if not Ddms | grep Kugou command to view the forwarding port:
Then do port forwarding:
adb forward tcp:8700 jdwp:24551
Remember this time you need to turn DDMS off or you will get an error.
Create the DEBUGSMALI/SRC directory, use Apktool or Baksmali to decompile the APK to the DEBUGSMALI/SRC directory to debug, and import the directory using Android Studio:
Then select Create Project from existing sources, and then select Next.
After successfully importing the project, right click on the SRC directory, set
Mark Directory As->Sources Root
To configure options for remote debugging, select Run-->edit configurations:
Add a debug option for remote debugging, port selection: 8700
Select File-->project Structure Configure JDK after setting port number
Run->debug after the good breakpoint,
Wait a few seconds, after the breakpoint is triggered, you can debug it one step at a
Android Studio Dynamic Debug Smali