문제

I want to, in my Android app, allow the user to set a countersign - a password of sorts, but one that is not used to log on to the app but possibly at some other point remotely. A Broadcast Receiver would watch/listen for it, and if it appeared, respond appropriately.

This would (potentially) be used by the owner of the device remotely (from another device).

However, if the person who currently had the device knew about this feature, he may be able to delete the file on which the password is stored or delete the setting that holds the value (or change it).

Is there a way to programmatically write a file or set a setting that can neither be changed or deleted, at least not without knowing the value (which will be encrypted)?

도움이 되었습니까?

해결책

For ordinary users, put the file on internal storage (e.g., getFilesDir()). They have no access to those files.

For users of rooted devices, there is no way to prevent them from deleting a file.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top