Skip to content

Instantly share code, notes, and snippets.

@azubkokshe
Created February 9, 2022 09:11
Show Gist options
  • Select an option

  • Save azubkokshe/ba32a9f9e0a0cdcc2fd201b4d6797109 to your computer and use it in GitHub Desktop.

Select an option

Save azubkokshe/ba32a9f9e0a0cdcc2fd201b4d6797109 to your computer and use it in GitHub Desktop.
Mofiying and repackaging an Android app
  1. Install apktoll
  2. Disassemble APK apktool d ./TestApp.apk
  3. 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>
  1. Reassemble APK apktool b ./TestApp
  2. Sign 5.1 keytool -genkey -v -keystore test.keystore -storepass password -alias android -keypass password -keyalg RSA -keysize 2048 -validity 10000 5.2 jarsigner -verbose -keystore test.keystore -storepass password -keypass password TestApp/dist/TestApp.apk android
  3. Install the new APK with adb adb install TestApp\dist\TestApp.apk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment