From c707804987081bb84b156731e053e2687a2fc303 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sun, 31 Mar 2024 13:47:54 +0400
Subject: [PATCH 01/11] fix(YouTube - GmsCore): Improve dialog text
instructions
---
src/main/resources/addresources/values/strings.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index 50e59bf272..6e3644a13b 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -14,12 +14,12 @@
- GmsCore is not installed. Install it.
+ %s is not installed. Install it.
- Follow the \"Don\'t kill my app\" guide for GmsCore.
+ Follow the \"Don\'t kill my app\" guide for %s.
Action needed
- GmsCore is not whitelisted from battery optimization.\n\nFollow the \"Don\'t kill my app\" guide for GmsCore.
- GmsCore does not have permission to run in the background.\n\nFollow the \"Don\'t kill my app\" guide for GmsCore.
+ %1$s does not have permission to run in the background.\n\nFollow the \"Don\'t kill my app\" guide and apply the instructions to %2$s.\n\nIf you do not make these changes, this app will not work.
+ %1$s is not whitelisted from battery optimization.\n\nFollow the \"Don\'t kill my app\" guide and turn off battery optimizations for %2$s.\n\nIf you do not make these changes, this app will not work.
Open website
From 4db2a9eab5a255cbe6bb3140e428655572faaae1 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sun, 31 Mar 2024 17:03:53 +0400
Subject: [PATCH 02/11] fix: Use 'MicroG GmsCore' app name
---
src/main/resources/addresources/values/strings.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index 6e3644a13b..15c679c704 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -14,12 +14,12 @@
- %s is not installed. Install it.
+ MicroG GmsCore is not installed. Install it.
- Follow the \"Don\'t kill my app\" guide for %s.
+ Follow the \"Don\'t kill my app\" guide for MicroG GmsCore.
Action needed
- %1$s does not have permission to run in the background.\n\nFollow the \"Don\'t kill my app\" guide and apply the instructions to %2$s.\n\nIf you do not make these changes, this app will not work.
- %1$s is not whitelisted from battery optimization.\n\nFollow the \"Don\'t kill my app\" guide and turn off battery optimizations for %2$s.\n\nIf you do not make these changes, this app will not work.
+ MicroG GmsCore does not have permission to run in the background.\n\nFollow the \"Don\'t kill my app\" guide and apply the instructions to MicroG.\n\nIf you do not make these changes, this app will not work.
+ MicroG GmsCore is not whitelisted from battery optimization.\n\nFollow the \"Don\'t kill my app\" guide and turn off battery optimizations for MicroG.\n\nIf you do not make these changes, this app will not work.
Open website
From acc0d386c874ffe56347d4c74b56d800ffe9bb79 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Mon, 1 Apr 2024 04:15:31 +0400
Subject: [PATCH 03/11] fix: Adjust language
---
src/main/resources/addresources/values/strings.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index 15c679c704..830d6f4674 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -18,8 +18,8 @@
Follow the \"Don\'t kill my app\" guide for MicroG GmsCore.
Action needed
- MicroG GmsCore does not have permission to run in the background.\n\nFollow the \"Don\'t kill my app\" guide and apply the instructions to MicroG.\n\nIf you do not make these changes, this app will not work.
- MicroG GmsCore is not whitelisted from battery optimization.\n\nFollow the \"Don\'t kill my app\" guide and turn off battery optimizations for MicroG.\n\nIf you do not make these changes, this app will not work.
+ MicroG GmsCore does not have permission to run in the background.\n\nFollow the \"Don\'t kill my app\" guide and apply the instructions to MicroG.\n\nThese changes are required for this app to work.
+ MicroG GmsCore is not whitelisted from battery optimization.\n\nFollow the \"Don\'t kill my app\" guide and turn off battery optimizations for MicroG.\n\nThese changes are required for this app to work.
Open website
From 78368f0579ad9d9368e901173b92e38a26b1bd57 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Mon, 1 Apr 2024 08:59:21 +0400
Subject: [PATCH 04/11] fix: Open the GmsCore battery disable optimizations
intent and not a website.
---
.../patches/music/misc/gms/GmsCoreSupportPatch.kt | 3 +++
src/main/resources/addresources/values/strings.xml | 13 ++++++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/main/kotlin/app/revanced/patches/music/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/gms/GmsCoreSupportPatch.kt
index 060d3447c7..28a86b8236 100644
--- a/src/main/kotlin/app/revanced/patches/music/misc/gms/GmsCoreSupportPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/music/misc/gms/GmsCoreSupportPatch.kt
@@ -21,6 +21,9 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch(
CastDynamiteModuleV2Fingerprint,
CastContextFetchFingerprint,
),
+ // This fingerprint could be improved by using a main Activity,
+ // as that allows showing a dialog if GmsCore is not whitelisted for battery optimizations.
+ // Because using this fingerprint only allows showing a brief toast and then opening a website.
mainActivityOnCreateFingerprint = ApplicationInitFingerprint,
integrationsPatchDependency = IntegrationsPatch::class,
gmsCoreSupportResourcePatch = GmsCoreSupportResourcePatch,
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index 830d6f4674..4340c0d19f 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -13,14 +13,17 @@
Import failed: %s
+ Action needed
+ MicroG GmsCore does not have permission to run in the background.\n\nFollow the \"Don\'t kill my app\" guide for your phone, and apply the instructions to your MicroG installation.\n\nThis is required for this app to work.
+ Open website
+ MicroG GmsCore battery optimizations must be turned off to prevent app crashes.\n\nPress the continue button, and allow turning off battery optimizations.
+ Continue
MicroG GmsCore is not installed. Install it.
- Follow the \"Don\'t kill my app\" guide for MicroG GmsCore.
- Action needed
- MicroG GmsCore does not have permission to run in the background.\n\nFollow the \"Don\'t kill my app\" guide and apply the instructions to MicroG.\n\nThese changes are required for this app to work.
- MicroG GmsCore is not whitelisted from battery optimization.\n\nFollow the \"Don\'t kill my app\" guide and turn off battery optimizations for MicroG.\n\nThese changes are required for this app to work.
- Open website
+ MicroG GmsCore requires turning off battery optimizations
+
+ Battery optimizations are still on, and this app may not work
From 67e09a653d6eedbf97f2a1ced51e14c8b3702d1d Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Tue, 2 Apr 2024 11:05:23 +0400
Subject: [PATCH 05/11] Update
src/main/resources/addresources/values/strings.xml
Co-authored-by: oSumAtrIX
---
src/main/resources/addresources/values/strings.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index 4340c0d19f..c01cf915f2 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -14,7 +14,7 @@
Action needed
- MicroG GmsCore does not have permission to run in the background.\n\nFollow the \"Don\'t kill my app\" guide for your phone, and apply the instructions to your MicroG installation.\n\nThis is required for this app to work.
+ MicroG GmsCore does not have permission to run in the background.\n\nFollow the \"Don\'t kill my app\" guide for your phone, and apply the instructions to your MicroG installation.\n\nThis is required for the app to work.
Open website
MicroG GmsCore battery optimizations must be turned off to prevent app crashes.\n\nPress the continue button, and allow turning off battery optimizations.
Continue
From 812d59cdb28f1b6b99d23e0742e290eb58bb8b98 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Tue, 2 Apr 2024 11:05:42 +0400
Subject: [PATCH 06/11] Update
src/main/resources/addresources/values/strings.xml
Co-authored-by: oSumAtrIX
---
src/main/resources/addresources/values/strings.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index c01cf915f2..ecb8fbba8c 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -16,7 +16,7 @@
Action needed
MicroG GmsCore does not have permission to run in the background.\n\nFollow the \"Don\'t kill my app\" guide for your phone, and apply the instructions to your MicroG installation.\n\nThis is required for the app to work.
Open website
- MicroG GmsCore battery optimizations must be turned off to prevent app crashes.\n\nPress the continue button, and allow turning off battery optimizations.
+ MicroG GmsCore battery optimizations must be disabled to prevent issues.\n\nPress the continue button and disable battery optimizations.
Continue
MicroG GmsCore is not installed. Install it.
From 620c27c0880222af1ae45dd5e06d1484b3bb32ef Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Tue, 2 Apr 2024 11:05:58 +0400
Subject: [PATCH 07/11] Update
src/main/resources/addresources/values/strings.xml
Co-authored-by: oSumAtrIX
---
src/main/resources/addresources/values/strings.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index ecb8fbba8c..8747884be6 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -21,9 +21,9 @@
MicroG GmsCore is not installed. Install it.
- MicroG GmsCore requires turning off battery optimizations
+ MicroG GmsCore requires disabling battery optimizations
- Battery optimizations are still on, and this app may not work
+ Battery optimizations are still enabled and can cause issues
From b92fe69677019ebad83e00643dce5b2799254554 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Tue, 2 Apr 2024 11:52:35 +0400
Subject: [PATCH 08/11] fix: Remove secondary nag
---
src/main/resources/addresources/values/strings.xml | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index 8747884be6..52d6b44831 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -18,12 +18,10 @@
Open website
MicroG GmsCore battery optimizations must be disabled to prevent issues.\n\nPress the continue button and disable battery optimizations.
Continue
-
+
MicroG GmsCore is not installed. Install it.
-
+
MicroG GmsCore requires disabling battery optimizations
-
- Battery optimizations are still enabled and can cause issues
From a7d0cd81eec69358eeb83d72637f82b0c1c4b015 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Wed, 3 Apr 2024 14:23:59 +0400
Subject: [PATCH 09/11] fix: Use activity fingerprint for YT Music, so GmsCore
can show a dialog
---
.../patches/music/misc/gms/GmsCoreSupportPatch.kt | 6 +-----
.../fingerprints/MusicActivityOnCreateFingerprint.kt | 11 +++++++++++
2 files changed, 12 insertions(+), 5 deletions(-)
create mode 100644 src/main/kotlin/app/revanced/patches/music/misc/gms/fingerprints/MusicActivityOnCreateFingerprint.kt
diff --git a/src/main/kotlin/app/revanced/patches/music/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/gms/GmsCoreSupportPatch.kt
index 28a86b8236..3c99992fce 100644
--- a/src/main/kotlin/app/revanced/patches/music/misc/gms/GmsCoreSupportPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/music/misc/gms/GmsCoreSupportPatch.kt
@@ -5,7 +5,6 @@ import app.revanced.patches.music.misc.gms.Constants.REVANCED_MUSIC_PACKAGE_NAME
import app.revanced.patches.music.misc.gms.GmsCoreSupportResourcePatch.gmsCoreVendorGroupIdOption
import app.revanced.patches.music.misc.gms.fingerprints.*
import app.revanced.patches.music.misc.integrations.IntegrationsPatch
-import app.revanced.patches.music.misc.integrations.fingerprints.ApplicationInitFingerprint
import app.revanced.patches.shared.fingerprints.CastContextFetchFingerprint
import app.revanced.patches.shared.misc.gms.BaseGmsCoreSupportPatch
@@ -21,10 +20,7 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch(
CastDynamiteModuleV2Fingerprint,
CastContextFetchFingerprint,
),
- // This fingerprint could be improved by using a main Activity,
- // as that allows showing a dialog if GmsCore is not whitelisted for battery optimizations.
- // Because using this fingerprint only allows showing a brief toast and then opening a website.
- mainActivityOnCreateFingerprint = ApplicationInitFingerprint,
+ mainActivityOnCreateFingerprint = MusicActivityOnCreateFingerprint,
integrationsPatchDependency = IntegrationsPatch::class,
gmsCoreSupportResourcePatch = GmsCoreSupportResourcePatch,
compatiblePackages = setOf(CompatiblePackage("com.google.android.apps.youtube.music")),
diff --git a/src/main/kotlin/app/revanced/patches/music/misc/gms/fingerprints/MusicActivityOnCreateFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/misc/gms/fingerprints/MusicActivityOnCreateFingerprint.kt
new file mode 100644
index 0000000000..2e46df2d96
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/music/misc/gms/fingerprints/MusicActivityOnCreateFingerprint.kt
@@ -0,0 +1,11 @@
+package app.revanced.patches.music.misc.gms.fingerprints
+
+import app.revanced.patcher.fingerprint.MethodFingerprint
+
+internal object MusicActivityOnCreateFingerprint : MethodFingerprint(
+ returnType = "V",
+ parameters = listOf("Landroid/os/Bundle;"),
+ customFingerprint = { methodDef, classDef ->
+ methodDef.name == "onCreate" && classDef.type.endsWith("/MusicActivity;")
+ }
+)
\ No newline at end of file
From 4db180fbb3cca4569f74da6b698d68d147bf2746 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Wed, 3 Apr 2024 14:35:54 +0400
Subject: [PATCH 10/11] refactor: Remove 'not whitelisted' toast logic that is
no longer needed
---
.../patches/shared/misc/gms/BaseGmsCoreSupportPatch.kt | 4 ++--
src/main/resources/addresources/values/strings.xml | 6 ++----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/main/kotlin/app/revanced/patches/shared/misc/gms/BaseGmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/shared/misc/gms/BaseGmsCoreSupportPatch.kt
index 9d2544b7e8..dd3fa0b599 100644
--- a/src/main/kotlin/app/revanced/patches/shared/misc/gms/BaseGmsCoreSupportPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/shared/misc/gms/BaseGmsCoreSupportPatch.kt
@@ -98,9 +98,9 @@ abstract class BaseGmsCoreSupportPatch(
// Verify GmsCore is installed and whitelisted for power optimizations and background usage.
mainActivityOnCreateFingerprint.result?.mutableMethod?.addInstructions(
- 1, // Hack to not disturb other patches (such as the YTMusic integrations patch).
+ 0,
"invoke-static/range { p0 .. p0 }, Lapp/revanced/integrations/shared/GmsCoreSupport;->" +
- "checkGmsCore(Landroid/content/Context;)V",
+ "checkGmsCore(Landroid/app/Activity;)V",
) ?: throw mainActivityOnCreateFingerprint.exception
// Change the vendor of GmsCore in ReVanced Integrations.
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index 52d6b44831..b2d80da710 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -13,15 +13,13 @@
Import failed: %s
+
+ MicroG GmsCore is not installed. Install it.
Action needed
MicroG GmsCore does not have permission to run in the background.\n\nFollow the \"Don\'t kill my app\" guide for your phone, and apply the instructions to your MicroG installation.\n\nThis is required for the app to work.
Open website
MicroG GmsCore battery optimizations must be disabled to prevent issues.\n\nPress the continue button and disable battery optimizations.
Continue
-
- MicroG GmsCore is not installed. Install it.
-
- MicroG GmsCore requires disabling battery optimizations
From 8ad3eaff1668715f919fe8c6fed8d9b43f628e75 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 4 Apr 2024 18:34:36 +0400
Subject: [PATCH 11/11] Update
src/main/resources/addresources/values/strings.xml
Co-authored-by: oSumAtrIX
---
src/main/resources/addresources/values/strings.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index 0b12942369..e752a62798 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -18,7 +18,7 @@
Action needed
MicroG GmsCore does not have permission to run in the background.\n\nFollow the \"Don\'t kill my app\" guide for your phone, and apply the instructions to your MicroG installation.\n\nThis is required for the app to work.
Open website
- MicroG GmsCore battery optimizations must be disabled to prevent issues.\n\nPress the continue button and disable battery optimizations.
+ MicroG GmsCore battery optimizations must be disabled to prevent issues.\n\nTap on the continue button and disable battery optimizations.
Continue