Android 中大数据安全存放在哪里

发布于 2024-11-29 17:45:59 字数 174 浏览 1 评论 0原文

我必须存储大量必须从网络服务器下载的图像。图像的大小可能为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

心头的小情儿 2024-12-06 17:45:59

不幸的是,外部存储具有 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.

小帐篷 2024-12-06 17:45:59

我建议将它们存储在外部存储中。如果您不希望用户能够读取它,请使用加密来保护它。我认为向用户强加大数据是一个坏主意。如果用户想要删除它,您不应该阻止它。如果图片已被删除,也许可以考虑从网上重新下载图片的可能性。

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.

忆悲凉 2024-12-06 17:45:59

Use encryption for file content:

i found nice and lightweight sample code on http://www.androidsnippets.com/encryptdecrypt-strings

青衫儰鉨ミ守葔 2024-12-06 17:45:59

我建议保存到外部。不建议阻止用户删除其数据。用户也可以格式化 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.

得不到的就毁灭 2024-12-06 17:45:59

如果您使用的是 Android 2.3,则 OBB 是您的选择。

http://developer.android.com/reference/android/os/存储/StorageManager.html

OBB 包含一个文件系统,该文件系统可能在磁盘上加密并根据应用程序的需要安装。 OBB 是提供大量二进制资产而不将其打包到 APK 中的好方法,因为它们的大小可能有数 GB。但是,由于它们的大小,它们很可能存储在所有程序都可以访问的共享存储池中。系统不保证 OBB 文件本身的安全性:如果任何程序修改 OBB,则无法保证从该 OBB 读取会产生预期的输出。

有关的
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

OBBs contain a filesystem that maybe be encrypted on disk and mounted on-demand from an application. OBBs are a good way of providing large amounts of binary assets without packaging them into APKs as they may be multiple gigabytes in size. However, due to their size, they're most likely stored in a shared storage pool accessible from all programs. The system does not guarantee the security of the OBB file itself: if any program modifies the OBB, there is no guarantee that a read from that OBB will produce the expected output.

Related
What is OBB(Opaque Binary Blob) in Android develop site?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文