Android 中大数据安全存放在哪里
我必须存储大量必须从网络服务器下载的图像。图像的大小可能为 80Mb。所以我想要一个指导来存储它们,无论是在内部还是外部存储中。两者都给我带来了一些问题。众所周知,内部存储非常有限,但外部存储的问题是用户可以访问图像。我不希望我的应用程序图像暴露给用户并被更改或删除。那么有没有其他选择或者有什么技术可以安全地将数据放入外部存储中呢?
I have to store a lot of images that have to be downloaded from the web server. The size of the images might be 80Mb. So I want a guidance where to store them, whether in internal or external storage. Both create some problems for me. Internal storage is as every one knows is very limited but the problem with external storage is that images can be accessed by user. I don't wanna my application images to be exposed to user and changed or deleted. So is there any alternative or is there any technique to safely put data into external storage?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
不幸的是,外部存储具有 FAT 文件系统,不支持访问限制。而且您根本不能在内存中存储如此大的数据块(否则用户不会喜欢您,温和地说)。
因此,唯一的方法是使用外部存储。如果您需要一些保护,那么您可以加密/解密数据。或者只是混淆数据,例如更改文件扩展名,或在每个文件的开头添加 10 个字节。混淆在资源方面更有效,但受到的保护却少得多。尽管仍然可以从您的应用程序中提取加密密钥,因此这两种方法都有其流程。
Unfortunately no, external storage has FAT file system, which does not support access restriction. And you simply must not store such large chunks of data in internal memory (or otherwise users will not like you, to put it mildly).
So the only way to go, is to use external storage. If you need some protection, then you may either encrypt/decrypt data. Or just obfuscate data, like changing file extensions, or adding 10 bytes at the beginning of each file. Obfuscation is more efficient resource-wise, but much less protected. Though encryption key can still be extracted from your application, so both of this approaches have their flows.
我建议将它们存储在外部存储中。如果您不希望用户能够读取它,请使用加密来保护它。我认为向用户强加大数据是一个坏主意。如果用户想要删除它,您不应该阻止它。如果图片已被删除,也许可以考虑从网上重新下载图片的可能性。
I would advice to store them in the external storage. If you don't want the user to be able to read it, protect it with an encryption. I think it's a bad idea to impose large data to the user. If the user wants to remove it, you shouldn't want to prevent it. Perhaps consider the possibility of re-download the pictures from the web if it has been deleted.
对文件内容使用加密:
我在 http://www.androidsnippets.com/encryptdecrypt 上找到了漂亮且轻量级的示例代码-字符串
Use encryption for file content:
i found nice and lightweight sample code on http://www.androidsnippets.com/encryptdecrypt-strings
我建议保存到外部。不建议阻止用户删除其数据。用户也可以格式化 SD 卡以将其删除。所以你无法阻止用户。你可以向他隐瞒。只需在文件夹名称前添加一个点即可将其隐藏。
I recommend saving to external. Preventing the user from deleting his data is not recommended. Also user can format the sdcard to delete it. so you cannot stop the user. You can hide it from him. Just prefix a dot to the folder name to make it hidden.
如果您使用的是 Android 2.3,则 OBB 是您的选择。
http://developer.android.com/reference/android/os/存储/StorageManager.html
有关的
Android开发网站中的OBB(不透明二进制Blob)是什么?< /a>
If you are using Android 2.3, OBB is your choice.
http://developer.android.com/reference/android/os/storage/StorageManager.html
Related
What is OBB(Opaque Binary Blob) in Android develop site?