如何使用android中的java代码从外部存储中删除文件,而不是恢复? [英] How to shred a file from external storage beyond recovery, using java code in android?

查看:137
本文介绍了如何使用android中的java代码从外部存储中删除文件,而不是恢复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用android中的java代码将文件从外部存储器中删除而不是恢复?

How to shred a file from external storage beyond recovery, using java code in android?

推荐答案

安全删除文件通常需要直接访问文件系统和底层存储因为底层存储介质的写入/擦除行为不同(例如,写入HD上的文件与写入基于Flash的介质有很大不同)。



在高清上打开文件,写入随机数据然后删除文件就足够了。



特别是对于基于Flash的媒体,你不需要除非您可以直接访问驱动程序并强制它擦除以前包含该文件的块,否则有任何保证,除非您可以直接访问该块。



如果你不如果有驱动程序访问权限,您可以通过以下步骤尝试强制擦除闪存介质:

Securely deleting files usually requires direct access to the filesystem and underlying storage driver because write/erase behavior is different for the underlying storage medium (e.g. writing to a file on a HD is significantly different from writing to a Flash-based medium).

On a HD it might be sufficient to open the file, write to it random data and then delete the file.

Especially for Flash-based media you don't have any guarantees, when a block is actually erased unless you can directly access the driver and force it to erase the block that previously contained the file.

If you don't have driver access, you can try to force an erase on a flash medium by these steps:
delete the file



标记文件使用的块因为不再使用,

但他们的内容仍在媒体上。即使写入文件也无济于事,因为修改后的块不会就地替换,而是放在介质上的其他地方。


The blocks used by the file are marked as no longer in use,
but their contents is still on the medium. Even writing to the file would not help, as the modified blocks are not replaced in-place, but put elsewhere on the medium.

Create a new file and write to it until the whole medium is filled



当介质填充时,会收集并擦除未使用的块,以便为不断增长的文件提供块。当介质已满时,应删除并覆盖包含已删除文件的块。实际行为取决于驱动程序实现和正在使用的闪存控制器,因此这些步骤可能会强制阻止块,但无法保证。



这种方法的另一个缺点是填充介质所需的时间。


As the medium fills, the unused blocks are collected and erased to make blocks available for the growing file. When the medium is full, the blocks containing the deleted file should be erased and overwritten. The actual behavior is dependent on the driver implementation and the flash controller in use, so these steps are likely to force the block to be overwritten, but there are no guarantees.

The other downside of this approach is the time required to fill the medium.


这篇关于如何使用android中的java代码从外部存储中删除文件,而不是恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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