First, please ensure your Android app has the following permissions to allow for the proxy recorder to record traffic on it while in debug mode:
- Ensure the application has the following permissions:
<uses-permission android:name=“android.permission.INTERNET”/>
<uses-permission android:name=“android.permission.ACCESS_NETWORK_STATE” />
<uses-permission android:name=“android.permission.ACCESS_WIFI_STATE”/> - In the application tag, include the following attribute:
android:networkSecurityConfig=“@xml/network_security_config”
- Create the XML directory in base/src/{packageMain}/res and add the following XML content to the file network_security_config.xml:
<?xml version=“1.0” encoding=“utf-8"?>
<network-security-config>
<debug-overrides>
<trust-anchors>
<!-- Trust user added CAs while debuggable only -->
<certificates src=“user” />
</trust-anchors>
</debug-overrides>
</network-security-config> - Run your app in debug mode.
If you want more information on this, you can view the official Android Developers documentation here.
Once the above is done, you can follow the below steps to record traffic from your app or mobile browser:
- On the left panel, you should be able to see all your proxy settings:
- It’s now time to configure your Android phone/tablet.
- Make sure your Wi-Fi connection is turned on. Go to your phone’s "Settings", go to Connections, then "Wi-Fi", and hold selection on your local Wi-Fi network.
- Select the "Manage network settings" option and select "Show advanced options".
- Tap the Proxy dropdown and select "Manual" for the proxy setup.
- You’ll now be asked to enter data for the server and the port. Here’s where you need to look at the proxy settings we provided earlier. For the server, enter the text displayed in the current proxy field - NOTE: don’t include the number at the end and don't include the "http://" prefix. Enter this number in the ‘port’ field.
- Activate the "Authenticate server" option and enter the authentication username and password that are provided in the proxy setup. You may be prompted for the username and password when accessing the browser, so be prepared to enter this information again.
- Tap the "Save" button to save these changes:
- Open your mobile browser and enter the following URL: http://mitm.it. You should see various devices, including Android and Apple, on your screen. Select the Android one for this case.
NOTE: You can also use the Other certificate here as well, in case you have an issue with the Android certificate. - Tap the Android option and download the certificate. Once downloaded, you will be prompted to enter a name for the certificate (doesn't matter what the name is) and set the "Used for" to "VPN and Apps" and tap "OK":
- Once this is done, turn off the Wi-Fi on your device, then turn it back on (this is to recycle the connection to use the certificate).
- Next, go back to your Recorder window/tab, and click that big red button at the bottom of your screen.
- Now, start recording your session.
1 Comments