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): Changing package name causing collisions within it's own manifest #2545

Open
3 tasks done
Shadow-Hunt3r opened this issue Dec 27, 2023 · 0 comments · May be fixed by #3846
Open
3 tasks done
Labels
Bug report Something isn't working

Comments

@Shadow-Hunt3r
Copy link

Shadow-Hunt3r commented Dec 27, 2023

Bug description

When applying the patch "Custom Package Name" to certain apps you can be faced with one of 2 issues depending on the app
AndroidManifest containing providers such as <provider android:name="com.facebook.FacebookContentProvider" ... /> which could be a collision to the app while still running the original package name throughout the manifest

Steps to Reproduce Provider Collision:

  1. Install and extract the base apk for an app with a provider name as above
  2. Apply patch change package name modification to the base apk
  3. Installing would cause a collision, in games it could occur regardless if the original game is still installed or not

After removing the provider above with the first solution below I closed the apk and ran it through revanced manager again to find another issue of "Can't install because provider name com.original.apk.NativeShareContentProvider (in package com.modded.apk) is already used by com.original.apk"
This issue is most likely caused by lines in the Manifest that follow as such android:authorities="com.original.apk.PERMISSION" when the permissions are given to com.original.apk

Solution

For the ContentProvider collision, i believe it to be caused as it is usually supplied with an identifier given with the app, making a patch that can find and remove or modify the code below could fix this issue, while warning that the feature may not work anymore based on how it is completed

 <provider android:name="com.facebook.FacebookContentProvider"
             android:exported="true"
             android:authorities="com.facebook.app.FacebookContentProvider*ID*" />

For changing the ID there would also be a meta-data string that contains the ID as well under the following

     <meta-data android:name="com.facebook.sdk.ApplicationId"
               android:value="fb*ID*" />

For the second issue parsing the manifest and replacing all traces of android:authorities="com.original.apk.PERMISSION" and replacing it with android:authorities="com.modded.apk.PERMISSION" seems to have fixed the issue but at the cost of Google Services in the app to no longer work, however it could possibly be fixed by adding seeing if it is possible to make GmsCore Support to have a universal application

Additional context

Below I have shown such an example using a game called Hackers by Trickster Arts
Before Removing FB - Fail caused by first error provided above

- Device Info
ReVanced Manager: 1.18.0
Model: Pixel 6a
Android version: 14
Supported architectures: arm64-v8a, armeabi-v7a, armeabi
Root permissions: No

- Patch Info
App: com.tricksterarts.hackers v1.225 (Suggested: Any)
Patches version: v3.1.0
Patches added: Change package name [Package name: com.hackers.shadow], Export all activities
Patches removed: None
Default patch options changed: None

- Settings
Allow changing patch selection: true
Version compatibility check: true
Show universal patches: true
Patches source: revanced/revanced-patches
Integration source: revanced/revanced-integrations

- Logs
Copying APK
Reading APK
Decoding app manifest
Loading patches
Deleting existing resource cache directory
Decoding resources
Executing patches
Applied 2 patches
Compiling patched dex files
Compiled 4 dex files
Compiling modified resources
Signing APK
Patched APK
Installing patched app
Installation failed

After Removing FB Content Provider - Fail caused by the second issue provided above

- Device Info
ReVanced Manager: 1.18.0
Model: Pixel 6a
Android version: 14
Supported architectures: arm64-v8a, armeabi-v7a, armeabi
Root permissions: No

- Patch Info
App: com.tricksterarts.hackers v1.225 (Suggested: Any)
Patches version: v3.1.0
Patches added: Change package name [Package name: com.hackers.shadow], Export all activities
Patches removed: None
Default patch options changed: None

- Settings
Allow changing patch selection: true
Version compatibility check: true
Show universal patches: true
Patches source: revanced/revanced-patches
Integration source: revanced/revanced-integrations

- Logs
Copying APK
Reading APK
Decoding app manifest
Loading patches
Deleting existing resource cache directory
Decoding resources
Executing patches
Applied 2 patches
Compiling patched dex files
Compiled 4 dex files
Compiling modified resources
Signing APK
Patched APK
Installing patched app
Installation failed

Screenshots below show Package Manager showing results of searching hackers from com.tricksterarts.hackers as well as both errors shown using SAI (both apps installed through F-Droid) to provide evidence of these issues being present in both issues named above
Screenshot_20231227-061731
Screenshot_20231227-102550
Screenshot_20231227-102642

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.
@Shadow-Hunt3r Shadow-Hunt3r added the Bug report Something isn't working label Dec 27, 2023
@LisoUseInAIKyrios LisoUseInAIKyrios changed the title Changing package name causing collisions within it's own manifest bug(Change package name): Changing package name causing collisions within it's own manifest Dec 27, 2023
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

Successfully merging a pull request may close this issue.

1 participant