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

Add patch for Android 11 (R) #1222

Closed
wants to merge 1 commit into from
Closed

Conversation

kdrag0n
Copy link

@kdrag0n kdrag0n commented Oct 10, 2020

This has been tested to work with a third-party app as part of my ProtonAOSP ROM. Thanks to @gudenau for their Android 10 patch, which I used as a base.

Note that Google has been deprecating dessert names and version letters since Android 10 in favor of using version numbers in more places, so maybe the patch file should be renamed to android_frameworks_base-11.patch.

This has been tested to work with a third-party app.
+ <!-- Allows an application to change the package signature as
+ seen by applications -->
+ <permission android:name="android.permission.FAKE_PACKAGE_SIGNATURE"
+ android:permissionGroup="android.permission-group.UNDEFINED"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 70 needs to be
android:permissionGroup="android.permission-group.FAKE_PACKAGE"
otherwise strings will not be correct in GUI.

@chris42
Copy link

chris42 commented Nov 15, 2020

Also I found, that within the app permissions the signature spoofing permission for microg is correctly shown. However in the overall list of the permission manager 0 apps are shown for signature spoofing.

@machiav3lli
Copy link

machiav3lli commented Dec 14, 2020

This attitude could also be seen also on some A10 ROMs with certain patch which leaves the permission management passively accepting all requests. While with some other patches(there's been couple) you needed to prompt the permission dialog manually through adb shell as the app wasn't patched to handle it. So what you discribe is fully dependant on the signature spoofing patch of the rom not of microG.

@chris42
Copy link

chris42 commented Dec 14, 2020

@machiav3lli Could you elaborate? I do not understand what you are trying to say.

@machiav3lli
Copy link

@chris42 gladly. In my experience I noticed that A10 ROMs differ on the matter of showing if an app has sigSpoofing. There's ROMs that behave the way you discribed it, while others show that there's an app requesting the permission but can't grant it manualy. Only through adb shell the request dialog could be called:

adb shell am start com.android.vending/.GrantFakeSignatureOermissionActivity

How they're patched is the only variable I could find then(unfortunately, didn't document the diffrrences then). And still didn't test enough number of A11 ROMs to say if it also applies, but we can assume that it's the same.

@chris42
Copy link

chris42 commented Dec 15, 2020

I am not sure how that relates to what I described before. I just noted, that in the permission overview signature spoofing is not showing any apps, while in the app specific it is shown. This is just the list of permissions and is independent of if it has been granted or not.
Regarding how it is patched. Exactly above with this patch in this PR.

I would suspect it has to do with linking of the created signature spoofing category.

@kdrag0n
Copy link
Author

kdrag0n commented Dec 15, 2020

Corresponding PermissionController patch, not included because it's outside of frameworks/base: ProtonAOSP/android_packages_apps_PermissionController@f7a946c

With this patch:

  • Requesting the permission in microG opens the runtime permission prompt
  • Permission manager says "Spoof package signature: 1 of 1 apps allowed"
  • Revoking the permission in permission manager works
  • Nothing is granted or ignored silently

@chris42
Copy link

chris42 commented Dec 17, 2020

@mar-v-in Would it make sense to add this and the last patch to the repository?

bananer pushed a commit to bananer/docker-lineage-cicd that referenced this pull request Jan 18, 2021
bananer added a commit to bananer/docker-lineage-cicd that referenced this pull request Jan 18, 2021
bananer added a commit to bananer/docker-lineage-cicd that referenced this pull request Jan 19, 2021
hmtheboy154 added a commit to BlissRoms-x86/platform_frameworks_base that referenced this pull request Feb 23, 2022
Based on R patch made by kdrag0n : microg/GmsCore#1222
@mar-v-in mar-v-in force-pushed the master branch 4 times, most recently from ae17355 to 8078073 Compare April 20, 2023 08:25
@mar-v-in
Copy link
Member

I moved this into https://github.com/microg/patches

@mar-v-in mar-v-in closed this Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants