Reversing
In this part we will extract the legitimate apk from emulator or the device and get the source code.
Tool
Android Debug Bridge (ADB) is a development tool that facilitates communication between an Android device and a personal computer.
How to Install ADB on Windows, macOS, and Linux
Note: You need debug usb enable in your emulator or device.
How view devices?
adb devices

How extract apk?
For this you need have installed the application in your device and know package name.
adb shell pm path package_name
This command print the path to the APK of the given

adb pull <remote> [<localDestination>]
This command pulls the file remote to local. If local isn’t specified, it will pull to the current folder.

Now, how to get to the source code?
jadx: The jadx suite allows you to simply load an APK and look at its Java source code. What’s happening under the hood is that jADX is decompiling the APK to smali and then converting the smali back to Java.
Usage
jadx -d [path-output-folder] [path-apk-or-dex-file]


Dex2Jar: use dex2jar to convert an APK to a JAR file.
d2j-dex2jar.sh or .bat /path/application.apk
Once you have the JAR file, simply open it with JD-GUI and you’ll see its Java code.

apktool: This tool get a source code in smali.
apktool d file.apk


jadx-gui: UI version of jadx
jadx\bin\jadx-gui

Last updated