From 746544f9d51d1013bb160075709cd26bffd425b3 Mon Sep 17 00:00:00 2001 From: aAbed <39409020+TheAabedKhan@users.noreply.github.com> Date: Thu, 3 Aug 2023 17:27:00 +0545 Subject: [PATCH] fix: clear method lookup maps before initializing them (#210) Co-authored-by: oSumAtrIX --- src/main/kotlin/app/revanced/patcher/Patcher.kt | 2 +- .../patcher/fingerprint/method/impl/MethodFingerprint.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/app/revanced/patcher/Patcher.kt b/src/main/kotlin/app/revanced/patcher/Patcher.kt index a0bf713..60bdf65 100644 --- a/src/main/kotlin/app/revanced/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/patcher/Patcher.kt @@ -392,4 +392,4 @@ class Patcher(private val options: PatcherOptions) { * @param patchInstance The instance of the [Patch] that was applied. * @param success The result of the [Patch]. */ -internal data class ExecutedPatch(val patchInstance: Patch, val success: Boolean) \ No newline at end of file +internal data class ExecutedPatch(val patchInstance: Patch, val success: Boolean) 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 3921827..3cd2212 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 @@ -99,7 +99,7 @@ abstract class MethodFingerprint( methodClassPairs!!.add(methodClassPair) } - if (methods.isNotEmpty()) throw PatchResultError("Map already initialized") + if (methods.isNotEmpty()) MethodFingerprint.clearFingerprintResolutionLookupMaps() context.classes.classes.forEach { classDef -> classDef.methods.forEach { method -> @@ -510,4 +510,4 @@ data class MethodFingerprintResult( ) } } -} \ No newline at end of file +}