Since Android SDK 3.0, users can choose to encrypt their entire disk which basically amounts to encrypting /data on a given device. The option is presented in the phone preferences so I assumed it would be available for read by applications. There's this DevicePolicyManager that looks like it has the information but am I to understand that an app must implement a receiver like here? This doesn't really work for me since I don't want to explicitly manage the user's device and certainly don't want them to have to agree to such a thing for them to install my application. Is there really not just some flag I can read somewhere to see if it's encrypted?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There's this DevicePolicyManager that looks like it has the information but am I to understand that an app must implement a receiver like here?
You could try using getSystemService()
to get a DevicePolicyManager
, then call getStorageEncryptionStatus()
, and see if it works.