Remove AGP version metadata from generated APKs (#10131)

This commit is contained in:
stevenyomi 2025-08-14 15:12:49 +00:00 committed by Draff
parent 1e8fec699c
commit 7c212dfaab
Signed by: Draff
GPG Key ID: E8A89F3211677653

View File

@ -80,6 +80,11 @@ android {
resources.excludes.add("kotlin-tooling-metadata.json")
}
// https://stackoverflow.com/a/77745844
tasks.withType(com.android.build.gradle.tasks.PackageAndroidArtifact).configureEach {
doFirst { appMetadata.asFile.get().write('') }
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
@ -116,9 +121,7 @@ tasks.register("writeManifestFile") {
doLast {
File tempFile = android.sourceSets.getByName('main').manifest.srcFile
if (!tempFile.exists()) {
tempFile.withWriter {
it.write('<?xml version="1.0" encoding="utf-8"?>\n<manifest />\n')
}
tempFile.write('<?xml version="1.0" encoding="utf-8"?>\n<manifest />\n')
}
}
}