简体   繁体   English

如何在自助服务终端模式/锁定任务模式下将安装程序包列入白名单?

[英]How to whitelist installer package during kiosk mode/ lock task mode?

I have created an kiosk application it has update functionality for other application within the device but the installer package is blocked.我创建了一个自助服务终端应用程序,它具有设备内其他应用程序的更新功能,但安装程序包被阻止。 How to whitelist installer package?如何将安装程序包列入白名单?

I have tried whitelisting this installer package but it is not working.我曾尝试将此安装程序包列入白名单,但它不起作用。 Maybe I'm missing an additional application to whitelist.也许我错过了一个额外的白名单应用程序。

...//My other whitelisted apps
private static String INSTALLER_PACKAGE = "com.google.android.packageInstaller";
private static String[] APP_PACKAGES = { ..., INSTALLER_PACKAGE};
...
dpm.setLockTaskPackages(cn, active ? APP_PACKAGES : new String[]{});

If you are setting FLAG_ACTIVITY_NEW_TASK flag on the ACTION_INSTALL_PACKAGE intent it will generally tell you "Unpinning is not allowed" when trying to invoke the PackageInstaller to update.如果您在ACTION_INSTALL_PACKAGE意图上设置FLAG_ACTIVITY_NEW_TASK标志,它通常会在尝试调用PackageInstaller进行更新时告诉您“不允许取消固定”。

For instance, in this example (AppCenter)例如,在这个例子中(AppCenter)

Intent intent = new Intent(Intent.ACTION_INSTALL_PACKAGE);
intent.setData(fileUri);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // <-- giving me grief
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);

I have found through my investigations that HockeyApp, Microsoft AppCenter and TestFairy is setting this flag, so I was unable to use their out-of-the-box in-app update solution when pinned (task locked).我通过调查发现 HockeyApp、Microsoft AppCenter 和 TestFairy 正在设置此标志,因此我无法在固定(任务锁定)时使用它们的开箱即用应用内更新解决方案。 I'm also running android:launchMode="singleTask" for what it's worth.我也在运行android:launchMode="singleTask"以获得它的价值。

I was however able to change HockeyApp's library to my liking.但是,我能够根据自己的喜好更改 HockeyApp 的库。 This was my initial inquiry https://github.com/bitstadium/HockeySDK-Android/issues/368这是我最初的询问https://github.com/bitstadium/HockeySDK-Android/issues/368

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

相关问题 当顾客很少来的时候,为 24 小时营业的餐厅制作信息亭的好方法是什么? (唤醒锁、信息亭模式、任务锁...) - What's a good way to make a kiosk for a 24-hour restaurant when few customers come? (wakelock , kiosk mode , task lock...) 有没有办法使用 ADB 命令而不是设备策略管理器将应用程序列入锁定任务模式的白名单? - Is there a way to whitelist apps for lock task mode using ADB commands instead of Device policy manager? 如何在Android 4.4中为信息亭模式锁定android主页按钮,最近的应用程序按钮和后退按钮? - How to lock android home button,recent app button and back button for kiosk mode in android 4.4? 树莓派“信息亭”模式 - Raspberry Pi "Kiosk" mode 如何在 Doze 模式下将应用列入白名单 Android 6.0 - How to WhiteList app in Doze mode Android 6.0 如何锁定JavaFX全屏模式? - How to lock JavaFX fullscreen mode? 在Kiosk模式下运行JavaFX屏幕 - Run JavaFX Screen in Kiosk Mode 使用“kiosk模式”创建Phonegap应用 - Create Phonegap app with “kiosk mode” 如何以KIOSK模式打开基于Java的Web应用程序? - How to open java based web application in a KIOSK mode? 在锁定任务模式下配对新设备 (Android P/10) - Pairing new device in Lock Task Mode (Android P/10)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM