简体   繁体   English

内部公司企业应用中的Android NFC设置和安装

[英]Android NFC Provisioning and installing in house corporate apps

My company wants to distribute tablets to employees for company use only, but wants to set them up with certain permissions, custom applications and a custom launcher. 我的公司希望将平板电脑分发给员工仅供公司使用,但希望使用某些权限,自定义应用程序和自定义启动器对其进行设置。

So I have the basics down as I have an app that will use NFC to provision an new tablet. 因此,我掌握了基础知识,因为我有一个使用NFC来配置新平板电脑的应用程序。 I've looked through the DevicePolicyManager API page and I'm not seeing some things I want to do. 我浏览了DevicePolicyManager API页面,但没有看到我想做的事情。 What I'm not sure on is the following so if people can point me in the right direction that would be great! 我不确定的是以下内容,因此,如果人们可以将我指向正确的方向,那就太好了!

1) can I use this provisioning process to install a custom launcher and make it the default? 1)我可以使用此设置过程来安装自定义启动器并将其设置为默认启动器吗?

2) can I push multiple corporate apps through this process? 2)我可以通过此过程推送多个公司应用程序吗? ie set the EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME property multiple times for all the apps I need installed? 即为我需要安装的所有应用程序多次设置EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME属性? Reading the API it sounds like you only set it once. 读取API听起来像您只设置了一次。

3) Does the apps being send have to be through a URL or can the original tablet be used to initiate the provisioning process have the apps and they are send through the given API somehow? 3)正在发送的应用程序是否必须通过URL进行操作,还是可以使用原始平板电脑来启动供应过程,使这些应用程序以某种方式通过给定的API发送? Right now I am using a URL and have a test app hosted, but if there are other ways that would be great to know. 现在,我正在使用URL并托管了一个测试应用程序,但是如果还有其他方法,那么我将很高兴知道。

4) A more basic questions but does it exactly mean to set an app as the device owner? 4)一个更基本的问题,但这是否意味着将应用程序设置为设备所有者? What should this app be doing in relation to the other corporate apps that will be installed? 与将要安装的其他公司应用程序相比,该应用程序应该做什么? If it's just managing policies then does it ever need to be executed manually or is it always running in a way so policies are set even after a reboot? 如果只是管理策略,那么它是否需要手动执行还是始终以某种方式运行,以便即使在重启后也可以设置策略?

5) if some apps want to be in a kiosk mode when executed until a reboot is the proper way to ask the device owner app to call setLockTaskPackages() with the probably app to kiosk? 5)如果某些应用在执行直到重启之前是否希望处于信息亭模式,是要求设备所有者应用使用可能的信息亭来调用setLockTaskPackages()的正确方法?

I probably have more questions, but this is all I can think of for now. 我可能还有更多问题,但这就是我现在能想到的。 Thanks for any answers. 感谢您的回答。

Yes, you can use NFC to setup your own Device Owner (DO) or Profile Owner (PO) device admin, see: 是的,您可以使用NFC来设置自己的设备所有者(DO)或配置文件所有者(PO)设备管理员,请参阅:

Activate a device owner using NFC on Android Lollipop 在Android Lollipop上使用NFC激活设备所有者

  1. Using NFC, you cannot directly provision a custom launcher, but you can provision a device admin application that downloads and installs a launcher. 使用NFC,您不能直接预配置自定义启动器,但是可以预配置下载并安装启动器的设备管理应用程序。 The device admin application can also use all policies in DevicePolicyManager as well as all standard public APIs to eg install applications, see: 设备管理应用程序还可以使用DevicePolicyManager中的所有策略以及所有标准的公共API来安装应用程序,例如:

Install Application programmatically on Android 在Android上以编程方式安装应用程序

  1. No, there can only be one DO or PO in the device. 不,设备中只能有一个DO或PO。 The can however be multiple device admin applications that are neither DO or PO. 但是,可以是既不是DO也不是PO的多个设备管理应用程序。

  2. You can either send an URL or give a package name of an already installed application. 您可以发送URL或提供已经安装的应用程序的程序包名称。

  3. Policies set by the device admin are stored by DevicePolicyManager in an xml file. 设备管理员设置的策略由DevicePolicyManager存储在xml文件中。 The policies are preserved during re-boot. 在重新引导期间将保留策略。

  4. Yes, the device admin can use the setLockTaskPackages() to enable kiosk mode of an application. 是的,设备管理员可以使用setLockTaskPackages()启用应用程序的信息亭模式。

Hope this helps. 希望这可以帮助。

/Marek Pola, Sony Mobile. / Marek Pola,索尼移动。

Most of the questions have already been answered by Marek. Marek已回答了大多数问题。 I hope you figured out that you can silently install an APK under certain circumstances. 希望您知道在某些情况下可以静默安装APK。

An example is shown here: https://github.com/wso2/product-emm/blob/master/modules/mobile-agents/android/system-service/app/src/main/java/org/wso2/emm/system/service/utils/AppUtils.java 此处显示了一个示例: https : //github.com/wso2/product-emm/blob/master/modules/mobile-agents/android/system-service/app/src/main/java/org/wso2/emm/系统/服务/utils/AppUtils.java

Basically you simply invoke the PackageManagers installPackage Method through reflection - and when the app that does that has the required rights to do so (depends on android version, user the app is running as, signature of the app, etc), it will be performed in the background. 基本上,您只需通过反射调用PackageManagers installPackage方法-且具有相应权限的应用程序具有这样做的权限(取决于android版本,运行该应用程序的用户,该应用程序的签名等),它将被执行在后台。

I know it work(ed) for system-apps / signed apps. 我知道它适用于系统应用程序/已签名的应用程序。 And as the example above is from an EMM/MDM solution I assume you can invoke this when you're the DO/PO. 就像上面的示例来自EMM / MDM解决方案一样,我假设您是DO / PO时可以调用此方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM