From 646358de0baffe123bae8f7aa2cc19380de00156 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 18 Dec 2022 19:39:36 +0100 Subject: [PATCH] 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 f446b5b0..a74800c5 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 f836b74b..51fced45 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)