gpt4 book ai didi

android - 以编程方式更改在android设备中从未知来源安装apk的权限

转载 作者:太空宇宙 更新时间:2023-11-03 12:37:19 24 4
gpt4 key购买 nike

为了允许或阻止从 SD 卡手动安装 apk 文件,我们勾选/取消勾选“允许从未知来源安装应用程序”复选框。

我们能否通过避免任何用户界面以编程方式做到这一点?

谢谢,

尼拉夫

最佳答案

不,除非您是运营商,否则不会,除非您使用的是贵公司拥有管理员访问权限的企业电话。

这是 Android 安全模型的一部分,因此用户不会因为恶意应用程序而失去对手机的控制权。

以下是执行类似操作所需的实际权限:

<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />

您可以尝试使用这些权限,但是 by design除非您拥有设备的根访问权限,否则它们将无法工作。

Within the device settings, users are able to view permissions for applications they have previously installed. Users can also turn off some functionality globally when they choose, such as disabling GPS, radio, or wi-fi.

In the event that an application attempts to use a protected feature which has not been declared in the application's manifest, the permission failure will typically result in a security exception being thrown back to the application. Protected API permission checks are enforced at the lowest possible level to prevent circumvention.

关于android - 以编程方式更改在android设备中从未知来源安装apk的权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15850345/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com