When you want to poke into the communication of an app.
This guide assumes you're using a UNIX-like operating system. Much of this is documented more in-depth in the objection wiki.
- Install Java8:
brew cask install homebrew/cask-versions/java8 - Install
apktool:brew install apktool - Install the Android SDK manager
brew cask install android-sdk- Change your
$PATHto include the Android SDK dir:- with bash, put
export ANDROID_SDK_ROOT='/usr/local/share/android-sdk'into your.bashrc - with fish, put
set -gx ANDROID_SDK_ROOT '/usr/local/share/android-sdk'into your~/.config/fish/config.fish
- with bash, put
- Install the Android SDK build tools
sdkmanager --updatesdkmanager build-tools;28.0.0-rc2sdkmanager platform-tools- Change your
$PATHto include the newly downloaded tools:- with bash, put
export PATH=$PATH:"$ANDROID_SDK_ROOT/tools":"$ANDROID_SDK_ROOT/build-tools/28.0.0-rc2":"$ANDROID_SDK_ROOT/platform-tools"into your.bashrc - with fish, put
set -gx PATH $PATH $ANDROID_SDK_ROOT'/tools' $ANDROID_SDK_ROOT'/build-tools/28.0.0-rc2' $ANDROID_SDK_ROOT'/platform-tools'into your~/.config/fish/config.fish
- with bash, put
- Get an Android phone, connect it to your computer, allow USB debugging on the device.
- Download the app
.apkarchive (you may instead want to pull it from your phone).- Find the ID of the app you want to analyse from the Play Store URL, e.g.
de.hafas.android.dbfromhttps://play.google.com/store/apps/details?id=de.hafas.android.db. - Navigate to apk-dl.com and download the app as an
.apkarchive.
- Find the ID of the app you want to analyse from the Play Store URL, e.g.
- Find the architecture of your device:
adb shell getprop ro.product.cpu.abi(i gotarm64-v8a). - Patch the
.apkusingobjection- Set up
objectionas described in its wiki. Use thevirtualenvmethod to get a clean install without messing up your system. - Patch the
.apkby runningobjection patchapk -a <your-architecture> -s <path-to-apk-file>
- Set up
- Load the app onto the device:
adb uninstall <your-app-id> && adb install <path-to-patched-apk-file> - Set up the HTTP proxy
- Get
mitmproxy:brew install mitmproxy. - Run the proxy with
mitmproxy -p 8080. - Get the local IP address of the computer where the proxy is running:
ifconfig en0 | grep inet. - Configure the Android device to use your proxy:
adb shell settings put global http_proxy <proxy-ip-address>:8080.
- Get
- Run the app
- Open the app. It will be in a so-called "paused state" (it won't open).
- Connect to the device using
objection explore. Once this succeeds, you will get a shell and the app will open. - In the
objectionshell, runandroid sslpinning disableto disable cert-pinning.
- Done!
mitmproxyshould now show you network requests being done by the app. - To remove the global proxy on the device run:
adb shell settings delete global http_proxyadb shell settings delete global global_http_proxy_hostadb shell settings delete global global_http_proxy_port