diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/fingerprints/WatchWhileActivityWithOutFlagsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/fingerprints/WatchWhileActivityWithOutFlagsFingerprint.kt index 135266846..6ed147149 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/fingerprints/WatchWhileActivityWithOutFlagsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/fingerprints/WatchWhileActivityWithOutFlagsFingerprint.kt @@ -9,16 +9,6 @@ object WatchWhileActivityWithOutFlagsFingerprint : MethodFingerprint( returnType = "V", parameters = listOf("Landroid/os/Bundle;"), opcodes = listOf( - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT, - Opcode.CONST_4, - Opcode.CONST_4, - Opcode.IF_NE, // target - Opcode.IGET_OBJECT, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT, - Opcode.INVOKE_STATIC, - Opcode.MOVE_RESULT, Opcode.IF_EQZ, // target Opcode.IGET_OBJECT, Opcode.INVOKE_VIRTUAL, diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/patch/NewSplashAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/patch/NewSplashAnimationPatch.kt index 605a6931b..e09d6f6ec 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/patch/NewSplashAnimationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/splashanimation/patch/NewSplashAnimationPatch.kt @@ -63,18 +63,31 @@ class NewSplashAnimationPatch : BytecodePatch( */ WatchWhileActivityWithOutFlagsFingerprint.result?.let { it.mutableMethod.apply { - for (index in getWideLiteralIndex(DarkSplashAnimation) - 1 downTo 0) { + var startIndex = getWideLiteralIndex(DarkSplashAnimation) - 1 + val endIndex = startIndex - 30 + + for (index in startIndex downTo endIndex) { if (getInstruction(index).opcode != Opcode.IF_EQZ) continue + startIndex = index - 8 + arrayOf( index, - index - 8, - index - 14 + index - 8 ).forEach { insertIndex -> inject(insertIndex) } break } + + for (index in startIndex downTo endIndex) { + if (getInstruction(index).opcode != Opcode.IF_NE) + continue + + inject(index) + + break + } } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FineScrubbingOverlayFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FineScrubbingOverlayFingerprint.kt index a1cd2d33e..03fd67e32 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FineScrubbingOverlayFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/fingerprints/FineScrubbingOverlayFingerprint.kt @@ -14,7 +14,7 @@ object FineScrubbingOverlayFingerprint : MethodFingerprint( opcodes = listOf( Opcode.IF_NEZ, Opcode.INVOKE_VIRTUAL, - Opcode.IGET_OBJECT, // insert index + Opcode.IGET_OBJECT, // insert index Opcode.IGET_OBJECT, Opcode.IGET_OBJECT, Opcode.IGET_OBJECT diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/patch/HideFilmstripOverlayPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/patch/HideFilmstripOverlayPatch.kt index 8e01efbb9..d6375cb37 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/patch/HideFilmstripOverlayPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/filmstripoverlay/patch/HideFilmstripOverlayPatch.kt @@ -74,7 +74,8 @@ class HideFilmstripOverlayPatch : BytecodePatch( if (SettingsPatch.upward1828) { val insertIndex = it.scanResult.patternScanResult!!.startIndex + 2 val replaceInstruction = getInstruction(insertIndex) - val replaceReference = getInstruction(insertIndex).reference + val replaceReference = + getInstruction(insertIndex).reference addComponentUpward1828(insertIndex, initialIndex) @@ -89,7 +90,8 @@ class HideFilmstripOverlayPatch : BytecodePatch( removeInstruction(insertIndex) } else { val insertIndex = getIndex("bringChildToFront") + 1 - val insertRegister = getInstruction(insertIndex).registerA + val insertRegister = + getInstruction(insertIndex).registerA addComponentBelow1828(insertIndex, initialIndex) @@ -175,6 +177,7 @@ class HideFilmstripOverlayPatch : BytecodePatch( const v$register, $value """.trimIndent() + else -> "" } diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/suggestactions/patch/SuggestedActionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/suggestactions/patch/SuggestedActionsPatch.kt index dd6302c01..d5bdd3ef7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/suggestactions/patch/SuggestedActionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/suggestactions/patch/SuggestedActionsPatch.kt @@ -1,7 +1,6 @@ package app.revanced.patches.youtube.player.suggestactions.patch import app.revanced.extensions.exception -import app.revanced.extensions.injectHideCall import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.data.BytecodeContext diff --git a/src/main/kotlin/app/revanced/patches/youtube/seekbar/thumbnailpreview/patch/NewThumbnailPreviewPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/seekbar/thumbnailpreview/patch/NewThumbnailPreviewPatch.kt index c11dd44a3..6905f77c0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/seekbar/thumbnailpreview/patch/NewThumbnailPreviewPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/seekbar/thumbnailpreview/patch/NewThumbnailPreviewPatch.kt @@ -9,8 +9,8 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch -import app.revanced.patches.youtube.utils.fingerprints.ThumbnailPreviewConfigFingerprint import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility +import app.revanced.patches.youtube.utils.fingerprints.ThumbnailPreviewConfigFingerprint import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.util.integrations.Constants.SEEKBAR import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/navbarindex/patch/NavBarIndexHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/navbarindex/patch/NavBarIndexHookPatch.kt index 8aa975f5c..d1f98ebe6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/navbarindex/patch/NavBarIndexHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/navbarindex/patch/NavBarIndexHookPatch.kt @@ -9,7 +9,11 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException import app.revanced.patches.youtube.utils.fingerprints.OnBackPressedFingerprint -import app.revanced.patches.youtube.utils.navbarindex.fingerprints.* +import app.revanced.patches.youtube.utils.navbarindex.fingerprints.MobileTopBarButtonOnClickFingerprint +import app.revanced.patches.youtube.utils.navbarindex.fingerprints.NavButtonOnClickFingerprint +import app.revanced.patches.youtube.utils.navbarindex.fingerprints.NavButtonOnClickLegacyFingerprint +import app.revanced.patches.youtube.utils.navbarindex.fingerprints.OnResumeFragmentsFingerprints +import app.revanced.patches.youtube.utils.navbarindex.fingerprints.SettingsActivityOnBackPressedFingerprint import app.revanced.util.integrations.Constants.UTILS_PATH import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction35c import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction