2

I'm working on a device-owner App that is installed at provision-time on Lollipop with a NFC Tag (or NFC Beam from other device, both are tested and working fine).

This install is working well on my Nexus 6, and I could test some other device-owner apps that can install as well... But when testing this on a LG Leon device (shipped with Android 5.0.1), the NFC beam fails with this error message :

Oops! Couldn't set up your device. Contact your IT department.

It is like if the NdefMessage was malformed... although there is no error because it works well elsewhere, and as I wrote before: it's the exact same issue for other Apps...

My first guess by eliminating issues is that there is something particular on this device (and maybe other LG's?)...

Did anyone encounter this issue on those LG devices ? Is there any trick to make it work there ? Maybe do they need some special EXTRA_PROVISIONING_PARAMETER_... to work ?

Just for information, below is my provisioning code to build the Ndef Message:

Properties p = new Properties();

p.setProperty(
    DevicePolicyManager.EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME,
    "com.myapp");

p.setProperty(
    DevicePolicyManager.EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION,
    "https://www.dropbox.com/s/dfjlsdfkjlkdf/MyApp.apk?dl=1");

p.setProperty(
    DevicePolicyManager.EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM,
    "tn5x7rSwSo6CILlbzBNmkFmfXlk");

ByteArrayOutputStream bos = new ByteArrayOutputStream();
OutputStream out = new ObjectOutputStream(bos);
p.store(out, "");
final byte[] bytes = bos.toByteArray();

NdefMessage msg = new NdefMessage(NdefRecord.createMime(
                DevicePolicyManager.MIME_TYPE_PROVISIONING_NFC, bytes));
return msg;

I tried to change the download package location, http, https just in case it would need https, but no luck... I tried also to send an EXTRA_PROVISIONING_LOCAL_TIME just in case, but no more luck... I also tried the LG developer forum... without any answer!

JBA
  • 2,889
  • 1
  • 21
  • 38
  • any update on your LG devices? – kash Feb 07 '16 at 08:13
  • Sadly i don't have the device for testing anymore... But it would be interesting to know whether they implemented it or not by the time... – JBA Feb 07 '16 at 10:36

2 Answers2

0

A LG tech replied this to me :

Now, H340n doesn't support Android For Work Device Owner applications. We have a update plan to support Device Owner applications after June 15.

Let's wait, and see...

JBA
  • 2,889
  • 1
  • 21
  • 38
0

I had a similar issue with LG devices. ADB method did not work either. Contacted LG but not much response from them. However, I did get it to work by rooting the device. You can find how to do that here.

Community
  • 1
  • 1
kash
  • 830
  • 2
  • 7
  • 19