Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: change package name doesn't change permission names #2696

Closed
3 tasks done
RaphaelTarita opened this issue Feb 6, 2024 · 3 comments
Closed
3 tasks done

bug: change package name doesn't change permission names #2696

RaphaelTarita opened this issue Feb 6, 2024 · 3 comments
Labels
Bug report Something isn't working

Comments

@RaphaelTarita
Copy link

RaphaelTarita commented Feb 6, 2024

Bug description

It seems like the "change package name" patch does not change the name of permissions, atleast for YouTube. This can lead to collisions with the original app.

Reproduction:

  1. Have YouTube (original) installed on your phone
  2. Patch a YouTube APK with "change package name" (choosing the default .revanced append is fine)
  3. Try to install it

Expected: Installation works because the "change package name" prevents a collision with the original YouTube

Actual: Installation fails with a package collision error. There's not much information provided but trying to install the patched APK via ADB shows that it is about permissions (see error log).

Error logs

this happens if you try to install the patched APK using ADB:

$ adb install ytrevanced.apk
Performing Streamed Install
adb: failed to install ytrevanced.apk: Failure [INSTALL_FAILED_DUPLICATE_PERMISSION: Package com.google.android.youtube.revanced attempting to redeclare permission com.google.android.youtube.permission.C2D_MESSAGE already owned by com.google.android.youtube]

Solution

I don't know a lot about android development or how the revanced patches work, but I assume a fix would be to also change permission names when the "change package name" patch is applied.

Additional context

The reason why this is a problem is that I ran into a problem after uninstalling a patched version of YouTube, and then tried to re-patch and re-install it. My phone has YouTube (original) preinstalled (I just disabled it), so it can only be uninstalled if the device is rooted. When trying to re-install, an error showed that there is a package collision with an existing app. I thought I could fix this problem by changing the package name of the patched APK, but as long as the permission collision exists, this patch is not a solution for my problem.

Acknowledgements

  • This issue is not a duplicate of an existing bug report.
  • I have chosen an appropriate title.
  • All requested information has been provided properly.
@RaphaelTarita RaphaelTarita added the Bug report Something isn't working label Feb 6, 2024
@LisoUseInAIKyrios
Copy link
Contributor

LisoUseInAIKyrios commented Feb 6, 2024

You don't need to use change package name with YouTube. Include 'GMS Core Support' and it already changes the package name to something different.

Similar issue of basically the same problem (not all manifest items are renamed): #2545

@RaphaelTarita
Copy link
Author

oh wow, thank you so much! I wasted so much time today trying to fix this problem but never did it occur to me OR show up in any research that I need the GmsCore patch. Works now!

Still, I don't know (and frankly, I do not have the expertise to say) whether renaming certain permissions like com.google.android.youtube.permission.C2D_MESSAGE should be done by the "change package name" patch..?

@LisoUseInAIKyrios
Copy link
Contributor

The change package name patch is very simple and does not work for all situations.

There exists a half dozen different "app cloning" tools that correctly handle renaming manifest and resource names. They are better suited for many situations.

Closing this as it's basically a duplicate issue.

@LisoUseInAIKyrios LisoUseInAIKyrios closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug report Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants