From e67d27cb947a512bd14fbfe1ab6351eda975a4d0 Mon Sep 17 00:00:00 2001 From: Ryan Brooks Date: Thu, 12 Dec 2024 13:47:12 -0800 Subject: [PATCH 1/3] Only use primary dex files for local snapshots --- .../android/gradle/tasks/snapshots/LocalSnapshots.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/tasks/snapshots/LocalSnapshots.kt b/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/tasks/snapshots/LocalSnapshots.kt index 79073ed4..50146afb 100644 --- a/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/tasks/snapshots/LocalSnapshots.kt +++ b/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/tasks/snapshots/LocalSnapshots.kt @@ -179,7 +179,7 @@ abstract class LocalSnapshots : DefaultTask() { ) { ZipFile(apk).use { zip -> zip.entries().asSequence().forEach { entry -> - if (entry.name.endsWith(".dex")) { + if (entry.name.matches(Regex("classes.*\\.dex"))) { val outputFile = File(outputDir, entry.name) zip.getInputStream(entry).use { input -> outputFile.outputStream().use { output -> From 87236342449a09482856bc98e19d5006f5c200dd Mon Sep 17 00:00:00 2001 From: Ryan Brooks Date: Thu, 12 Dec 2024 14:09:22 -0800 Subject: [PATCH 2/3] Enforce start --- .../android/gradle/tasks/snapshots/LocalSnapshots.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/tasks/snapshots/LocalSnapshots.kt b/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/tasks/snapshots/LocalSnapshots.kt index 50146afb..e2a65f0a 100644 --- a/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/tasks/snapshots/LocalSnapshots.kt +++ b/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/tasks/snapshots/LocalSnapshots.kt @@ -179,7 +179,7 @@ abstract class LocalSnapshots : DefaultTask() { ) { ZipFile(apk).use { zip -> zip.entries().asSequence().forEach { entry -> - if (entry.name.matches(Regex("classes.*\\.dex"))) { + if (entry.name.matches(Regex("^classes.*\\.dex"))) { val outputFile = File(outputDir, entry.name) zip.getInputStream(entry).use { input -> outputFile.outputStream().use { output -> From f1cd78625dc53ced50f63e973d19b036d4f2d9a7 Mon Sep 17 00:00:00 2001 From: Ryan Brooks Date: Thu, 12 Dec 2024 14:18:51 -0800 Subject: [PATCH 3/3] Stricter --- .../android/gradle/tasks/snapshots/LocalSnapshots.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/tasks/snapshots/LocalSnapshots.kt b/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/tasks/snapshots/LocalSnapshots.kt index e2a65f0a..dec4fec0 100644 --- a/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/tasks/snapshots/LocalSnapshots.kt +++ b/gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/tasks/snapshots/LocalSnapshots.kt @@ -179,7 +179,7 @@ abstract class LocalSnapshots : DefaultTask() { ) { ZipFile(apk).use { zip -> zip.entries().asSequence().forEach { entry -> - if (entry.name.matches(Regex("^classes.*\\.dex"))) { + if (entry.name.matches(Regex("^classes[0-9]*\\.dex"))) { val outputFile = File(outputDir, entry.name) zip.getInputStream(entry).use { input -> outputFile.outputStream().use { output ->