From e9bfb25dfe85754fd7fa5c9db934bb4fc52e4694 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Thu, 16 May 2024 21:12:04 +0400 Subject: [PATCH] feat(YT Music): Add support for `7.01.52` (#3177) --- .../fingerprints/ApplicationInitFingerprint.kt | 9 --------- .../shared/misc/integrations/BaseIntegrationsPatch.kt | 3 ++- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/music/misc/integrations/fingerprints/ApplicationInitFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/misc/integrations/fingerprints/ApplicationInitFingerprint.kt index d825b4e8d..45ebf8377 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/integrations/fingerprints/ApplicationInitFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/integrations/fingerprints/ApplicationInitFingerprint.kt @@ -1,19 +1,10 @@ package app.revanced.patches.music.misc.integrations.fingerprints import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint -import com.android.tools.smali.dexlib2.Opcode internal object ApplicationInitFingerprint : IntegrationsFingerprint( returnType = "V", parameters = emptyList(), - opcodes = listOf( - Opcode.NEW_INSTANCE, - Opcode.INVOKE_DIRECT, - Opcode.INVOKE_STATIC, - Opcode.NEW_INSTANCE, - Opcode.INVOKE_DIRECT, - Opcode.INVOKE_VIRTUAL - ), strings = listOf("activity"), customFingerprint = { methodDef, _ -> methodDef.name == "onCreate" }, ) diff --git a/src/main/kotlin/app/revanced/patches/shared/misc/integrations/BaseIntegrationsPatch.kt b/src/main/kotlin/app/revanced/patches/shared/misc/integrations/BaseIntegrationsPatch.kt index ff208efd5..0178ed5af 100644 --- a/src/main/kotlin/app/revanced/patches/shared/misc/integrations/BaseIntegrationsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/misc/integrations/BaseIntegrationsPatch.kt @@ -8,6 +8,7 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint.IRegisterResolver import app.revanced.patches.shared.misc.integrations.fingerprints.ReVancedUtilsPatchesVersionFingerprint +import app.revanced.util.exception import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.ClassDef @@ -139,7 +140,7 @@ abstract class BaseIntegrationsPatch( "invoke-static/range { v$contextRegister .. v$contextRegister }, " + "$integrationsDescriptor->setContext(Landroid/content/Context;)V", ) - } ?: throw PatchException("Could not find hook target fingerprint.") + } ?: throw this.exception } interface IHookInsertIndexResolver : (Method) -> Int {