Using Zip4j library give warning error in play console how to resolve?

大兔子大兔子 提交于 2020-03-03 07:40:28

问题


I used zip4j library for unzipping files to internal app folder (i.e. getApplicationInfo().dataDir + "/databases") and the App is published on play store, console give warring of "Fixing a Zip Path Traversal Vulnerability In Android"

https://support.google.com/faqs/answer/9294009

How to resolve this issue or any other libs for extracting unzip the password-protected zip file. thanks

here code for extracting password-protected zip file.

   try {
            net.lingala.zip4j.core.ZipFile zipFile = new net.lingala.zip4j.core.ZipFile(zipFilePath);
            if (zipFile.isEncrypted())
                zipFile.setPassword(pass.toCharArray());
            File des = new File(unzipAtLocation);
            boolean isCreated = true;
            if (!des.exists())
                isCreated = des.mkdirs();
            if (isCreated)
                zipFile.extractAll(unzipAtLocation);
        } catch (Exception e) {
            Log.e("Unzip zip", "Unzip exception", e);
        }

回答1:


This issue has been fixed in version 2.3.1 of Zip4j.

Anyone having the same problem should upgrade the version of the library to 2.3.1 and above.

Source.



来源:https://stackoverflow.com/questions/59879078/using-zip4j-library-give-warning-error-in-play-console-how-to-resolve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!