-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 user-install microG User Services #2188
Conversation
@p1gp1g |
play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java
Outdated
Show resolved
Hide resolved
Now it fails build:
|
I've not tested locally, but it should build now. I'll rebase to fix the commit into the previous one later.
IIRC signature spoofing works only for system app, so microG (system) should have a different signature. I think we should test this case. A few things should be done on the UI for the user services:
|
microG Services can be installed as a user / non-system app already. (If that's not possible on GrapheneOS that might be a GrapheneOS specific issue and would be interesting to analyze that.) As a matter of fact, I personally run microG as a user app myself (using my homebrowed OS that's just very few modifications on top of AOSP). Many systems would not allow signature spoofing when installing microG as a user app. While signature spoofing might be restricted to system apps on systems that come with microG, that doesn't mean it needs to be. DivestOS for example supports signature spoofing for microG running as a user app. Signature spoofing does not have an impact on any (security) feature of the OS that are signature specific (like signature shared permission declarations). Signature spoofing only affects apps that ask the OS for the signing certificate of an app - which essentially is only the play services client library, because use of that OS feature is discouraged by Google for being insecure as a security mechanism (it's possible to run race attacks against it) and unsuitable for anything else. Some OS include modified or resigned versions of microG Services. Those obviously have a different signature and can't be upgraded from the original microG package. Otherwise, I would nornally expect both variants to be signed using the same signing key, so that it's easy for users to verify. To prevent users from installing both, we can and probably should just display appropriate messages when the user does so. Reworking the self-check has been on my list for some time already, so this could become part of it. Given what I wrote I think the branding as "microG User Services" is very much misleading. We should come up with another name before publishing this. Something along the lines of "microG Services without Google Play Services compatibility", which would be more descriptive but not a nice name ;) |
I'll use CGAG for services with id com.google.android.gms and OMG to talk about services with id org.microg.gms.
TIL about DivestOS doing it. A user installing OMG when CGAG is already installed should not be an issue since CGAG has always the priority. The main issue is :
Note that the 2nd issue is already there. So. Maybe we should add a dialog to CGAG:
It isn't important if both is installed, CGAG takes the priority.
I know, that's a temporary name :) microG Minus Services ? |
Signature spoofing has no impact here.
|
Sorry, I missed that point, I've edited the previous comment |
d304a7d
to
af11563
Compare
The last commit introduced a function to remember the service used by the application. That way, if I use the embedded core, then the app won't use an external one after OMG/CGAG install. For instance, CCTG won't lose its data. Also, I adds a check to be sure microG/Play services is legit to reduce risks of malicious app branded as another. It assures the service
I think this is important because: if a user doesn't have play services/microG with id com.google.android.gms (big if), a malicious app installed with id com.google.android.gms, branded has another service (a cooking app for instance), may use the FIDO service to get access to some services: PS: I don't think the CI Out Of Memory error is related to this PR, isn't it ? Could it be restarted ? |
Quote:
Isn't this simpler? |
Instead of the resValue package_id ? I've done that because I don't know if that's possible to use it in the activity's xml. |
Yes, for the microG self check it should be the simplest way (it also avoid passing context), for other cases I don't know; I don't have time to try currently. |
In |
You mean the check in function |
The packageId must be shared with a resValue if it used in resource files (eg. https://stackoverflow.com/questions/57074999/get-application-id-in-xml-dynamically) |
af11563
to
07c9829
Compare
I have renamed the services microG Minus Services, this will be less confusing. Feel free to change the name I have also added a dialog on first run to inform the user that this flavor is only compatible with microG libraries, I hope it will reduce users misunderstanding. |
(JFTR, since it was discussed earlier, there is now a major ROM allowing signature spoofing as user app: https://review.lineageos.org/c/LineageOS/android_frameworks_base/+/383573) |
I'm OK to check the microG signature (or Google Play signature) instead of controlling the application name: https://github.com/microg/GmsCore/pull/2188/files#diff-4fe7d2cf47e0e66eec592e3286e77a70323b66a82f5d43bfe7f903623230525dR77 . I've done that because some other project may want to fork microG/reimplement (I've seen one exists). I can change it if you want |
@ArchangeGabriel |
But this PR introduces 2 things too:
|
Many ROMs ship a custom microG with a different signature, so a signature check isn't a good thing. |
I don't think this name check is really necessary or a good idea. I would prefer if forks of microG would not call themselves microG (to not confuse users), but this reinforces them to actually have microG in their name. I personally don't think apps taking over the package name is a huge risk as there is a ton of other ways that malware could affect your system if you install apps blindly from untrusted source. But anyway, I'd propose to do at most the following: Doesn't need to be part of this pull request though. |
I know, I was just replying to:
from @p1gp1g, even though @mar-v-in already addressed that with:
I was just wanting to point out that allowing signature spoofing as user app just become suddenly much more common. ;) |
7af7d59
to
b399e09
Compare
I'm OK with that. I've set a signature check, tested with Google Play, if someone can test it with microG. I've started to look into the user confirmation when the signature doesn't match, it introduces 2 main changes:
I think the user confirmation can fit another PR, but I need to know what's your way to deal with those 2 points :) |
Move default config out of flavors
29e662f
to
0d911b5
Compare
0d911b5
to
ffb5815
Compare
Gentle ping for the review @mar-v-in |
Sorry @p1gp1g, I keep moving this to the next milestone. Testing this is a little more involved, so I haven't managed to finish it yet and I don't want to block the release any longer. I'll do my best to finally do this in the next weeks |
Is it possible to help testing it ? I really wish to use FIDO on my phone 🥲 The only important change is in MultiConnectionKeeper |
My plan was to hit the merge button right after the 0.3.3 release (which is due to happen in the next days), so I will force myself to test it while on master. 0.3.4 is expected to happen in October, so it won't be too long. |
Great to hear ! Let me know if you need anything (I'm in the matrix room too) |
Hi Why limited? At the moment, this microg variant provides relatively identical opportunities for applications. |
It is limited as it only works with applications using the microg libraries. Also, some features will not work, because they require system rights. For example the capability to add an application in power-saving whitelist:
For this exact feature, we may check if the OS supports GMSCompatibility (like GraphenOS and DivestOS). They add this service to all application using firebase-messaging: https://github.com/GrapheneOS/platform_frameworks_base/blob/4e0f5bc2fab938de0433b19a0c4eb869a60beccd/core/java/com/android/internal/gmscompat/client/GmsCompatClientService.java#L34. It is possible to bind with foreground priority to this service for some seconds, it will achieve the same thing than whitelisting the app |
Following discussion on #2183 (which may be closed ? Superseded by this one)
@mar-v-in @ale5000-git
I have tested, and org.microg.gms can't be installed on a system with com.google.android.gms (Google or microG) because of duplicate permission.
I have used the dimension 'target' for the user flavor, I think that's the one to use.