zip文件的解压可以使用java的zip库,但是没有实现对加密文件的解压功能,这里可以使用zip4j来实现。具体可以参看该文《Android下zip压缩文件加密解密的完美解决方案 http://www.linuxidc.com/Linux/2014-11/109061.htm 》。该文件中没有实现解压进度的功能,这里进行一简单的实现。
Zip4jSp.java
/**
* unzip file to dest dir with password in thread.
*
* @param zipFile
* @param dest
* @param passwd
* @param charset
* null or empty is utf-8
* @param Handler
* handler in thread
* @param isDeleteZipFile
* true:delete zip file.false:not.
* @throws ZipException
*/
public static void Unzip(final File zipFile, String dest, String passwd,
String charset, final Handler handler, final boolean isDeleteZipFile)
throws ZipException {
ZipFile zFile = new ZipFile(zipFile);
if (TextUtils.isEmpty(charset)) {