Android Device & Emulator
How to install Proxyman CA on Android Devices
In order to capture the HTTP/HTTPS message in physical Android Devices or Android Emulators, please navigate to:
  • Certificate Menu -> Install Certificate on Android -> Device
  • Certificate Menu -> Install Certificate on Android -> Emulator
For the Android Emulator, let check out the Automatic Script for Android Emulator

Android Setup Guide

Let follow the guideline:
  1. 1.
    Install Root Proxyman Certificate on your machine: You can follow the macOS Guide.
  2. 2.
    Get your Android Device or Emulator -> Open Setting app -> Wifi -> Select the current Wifi -> Config the HTTP Proxy by following the next tables.
Name
Value
Server IP
Your current IP Network
Port
The current port of Proxyman: 9090 is the default
Authentication
No
Some Samsung devices couldn't access the Internet after setting the HTTP Proxy. Please try to forget your current network and connect again.
If you're using any VPN app, please make sure to close it, since some VPN apps conflict with HTTPS Proxy config
3. Open http://proxy.man/ssl from the native web browser on your Android Devices in order to install the Proxyman Certificate.
Please make sure to install the Certificate and select the VPN and App Section.
http://proxy.man/ssl is a local website, which serves from the local Proxyman's HTTP server. If you couldn't open it, please forget the wifi, re-connect and make sure the Proxyman app is opening.
4. From Android Emulator API 30+, it requires extra steps to trust the Proxyman Certificate
  • Setting app -> Security -> Encryption & Credentials -> Install a Certificate -> CA Certificate -> Install Anyway and Select CA Proxyman Certificate in your storage
You can verify that by opening Trusted Credentials -> User Tab
5. From Android N, we have to trust the Proxyman Certificate in your app by adding the following code: It means that you can only use SSL Proxying in apps, which you are in control
  • Add res/xml/network_security_config.xml
network_security_config.xml
1
<network-security-config>
2
<debug-overrides>
3
<trust-anchors>
4
<!-- Trust user added CAs while debuggable only -->
5
<certificates src="user" />
6
<certificates src="system" />
7
</trust-anchors>
8
</debug-overrides>
9
10
<base-config cleartextTrafficPermitted="true">
11
<trust-anchors>
12
<certificates src="system" />
13
</trust-anchors>
14
</base-config>
15
16
<domain-config>
17
<!-- Make sure your URL Server here -->
18
<domain includeSubdomains="true">your_production_domain</domain>
19
<trust-anchors>
20
<certificates src="user"/>
21
<certificates src="system"/>
22
</trust-anchors>
23
</domain-config>
24
</network-security-config>
Copied!
Make sure you replace your_production_domain with the real domains that you're going to intercept.
  • Add to AndroidManifest.xml
manifest.xml
1
<?xml version="1.0" encoding="utf-8"?>
2
<manifest ... >
3
<application android:networkSecurityConfig="@xml/network_security_config" ... >
4
...
5
</application>
6
</manifest>
Copied!
Find more information at Network Security Configuration
Make sure that you remove those configs in the Release build. If not, your HTTP/HTTPS requests can be intercepted and leak your sensitive data in the Production build.
6. If it's Android Emulator, please restart the emulator
7. Try to open your app, and intercept your domain, which is added on the network_security_config.xml

Troubleshooting

Please check out this troubleshooting section.

Sample Android Project

If you've struggled to config XML settings, let check out this simple project that we've configured:
See HTTPS traffic (https://www.google.com)

React Native Android app

If you're using React Native for the Android app, please follow this short tutorial to know how to configure res/xml/network_security_config.xml and AndroidManifest.xml.

Intercept Traffic from embedding WebView

Some Android apps have embedded WebView that requires extra steps in order to intercept the HTTPS traffic.
  1. 1.
    Make sure you're able to see other HTTPS traffic from your Android app. It means that you've set up the certificate properly
  2. 2.
    Inject the following code to your WebView
1
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
2
WebView.setWebContentsDebuggingEnabled(true);
3
}
4
5
// The following two lines help with disabling asset caching
6
webView.getSettings().setAppCacheEnabled(false);
7
webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
Copied!
3. Open a new Chrome tab on your computer and navigate to chrome://inspect
4. When you open the WebView, the view will appear in your Chrome tab, then you can simply click inspect to start using the remote debugger.

SSL Proxying using Root Device

Credit for Shirshak
If your Android version is below 7 you don't need to do this step. Google added extra security that doesn't allow man-in-middle-app to attack after Android 6. i.e unable to do MITM attack to android apps.
We don't bear any responsibility for problems due to rooting phones. So please follow the guide at your own risk.
  1. 1.
    Root your phone with magisk framework.
  2. 2.
    Install the Root file browser so you can copy and paste files in a restricted system folder.
  3. 3.
    Type the following script in the command line
    1
    $ cd ~/.proxyman
    2
    // We copy certificate to another file name just so we may need it later
    3
    $ cp proxyman-ca.pem temp.pem
    4
    $ hash=$(openssl x509 -inform PEM -subject_hash_old -in temp.pem | head -1)
    5
    $ mv temp.pem "$hash.0"
    Copied!
  4. 4.
    If you go to ~/.proxyman folder you must notice a file name starting with numbers with extension
  5. 5.
    Copy that file to your Andriod.
  6. 6.
    Using root file browser transfer that file to /system/etc/security/cacerts/
  7. 7.
    Enjoy proxying.
  1. 1.
    When using Andriod phones, set gateway to any wrong IP just so you can be sure all your traffic goes from proxy man proxy only.
  2. 2.
    We can use the macOS sharing feature to create a mobile hotspot. And from an android phone, you can use Proxyman proxy easily. It is much better because sometimes the router can block requests between mobile and macOS.

Addition resources

Last modified 2mo ago