hzy3774/AndroidUn7zip


A simple android ndk library used to simply extract lzma 7z files. https://github.com/hzy3774/AndroidUn7zip

Download


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"]]
        
        

Readme


AndroidUn7zip(安卓7zip解压)

A simple library with lzma sdk for 7z extraction.(使用LZMA SDK解压7z压缩包)

auc api

Introduction

  • 官方网站:https://www.7-zip.org/sdk.html
  • 7z is the new archive format, providing high compression ratio.

Begin To Use

  • Add gradle dependencie:
repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
   implementation 'com.github.hzy3774:AndroidP7zip:v1.7.2'
}
dependencies {
    implementation 'com.hzy:un7zip:+'
}
  • Or just download the aar here
  • If you want to add some abi filters
android {
    ...
    defaultConfig {
        ...
        ndk {
            abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
         }
    }
}

Java API:

boolean extractFile(filePath, outPath, callback);
boolean extractAsset(assetManager, fileName, outPath, callback);
String getLzmaVersion();

ProGuard

If you are using ProGuard you might need to add the following options:

-keep class com.hzy.lib7z.** { *; }

Fetures

  • easily extract 7z from file
  • directly extract 7z from assets
  • unicode file names is available
  • add extract callbacks

Screenshot

image

Thanks To

  • danhantao offered X86 compiled(修复了X86编译问题)
  • ransj offered the way to extract 7z file from assets directly(添加了直接从assets解压的功能)

About Me

Contact To Me

image

Others

  • 想捐助我喝杯热水(¥0.01起捐)</br> donate