Open Goooler opened 4 months ago
Workaround for AppLovinQualityServiceGradlePlugin:4.13.6
:
/**
* TODO: remove this once https://github.com/AppLovin/AppLovin-MAX-Ad-Review-SDK-Android/issues/7 is fixed.
*/
def removeProguardRules = tasks.register('removeProguardRules') {
def file = rootProject.file(".safedk/proguard-safedk.pro")
if (file.exists()) {
def newRules = file.readLines().findAll { !it.contains("androidx.**") }.join('\n')
file.text = newRules
}
}
tasks.withType(com.android.build.gradle.internal.tasks.R8Task).configureEach {
dependsOn(removeProguardRules)
}
Workaround for AppLovinQualityServiceGradlePlugin:5.2.7
:
def removeProguardRules = tasks.register('removeProguardRules') {
def file = rootProject.file(".safedk/proguard-safedk.pro")
if (file.exists()) {
def redundantRules = [
"-keep class androidx.** {",
"*** startActivityForResult(***);",
"*** startActivity(***);",
"}",
]
def newRules = file.readLines().collect { it.trim() }
newRules.removeAll(redundantRules)
file.text = newRules.join('\n')
}
}
This issue is stale because it has been open for 30 days with no activity.
It's alive.
The ProGuard file generated by this plugin is located at
project_dir/.safedk/proguard-safedk.pro
, it looks like:contains
-keep class androidx.** { *; }
to keep all AndroidX classes, significantly increasing the generated APK file sizes. Usually, rules are bundled in AndroidX packages, we don't need to add any extra ones. Please remove it.