From a041ca2e2f5643a083ceba9cc7f27635e8cd26a7 Mon Sep 17 00:00:00 2001 From: inotia00 <108592928+inotia00@users.noreply.github.com> Date: Sun, 15 Sep 2024 20:40:28 +0900 Subject: [PATCH] fix(YouTube Music/GmsCore support): can't share the stories to Facebook, Instagram and Snapchat https://github.com/inotia00/ReVanced_Extended/issues/1830 --- .../music/utils/fix/fileprovider/FileProviderPatch.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/music/utils/fix/fileprovider/FileProviderPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/fix/fileprovider/FileProviderPatch.kt index 738aaab18..6b6212d46 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/fix/fileprovider/FileProviderPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/fix/fileprovider/FileProviderPatch.kt @@ -22,7 +22,7 @@ object FileProviderPatch : BytecodePatch( * For some reason, if the app gets "android.support.FILE_PROVIDER_PATHS", * the package name of YouTube is used, not the package name of the YT Music. * - * There is no issue in the stock YT Music, but this is an issue in the MicroG Build. + * There is no issue in the stock YT Music, but this is an issue in the GmsCore Build. * https://github.com/inotia00/ReVanced_Extended/issues/1830 * * To solve this issue, replace the package name of YouTube with YT Music's package name. @@ -31,10 +31,16 @@ object FileProviderPatch : BytecodePatch( it.mutableMethod.apply { addInstructionsWithLabels( 0, """ + const-string v0, "com.google.android.youtube.fileprovider" + invoke-static {p1, v0}, Ljava/util/Objects;->equals(Ljava/lang/Object;Ljava/lang/Object;)Z + move-result v0 + if-nez v0, :fix const-string v0, "$youtubePackageName.fileprovider" invoke-static {p1, v0}, Ljava/util/Objects;->equals(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v0 - if-eqz v0, :ignore + if-nez v0, :fix + goto :ignore + :fix const-string p1, "$musicPackageName.fileprovider" """, ExternalLabel("ignore", getInstruction(0)) )