fix: signature checker with changes of patcher

This commit is contained in:
Lucaskyy 2022-04-15 11:55:35 +02:00
parent f4d8a8525b
commit e82459d377
No known key found for this signature in database
GPG Key ID: 1530BFF96D1EEB89
2 changed files with 5 additions and 5 deletions

2
.gitignore vendored
View File

@ -114,4 +114,4 @@ gradle-app.setting
# gradle/wrapper/gradle-wrapper.properties # gradle/wrapper/gradle-wrapper.properties
# Potentially copyrighted test APK # Potentially copyrighted test APK
stock.apk *.apk

View File

@ -10,9 +10,9 @@ import java.io.File
internal class SignatureChecker { internal class SignatureChecker {
@Test @Test
fun checkSignatures() { fun checkSignatures() {
val file = File("newest.apk") val file = File("stock.apk")
if (!file.exists()) { if (!file.exists()) {
throw IllegalStateException("Missing stock.apk! To run this test, please place stock.apk here: ${file.absolutePath}") throw IllegalStateException("Missing $file! To run this test, please place stock.apk here: ${file.absolutePath}")
} }
val patcher = Patcher(file) val patcher = Patcher(file)
patcher.addPatches(Index.patches.map { it() }) patcher.addPatches(Index.patches.map { it() })
@ -30,10 +30,10 @@ internal class SignatureChecker {
println("Signature: ${signature.metadata.name}.\nMethod: ${method.definingClass}->${method.toStr()}\nWarnings: ${warnings.count()}") println("Signature: ${signature.metadata.name}.\nMethod: ${method.definingClass}->${method.toStr()}\nWarnings: ${warnings.count()}")
for (warning in warnings) { for (warning in warnings) {
println("${warning.instructionIndex} / ${warning.patternIndex}: ${warning.current} (expected: ${warning.expected})") println("${warning.instructionIndex} / ${warning.patternIndex}: ${warning.wrongOpcode} (expected: ${warning.correctOpcode})")
} }
println("=".repeat(20) + "\n") println("=".repeat(20))
} }
} }
if (unresolved.isNotEmpty()) { if (unresolved.isNotEmpty()) {