From 7cf79e68e0e9dfd9faddee33139b127b71882d3e Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 18 Dec 2022 00:34:16 +0100 Subject: [PATCH 1/4] fix: print full exception when patch fails --- src/main/kotlin/app/revanced/patcher/Patcher.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/app/revanced/patcher/Patcher.kt b/src/main/kotlin/app/revanced/patcher/Patcher.kt index 6c69d8b..eeaa556 100644 --- a/src/main/kotlin/app/revanced/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/patcher/Patcher.kt @@ -399,9 +399,10 @@ class Patcher(private val options: PatcherOptions) { val result = executePatch(dependency, executedPatches) if (result.isSuccess()) return@forEach - val error = result.error()!! - val errorMessage = error.cause ?: error.message - return PatchResultError("'$patchName' depends on '${dependency.patchName}' but the following error was raised: $errorMessage") + return PatchResultError( + "'$patchName' depends on '${dependency.patchName}' but the following error was raised: " + + result.error()!!.let { it.cause?.stackTraceToString() ?: it.message } + ) } val isResourcePatch = ResourcePatch::class.java.isAssignableFrom(patchClass) From c391ca648b06c78023fe8b396ad659a58864bb45 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sat, 17 Dec 2022 23:35:16 +0000 Subject: [PATCH 2/4] chore(release): 6.3.2-dev.1 [skip ci] ## [6.3.2-dev.1](https://github.com/revanced/revanced-patcher/compare/v6.3.1...v6.3.2-dev.1) (2022-12-17) ### Bug Fixes * print full exception when patch fails ([27a8401](https://github.com/revanced/revanced-patcher/commit/27a8401d81e078e0303f7ddcb0ac6f342f8e4def)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14828a0..5fcfd96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [6.3.2-dev.1](https://github.com/revanced/revanced-patcher/compare/v6.3.1...v6.3.2-dev.1) (2022-12-17) + + +### Bug Fixes + +* print full exception when patch fails ([27a8401](https://github.com/revanced/revanced-patcher/commit/27a8401d81e078e0303f7ddcb0ac6f342f8e4def)) + ## [6.3.1](https://github.com/revanced/revanced-patcher/compare/v6.3.0...v6.3.1) (2022-12-13) diff --git a/gradle.properties b/gradle.properties index 0889570..064bee2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ kotlin.code.style = official -version = 6.3.1 +version = 6.3.2-dev.1 From c5de9e29889dffd18b31e62a892881cc48e8b607 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 18 Dec 2022 19:39:36 +0100 Subject: [PATCH 3/4] fix: check if fingerprint string is substring of any string references --- .../patcher/fingerprint/method/impl/MethodFingerprint.kt | 2 +- .../app/revanced/patcher/patch/annotations/PatchAnnotation.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/app/revanced/patcher/fingerprint/method/impl/MethodFingerprint.kt b/src/main/kotlin/app/revanced/patcher/fingerprint/method/impl/MethodFingerprint.kt index f446b5b..a74800c 100644 --- a/src/main/kotlin/app/revanced/patcher/fingerprint/method/impl/MethodFingerprint.kt +++ b/src/main/kotlin/app/revanced/patcher/fingerprint/method/impl/MethodFingerprint.kt @@ -109,7 +109,7 @@ abstract class MethodFingerprint( if (instruction.opcode.ordinal != Opcode.CONST_STRING.ordinal) return@forEachIndexed val string = ((instruction as ReferenceInstruction).reference as StringReference).string - val index = stringsList.indexOfFirst { it == string } + val index = stringsList.indexOfFirst(string::contains) if (index == -1) return@forEachIndexed add( diff --git a/src/main/kotlin/app/revanced/patcher/patch/annotations/PatchAnnotation.kt b/src/main/kotlin/app/revanced/patcher/patch/annotations/PatchAnnotation.kt index f836b74..51fced4 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/annotations/PatchAnnotation.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/annotations/PatchAnnotation.kt @@ -14,7 +14,7 @@ import kotlin.reflect.KClass annotation class Patch(val include: Boolean = true) /** - * Annotation for dependencies of [Patch]es . + * Annotation for dependencies of [Patch]es. */ @Target(AnnotationTarget.CLASS) @Retention(AnnotationRetention.RUNTIME) From 96ef150e8954161179bb49dedf3a3b13bcdedd4b Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 18 Dec 2022 21:08:40 +0000 Subject: [PATCH 4/4] chore(release): 6.3.2-dev.1 [skip ci] ## [6.3.2-dev.1](https://github.com/revanced/revanced-patcher/compare/v6.3.1...v6.3.2-dev.1) (2022-12-18) ### Bug Fixes * check if fingerprint string is substring of any string references ([c5de9e2](https://github.com/revanced/revanced-patcher/commit/c5de9e29889dffd18b31e62a892881cc48e8b607)) * print full exception when patch fails ([7cf79e6](https://github.com/revanced/revanced-patcher/commit/7cf79e68e0e9dfd9faddee33139b127b71882d3e)) --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fcfd96..8ee0474 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [6.3.2-dev.1](https://github.com/revanced/revanced-patcher/compare/v6.3.1...v6.3.2-dev.1) (2022-12-18) + + +### Bug Fixes + +* check if fingerprint string is substring of any string references ([c5de9e2](https://github.com/revanced/revanced-patcher/commit/c5de9e29889dffd18b31e62a892881cc48e8b607)) +* print full exception when patch fails ([7cf79e6](https://github.com/revanced/revanced-patcher/commit/7cf79e68e0e9dfd9faddee33139b127b71882d3e)) + ## [6.3.2-dev.1](https://github.com/revanced/revanced-patcher/compare/v6.3.1...v6.3.2-dev.1) (2022-12-17)