mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
04552375a9
The "official way" is now to just use transparent mode.
54 lines
2.3 KiB
HTML
54 lines
2.3 KiB
HTML
|
|
The proxy situation on Android is [an
|
|
embarrasment](http://code.google.com/p/android/issues/detail?id=1273). It's
|
|
scarcely credible, but Android didn't have a global proxy setting at all until
|
|
quite recently, and it's still not supported on many common Android versions.
|
|
In the meantime the app ecosystem has grown used to life without this basic
|
|
necessity, and many apps merrily ignore it even if it's there. This situation
|
|
is improving, but in many circumstances using [transparent
|
|
mode](@!urlTo("transparent.html")!@) is mandatory for testing Android apps.
|
|
|
|
We used an Asus Transformer Prime TF201 with Android 4.0.3 in the examples
|
|
below - your device may differ, but the broad process should be similar.
|
|
|
|
|
|
Installing the mitmproxy certificate
|
|
====================================
|
|
|
|
The first step is to install mitmproxy's interception certificate on the
|
|
Android device. In your ~/.mitmproxy directory, there is a file called
|
|
__mitmproxy-ca-cert.cer__ - we need to transfer this file to
|
|
__/sdcard/Downloads__ on the Android device. If this file doesn't exist for
|
|
you, your certs were generated with an older version of mitmproxy - just copy
|
|
the __mitmproxy-ca-cert.pem__ file to __mitmproxy-ca-cert.cer__ and proceed
|
|
from there.
|
|
|
|
In this case, we're using wget from Better Terminal Emulator Pro to transfer
|
|
the certificate from a local HTTP server. Other terminal applications may work,
|
|
and you might also transfer the file via external media like an SDcard:
|
|
|
|
<img src="android-shellwgetmitmproxyca.png"/>
|
|
|
|
Once we have the certificate on the local disk, we need to import it into the
|
|
list of trusted CAs. Go to Settings -> Security -> Credential Storage,
|
|
and select "Install from storage":
|
|
|
|
<img src="android-settingssecuritymenu.png"/>
|
|
|
|
The certificate in /sdcard/Downloads is automatically located and offered for
|
|
installation. Installing the cert will delete the download file from the local
|
|
disk:
|
|
|
|
<img src="android-settingssecurityinstallca.png"/>
|
|
|
|
Afterwards, you should see the certificate listed in the Trusted Credentials
|
|
store:
|
|
|
|
<img src="android-settingssecurityuserinstalledca.png"/>
|
|
|
|
If you're lucky enough to be working with an app that obeys the wireless proxy
|
|
settings, you're just about done - simply configure the settings to point at
|
|
mitmproxy. If not, proceed to the next step...
|
|
|
|
|