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
$PATH
to 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 --update
sdkmanager build-tools;28.0.0-rc2
sdkmanager platform-tools
- Change your
$PATH
to 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
.apk
archive (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.db
fromhttps://play.google.com/store/apps/details?id=de.hafas.android.db
. - Navigate to apk-dl.com and download the app as an
.apk
archive.
- 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
.apk
usingobjection
- Set up
objection
as described in its wiki. Use thevirtualenv
method to get a clean install without messing up your system. - Patch the
.apk
by 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
objection
shell, runandroid sslpinning disable
to disable cert-pinning.
- Done!
mitmproxy
should 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_proxy
adb shell settings delete global global_http_proxy_host
adb shell settings delete global global_http_proxy_port