fix(mapper): content callback class

This commit is contained in:
rhunk 2023-12-02 23:02:05 +01:00
parent 98d0f98714
commit bfe367efd0

View File

@ -4,6 +4,9 @@ import me.rhunk.snapenhance.mapper.AbstractClassMapper
import me.rhunk.snapenhance.mapper.ext.getClassName
import me.rhunk.snapenhance.mapper.ext.getSuperClassName
import me.rhunk.snapenhance.mapper.ext.isFinal
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.formats.Instruction21t
import org.jf.dexlib2.iface.instruction.formats.Instruction22t
class CallbackMapper : AbstractClassMapper() {
init {
@ -18,7 +21,9 @@ class CallbackMapper : AbstractClassMapper() {
if (clazz.getClassName().endsWith("\$CppProxy")) return@filter false
// ignore dummy ContentCallback class
if (superclassName.endsWith("ContentCallback") && !clazz.methods.first { it.name == "<init>" }.parameterTypes.contains("Z"))
if (superclassName.endsWith("ContentCallback") && clazz.methods.none { it.name == "handleContentResult" && it.implementation?.instructions?.firstOrNull { instruction ->
instruction is Instruction22t || instruction is Instruction21t
} != null})
return@filter false
val superClass = getClass(clazz.superclass) ?: return@filter false