Question

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)?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top