我需要什么:
对于 Android:我需要永久保存数据,但也能够编辑(显然是读取)数据。用户不应访问此数据 - 它可以包含诸如高分之类的内容,用户不得对其进行编辑。
我的问题
我会(并且已经)使用Internal Storage
,但我不确定它到底有多安全。 Here它说:
You can save files directly on the device's internal storage. By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user). When the user uninstalls your application, these files are removed.
这基本上正是我所需要的 - 但它真的安全吗? 是否可以通过 root 设备访问(也许只能读取?)? (或任何其他方式?)
SQLite 数据库或共享内存怎么样?它们是否更适合保存(少量)数据?
此外:通常建议在内部以不同的方式处理“ secret ”数据吗? (比如不(在内部)将其保存为整数/字符串,而是某种加密形式)
最佳答案
Can it be accessed (maybe only read?) through a rooted device?
可以读写。
it can contain things like a highscore, which must not be edited by the user.
这是用户的数据,不是你的。它是用户的设备,而不是你的。因此,用户可以根据需要编辑该数据,只要他们的数据存储在他们的设备上即可。
现在,如果您想防止其他人编辑该数据,那么使用用户提供的密码进行加密是一种合理的措施。对于游戏高分来说,这似乎是不必要的。
否则,如果您不希望他们编辑该数据,请不要将其存储在他们的设备上。
关于java - 内部存储有多安全?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17813662/