Open fkirc opened 5 years ago
Thanks for your notice! Can you make a standalone library for that? so I can make a pointer to your project and make this library deprecated.
I believe that it is not worth to create a standalone library. I only created the following two files, everything else is just a copy of the zip4j source code:
https://github.com/fkirc/secure-zip-notes/blob/master/zip4j/build.gradle https://github.com/fkirc/secure-zip-notes/blob/master/zip4j/src/main/AndroidManifest.xml
I use Gradle instead of Maven and I compile it as an "Android library", which is somewhat suboptimal.
Ironically, this repo is not as outdated as you might think. There exists a Zip4J version 2.0.X, but I consider the 2.0.X version as not ready for production usage until my recent issues are resolved: https://github.com/srikanth-lingala/zip4j/issues/
There have been quite a few updates to Zip4j recently (https://github.com/srikanth-lingala/zip4j/releases/tag/v2.1.4) I am very interested in using it, but I need it to work with streams as I am unzipping android data that is on the SD card (and need to use DocumentContract...urgh). Can you update to the most recent version?
I just realized a better way to use zip4j in my android project: reference it as an implementation (duh).
implementation 'net.lingala.zip4j:zip4j:2.1.4'
Make sure you also have mavenCentral added as a repo:
repositories {
mavenCentral()
...
}
@johnml1135: Thanks for the notice! I'll mark this project as deprecated and point to the https://github.com/srikanth-lingala/zip4j project in the README.
Actually, I tried it in my project and it is crashing before it opens up even through it builds and loads fine... I will be investigating more this next week.
Someone created a basic android project: https://github.com/nicolabeghin/zip4jtest - found on zip4j issue 34. It may be the solution we need.
From https://github.com/srikanth-lingala/zip4j:
"And also, Zip4j now supports a minimum of JRE 8, as compared to JRE 5 with 1.x, which obviously will bring some nice features that I can make use of."
Android's support for Java 8 is spotty (https://developer.android.com/studio/write/java8-support) and more work would have to be done to see how they could work together.
To make it easier for the newcomers:
This version of Zip4j is outdated. If you are looking for an easy way to integrate Zip4j into Android, then you can copy the Zip4j module of https://github.com/fkirc/secure-zip-notes into your Android Studio project and add a local gradle dependency.
Alternatively, you can just grab the most recent Zip4j source and write your own gradle file/module.