Skip to content

Commit cc6aa7f

Browse files
Update FOSS sanitizer to include Proguard and dexBuilder
Enhanced FOSS sanitizer to sweep intermediate files for non-free binaries.
1 parent 419711a commit cc6aa7f

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

mobile/android/app/build.gradle.kts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,23 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach
5757

5858
project.afterEvaluate {
5959
tasks.configureEach {
60-
if (name.contains("minifyReleaseWithR8") || name.contains("compileReleaseJavaWithJavac")) {
60+
if (name.contains("minifyReleaseWithR8") || name.contains("minifyReleaseWithProguard") || name.contains("dexBuilderRelease")) {
6161
doFirst {
62-
val intermediatesDir = File(project.buildDir, "intermediates/classes/release")
63-
if (intermediatesDir.exists()) {
64-
val playCoreDir = File(intermediatesDir, "com/google/android/play/core")
65-
if (playCoreDir.exists()) {
66-
playCoreDir.deleteRecursively()
67-
logger.lifecycle("FOSS SANITIZER: Successfully purged pre-compiled Play Core binaries from intermediate pools.")
62+
logger.lifecycle("FOSS SANITIZER: Active. Sweeping intermediate files for non-free binaries...")
63+
64+
val searchDirs = listOf(
65+
File(project.layout.buildDirectory.asFile.get(), "intermediates/classes/release"),
66+
File(project.layout.buildDirectory.asFile.get(), "intermediates/javac/release")
67+
)
68+
69+
for (dir in searchDirs) {
70+
if (dir.exists()) {
71+
dir.walkTopDown().forEach { file ->
72+
if (file.isDirectory && file.absolutePath.endsWith("com/google/android/play/core")) {
73+
file.deleteRecursively()
74+
logger.lifecycle("Successfully deleted shaded directory: ${file.absolutePath}")
75+
}
76+
}
6877
}
6978
}
7079
}

0 commit comments

Comments
 (0)