lukaspieper / Gcam-Services-Provider

App faking only the absolute necessary Apis to use Gcam without Play Services
MIT License
592 stars 27 forks source link

Unable to install app-photos-debug.apk -> INSTALL_FAILED_CONFLICTING_PROVIDER #60

Closed morpheux74 closed 2 years ago

morpheux74 commented 2 years ago

Describe the bug

I get Failure [INSTALL_FAILED_CONFLICTING_PROVIDER: Scanning Failed.: Can't install because provider name com.google.android.gsf.gservices (in package com.google.android.apps.photos) is already used by com.google.android.gsf] when trying to install app-photo-debug.apk via the adb command : adb shell pm install --force-queryable /data/local/tmp/app-photos-debug.apk

To Reproduce

Steps to reproduce the behavior:

Smartphone

Device: Pixel 3a OS/ROM: GrapheneOS 11 (SP1A.211105.002.2021111414) Gcam-Services-Provider version: 1.4

Additional context

There is Google Play Services installed on a Sandbox (another user profile), but not on the user profile I'm trying to install app-photo-debug.apk

lukaspieper commented 2 years ago

Hi,

please update this issue to match the issue template and provide more information about your use case.

Thanks!

Gladox114 commented 2 years ago

Got exactly the same Error on Pixel 5 with Graphene OS. It's conflicting with the sandboxed Google Play services. But they should be sandboxed. Why do they conflict on different workprofiles?

I am using Insular to Sandbox them.

Gladox114 commented 2 years ago

The response of strcat was to just use Google Play Services on your main Profile because Graphene OS sandboxes every app.

I just installed Google Play Services on my main Profile and restricted Network and Sensor access. It shouldn't be able to do any harm I think. So there is no need to fake it.

So just install com.google.android.gsf and restrict everything to it to use Gcam.

Edit: you also need to reinstall Gcam again (in my case) to make it work.

lukaspieper commented 2 years ago

Saw the discussion on Matrix and just want to comment on that here.

Gcam-Services-Provider uses official app IDs that don't belong to them That's how it works You're trying to install two apps with the same app ID Those will conflict with each other because they're not signed the same

My app (the basic variant) has not been using Google's ApplicationId for a couple of versions. The variant with gallery support, on the other hand, must use the ApplicationId from Google Photos. So both do not use com.google.android.gsf as ApplicationId.

However, both variants of the app register a provider with the id com.google.android.gsf.gservices. This provider is of course included in the app com.google.android.gsf and that is why the installation does not work, because there can never be two providers with the same ID. This therefore has nothing to do with signing (except when using Google Photos).

But they should be sandboxed. Why do they conflict on different workprofiles?

This has already been answered perfectly by Daniel. Here is a quote:

when you install an app in any user / work profile, it installs the apk globally and enforces key pinning / downgrade protection based on the currently installed one if you update the app in any profile, it updates it globally, you don't have to update it in each it doesn't keep a separate copy of the apk for each profile where an app is installed and they don't need to be separately updated, and the key pinning / downgrade protection is enforced across all

So why do I continue to maintain this app, even though I use GrapheneOS myself and could simply use the app com.google.android.gsf? GSF not only provides the necessary interfaces to get Google Camera working, but also takes care of other things. These additional interfaces, which do not exist in my app, can have (side) effects on other apps. Providing only the bare essentials has always been a core feature of this project. Before I put this app together, you could get Gcam to work with microg (of course also in a sandbox and without privileges like any app), but there were a lot of side effects.

By the way, questions similar to these have already been answered in previous issues. This is not a bug in my app, but a reasonable restriction of the OS.

morpheux74 commented 2 years ago

There's something I can hardly understand : If you install play services on main profile, don't log in, and restrict every privilege including Network, where would be the security issue ? What is the value-added of Gcam-Services-Provider then ?

Anyway, thanks @lukaspieper, too bad I can't use your solution, thank you anyway for your time and your involvement in the community !

lukaspieper commented 2 years ago

If you install play services on main profile, don't log in, and restrict every privilege including Network, where would be the security issue ? What is the value-added of Gcam-Services-Provider then ?

I have not used the word security at all so far, for the simple reason that there is no security benefit. I have only talked about compatibility and side effects. It may be that GSF causes side effects on other apps.

But now let's talk in practical terms. This app has been around much longer than the GrapheneOS compatibility layer. From today's perspective, I might not have developed this app at all, but more than a year and a half ago there was no good alternative. For all those who use the new compatibility layer in GrapheneOS, my app is no longer usable. For many other users (there are also users without GrapheneOS), my app is still the best way to go. Also, the preview button does not work with GSF and without Google Photos, which is a new feature here since a few versions.

Anyway, thanks @lukaspieper, too bad I can't use your solution, thank you anyway for your time and your involvement in the community !

You're welcome.

e-t-l commented 1 year ago

~lukaspieper Thank you for being so responsive with explaining things in this thread. I'm new to Graphene and trying to follow: Is it possible to use the Photos version of this app on Graphene? I get an error that it cannot install "due to unknown error", even if I've completely uninstalled Graphene's play store/services/framework apps. My main interest is to get gcam's Photos shortcut to work. Sorry if you already answered this and I missed it, but is this possible?~

Nevermind, I found the Calyx Photos Preview app!

lukaspieper commented 1 year ago

Nevermind, I found the Calyx Photos Preview app!

Also you found a suitable solution let me answer one or two things (for future readers).

Is it possible to use the Photos version of this app on Graphene?

Yes absolutely. The compatibility restrictions of the basic version apply plus the fact that you cannot have Google Photos installed.

I get an error that it cannot install "due to unknown error", even if I've completely uninstalled Graphene's play store/services/framework apps.

There are technical solutions to get the real cause of the issue. For the average user that error messages would not be too advanced. As I had this a few days back I might need to consider documenting the steps somewhere.