From b30c7375a7ea61184be5dca19062ee74d1f97692 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Wed, 22 Jun 2022 03:38:11 +0200 Subject: [PATCH] fix: migrate to changes of patcher --- build.gradle.kts | 2 +- src/main/kotlin/app/revanced/cli/patcher/Patcher.kt | 2 +- src/main/kotlin/app/revanced/utils/signature/Signature.kt | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 77141a08..11d22f8a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -32,7 +32,7 @@ dependencies { implementation(kotlin("stdlib")) implementation(kotlin("reflect")) - implementation("app.revanced:revanced-patcher:1.4.0") + implementation("app.revanced:revanced-patcher:1.5.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 diff --git a/src/main/kotlin/app/revanced/cli/patcher/Patcher.kt b/src/main/kotlin/app/revanced/cli/patcher/Patcher.kt index f99bfee5..7962788e 100644 --- a/src/main/kotlin/app/revanced/cli/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/cli/patcher/Patcher.kt @@ -30,7 +30,7 @@ internal object Patcher { ZipFileSystemUtils(inputFile, output).use { fileSystem -> // replace all dex files result.dexFiles.forEach { - fileSystem.write(it.name, it.memoryDataStore.data) + fileSystem.write(it.name, it.dexFileInputStream.readAllBytes()) } // inputFile being null implies resource patching being disabled diff --git a/src/main/kotlin/app/revanced/utils/signature/Signature.kt b/src/main/kotlin/app/revanced/utils/signature/Signature.kt index 80573596..1e3390fa 100644 --- a/src/main/kotlin/app/revanced/utils/signature/Signature.kt +++ b/src/main/kotlin/app/revanced/utils/signature/Signature.kt @@ -1,7 +1,6 @@ package app.revanced.utils.signature import app.revanced.patcher.Patcher -import org.jf.dexlib2.iface.Method object Signature { @@ -49,7 +48,7 @@ object Signature { */ } - private fun Method.toStr(): String { - return "${this.name}(${this.parameterTypes.joinToString("")})${this.returnType}" - } + //private fun Method.toStr(): String { + // return "${this.name}(${this.parameterTypes.joinToString("")})${this.returnType}" + //} } \ No newline at end of file