Attaullah
Attaullah

Reputation: 4021

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

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);
        }

Upvotes: 1

Views: 282

Answers (1)

Yogesh Umesh Vaity
Yogesh Umesh Vaity

Reputation: 48309

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.

Upvotes: 1

Related Questions