mirror of
https://github.com/revanced/revanced-cli.git
synced 2025-01-10 11:15:50 +01:00
refactor: migrate from Signature
to Fingerprint
BREAKING CHANGE: Not backwards compatible, since a lot of classes where renamed.
This commit is contained in:
parent
8dd9293cb9
commit
88852a45ac
@ -10,13 +10,7 @@ val githubPassword: String = project.findProperty("gpr.key") as? String ?: Syste
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url = uri("https://maven.pkg.github.com/revanced/multidexlib2")
|
||||
credentials {
|
||||
username = githubUsername
|
||||
password = githubPassword
|
||||
}
|
||||
}
|
||||
mavenLocal()
|
||||
maven {
|
||||
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
|
||||
credentials {
|
||||
@ -32,7 +26,7 @@ dependencies {
|
||||
implementation(kotlin("stdlib"))
|
||||
implementation(kotlin("reflect"))
|
||||
|
||||
implementation("app.revanced:revanced-patcher:1.11.0")
|
||||
implementation("app.revanced:revanced-patcher:2.0.0")
|
||||
implementation("info.picocli:picocli:4.6.3")
|
||||
implementation("com.android.tools.build:apksig:7.2.1")
|
||||
implementation("com.github.revanced:jadb:master-SNAPSHOT") // updated fork
|
||||
|
@ -4,11 +4,11 @@ import app.revanced.cli.command.MainCommand
|
||||
import app.revanced.cli.command.MainCommand.args
|
||||
import app.revanced.cli.command.MainCommand.logger
|
||||
import app.revanced.patcher.Patcher
|
||||
import app.revanced.patcher.data.base.Data
|
||||
import app.revanced.patcher.data.Data
|
||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
||||
import app.revanced.patcher.extensions.PatchExtensions.include
|
||||
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
||||
import app.revanced.patcher.patch.base.Patch
|
||||
import app.revanced.patcher.patch.Patch
|
||||
import app.revanced.patcher.util.patch.implementation.JarPatchBundle
|
||||
|
||||
fun Patcher.addPatchesFiltered(
|
||||
|
@ -1,54 +0,0 @@
|
||||
package app.revanced.utils.signature
|
||||
|
||||
import app.revanced.patcher.Patcher
|
||||
|
||||
object Signature {
|
||||
|
||||
fun checkSignatures(patcher: Patcher) {
|
||||
TODO()
|
||||
/**
|
||||
val failed = mutableListOf<String>()
|
||||
for (signature in patcher.resolveSignatures()) {
|
||||
val signatureClass = signature::class.java
|
||||
val signatureName = signature.name ?: signatureClass.simpleName
|
||||
if (!signature.resolved) {
|
||||
failed.add(signatureName)
|
||||
continue
|
||||
}
|
||||
|
||||
val method = signature.result!!.method
|
||||
val matchingMethod = signature.matchingMethod ?: MatchingMethod()
|
||||
|
||||
println(
|
||||
"""
|
||||
[Signature] $signatureName
|
||||
[Method] ${matchingMethod.definingClass}->${matchingMethod.name}
|
||||
[Match] ${method.definingClass}->${method.toStr()}
|
||||
""".trimIndent()
|
||||
)
|
||||
|
||||
signature.fuzzyThreshold.let {
|
||||
val warnings = signature.result!!.scanResult.warnings!!
|
||||
println(
|
||||
"""
|
||||
[Warnings: ${warnings.count()}]
|
||||
${warnings.joinToString(separator = "\n") { warning -> "${warning.instructionIndex} / ${warning.patternIndex}: ${warning.wrongOpcode} (expected: ${warning.correctOpcode})" }}
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
println(
|
||||
"""
|
||||
${"=".repeat(50)}
|
||||
[Failed signatures: ${failed.size}]
|
||||
${failed.joinToString(separator = "\n") { it }}
|
||||
""".trimIndent()
|
||||
)
|
||||
*/
|
||||
}
|
||||
|
||||
//private fun Method.toStr(): String {
|
||||
// return "${this.name}(${this.parameterTypes.joinToString("")})${this.returnType}"
|
||||
//}
|
||||
}
|
Loading…
Reference in New Issue
Block a user