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.
@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.

@fynngodau
If the existing option doesn't apply, I think we should add a new one, since anything that causes contact with a remote server (and thus potentially reduces privacy) should be able to be disabled by the user.

@mar-v-in mar-v-in modified the milestones: 0.3.5, 0.3.6 Nov 12, 2024
@mar-v-in mar-v-in modified the milestones: 0.3.6, 0.3.7 Dec 18, 2024
@mar-v-in
Copy link
Member

The PR is getting huge and there are still some issues with split install (can cause repeated downloads resulting in a lot of data usage). To get 0.3.6 out before Christmas, I moved this to 0.3.7. I'll see if we can split this up again and make sure that all the good code can land in 0.3.7 in January.

@ale5000-git
Copy link
Member

Split Install Service is also used outside "work app store", without it some apps may not be able to download the necessary components so I think it should have priority in my opinion.

Why not split it (the rewritten one) in a separate PR so it can be merged in less time?

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