Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.hzy3774:AndroidUn7zip:1.6.0'
}
<dependency>
<groupId>com.github.hzy3774</groupId>
<artifactId>AndroidUn7zip</artifactId>
<version>1.6.0</version>
</dependency>
libraryDependencies += "com.github.hzy3774" % "AndroidUn7zip" % "1.6.0"
:dependencies [[com.github.hzy3774/AndroidUn7zip "1.6.0"]]
A simple library with lzma sdk for 7z extraction.(使用LZMA SDK解压7z压缩包)
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.hzy3774:AndroidP7zip:v1.7.2'
}
dependencies {
implementation 'com.hzy:un7zip:+'
}
android {
...
defaultConfig {
...
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
}
}
}
boolean extractFile(filePath, outPath, callback);
boolean extractAsset(assetManager, fileName, outPath, callback);
String getLzmaVersion();
If you are using ProGuard you might need to add the following options:
-keep class com.hzy.lib7z.** { *; }