Skip to content

Instantly share code, notes, and snippets.

@aknik
Last active June 9, 2018 18:57
Show Gist options
  • Save aknik/088aed3d725ee66cbed6baf83e32c1da to your computer and use it in GitHub Desktop.
Save aknik/088aed3d725ee66cbed6baf83e32c1da to your computer and use it in GitHub Desktop.
smali java
If you need to know the value of a string - e.g. a parameter -
you can use Log.d(String tag, String message) to log it to the system log.
const-string/jumbo v0, "YourTag"
invoke-static {v0, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
If you are having trouble navigating the smali code and understand the flow of an app
you can use the following smali code. It will call Thread.dumpStack() which logs the current thread's call stack.
invoke-static {}, Ljava/lang/Thread;->dumpStack()V
---------------------------------------------------------------------------------------
apktool d -r -s mod.apk #Extrae classes.dex
d2j-dex2jar mod/classes.dex #Decompila
java -jar /opt/jd-gui/jd-gui-1.4.0.jar #Visualiza el codigo java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment