Is it support Android?
Theoretically yes, but I never tried it. You can try ARM jar for ARM-based Android systems.
@borisbrodski , I test the library on Mi Note, android os 4.4.4 and It not work. I test it like this: 1.use those libs sevenzipjbinding.jar sevenzipjbinding-Linux-arm.jar
try {
SevenZip.initSevenZipFromPlatformJAR();
System.out.println("7-Zip-JBinding library was initialized");
} catch (SevenZipNativeInitializationException e) {
e.printStackTrace();
}
and the error log:
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: Error loading SevenZipJBinding native library into JVM: error loading native library 'lib7-Zip-JBinding.so' from a jar-file 'sevenzipjbinding-<Platform>.jar'. [You may also try different SevenZipJBinding initialization methods 'net.sf.sevenzipjbinding.SevenZip.init*()' in order to solve this problem]
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at net.sf.sevenzipjbinding.SevenZip.throwInitException(SevenZip.java:827)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at net.sf.sevenzipjbinding.SevenZip.throwInitException(SevenZip.java:822)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at net.sf.sevenzipjbinding.SevenZip.copyOrSkipLibraries(SevenZip.java:563)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at net.sf.sevenzipjbinding.SevenZip.initSevenZipFromPlatformJARIntern(SevenZip.java:454)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at net.sf.sevenzipjbinding.SevenZip.initSevenZipFromPlatformJAR(SevenZip.java:339)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at com.example.lz.myunrar.MainActivity.test7zipJ(MainActivity.java:64)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at com.example.lz.myunrar.MainActivity.onCreate(MainActivity.java:38)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at android.app.Activity.performCreate(Activity.java:5249)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2165)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at android.app.ActivityThread.access$900(ActivityThread.java:141)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1213)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at android.os.Looper.loop(Looper.java:136)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5072)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at java.lang.reflect.Method.invokeNative(Native Method)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at java.lang.reflect.Method.invoke(Method.java:515)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
12-06 17:50:43.342 32609-32609/com.example.lz.myunrar W/System.err: at dalvik.system.NativeStart.main(Native Method)
Do you have any idea with this?
Look's like we experience this issue: https://code.google.com/p/android/issues/detail?id=10076
#7 [email protected] OK - I now understand android a little better now. I normal java you can locate resources (via the classloader) by bundling them in with the class files and then making a java archive. Android creates the dex from the classes and any resources get thrown out unless explicitly referenced by apkbuilder using '-rf' for the root resource dir and then the resources are saved as a tree at the base of the apk file.
It's a real shame that your documentation doesn't specify this in both ClassLoader and ResourceBundle - it would save the few a lot of time!
Thanks for the pointers ... best, Nick
I will have to rewrite initialization algorithm for Android later.
But for now, could you please try to load the ARM native library manually? Just extract sevenzipjbinding-Linux-arm.jar and put the library into resources directory. Then load it manually like this
System.load(libraryPathAndFileNameOnAndroidDevice);
SevenZip.initLoadedLibraries();
System.out.println("7-Zip-JBinding library was initialized");
@borisbrodski ,I do it like this:
System.load(Environment.getExternalStorageDirectory() + "/Download/lib7-Zip-JBinding.so");
SevenZip.initLoadedLibraries();
System.out.println("7-Zip-JBinding library was initialized");
but it has err:
12-09 16:11:40.834 2853-2853/com.example.lz.myunrar E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.lz.myunrar, PID: 2853
java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH in "lib7-Zip-JBinding.so" (built with --hash-style=gnu?)
at java.lang.Runtime.load(Runtime.java:333)
at java.lang.System.load(System.java:512)
at com.example.lz.myunrar.MainActivity.test7zipJ(MainActivity.java:65)
at com.example.lz.myunrar.MainActivity.onCreate(MainActivity.java:38)
at android.app.Activity.performCreate(Activity.java:5249)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2165)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250)
at android.app.ActivityThread.access$900(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1213)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5072)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)
I tried the same thing .ended up with
FATAL EXCEPTION: main java.lang.UnsatisfiedLinkError: dlopen failed: library "libdl.so.2" not found at java.lang.Runtime.loadLibrary(Runtime.java:372) at java.lang.System.loadLibrary(System.java:1076)
Thank you. I consider Android support very important. But it will need some afford to make it happen.
Any help is appreciated!
Yea ask it anytime
Thank you!
I got the same error (.... java.lang.UnsatisfiedLinkError: dlopen failed: ...) There are some solution?
There is actually a successful port to Android made by seven332: https://github.com/seven332/sevenzipjbinding/tree/migrate-to-15.09-try2
You might give it a try!
(I will encorporate it into the official 7-Zip-JBinding in a while.)
Thanks for the quick response. I need to unpack only - arj. In the link I see tar, zip, 7z ....., but I do not see arj. :( Something missed, or is not there?
7-Zip-JBinding does support ARJ. Check the ArchiveFormat enum here: https://github.com/seven332/sevenzipjbinding/blob/migrate-to-15.09-try2/jbinding-java/src/net/sf/sevenzipjbinding/ArchiveFormat.java
Thanks for your great library. It's very useful for me, but I have a bug with a certain file which I can extract using other apps normally. I get ExtractOperationResult.DATAERROR. I am using seven332's port to android. This is the archive I'm trying to extract. http://www100.zippyshare.com/v/n5VRzhIV/file.html Thanks in advance
Thank You for the report. I'm on vocation right now (with no laptop in sight!). I will be back in two weeks. Please, drop a small reminder message here, if don't get response by the time. Thank you! Cheers,Boris
Gesendet von Yahoo Mail auf Android
Am Mo., 8. Aug. 2016 um 15:43 hat [email protected] Folgendes geschrieben:
Thanks for your great library. It's very useful for me, but I have a bug with a certain file which I can extract it using other apps normally. I get ExtractOperationResult.DATAERROR. I am using seven332's port to android. This is the archive I'm trying to extract.
http://www100.zippyshare.com/v/n5VRzhIV/file.html
Thanks in advance
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Thank you for your quick response. Take your time. I hope you'll enjoy.
@MSDarwish2000 @borisbrodski can you help me with https://github.com/borisbrodski/sevenzipjbinding/issues/52
Hello borisbrodski. Is this project support Android? Hope for your reply!