From 3c9fe2751e3a92e7e674b1645cd1a54ce361cb7c Mon Sep 17 00:00:00 2001 From: tianxiangyu <96164429+FlyJingFish@users.noreply.github.com> Date: Tue, 12 Dec 2023 15:31:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9F=A5=E8=AF=A2=E5=8F=B6?= =?UTF-8?q?=E5=AD=90=E7=BB=A7=E6=89=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../android_aop_plugin/beans/ClassSuperInfo.kt | 2 +- .../scanner_visitor/ClassSuperScanner.java | 13 +------------ .../android_aop_plugin/utils/WovenInfoUtils.kt | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/beans/ClassSuperInfo.kt b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/beans/ClassSuperInfo.kt index d74dce31..a6f97aa2 100644 --- a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/beans/ClassSuperInfo.kt +++ b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/beans/ClassSuperInfo.kt @@ -1,4 +1,4 @@ package com.flyjingfish.android_aop_plugin.beans -class ClassSuperInfo(val className: String, val superName: String, val interfaces: ArrayList) { +class ClassSuperInfo(val className: String, val superName: String?, val interfaces: Array?) { } \ No newline at end of file diff --git a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/ClassSuperScanner.java b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/ClassSuperScanner.java index 9dd9b7fc..065bdbb5 100644 --- a/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/ClassSuperScanner.java +++ b/android-aop-plugin/src/main/kotlin/com/flyjingfish/android_aop_plugin/scanner_visitor/ClassSuperScanner.java @@ -1,15 +1,10 @@ package com.flyjingfish.android_aop_plugin.scanner_visitor; import com.flyjingfish.android_aop_plugin.beans.ClassSuperInfo; -import com.flyjingfish.android_aop_plugin.utils.UtilsKt; import com.flyjingfish.android_aop_plugin.utils.WovenInfoUtils; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.Opcodes; -import org.slf4j.Logger; - -import java.util.ArrayList; -import java.util.Arrays; public class ClassSuperScanner extends ClassVisitor { public ClassSuperScanner() { @@ -19,12 +14,6 @@ public ClassSuperScanner() { @Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { super.visit(version, access, name, signature, superName, interfaces); - ArrayList interfaceList; - if (interfaces == null){ - interfaceList = new ArrayList<>(); - }else { - interfaceList = new ArrayList<>(Arrays.asList(interfaces)); - } - WovenInfoUtils.INSTANCE.addClassSuper(new ClassSuperInfo(name,superName,interfaceList)); + WovenInfoUtils.INSTANCE.addClassSuper(new ClassSuperInfo(name,superName,interfaces)); } } \ No newline at end of file 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 00b9b836..804ad4a5 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 @@ -88,7 +88,7 @@ object WovenInfoUtils { fun isLeaf(className:String):Boolean{ for (classSuperInfo in classSuperList) { - if (classSuperInfo.superName == className || (classSuperInfo.interfaces.contains(className))){ + if (classSuperInfo.superName == className || (classSuperInfo.interfaces?.contains(className) == true)){ return false } }