Remove obfuscation in proguard (#6067)
* Remove obfuscation in proguard for the OSS app. Fully allow it by default for enterprise ones. * Add logic to use additional customizable proguard files depending on whether the build is an enterprise one or not.
This commit is contained in:
parent
b73e15625a
commit
fdbd7359a0
3 changed files with 25 additions and 7 deletions
|
|
@ -132,8 +132,23 @@ android {
|
|||
optimization {
|
||||
enable = true
|
||||
keepRules {
|
||||
files.add(File(projectDir, "proguard-rules.pro"))
|
||||
files.add(File(projectDir, "common-proguard-rules.pro"))
|
||||
files.add(getDefaultProguardFile("proguard-android-optimize.txt"))
|
||||
|
||||
// Depending on whether the app flavor is enterprise or not we want to use different proguard rules.
|
||||
val flavorProguardFile = if (isEnterpriseBuild) {
|
||||
// Custom rules for enterprise builds
|
||||
File(projectDir, "enterprise-proguard-rules.pro")
|
||||
} else {
|
||||
// These default rules prevent the OSS app from being obfuscated
|
||||
File(projectDir, "default-proguard-rules.pro")
|
||||
}
|
||||
|
||||
if (flavorProguardFile.exists()) {
|
||||
files.add(flavorProguardFile)
|
||||
} else {
|
||||
logger.warn("Proguard file ${flavorProguardFile.absolutePath} does not exist")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue