mirror of
https://github.com/revanced/revanced-patches
synced 2024-11-09 03:07:04 +01:00
fix: signature checker with changes of patcher
This commit is contained in:
parent
f4d8a8525b
commit
e82459d377
2
.gitignore
vendored
2
.gitignore
vendored
@ -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
|
@ -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()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user