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:
- If you have not already done so, create a new XML file:
res/xml/network_security_config.xml
. - In your application manifest
AndroidManifest.xml
, add the configuration to yourapplication
attribute:<manifest><application android:networkSecurityConfig="@xml/network_security_config">⋮</application></manifest> - 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> - 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:
- Create an Android Library by creating a new folder
Assets/Plugins/Android/«name-of-your-library».androidlib
. - Create an
AndroidManifest.xml
file inAssets/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> - Create a new
project.properties
file inAssets/Plugins/Android/«name-of-your-library».androidlib/
with the following contents:target=android-31android.library=true - 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> - Move your
network_security_config.xml
file into theAssets/Plugins/Android/«name-of-your-library».androidlib/res/xml
folder. - Create a debug build.
- Select Development Build in Build Settings.