1

I am working on a google-glass project, where i have to install/update an app programmatically, in my Research i have following complication:

  1. Getting System Dialog actions, to perform click programmatically
  2. In order to install programmatically, the intent leads to System Dialog for user permission, but its not possible to stimulate the action of System Dialog programmatically. This solution is no possible link

  3. Using EMM Solution (WSO2 IOT)
  4. I used WSO2-IOT, but since there is no device policy manager available for google-glass, so even installing the agent apk wont help, as i can not avail any service provided by the EMM (WSO2 IOT), (to install or update my app)

  5. Getting System Privileges without Root
  6. In order to use the following permissions:
    • <uses-permission android:name="android.permission.INSTALL_PACKAGES"/>
    • <uses-permission android:name="android.permission.DELETE_PACKAGES"/>
    My app would require System Privileges, to silently install/delete/update the app.

According to my knowledge and research so far the only current solution is the third solution, that is to get the System Privileges. In order to get it, i also tried Sigined the APK with the system certificate.
Still i get the error:
java.lang.SecurityException: Neither user 10056 nor current process has android.permission.INSTALL_PACKAGES.
Also i have tried adding the android:sharedUserId="android.uid.system to the manifest as described here

So far there is no success with achieving it. I would like to know how can i achieve installing an app silently in the background, with out rooting the device.

Any suggetions that will help will highly be appretiated.

Thank you.

Community
  • 1
  • 1
asadnwfp
  • 733
  • 6
  • 10

1 Answers1

2

When you need to install/update an app in the device, you have to trigger the Package Manager with the relevant details. But for triggering the Package Manager you must have the above permissions (android.permission.INSTALL_PACKAGES & android.permission.DELETE_PACKAGES) thus the device admin privileges. As you said, it is impossible to automate actions for System Dialog which is prompted for getting admin privileges.

The Device Owner concept is also available on if there exists the device policy manager. Therefore you will have to find an alternative.

I can provide you a light-weight version of an agent which successfully enroll with the IoT server without any hassle in your google-glass. But I'm afraid it is not possible to do any tasks that will need device policy manager from it. Please find the source here: https://github.com/milanperera/android-glass-agent

PasinduJay
  • 487
  • 5
  • 17
  • Thankyou, i agree to you. There is no DevicePolicyManager and also there is no PlayServices available in the glass. i have't encoutered with the DeviceOwner concept yet, but i will look into that. – asadnwfp Sep 07 '17 at 06:53