- Install apktoll
- Disassemble APK
apktool d ./TestApp.apk - Make any changes...
3.1. For example modify "network_security_config.xml" in the res/xml directory
3.2 Add
<certificates src="user" />
<network-security-config>
<base-config>
<trust-anchors>
<certificates src="system" />
<!-- Additionally trust user added CAs -->
<certificates src="user" />
</trust-anchors>
</base-config>
</network-security-config>- Reassemble APK
apktool b ./TestApp - Sign
5.1
keytool -genkey -v -keystore test.keystore -storepass password -alias android -keypass password -keyalg RSA -keysize 2048 -validity 100005.2jarsigner -verbose -keystore test.keystore -storepass password -keypass password TestApp/dist/TestApp.apk android - Install the new APK with adb
adb install TestApp\dist\TestApp.apk