fun fileDecryption(encFile: File, decFile: File): Boolean {
if (!encFile.exists()) {
return false
}
if (!decFile.exists()) {
decFile.createNewFile()
}
val fis: InputStream = FileInputStream(encFile) // 输入文件流
val fos: OutputStream = FileOutputStream(decFile) // 输出文件流
var dataOfFile = 0 //文件字节内容
while (fis.read().also { dataOfFile = it } > -1) {
fos.write(dataOfFile xor 0x66 xor 0x99)
}
fis.close()
fos.flush()
fos.close()
return true
}
Android文件解密
最新推荐文章于 2024-07-27 13:31:57 发布