fix: SignatureChecker
not handling nullable field methodMetadata
This commit is contained in:
parent
736a71fac2
commit
17bcf786a8
|
@ -1,6 +1,7 @@
|
||||||
package app.revanced.patches
|
package app.revanced.patches
|
||||||
|
|
||||||
import app.revanced.patcher.Patcher
|
import app.revanced.patcher.Patcher
|
||||||
|
import app.revanced.patcher.signature.MethodMetadata
|
||||||
import app.revanced.patcher.signature.MethodSignature
|
import app.revanced.patcher.signature.MethodSignature
|
||||||
import app.revanced.patcher.signature.PatternScanMethod
|
import app.revanced.patcher.signature.PatternScanMethod
|
||||||
import org.jf.dexlib2.iface.Method
|
import org.jf.dexlib2.iface.Method
|
||||||
|
@ -27,7 +28,8 @@ internal class SignatureChecker {
|
||||||
if (patternScanMethod is PatternScanMethod.Fuzzy) {
|
if (patternScanMethod is PatternScanMethod.Fuzzy) {
|
||||||
val warnings = patternScanMethod.warnings!!
|
val warnings = patternScanMethod.warnings!!
|
||||||
val method = signature.result!!.method
|
val method = signature.result!!.method
|
||||||
val methodFromMetadata = signature.metadata.methodMetadata
|
val methodFromMetadata = if (signature.metadata.methodMetadata != null) signature.metadata.methodMetadata!! else MethodMetadata(null, null)
|
||||||
|
|
||||||
println("Signature: ${signature.metadata.name}.\nMethod: ${methodFromMetadata.definingClass}->${methodFromMetadata.name} (Signature matches: ${method.definingClass}->${method.toStr()})\nWarnings: ${warnings.count()}")
|
println("Signature: ${signature.metadata.name}.\nMethod: ${methodFromMetadata.definingClass}->${methodFromMetadata.name} (Signature matches: ${method.definingClass}->${method.toStr()})\nWarnings: ${warnings.count()}")
|
||||||
for (warning in warnings) {
|
for (warning in warnings) {
|
||||||
println("${warning.instructionIndex} / ${warning.patternIndex}: ${warning.wrongOpcode} (expected: ${warning.correctOpcode})")
|
println("${warning.instructionIndex} / ${warning.patternIndex}: ${warning.wrongOpcode} (expected: ${warning.correctOpcode})")
|
||||||
|
|
Loading…
Reference in a new issue