File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
src/main/kotlin/app/revanced/patcher/patch Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -62,17 +62,16 @@ class BytecodePatchContext internal constructor(private val config: PatcherConfi
62
62
* Merge the extensions for this set of patches.
63
63
*/
64
64
internal fun Set <Patch <* >>.mergeExtensions () {
65
- // Lookup map for fast checking if a class exists by its type.
65
+ // Lookup map to check if a class exists by its type quickly .
66
66
val classesByType = mutableMapOf<String , ClassDef >().apply {
67
67
classes.forEach { classDef -> put(classDef.type, classDef) }
68
68
}
69
69
70
70
forEachRecursively { patch ->
71
- if (patch is BytecodePatch && patch.extension != null ) {
71
+ if (patch ! is BytecodePatch ) return @forEachRecursively
72
72
73
- val extension = patch.extension.readAllBytes()
74
-
75
- RawDexIO .readRawDexFile(extension, 0 , null ).classes.forEach { classDef ->
73
+ patch.extension?.use { extensionStream ->
74
+ RawDexIO .readRawDexFile(extensionStream, 0 , null ).classes.forEach { classDef ->
76
75
val existingClass = classesByType[classDef.type] ? : run {
77
76
logger.fine(" Adding class \" $classDef \" " )
78
77
You can’t perform that action at this time.
0 commit comments