diff --git a/src/main/kotlin/app/revanced/patches/music/misc/splash/CairoSplashAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/splash/CairoSplashAnimationPatch.kt new file mode 100644 index 000000000..eee8f8625 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/music/misc/splash/CairoSplashAnimationPatch.kt @@ -0,0 +1,44 @@ +package app.revanced.patches.music.misc.splash + +import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.annotation.CompatiblePackage +import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.music.misc.splash.fingerprints.CairoSplashAnimationConfigFingerprint +import app.revanced.patches.music.utils.integrations.Constants.MISC_PATH +import app.revanced.patches.music.utils.settings.CategoryType +import app.revanced.patches.music.utils.settings.SettingsPatch +import app.revanced.util.literalInstructionBooleanHook + +@Patch( + name = "Enable Cairo splash animation", + description = "Adds an option to enable Cairo splash animation.", + dependencies = [SettingsPatch::class], + compatiblePackages = [ + CompatiblePackage( + "com.google.android.apps.youtube.music", + [ + "7.06.53", + ] + ) + ] +) +@Suppress("unused") +object CairoSplashAnimationPatch : BytecodePatch( + setOf(CairoSplashAnimationConfigFingerprint) +) { + override fun execute(context: BytecodeContext) { + + CairoSplashAnimationConfigFingerprint.literalInstructionBooleanHook( + 45635386, + "$MISC_PATH/CairoSplashAnimationPatch;->enableCairoSplashAnimation()Z" + ) + + SettingsPatch.addSwitchPreference( + CategoryType.MISC, + "revanced_enable_cairo_splash_animation", + "false" + ) + + } +} diff --git a/src/main/kotlin/app/revanced/patches/music/misc/splash/fingerprints/CairoSplashAnimationConfigFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/misc/splash/fingerprints/CairoSplashAnimationConfigFingerprint.kt new file mode 100644 index 000000000..54bf6c3e7 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/music/misc/splash/fingerprints/CairoSplashAnimationConfigFingerprint.kt @@ -0,0 +1,10 @@ +package app.revanced.patches.music.misc.splash.fingerprints + +import app.revanced.util.fingerprint.LiteralValueFingerprint + +/** + * This fingerprint is compatible with YouTube Music v7.06.53+ + */ +internal object CairoSplashAnimationConfigFingerprint : LiteralValueFingerprint( + literalSupplier = { 45635386 } +) \ No newline at end of file diff --git a/src/main/resources/music/settings/host/values/strings.xml b/src/main/resources/music/settings/host/values/strings.xml index e87f0ba8d..476f9607d 100644 --- a/src/main/resources/music/settings/host/values/strings.xml +++ b/src/main/resources/music/settings/host/values/strings.xml @@ -358,6 +358,8 @@ Some features may not work properly in the old player layout." Miscellaneous + Enable Cairo splash animation + Enables Cairo splash animation when the app starts up. Enable debug logging Prints the debug log. Enable debug buffer logging @@ -375,7 +377,7 @@ Info: Action needed "GmsCore does not have permission to run in the background. -Follow the Don't kill my app! guide for your device, and apply the instructions to your GmsCore installation. +Follow the 'Don't kill my app!' guide for your device, and apply the instructions to your GmsCore installation. This is required for the app to work." Open website