diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconPatch.kt index a4cedb451..4b9b2b5cc 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/CustomBrandingIconPatch.kt @@ -10,6 +10,7 @@ import app.revanced.patches.youtube.utils.playservice.is_19_17_or_greater import app.revanced.patches.youtube.utils.playservice.is_19_32_or_greater import app.revanced.patches.youtube.utils.playservice.is_19_34_or_greater import app.revanced.patches.youtube.utils.playservice.versionCheckPatch +import app.revanced.patches.youtube.utils.settings.ResourceUtils.restoreOldSplashAnimationIncluded import app.revanced.patches.youtube.utils.settings.ResourceUtils.updatePatchStatusIcon import app.revanced.patches.youtube.utils.settings.getBytecodeContext import app.revanced.patches.youtube.utils.settings.settingsPatch @@ -208,6 +209,8 @@ val customBrandingIconPatch = resourcePatch( // Change splash screen. if (restoreOldSplashAnimationOption == true) { + restoreOldSplashAnimationIncluded = true + oldSplashAnimationResourceGroups.let { resourceGroups -> resourceGroups.forEach { copyResources("$appIconResourcePath/splash", it) diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/player/seekbar/SeekbarComponentsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/player/seekbar/SeekbarComponentsPatch.kt index 92bf1da06..f549f9d0e 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/player/seekbar/SeekbarComponentsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/player/seekbar/SeekbarComponentsPatch.kt @@ -11,14 +11,12 @@ import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.shared.drawable.addDrawableColorHook import app.revanced.patches.shared.drawable.drawableColorHookPatch import app.revanced.patches.shared.mainactivity.onCreateMethod -import app.revanced.patches.youtube.layout.branding.icon.customBrandingIconPatch import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE import app.revanced.patches.youtube.utils.extension.Constants.PATCH_STATUS_CLASS_DESCRIPTOR import app.revanced.patches.youtube.utils.extension.Constants.PLAYER_CLASS_DESCRIPTOR import app.revanced.patches.youtube.utils.extension.Constants.PLAYER_PATH import app.revanced.patches.youtube.utils.flyoutmenu.flyoutMenuHookPatch import app.revanced.patches.youtube.utils.mainactivity.mainActivityResolvePatch -import app.revanced.patches.youtube.utils.patch.PatchList.CUSTOM_BRANDING_ICON_FOR_YOUTUBE import app.revanced.patches.youtube.utils.patch.PatchList.SEEKBAR_COMPONENTS import app.revanced.patches.youtube.utils.playerButtonsResourcesFingerprint import app.revanced.patches.youtube.utils.playerButtonsVisibilityFingerprint @@ -37,6 +35,7 @@ import app.revanced.patches.youtube.utils.seekbarFingerprint import app.revanced.patches.youtube.utils.seekbarOnDrawFingerprint import app.revanced.patches.youtube.utils.settings.ResourceUtils.addPreference import app.revanced.patches.youtube.utils.settings.ResourceUtils.getContext +import app.revanced.patches.youtube.utils.settings.ResourceUtils.restoreOldSplashAnimationIncluded import app.revanced.patches.youtube.utils.settings.settingsPatch import app.revanced.patches.youtube.utils.totalTimeFingerprint import app.revanced.patches.youtube.video.information.videoInformationPatch @@ -48,7 +47,6 @@ import app.revanced.util.fingerprint.injectLiteralInstructionBooleanCall import app.revanced.util.fingerprint.matchOrThrow import app.revanced.util.fingerprint.methodOrThrow import app.revanced.util.fingerprint.resolvable -import app.revanced.util.getBooleanOptionValue import app.revanced.util.getReference import app.revanced.util.getWalkerMethod import app.revanced.util.indexOfFirstInstructionOrThrow @@ -122,9 +120,6 @@ val seekbarComponentsPatch = bytecodePatch( execute { - val restoreOldSplashAnimationIncluded = CUSTOM_BRANDING_ICON_FOR_YOUTUBE.included == true && - customBrandingIconPatch.getBooleanOptionValue("restoreOldSplashAnimation").value == true - var settingArray = arrayOf( "PREFERENCE_SCREEN: PLAYER", "SETTINGS: SEEKBAR_COMPONENTS" diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/utils/fix/splash/DarkModeSplashScreenPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/utils/fix/splash/DarkModeSplashScreenPatch.kt index f677f3965..5a193d9e6 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/utils/fix/splash/DarkModeSplashScreenPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/utils/fix/splash/DarkModeSplashScreenPatch.kt @@ -1,11 +1,9 @@ package app.revanced.patches.youtube.utils.fix.splash import app.revanced.patcher.patch.resourcePatch -import app.revanced.patches.youtube.layout.branding.icon.customBrandingIconPatch -import app.revanced.patches.youtube.utils.patch.PatchList.CUSTOM_BRANDING_ICON_FOR_YOUTUBE import app.revanced.patches.youtube.utils.playservice.is_19_32_or_greater import app.revanced.patches.youtube.utils.playservice.versionCheckPatch -import app.revanced.util.getBooleanOptionValue +import app.revanced.patches.youtube.utils.settings.ResourceUtils.restoreOldSplashAnimationIncluded import org.w3c.dom.Element /** @@ -27,9 +25,6 @@ val darkModeSplashScreenPatch = resourcePatch( return@finalize } - val restoreOldSplashAnimationIncluded = CUSTOM_BRANDING_ICON_FOR_YOUTUBE.included == true && - customBrandingIconPatch.getBooleanOptionValue("restoreOldSplashAnimation").value == true - if (restoreOldSplashAnimationIncluded) { document("res/values-night/styles.xml").use { document -> val resourcesNode = document.getElementsByTagName("resources").item(0) as Element diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/utils/settings/ResourceUtils.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/utils/settings/ResourceUtils.kt index 7b84b5f93..43cd0c4f1 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/utils/settings/ResourceUtils.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/utils/settings/ResourceUtils.kt @@ -25,6 +25,7 @@ internal object ResourceUtils { const val RVX_PREFERENCE_PATH = "res/xml/revanced_prefs.xml" const val YOUTUBE_SETTINGS_PATH = "res/xml/settings_fragment.xml" + var restoreOldSplashAnimationIncluded = false var youtubeMusicPackageName = YOUTUBE_MUSIC_PACKAGE_NAME var youtubePackageName = YOUTUBE_PACKAGE_NAME