Skip to content

Generating APK with Support for Proxying into Network Traffic

The AppLovin team may request a debuggable APK that can proxy into networking traffic by using Android’s Network Security Configuration feature.

These instructions show you how to create such an APK:

  1. If you have not already done so, create a new XML file: res/xml/network_security_config.xml.
  2. In your application manifest AndroidManifest.xml, add the configuration to your application attribute:
    <manifest>
    <application android:networkSecurityConfig="@xml/network_security_config">
    </application>
    </manifest>
  3. In the res/xml/network_security_config.xml file, add the following:
    <network-security-config>
    <debug-overrides>
    <trust-anchors>
    <certificates src="system" />
    <certificates src="user" />
    </trust-anchors>
    </debug-overrides>
    </network-security-config>
  4. Create a debug build.
    • Build with a debug configuration.

Unity

Unity deprecated the use of res folders within the Assets/Plugins/Android directory. These instuctions show you how to create a debuggable APK with proxy support when you use Unity to develop your application:

  1. Create an Android Library by creating a new folder Assets/Plugins/Android/«name-of-your-library».androidlib.
  2. Create an AndroidManifest.xml file in Assets/Plugins/Android/«name-of-your-library».androidlib/, and add the following to that file:
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.library.network.security">
    <application android:networkSecurityConfig="@xml/network_security_config" />
    </manifest>
  3. Create a new project.properties file in Assets/Plugins/Android/«name-of-your-library».androidlib/ with the following contents:
    target=android-31
    android.library=true
  4. If you have not already done so, create a new XML file, network_security_config.xml, with the following contents:
    <network-security-config>
    <debug-overrides>
    <trust-anchors>
    <certificates src="system" />
    <certificates src="user" />
    </trust-anchors>
    </debug-overrides>
    </network-security-config>
  5. Move your network_security_config.xml file into the Assets/Plugins/Android/«name-of-your-library».androidlib/res/xml folder.
  6. Create a debug build.
    • Select Development Build in Build Settings.