mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 01:02:22 +01:00
revert: previous commits check for dupes in dexFile, not cache
This reverts commitaed4fd9a3c
. This reverts commit622138736d
.
This commit is contained in:
parent
622138736d
commit
433914feda
1 changed files with 2 additions and 4 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue