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

Work app store #2553

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open

Conversation

fynngodau
Copy link
Contributor

@fynngodau fynngodau commented Sep 22, 2024

Supersedes and contains #2500. Supersedes and contains #2521.

Allows users to download apps to their work profile using the special vending component "Work app store". This component is disabled, and enabled only when a work profile is added (which in turn can only be done by a device or profile admin).

Yet to do:

  • rewrite download code for components (Implement SplitInstallService #2500 (comment))
    • don't allocate RAM for the entire download
    • download directly to installer session
  • add meaningful progress information
    • to store app
    • while downloading in the background through store app
    • while splitinstalling
  • determine and verify meaning of policy field in /getEnterpriseClientPolicy
  • test additional dpc services
  • show Work app store only after adding work account
  • automatic dependency installation (i.e. installing Google Chrome), see https://gitlab.com/AuroraOSS/AuroraStore/-/issues/346)
  • acquire user consent before provisioning work account
  • automatically install / remove apps on demand of dpc controller

Current screenshot:

Screenshot_1727017306

DaVinci9196 and others added 30 commits August 19, 2024 19:22
Verify that work accounts are only added by device owners or profile
owners.

For instance, Microsoft Intune will create a work profile (moving itself
to the work profile in the process) before using the work account servce
to create a work account, so at that point it will already be profile
owner. Apps that are not the profile owner will subsequently not be able
to disable the work account authenticator or remove the work account.
The personal account would not have an owner and thus no application
could enable the work account provider there.
@ale5000-git
Copy link
Member

@fynngodau
Can it help with Shelter? https://f-droid.org/it/packages/net.typeblog.shelter/

@fynngodau
Copy link
Contributor Author

@ale5000-git No. This PR adds support for Device Policy Controller apps that want to register a Work google account. See #2521.

@ale5000-git
Copy link
Member

Shelter use a work profile, and I remember it was failing on my device but I'm not sure if the issue is with microG or with the ROM.

@mar-v-in mar-v-in added this to the 0.3.5 milestone Sep 24, 2024
Allows downloading large applications
* reduces temporary storage usage
* speeds up installation by a little bit
Storage leaks can still happen if session commits have errors (for
instance, because the device was shutdown during installation), as those
sessions can still be reopened and retried according to docs. However,
we may expect all dangling sessions to be cleared after a certain
timespan in the magnitude of a day.
@DaVinci9196
Copy link
Contributor

@fynngodau Can the download and notification process of game sub-packages be incorporated into this project? The corresponding functions have been implemented in #2506.

@fynngodau
Copy link
Contributor Author

@DaVinci9196 That would be beneficial, though I will not incorporate another PR into this one as it is already quite large.

Auth files are now moved to `play-services-base-core` so they can be
accessed by other the workaccount module.
Purchasing before downloading seems to be necessary in at least some
cases for work profiles as well.
Support unexpected scenarios spotted in the wild on a best-effort basis:

* Enterprise policies with apps missing policy fields
* App not downloading due to not being purchased
@fynngodau fynngodau marked this pull request as ready for review October 19, 2024 13:34
Comment on lines 103 to 114
// Purchase app (only needs to be done once, in theory)
val parameters = mapOf(
"ot" to "1",
"doc" to app.packageName,
"vc" to app.versionCode.toString()
)
client.post(
url = URL_PURCHASE,
headers = buildRequestHeaders(auth!!.authToken, auth!!.gsfId.toLong(16)),
params = parameters,
adapter = GoogleApiResponse.ADAPTER
)
Copy link
Member

Choose a reason for hiding this comment

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

@fynngodau
I don't know the code enough but does it check the microG option before purchase?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That wouldn't make sense to me, as this is neither in-app billing nor during an app license check.

Copy link
Member

Choose a reason for hiding this comment

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

I mean the option: Auto purchase free apps

Copy link
Member

Choose a reason for hiding this comment

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

@fynngodau
It can also be a new option but it shouldn't automatically purchase apps (even if free) if not configured in microG settings.

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.

5 participants