fix(YouTube Music/GmsCore support): can't share the stories to Facebook, Instagram and Snapchat https://github.com/inotia00/ReVanced_Extended/issues/1830

This commit is contained in:
inotia00 2024-09-15 20:40:28 +09:00
parent d708f36052
commit a041ca2e2f

View File

@ -22,7 +22,7 @@ object FileProviderPatch : BytecodePatch(
* For some reason, if the app gets "android.support.FILE_PROVIDER_PATHS", * 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. * 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 * https://github.com/inotia00/ReVanced_Extended/issues/1830
* *
* To solve this issue, replace the package name of YouTube with YT Music's package name. * 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 { it.mutableMethod.apply {
addInstructionsWithLabels( addInstructionsWithLabels(
0, """ 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" const-string v0, "$youtubePackageName.fileprovider"
invoke-static {p1, v0}, Ljava/util/Objects;->equals(Ljava/lang/Object;Ljava/lang/Object;)Z invoke-static {p1, v0}, Ljava/util/Objects;->equals(Ljava/lang/Object;Ljava/lang/Object;)Z
move-result v0 move-result v0
if-eqz v0, :ignore if-nez v0, :fix
goto :ignore
:fix
const-string p1, "$musicPackageName.fileprovider" const-string p1, "$musicPackageName.fileprovider"
""", ExternalLabel("ignore", getInstruction(0)) """, ExternalLabel("ignore", getInstruction(0))
) )