File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
processor/src/main/kotlin/org/lsposed/lsparanoid/processor Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ plugins {
99
1010allprojects {
1111 group = " com.github.Androidacy.LSParanoid"
12- version = " 0.9.5 "
12+ version = " 0.9.6 "
1313
1414 plugins.withType(JavaPlugin ::class .java) {
1515 extensions.configure(JavaPluginExtension ::class .java) {
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ class Patcher(
9393 val reader = ClassReader (source.readFile(name))
9494 val writer = StandaloneClassWriter (
9595 reader,
96- ClassWriter .COMPUTE_MAXS ,
96+ ClassWriter .COMPUTE_FRAMES ,
9797 classRegistry,
9898 fileRegistry
9999 )
@@ -116,7 +116,7 @@ class Patcher(
116116 it
117117 )
118118 }
119- reader.accept(patcher, ClassReader .EXPAND_FRAMES )
119+ reader.accept(patcher, ClassReader .SKIP_FRAMES )
120120 jar.createFile(name, writer.toByteArray())
121121 return true
122122 }
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ class StandaloneClassWriter : ClassWriter {
3131 private val logger = getLogger()
3232 private val classRegistry: ClassRegistry
3333 private val fileRegistry: FileRegistry
34+ private val superClassCache = HashMap <Pair <String , String >, String > ()
3435
3536 constructor (
3637 flags: Int ,
@@ -52,6 +53,17 @@ class StandaloneClassWriter : ClassWriter {
5253 }
5354
5455 override fun getCommonSuperClass (type1 : String , type2 : String ): String {
56+ val key = Pair (type1, type2)
57+ superClassCache[key]?.let { return it }
58+ val reverseKey = Pair (type2, type1)
59+ superClassCache[reverseKey]?.let { return it }
60+
61+ val result = computeCommonSuperClass(type1, type2)
62+ superClassCache[key] = result
63+ return result
64+ }
65+
66+ private fun computeCommonSuperClass (type1 : String , type2 : String ): String {
5567 val hierarchy = HashSet <Type >()
5668 for (mirror in classRegistry.findClassHierarchy(getObjectTypeByInternalName(type1))) {
5769 hierarchy.add(mirror.type)
You can’t perform that action at this time.
0 commit comments