我看过各种SO posts关于如何在应用程序运行时检查 android 文件系统是否加密。
我要做的是阻止应用程序安装,除非设备已加密。 这可能吗?如果不可能,我认为我唯一能做的就是检查我的主要 Activity (和引导服务)中的加密状态,如果未加密则退出 Activity/关闭服务。
我探索了 App Manifest documentation并且还没有找到这样的东西。
最佳答案
Is this possible?
没有。
If not, I think the only thing I could do is check the encryption status in my main activity (and boot services), and exit the activity / close the service if it's not encrypted.
这是可能的,使用 DevicePolicyManager
和 getStorageEncryptionStatus()
.尽管您可能至少想在您的 Activity 中向用户解释为什么用户不能使用您的应用。
关于android - 要求在安装应用程序之前对设备进行加密,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24757450/