如何限制用户从Android设备中的文件浏览器查看/访问缓存的文件? [英] How to restrict user from viewing/accessing the cached files from file explorer in an Android Device?

查看:262
本文介绍了如何限制用户从Android设备中的文件浏览器查看/访问缓存的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的要求是将文件安全地缓存在android内部/外部存储中,在该内部/外部存储中,除我的应用以外的其他应用均不应查看/访问我存储的文档。

My requirement is to cache the files securely in android internal/external storage, where apps other than my app should not view/access the documents I store.

当前实现:

当前,该应用程序使用 context.getExternalCacheDir()作为基本目录,并带有各自的文件夹结构缓存文件。这里的问题是,任何用户都可以使用某些File Explorer应用程序浏览路径来查看存储的文件。

Currently, the app uses context.getExternalCacheDir() as a base directory and followed by respective folder structure to cache files. The problem here is, any user can view the files stored by just navigating through the path using some File Explorer apps.

我们可以使用上下文。 getCacheDir()或文件目录
使用它存在局限性,因为它具有较小的空间,并且平台可能需要空间来进行其他操作时会自动删除文件。

We can use context.getCacheDir() or file directory, There are limitations in using it, as it has less space and the platform might automatically delete files when it wants space for other operations.

必需的实现:
加密/解密是一种方法,请建议其他可能的方法来安全地缓存文件,以使用户无法使用其他外部应用程序查看/访问。 / p>

Required Implementation: Encryption/decryption would be one way yet, please suggest other possible ways to cache the files securely, so that users cannot view/access using other external applications.

推荐答案


,因为其空间较小

as it has less space

对于过去8年中创建的大多数Android设备而言,情况并非如此。

That is not true for most Android devices created in the last 8 years.


平台需要空间进行其他操作时可能会自动删除文件

the platform might automatically delete files when it wants space for other operations

getExternalCacheDir()也是如此。


请建议其他可能的方式来安全地缓存文件,以使用户无法使用其他外部应用程序查看/访问

please suggest other possible ways to cache the files securely, so that user cannot view/access using other external application

使用 getFilesDir()

这篇关于如何限制用户从Android设备中的文件浏览器查看/访问缓存的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆