Skip to content

Commit

Permalink
revert: previous commits check for dupes in dexFile, not cache
Browse files Browse the repository at this point in the history
This reverts commit aed4fd9.
This reverts commit 6221387.
  • Loading branch information
Sculas authored and oSumAtrIX committed Jun 5, 2022
1 parent e65ebd2 commit e810197
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/kotlin/app/revanced/patcher/Patcher.kt
Expand Up @@ -43,16 +43,14 @@ class Patcher(
fun addFiles(vararg files: File, throwOnDuplicates: Boolean = false) {
for (file in files) {
val dexFile = MultiDexIO.readDexFile(true, files[0], NAMER, null, null)
val classes = mutableSetOf<String>()
for (classDef in dexFile.classes) {
if (classes.add(classDef.type)) { // has duplicate
if (cache.classes.any { it.type == classDef.type }) {
// TODO: Use logger and warn about duplicate classes
if (throwOnDuplicates)
throw Exception("Class ${classDef.type} has already been added to the patcher.")
continue
}
cache.classes.add(classDef)
}
classes.clear()
}
}
/**
Expand Down

0 comments on commit e810197

Please sign in to comment.