如何使文件隐藏在android SD卡中? [英] How to make a file hidden in android sd card?

查看:25
本文介绍了如何使文件隐藏在android SD卡中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建 android 应用程序,其中包含需要在 SD 卡中隐藏(用户无法访问)的数据库.谁能告诉我怎么做?

I am creating android application which contains DB that needs to be hidden(not able to access by the user)in the SD Card. Can anyone tell me how to do this?

推荐答案

存储在 SD 卡上的任何文件都可以被手机上运行的应用程序访问,也可以被安装了 SD 卡的用户访问(当它在手机中时)否则).

Any file stored on the SD card is accessible both by applications running on the phone, and by users who have mounted the SD card (both while it's in the phone and otherwise).

您可以更改文件属性以使其隐藏",但它仍然很容易被找到.没有办法以您描述的方式在像 SD 卡这样的公共分区上创建安全"文件 - 用户将始终能够复制、删除和可能更改文件.

You can change the file properties to make it 'hidden', but it will still be easily found. There is no way to make a file on a public partition like an SD Card 'secure' in the manner you describe - users will always be able to copy, delete, and potentially change the file.

解决问题的最佳方法是研究加密数据库以安全记录的方法.您将无法阻止用户删除或复制文件,但您应该能够让他们难以从中读取数据或修改其内容.

The best solution to your problem is to look into ways to encrypt your database to record it securely. You won't be able to prevent users from deleting or copying the file, but you should be able to make it difficult for them to read data from it or modify its contents.

这篇关于如何使文件隐藏在android SD卡中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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