DLSTAGER on JoyaTouch Android 7 and OWN Command

Hi.

I am using DLSTAGER on Android 7 Joya Touch A6 for staging porpouse.
I would like to set my App as DEVICE OWNER so I use the OWN command.
The process works and, at the end, I see my app in DEVICE OWNER mode:

The problem is when I try to check if the app is really in device owner mode with this code:

        `boolean isDeviceOwner = devicePolicyManager.isDeviceOwnerApp(packageName);`

It returns FALSE…

If I check with:

        `boolean isProfileOwner = devicePolicyManager.isProfileOwnerApp(packageName);`

it returns TRUE…

So, it seems that OWN command (that is not documented in https://datalogic.github.io/scan2deploy/android-schema/#scripting ) does not set the app as DEVICE OWNER but in PROFILE OWNER.

This is a problem because some functionalities (like install other apps silently…) does not work.

If I set the DEVICE OWNER using ADB like this:

adb shell dpm set-device-owner it.yyy.xxx/.broadcastreceiver.AdminReceiver

the code

       ` boolean isDeviceOwner = devicePolicyManager.isDeviceOwnerApp(packageName);`

returns TRUE.

Is it possible to use DLSTAGER SHELL command to send the same “dpm set-device-owner” as a workaround?

There is a way to solve this problem and set an application really in DEVICE OWNER mode using DLSTAGER?

Thanks
Alessandro

Hi Alessandro,

There are not any plans to extend the OWN command to enable DEVICE OWNER mode. You could certainly try to enable DEVICE OWNER mode using the SHELL command as you suggest, but I don’t believe it will work; DL STAGER doesn’t have the same permissions as the adb shell itself does, so the command will likely fail.

You could consider using the AEQR tool (Google " Android Enterprise QR Code Generator") to enroll your app at the “Hi there” page that appears on the device upon factory reset.

Cody

Hi Cody.
The Joya Touch A6 that I use (Android 7) has not the “Hi there” page.

Alessandro