APKRepacker is a gradle plugin that helps you automatically repackage and modify your APK after building. It makes it easier for developers to customize their APKs—such as removing content or adding resources—saving you from manual work.
This plugin is compatible with AGP 9, ensuring seamless integration with the latest Android build tools and features.
Add the following to your file: app/build.gradle, see: app/build.gradle
plugins {
id "cn.lalaki.buildSrc" version "1.2.2"
}
def yourTask = tasks.register("yourTaskName") {
doLast {
println "This is your custom task."
}
}
// configuration
repackageConfig {
// *Sign your apk
autoSign = true
storeFile = "D:\\lalaki-new-1.jks"
keyAlias = "0"
ksPass = "0"
keyPass = "0"
signerName = "hello"
// *Remove version-control-info.textproto and app-metadata.properties
includeMetaData = false
// *Remove DebugProbesKt.bin
debugKt = false
// *Remove custom files from the APK. support '*' wildcard
blackList = List.of("*.version", "lib/armeabi-v7a/libbarhopper_v3.so")
// *Add file to apk assets dir, only file! can't add dir!
addAssetsList = List.of("D:\\test.txt")
// *Print the APK path to the console.
printOutputApk = true
// *After APKRepacker Task
doAfterTask = yourTask.getName() // or doAfterTask = "yourTaskName"
// *Disable this plugin.
disabled = false
}