Android zip4j:从加密文件获取流是否会创建一个临时的未加密暂存区域?

Android zip4j:从加密文件获取流是否会创建一个临时的未加密暂存区域?,android,encryption,zip4j,Android,Encryption,Zip4j,我有以下代码在Android上使用zip4j读取加密的zip文件。我不提供临时文件。zip4j是否创建用于解密的临时文件?或者zip标准允许动态解密,因此不会将加密数据临时写入存储 ZipFile table = null; try { table = new ZipFile("/sdcard/file.zip"); if( table.isEncrypted() ){ table.setPassword("password");

我有以下代码在Android上使用zip4j读取加密的zip文件。我不提供临时文件。zip4j是否创建用于解密的临时文件?或者zip标准允许动态解密,因此不会将加密数据临时写入存储

ZipFile table = null;
    try {
        table = new ZipFile("/sdcard/file.zip");
        if( table.isEncrypted() ){
            table.setPassword("password");
        }
    } catch (Exception e) {
        // if can't be opened then return null
        e.printStackTrace();
        return;
    }
    InputStream in = null;
    try {

        FileHeader entry = table.getFileHeader("file.txt");

        in = table.getInputStream(entry);
             ...

这是来自zip4j的源代码

public ZipInputStream getInputStream() throws ZipException {
    if (fileHeader == null) {
        throw new ZipException("file header is null, cannot get inputstream");
    }

    RandomAccessFile raf = null;
    try {
        raf = createFileHandler(InternalZipConstants.READ_MODE);
        String errMsg = "local header and file header do not match";
        //checkSplitFile();

        if (!checkLocalHeader())
            throw new ZipException(errMsg);

        init(raf);
        ...
}
private RandomAccessFile createFileHandler(String mode) throws ZipException {
    if (this.zipModel == null || !Zip4jUtil.isStringNotNullAndNotEmpty(this.zipModel.getZipFile())) {
        throw new ZipException("input parameter is null in getFilePointer");
    }

    try {
        RandomAccessFile raf = null;
        if (zipModel.isSplitArchive()) {
            raf = checkSplitFile();
        } else {
            raf = new RandomAccessFile(new File(this.zipModel.getZipFile()), mode);
        }
        return raf;
    } catch (FileNotFoundException e) {
        throw new ZipException(e);
    } catch (Exception e) {
        throw new ZipException(e);
    }
}
我相信
raf=newrandomAccessFile(新文件(this.zipModel.getZipFile()),mode)行表示它确实在加密zip文件路径的子目录下生成一个解密文件


我不知道你是否能在飞行中解压(可能不能)。如果你不希望人们查看解密文件,考虑将ZIP文件存储在应用程序的受保护的内部存储空间中,而不是SD卡。p> 作为Zip4j的作者,我可以向您保证Zip4j不会创建任何用于解密的临时文件

Zip4j将解密内存中的数据,并且不会将加密数据写入任何临时文件。Zip格式规范允许对AES和标准Zip加密进行动态或内存解密