I. Re-opening the package apk
1.apktool unpacking file apktool d-d xxx.apk Note here that using the-d parameter, the generated Smali file ends in Java to be recognized by eclipse
2. Locate the Androidmanifest file, set allow debugging to locate the Androidmanifest.xml file, set the property in the application node android:debuggable= "true"
Or when you add the-D parameter back to the compilation, the property is automatically set, and the feature is canceled by the high version Apktool
3. Add the OnCreate function (not included)invoke-static {}, Landroid/os/debug;->waitfordebugger () V
4. Recompile the package
5. Signature APK The above process is too cumbersome, I have written a Python script to complete a key operation, the use of the need to configure the config.py environment Https://github.com/bingghost/apk_repack
Run the program after installation, you can see we need to debug the program's port number is 8620
Create a new project with Eclipse and then import the SRC directory after unpacking
Power Down Under the OnCreate function of the main activity
Configuring debugging Options
Project Right-click->debug as->debug config->remote Java application->new-> Port 8620
then click Debug, Exit the program to the main interface, and then go in, and the breakpoint breaks down.
And then you can start one-step debugging.
From for notes (Wiz)
8.eclipse Debug Smali