git clone https://github.com/MobSF/Mobile-Security-Framework-MobSF then .\setup.bat
7-Zip (APK/ZIP)
winget install 7zip.7zip
# host — PowerShell — persist SDK env vars for the current usersetxANDROID_HOME"$env:LOCALAPPDATA\Android\Sdk"setxPATH"$env:PATH;$env:LOCALAPPDATA\Android\Sdk\platform-tools;$env:LOCALAPPDATA\Android\Sdk\emulator"
# host — Linux — ~/.bashrcexportANDROID_HOME="$HOME/Android/Sdk"exportPATH="$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$ANDROID_HOME/cmdline-tools/latest/bin"
# host — Linux — udev rule so adb sees a physical device without rootecho'SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0664", GROUP="plugdev"'\|sudotee/etc/udev/rules.d/51-android.rules
sudoudevadmcontrol--reload-rules&&sudoudevadmtrigger
# host — launch the emulator with a writable system and no snapshot
emulator-list-avds
emulator-avdpentest35-writable-system-no-snapshot-load
emulator-avdpentest35-writable-system-http-proxy127.0.0.1:8080
emulator-avdpentest35-wipe-data# factory reset the AVD
emulator-avdpentest35-gpuswiftshader_indirect# when GPU passthrough breaks
# host — make /system writable on an emulator (API 29+ needs the verity dance)
adbroot
adbremount
# if remount refuses:
adbshellavbctldisable-verification&&adbreboot&&adbroot&&adbremount
# adb shell — enumerate packages
pmlistpackages# all
pmlistpackages-3# third-party only
pmlistpackages-s# system only
pmlistpackages-f# with the APK path
pmlistpackages-e# enabled only
pmlistpackages-d# disabled only
pmlistpackages-u# include uninstalled-but-retained
pmlistpackages|grep-ibank# filter# adb shell — locate and describe one package
pmpathcom.example.app# prints every APK path incl. splits
pmdumpcom.example.app|head-100
dumpsyspackagecom.example.app
# adb shell — dumpsys targets worth memorising
dumpsyspackage<pkg># permissions, components, signatures, install source
dumpsysactivityactivities# task/back stack, current top activity
dumpsysactivitytop# focused activity + its state
dumpsyswindowwindows|grep-E'mCurrentFocus|mFocusedApp'
dumpsys-l# list every registered service
servicelist# every Binder service name + interface
# adb shell — device fingerprinting properties
getprop# everything
getpropro.build.version.release# 14
getpropro.build.version.sdk# 34
getpropro.product.model
getpropro.product.cpu.abi# arm64-v8a / x86_64 — picks your frida-server build
getpropro.debuggable# 1 on userdebug/eng
getpropro.secure# 0 means adbd can run as root
getpropro.boot.verifiedbootstate# green / orange / yellow / red
getprop|grep-iqemu# emulator tells
# adb shell — processes, users, sockets
ps-A-oPID,USER,NAME|grep<pkg># find the app's pid and uid
id# current uid/gid/SELinux context
netstat-tulpn# listening sockets
cat/proc/<pid>/maps# loaded modules and memory regions
# host — logcat recipes
adblogcat-c# clear the ring buffer first
adblogcat*:E# errors and worse
adblogcat-s"MyTag"# single tag
adblogcat--pid=$(adbshellpidof-scom.example.app)
adblogcat-vtime-bcrash# crash buffer with timestamps
adblogcat-ball-d>full.log# dump every buffer once and exit
adblogcat|grep-iE'token|password|secret|authorization'
Android 7.0 (API 24) stopped trusting user-added CAs for apps targeting API 24+. The certificate has
to land in the system trust store, or be injected at runtime.
# host — export the CA from Burp: Proxy → Options → Import/Export CA certificate → DER → cacert.der
opensslx509-informDER-incacert.der-outcacert.pem
# host — compute the legacy hash Android uses as the filename
opensslx509-informPEM-subject_hash_old-incacert.pem|head-1
# → e.g. 9a5ba580# host — build the file: <hash>.0 must contain PEM + human-readable text
catcacert.pem>9a5ba580.0
opensslx509-informPEM-text-incacert.pem-noout>>9a5ba580.0
# host — install into /system (emulator / rooted device with writable system)
adbroot
adbremount
adbpush9a5ba580.0/system/etc/security/cacerts/
adbshellchmod644/system/etc/security/cacerts/9a5ba580.0
adbshellchownroot:root/system/etc/security/cacerts/9a5ba580.0
adbreboot
# host — unpack, push, run
unxzfrida-server-16.x.y-android-arm64.xz
adbpushfrida-server-16.x.y-android-arm64/data/local/tmp/frida-server
adbshell"chmod 755 /data/local/tmp/frida-server"
adbshell"su -c '/data/local/tmp/frida-server &'"# or on an adb-root device:
adbroot&&adbshell"/data/local/tmp/frida-server &"
# host — verify and use
frida-ps-U# processes on the USB device
frida-ps-Ua# only running apps
frida-ps-Uai# all installed apps
frida-U-fcom.example.app--pause# spawn and hold
frida-U-ncom.example.app# attach to a running process
frida-U-fcom.example.app-lhook.js# spawn with a script
frida-trace-U-ncom.example.app-j'javax.net.ssl.*!*'
# host — non-standard port / over TCP
adbshell"/data/local/tmp/frida-server -l 0.0.0.0:1337 &"
adbforwardtcp:1337tcp:1337
frida-H127.0.0.1:1337-fcom.example.app
Symptom
Usual cause
Failed to enumerate processes: unable to connect
frida-server not running, or wrong arch
unable to communicate with remote frida-server; please upgrade
# host — GUI
jadx-guiapp.apk
# host — decompile to Java sources
jadx-dout/app.apk
jadx-dout/--show-bad-codeapp.apk# keep code that failed to decompile cleanly
jadx-dout/--no-resapp.apk# skip resources, much faster
jadx-dout/--deobfapp.apk# rename obfuscated identifiers
jadx-dout/-eapp.apk# also export a Gradle project skeleton
jadx--export-gradle-dout/app.apk
jadx-dout/classes.dex# a bare DEX works too# host — grep the decompiled tree
grep-rniE"api[_-]?key|secret|password|token|http://"out/sources/
grep-rn"addJavascriptInterface\|setAllowFileAccess\|SSLSocketFactory"out/sources/
# host — run in Docker (least painful)
dockerpullopensecurity/mobile-security-framework-mobsf:latest
dockerrun-it--rm-p8000:8000opensecurity/mobile-security-framework-mobsf:latest
# open http://127.0.0.1:8000# host — from source
./setup.sh# or setup.bat on Windows
./run.sh# or run.bat
# host — REST API (key is printed at startup and shown in the web UI)
curl-F"file=@app.apk"http://127.0.0.1:8000/api/v1/upload-H"Authorization: <API_KEY>"
curl-XPOSThttp://127.0.0.1:8000/api/v1/scan-d"hash=<md5>"-H"Authorization: <API_KEY>"
curl-XPOSThttp://127.0.0.1:8000/api/v1/download_pdf-d"hash=<md5>"-H"Authorization: <API_KEY>"-oreport.pdf