In this part we will extract the legitimate apk from emulator or the device and get the source code.
First Steps
# install tools
apt install adb apktool openjdk-11-jdk-headless zipalign apksigner
# list android attached devices
adb devices
# find app name
adb shell pm list packages -f | grep $app_name
# list installed packages
adb shell pm list packages -f
# get path of the app we want to reverse
adb shell pm path $package_name
# get the app on our local machine on current folder
adb pull $PATH_app .
Get the source code
Tools :
jadx / jadx-gui
dex2jar
apktool
apkx
jadx -d $path_output_folder app.apk
# or d2j
d2j-dex2jar.sh app.apk
# or apktool decompile
apktool d app.apk -o $output_folder
# or apkx
apkx app.apk
cd app
# open in visual studio
code .
# or use jadx-gui
jadx-gui app.apk
# Open the JAR file with JD-GUI and youβll see its Java code.