diff --git a/buildSrc/src/main/java/DesugarClassVisitorFactory.kt b/buildSrc/src/main/java/DesugarClassVisitorFactory.kt index a34ec1ec8..554911e0e 100644 --- a/buildSrc/src/main/java/DesugarClassVisitorFactory.kt +++ b/buildSrc/src/main/java/DesugarClassVisitorFactory.kt @@ -7,11 +7,14 @@ import org.objectweb.asm.MethodVisitor import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes.ASM9 +private const val ZIP_ENTRY_CLASS_NAME = "java.util.zip.ZipEntry" private const val DESUGAR_CLASS_NAME = "com.topjohnwu.magisk.core.utils.Desugar" private const val ZIP_ENTRY_GET_TIME_DESC = "()Ljava/nio/file/attribute/FileTime;" private const val DESUGAR_GET_TIME_DESC = "(Ljava/util/zip/ZipEntry;)Ljava/nio/file/attribute/FileTime;" +private fun ClassData.isTypeOf(name: String) = className == name || superClasses.contains(name) + abstract class DesugarClassVisitorFactory : AsmClassVisitorFactory { override fun createClassVisitor( classContext: ClassContext, @@ -45,14 +48,15 @@ abstract class DesugarClassVisitorFactory : AsmClassVisitorFactory