revert: previous commits check for dupes in dexFile, not cache

This reverts commit aed4fd9a3c.
This reverts commit 622138736d.
This commit is contained in:
Lucaskyy 2022-04-09 22:44:57 +02:00
parent 622138736d
commit 433914feda
No known key found for this signature in database
GPG key ID: 1530BFF96D1EEB89

View file

@ -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()
}
}
/**