From a86fd6068b2ed8086075063cb354b912ff245864 Mon Sep 17 00:00:00 2001 From: FlyJingFish Date: Sun, 27 Oct 2024 19:33:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4CtClass.detach()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scanner_visitor/ReplaceBaseClassVisitor.kt | 2 +- .../android_aop_plugin/scanner_visitor/WovenIntoCode.kt | 6 +++--- .../flyjingfish/android_aop_plugin/utils/AopTaskUtils.kt | 8 ++++---- .../android_aop_plugin/utils/ClassFileUtils.kt | 2 +- .../com/flyjingfish/android_aop_plugin/utils/Utils.kt | 4 ++-- .../android_aop_plugin/utils/WovenInfoUtils.kt | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/ReplaceBaseClassVisitor.kt b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/ReplaceBaseClassVisitor.kt index 56a7f83b..70ad79dc 100644 --- a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/ReplaceBaseClassVisitor.kt +++ b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/ReplaceBaseClassVisitor.kt @@ -128,7 +128,7 @@ open class ReplaceBaseClassVisitor( val cp = ClassPoolUtils.getNewClassPool() val ctClass = cp.get(extendClass) val has = ctClass.getConstructor(descriptor) != null - ctClass.detach() +// ctClass.detach() has } catch (e: Exception) { false diff --git a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/WovenIntoCode.kt b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/WovenIntoCode.kt index 88935187..525f2392 100644 --- a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/WovenIntoCode.kt +++ b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/WovenIntoCode.kt @@ -313,7 +313,7 @@ object WovenIntoCode { WovenInfoUtils.recordOverrideClassname(value.overrideClassname,value.methodName, value.descriptor) } catch (_: Exception) { } - ctClass.detach() +// ctClass.detach() } } thisCollectClassName?.let { @@ -489,7 +489,7 @@ object WovenIntoCode { } } val wovenBytes = ctClass.toBytecode() - ctClass.detach() +// ctClass.detach() return wovenBytes } @@ -794,7 +794,7 @@ object WovenIntoCode { }else{ iterator.remove() } - ctClass.detach() +// ctClass.detach() } catch (_: Exception) { } } diff --git a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/AopTaskUtils.kt b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/AopTaskUtils.kt index 2cb3279f..80d6224d 100644 --- a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/AopTaskUtils.kt +++ b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/AopTaskUtils.kt @@ -294,10 +294,10 @@ class AopTaskUtils(private val project: Project,private val variantName: String, } } } - for (allMethod in allMethods) { - allMethod.declaringClass.detach() - } - ctClass.detach() +// for (allMethod in allMethods) { +// allMethod.declaringClass.detach() +// } +// ctClass.detach() } } diff --git a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/ClassFileUtils.kt b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/ClassFileUtils.kt index f4af47ae..1e3c9997 100644 --- a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/ClassFileUtils.kt +++ b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/ClassFileUtils.kt @@ -69,7 +69,7 @@ object ClassFileUtils { outFile.checkExist() classByteData.saveFile(outFile) cacheFiles.add(path) - ctClass.detach() +// ctClass.detach() } return cacheFiles } diff --git a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/Utils.kt b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/Utils.kt index c101d9cf..a863bca2 100644 --- a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/Utils.kt +++ b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/Utils.kt @@ -462,8 +462,8 @@ fun String.instanceof(instanceofClassNameKey: String): Boolean { val clazz = pool!!.get(className) val instanceofClazz = pool.get(instanceofClassName) val subtypeOf = clazz.subtypeOf(instanceofClazz) - clazz.detach() - instanceofClazz.detach() +// clazz.detach() +// instanceofClazz.detach() subtypeOf } catch (e: Exception) { false diff --git a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/WovenInfoUtils.kt b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/WovenInfoUtils.kt index a0de08a6..3fca15fa 100644 --- a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/WovenInfoUtils.kt +++ b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/utils/WovenInfoUtils.kt @@ -522,7 +522,7 @@ object WovenInfoUtils { } } } - ctClass.detach() +// ctClass.detach() } fun addCollectConfig(aopCollectCut: AopCollectCut){