feat(YouTube Music): add Enable Cairo splash animation patch (YouTube Music 7.06.53+)

This commit is contained in:
inotia00 2024-06-23 13:42:16 +09:00
parent fc39cb374e
commit 2872aaa580
3 changed files with 57 additions and 1 deletions

View File

@ -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"
)
}
}

View File

@ -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 }
)

View File

@ -358,6 +358,8 @@ Some features may not work properly in the old player layout."</string>
<!-- PreferenceScreen: Miscellaneous -->
<string name="revanced_preference_screen_misc_title">Miscellaneous</string>
<string name="revanced_enable_cairo_splash_animation_title">Enable Cairo splash animation</string>
<string name="revanced_enable_cairo_splash_animation_summary">Enables Cairo splash animation when the app starts up.</string>
<string name="revanced_enable_debug_logging_title">Enable debug logging</string>
<string name="revanced_enable_debug_logging_summary">Prints the debug log.</string>
<string name="revanced_enable_debug_buffer_logging_title">Enable debug buffer logging</string>
@ -375,7 +377,7 @@ Info:
<string name="gms_core_dialog_title">Action needed</string>
<string name="gms_core_dialog_not_whitelisted_not_allowed_in_background_message">"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."</string>
<string name="gms_core_dialog_open_website_text">Open website</string>