From 4fe5ea9fce5a305d7b0fbbc7b070eb13f7ea71b3 Mon Sep 17 00:00:00 2001 From: inotia00 <108592928+inotia00@users.noreply.github.com> Date: Sat, 20 Apr 2024 23:38:45 +0900 Subject: [PATCH] fix(GmsCore support): prompt to disable battery optimizations, if not done already --- .../shared/gms/BaseGmsCoreSupportPatch.kt | 2 +- .../music/settings/host/values/strings.xml | 17 ++++++++++++----- .../youtube/settings/host/values/strings.xml | 16 +++++++++++----- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/shared/gms/BaseGmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/shared/gms/BaseGmsCoreSupportPatch.kt index 3596d91d0..2a880b6bd 100644 --- a/src/main/kotlin/app/revanced/patches/shared/gms/BaseGmsCoreSupportPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/gms/BaseGmsCoreSupportPatch.kt @@ -107,7 +107,7 @@ abstract class BaseGmsCoreSupportPatch( mainActivityOnCreateFingerprint.resultOrThrow().mutableMethod.addInstructions( 1, // Hack to not disturb other patches (such as the YTMusic integrations patch). "invoke-static/range { p0 .. p0 }, $INTEGRATIONS_PATH/patches/GmsCoreSupport;->" + - "checkGmsCore(Landroid/content/Context;)V", + "checkGmsCore(Landroid/app/Activity;)V", ) // Change the vendor of GmsCore in ReVanced Integrations. diff --git a/src/main/resources/music/settings/host/values/strings.xml b/src/main/resources/music/settings/host/values/strings.xml index 6640648d9..62b3e4743 100644 --- a/src/main/resources/music/settings/host/values/strings.xml +++ b/src/main/resources/music/settings/host/values/strings.xml @@ -1,12 +1,19 @@ - GmsCore does not have permission to run in the background. - GmsCore is not whitelisted from battery optimization. - Action needed - Enable cloud messaging to receive notifications. Open GmsCore + Enable cloud messaging to receive notifications. GmsCore is not installed. Install it. - "Follow the 'Don't kill my app' guide for GmsCore." + Action needed + "GmsCore does not have permission to run in the background. + +Follow the 'Don't kill my app' guide for your phone, and apply the instructions to your MicroG installation. + +This is required for the app to work." + Open website + "GmsCore battery optimizations must be disabled to prevent issues. + +Tap on the continue button and disable battery optimizations." + Continue Account Action Bar diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml index 716afa842..2ac90fa8f 100644 --- a/src/main/resources/youtube/settings/host/values/strings.xml +++ b/src/main/resources/youtube/settings/host/values/strings.xml @@ -1214,12 +1214,18 @@ Limitation: Official headers in search results will be hidden." Open GmsCore Enable cloud messaging to receive notifications. - GmsCore does not have permission to run in the background. - GmsCore is not whitelisted from battery optimization. - Action needed - Open website GmsCore is not installed. Install it. - "Follow the 'Don't kill my app' guide for GmsCore." + Action needed + "GmsCore does not have permission to run in the background. + +Follow the 'Don't kill my app' guide for your phone, and apply the instructions to your MicroG installation. + +This is required for the app to work." + Open website + "GmsCore battery optimizations must be disabled to prevent issues. + +Tap on the continue button and disable battery optimizations." + Continue Sanitize sharing links Removes tracking query parameters from the URLs when sharing links.