Search code examples
androidcordovapasswordsunzip

Open a Zip File protected by password Phonegap Android


Ive tried many zip pluggin but none of them has a password parameter. Do you know any cordova plugin that can unzip a password portected .zip Format?


Solution

  • The popular cordova-plugin-zip rely on ZipInputStream to unzip files, but this class do not support decrypting password-protected Zip files.

    An alternative java decrypting library called zip4j exists, but isn't clear if it's compatible with Android. An Android porting of zip4j is available, but isn't present on maven repository so you should add it manually to your project.

    Moreover, seems that somebody has written his custom java class to decrypt zip files.

    Following the source code of the cordova zip plugin for Android, will be very easy for you to write your custom unzip plugin (and I hope that you'll publish it!).

    Edit: see also these interesting answers to a similar question.