ReVanced / revanced-patches

🧩 Patches for ReVanced
https://revanced.app
GNU General Public License v3.0
2.13k stars 245 forks source link

bug: (Youtube - Vanced MicroG support) the resulting apk redeclares an already owned permission #65

Closed adam-devel closed 8 months ago

adam-devel commented 8 months ago

Bug description

Installing Youtube 18.45.41 fails with:

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

this issue has been raised in ReVanced/revanced-patches-template#1399 and solved in 3d1cce5b4ca54c622b863f24febeb03a6060033c, so i assume this is a regression.

Toolchain

Included patches (exclusive)

Command line

java -jar .tmp/cli.jar patch .tmp/youtube.apk \
    --patch-bundle .tmp/patches.jar           \
    --exclusive -i "Hide ads" -i "Video ads" -i "Disable resuming Shorts on startup" -i "Custom branding" -i "Disable auto captions" -i "SponsorBlock" -i "Hide crowdfunding box" -i "Hide floating microphone button" -i "Hide breaking news shelf" -i "Theme" -i "Return YouTube Dislike" -i "Client spoof" -i "Spoof device dimensions" -i "Bypass URL redirects" -i "Open links externally" -i "Vanced MicroG support" -i "Minimized playback" -i "Remember video quality" -i "Swipe controls"  \
    --merge        .tmp/integrations.apk      \
    --out ".tmp/out/YouTube-18.45.41.apk"

Revanced CLI's output

Loading patches 
Decoding app manifest 
Export all activities excluded 
Remove screen capture restriction excluded 
Spoof SIM country excluded 
Change package name excluded 
Enable Android debugging excluded 
Override certificate pinning excluded 
Spoof Wi-Fi connection excluded 
Remove screenshot restriction excluded 
Predictive back gesture excluded 
Alternative thumbnails excluded 
Premium heading excluded 
Wide searchbar excluded 
Hide captions button excluded 
Hide cast button excluded 
Hide player buttons excluded 
Navigation buttons excluded 
Hide autoplay button excluded 
Hide video action buttons excluded 
Disable player popup panels excluded 
Custom player overlay opacity excluded 
Remove player controls background excluded 
Hide timestamp excluded 
Hide layout components excluded 
Hide endscreen cards excluded 
Hide album cards excluded 
Hide email address excluded 
Player flyout menu excluded 
Hide filter bar excluded 
Disable rolling number animations excluded 
Disable fullscreen ambient mode excluded 
Hide 'Load more' button excluded 
Disable suggested video end screen excluded 
Hide seekbar excluded 
Hide Shorts components excluded 
Hide info cards excluded 
Comments excluded 
Spoof app version excluded 
Enable tablet layout excluded 
Restore old seekbar thumbnails excluded 
Tablet mini player excluded 
Always autorepeat excluded 
Disable zoom haptics excluded 
Announcements excluded 
Enable debugging excluded 
Remove tracking query parameter excluded 
HDR auto brightness excluded 
Playback speed excluded 
Restore old video quality menu excluded 
Copy video url excluded 
External downloads excluded 
Seekbar tapping excluded 
Disable precise seeking gesture excluded 
Enable slide to seek excluded 
Setting patch options 
Merging integrations 
Deleting existing resource cache directory 
Decoding resources 
Executing patches 
Bypass URL redirects succeeded 
Client spoof succeeded 
Custom branding succeeded 
Disable auto captions succeeded 
Disable resuming Shorts on startup succeeded 
Hide ads succeeded 
Hide breaking news shelf succeeded 
Hide crowdfunding box succeeded 
Hide floating microphone button succeeded 
Minimized playback succeeded 
Open links externally succeeded 
Remember video quality succeeded 
Return YouTube Dislike succeeded 
SponsorBlock succeeded 
Spoof device dimensions succeeded 
Swipe controls succeeded 
Theme succeeded 
Vanced MicroG support succeeded 
Video ads succeeded 
Change package name succeeded 
Compiling patched dex files 
Compiled classes.dex 
Compiled classes2.dex 
Compiled classes3.dex 
Compiled classes4.dex 
Compiled classes5.dex 
Compiled classes6.dex 
Compiled classes7.dex 
Compiled classes8.dex 
Compiling modified resources 
Aligning youtube.apk 
Signing youtube.apk 

Error logs

No response

Solution

No response

Additional context

I didn't include the "Change package name" patch, i assumed it's implied by "Vanced MicroG support". revanced-cli reports excluding "Change package name", it then reports applying it anyways. i confirm that the resulting apk has a changed package name.

i doubt this will help but here's the manifest file, just in case.

Acknowledgements

cyberboh commented 8 months ago

Change package name patch not available in revanced patches, make sure you redownload right tools (patches, inte and cli) and i also always patched revanced using cli and installed it via adb never had this error. And disable stock YT at first

adam-devel commented 8 months ago

make sure you redownload right tools (patches, inte and cli)

if i didn't use the right tools for the right purposes i wouldn't be able to generate a patched APK in the first place, let alone report an issue about installing it.

never had this error

i am glad you haven't encountered this error

disable stock YT at first

already disabled

Change package name patch not available in revanced patches

it is in fact available: you can check the website, the api or the bundle directly:

$ java -jar cli.jar list-patches patches.jar | grep -C1 "Change package name"
Index: 20
Name: Change package name
Description: Appends ".revanced" to the package name by default.

i think what you are trying to say is that it's not available for youtube. if that's what you mean then no, Change package name is a universal patch, it applies to every app, including youtube. it doesn't show up in the website when you select youtube but it does show up in the cli:

$ java -jar cli.jar list-patches patches.jar  -f com.google.android.youtube | grep -C1 "Change package name"
Index: 20
Name: Change package name
Description: Appends ".revanced" to the package name by default.

even if i am wrong and the issue is the Change package name patch, that doesn't matter because i already said that i didn't include the patch.

oSumAtrIX commented 8 months ago

Vanced MicroG patch implies changing the package name, but it is unrelated to this issue.I am also not able to reproduce the issue so I cannot debug it. You can try to add the permission to the list of permissions to change the package name in the Vanced MicroG patch

adam-devel commented 8 months ago

@oSumAtrIX thank you for taking the time to try to reproduce the issue, i will continue investigating

adam-devel commented 8 months ago

not sure what happened, can't be bothered to go over my scripts logs, i have tried again with a clean environment, it works now, the issue must be on my end