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

Question: what is this all about? #37

Closed
AndroidDeveloperLB opened this issue Jul 21, 2017 · 7 comments
Closed

Question: what is this all about? #37

AndroidDeveloperLB opened this issue Jul 21, 2017 · 7 comments

Comments

@AndroidDeveloperLB
Copy link

AndroidDeveloperLB commented Jul 21, 2017

  1. Does this sample show how a third party can install APKs and uninstall apps, maybe using the PackageInstaller ?
    If so, how does it work?
  2. Can this work as a normal app, that can be published on the Play Store? If so, how do I, as a user, grant this sample the needed permission via the UI of the OS ? Granting via the "device admin apps" doesn't seem to do anything. It keeps saying "this app is not an admin", even though it is.
  3. If it's not for normal use, what is it for? In which cases can people use this?
@sarog
Copy link

sarog commented Jul 27, 2017

Check this out for more information: https://developers.google.com/android/work/build-dpc

TLDR: Enterprise Mobile Management (EMM) console software + Device Policy Controller (DPC, re: this sample project) allows you to setup and deploy Android devices in the enterprise. You can configure various policies, such as enabling/disabling settings, silently install and update APKs, creating work profile accounts, and lock down devices as you please (make your app "locked" to the screen, aka kiosk-mode).

The DPC is what gets installed on the device and manages everything from the user's (hidden) perspective. It is a service that runs in the background with the highest-level privileges. It's basically a Google "Device Policy" app for non-G Suite (Google Apps) users & devices.

The EMM console is what administrators use to manage device policies remotely. You can, for example, manage APK installations by scheduling it through the EMM console and have the DPC listen and perform your requested actions.

The DPC is normally deployed when a device is first setup (or after a factory reset). Instead of signing in with a Google Account, users/admins can provision a supported device by entering a "AfW" code, e.g. afw#123456 and have it automatically download, install and configure everything. This kind of deployment requires "paperwork" to be filled out with Google (re: joining their EMM Community) but it's not a requirement to use DPC as far as I know.

@AndroidDeveloperLB
Copy link
Author

So in short, this is not for normal third party apps.
Right? I can't just publish an app that has this, and everyone would be able to use it....
I also don't get why it asked for being admin, and it didn't updated to show that it has admin rights.

@tony-mak
Copy link
Contributor

tony-mak commented Aug 1, 2017

You can publish the app with this, however you will need to ask user consent to set your as admin.
You will find two icons after you have installed TestDPC, tap the "set up" one please.

Thanks.

@tony-mak tony-mak closed this as completed Aug 1, 2017
@AndroidDeveloperLB
Copy link
Author

AndroidDeveloperLB commented Aug 1, 2017

You mean app shortcut icons. Found it.
I granted admin rights to the app, yet when I pressed the "set up" it showed a wizard, and after accepting all, it has restarted the OS (OS crashed).
Then going back to "test dpc", still everything is the same. Most items there are disabled, exactly as before going to the "set-up" phase.
Tested on Galaxy S7 with Android 7.0.
I then tried to run the "set-up" again, yet this time it allows me to only exit, with the message "TestDPC isn't currently allowed to be set up as the profile or device owner" :

image

Does it require only admin rights, or more?

Is it possible to have admin rights to be able to install APK files and uninstall apps in the background, using the PackageInstaller.Session API ?
Or maybe I need the set-up phase too?
How come I can't see the UI of the app being updated after granting it admin rights?

@AndroidDeveloperLB
Copy link
Author

Why is it closed? This doesn't work...

@tony-mak
Copy link
Contributor

@AndroidDeveloperLB
After provisioning, you should tap on the TestDPC icon with a badge.

@AndroidDeveloperLB
Copy link
Author

I see. Why does it have a badge ? Why not launch the other, normal icon of the app?
Also, is there a way here to use it for app operations like batch install, batch uninstall, clear data, etc... ?

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

No branches or pull requests

3 participants