From 92ac0552ce7220ccdde1636aef6fb54727365dd5 Mon Sep 17 00:00:00 2001 From: inotia00 Date: Tue, 27 Dec 2022 23:24:45 +0900 Subject: [PATCH] fix: subscribe notification button not showing --- .../bytecode/fingerprints/PrimaryPiPFingerprint.kt | 2 +- .../bytecode/patch/PiPNotificationBytecodePatch.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/pipnotification/bytecode/fingerprints/PrimaryPiPFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/pipnotification/bytecode/fingerprints/PrimaryPiPFingerprint.kt index 9acfdd2e1..707c6be9f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/pipnotification/bytecode/fingerprints/PrimaryPiPFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/pipnotification/bytecode/fingerprints/PrimaryPiPFingerprint.kt @@ -13,5 +13,5 @@ object PrimaryPiPFingerprint : MethodFingerprint( Opcode.CHECK_CAST, Opcode.IGET_OBJECT ), - strings = listOf("OnYpcTransactionListener") + strings = listOf("honeycomb.Shell\$HomeActivity") ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/pipnotification/bytecode/patch/PiPNotificationBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/pipnotification/bytecode/patch/PiPNotificationBytecodePatch.kt index 3dfc78fe8..77288e582 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/pipnotification/bytecode/patch/PiPNotificationBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/pipnotification/bytecode/patch/PiPNotificationBytecodePatch.kt @@ -28,7 +28,8 @@ class PiPNotificationBytecodePatch : BytecodePatch( ).map { it.result ?: return it.toErrorResult() }.forEach { result -> - result.mutableMethod.addInstruction(0, "return-void") + val index = result.scanResult.patternScanResult!!.startIndex + 1 + result.mutableMethod.addInstruction(index, "return-void") } return PatchResultSuccess()