DDMS
DDMS (Dalvik debug Monitor Server) is a tool for dynamic debugging (I do not know if the Android L will rename--!). DDMS provides file browsing, Logcat, Method profiling and other functions.
Locating critical Code1. Code Injection Method
Use Apktool decompile to get Smali, find the onclick (), such as to find the program registration code, read carefully after the registration code and user input function
invoke-virtual {v1, v0},ljava/lang/string;->equalsignorecase (ljava/lang/string;) Z
Move=result v3
IF-EQZ v3,: cond_2
Then add LOG.V () to output the V0 register:
Const-string v3, "SN"
invoke-static {v3, v0},landroid/util/log;->v (ljava/lang/string; ljava/lang/string;) I
Then use Apktool to pack, sign,
Output SN with "adb logcat-s sn:v".
2. Stack tracing method
Code injection mates Logcat useful but need to read a lot of disassembly code to find "output points".
The stack tracing method also belongs to the injection category.
For example, to find a toast when it was called, do not have to read too much disassembly code, but to locate the toast, and then after this section to join
New Exception ("Print Trace"). Printstacktrace ();
The correspondence Smali is not written in the book.
Then package the signature to run,
In cmd input "adb logcat-s system.err:v *w"
The java.lang.Exception print trace is output as a stack
It then outputs all the methods that were called during the execution of the program boot to Printstacktrace ().