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