Please add support for 7-Zip (.7z) archives. Preferably also support encrypted ones.
It can be done with commons-compress...
@wb9688 What do you mean?
Hello,
How do you add common compress to amaze or the android system ?
Thanks.
Best regards
B.
Commons compress is already implemented... Adding 7z to the decompression is not that difficult, see CompressedHelper.
Hello Emmanuel,
Thanks for your job ! That's so great.
So I have to enter all theses commands in adb shell, isn't it ?
Thanks.
Cheers
B.
Edit : I've just try : your script it don't work this way, maybe I have to edit some stuff into it ? ty
barabbas@PepperChuwi:~$ adb shell
adb server is out of date. killing...
* daemon started successfully *
shell@HWPLK:/ $ package com.amaze.filemanager.filesystem.compressed;
/system/bin/sh: package: not found
127|shell@HWPLK:/ $
*
* @author Emmanuel
* on 23/11/2017, at 17:46.
*/
public class CompressedHelper {
public static final String fileExtensionZip = "zip", fileExtensinJar = "127|shell@HWPLK:/ $ import android.content.Context;
/system/bin/sh: import: not found
127|shell@HWPLK:/ $
ilesystem.compressed.extractcontents.helpers.GzipExtractor; <
[...]
To add support for 7zip you must create the Decompressor and Extractor and then add the constructors to getCompressorInstance() and getExtractorInstance() respectively (for that you will need to create the isSevenZip() function in CompressedHelper). Then recompile and run.
@EmmanuelMess maybe you can implement it? It's difficult for someone without the knowledge of java programming.
Not enough time, will see.
I don't kwow why that make you mad ?! That was constructive & polite, it don't need to be moderated (just answer "I can't give you info" or anything else). Don't care about me I'll never ask you anything... Bye
@B4rabbas This is a 7z issue in a file manager, your deleted comment wasn't constructive, it was just asking for tutorials, this is not the place.
If I compile an apk with the compress-commons code and share it there I think it's a good request if the issue is fixed at the end...
However you can moderate this message too when you read it. I'll just read the few info I found here and try to make it with theses in completion of info mined on others forums
Of course it's not emotional reaction/ego trip, if I find a method to compile it I'll share it to, with your help or not (I understand you have a life like anybody else).
A little update about the situation.
For processing 7zip files, commons-compress seems to be the obvious choice, since we had been using it and if you don't want to mess with yet another external library.
I did wrote some POC on my own feature branch (which is a greedy one, I was trying to solve #138 and bring #1222 back), but end up crashing my Oneplus 2 running Slim7 (7.1.2)
2019-03-01 22:42:01.092 32484-32601/? E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.amaze.filemanager.debug, PID: 32484
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:325)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Caused by: java.lang.NoSuchMethodError: No virtual method toPath()Ljava/nio/file/Path; in class Ljava/io/File; or its super classes (declaration of 'java.io.File' appears in /system/framework/core-oj.jar)
at org.apache.commons.compress.archivers.sevenz.SevenZFile.<init>(SevenZFile.java:108)
at org.apache.commons.compress.archivers.sevenz.SevenZFile.<init>(SevenZFile.java:262)
at com.amaze.filemanager.asynchronous.asynctasks.compress.SevenZipHelperTask.addElements(SevenZipHelperTask.java:30)
at com.amaze.filemanager.asynchronous.asynctasks.compress.CompressedHelperTask.doInBackground(CompressedHelperTask.java:48)
at com.amaze.filemanager.asynchronous.asynctasks.compress.CompressedHelperTask.doInBackground(CompressedHelperTask.java:33)
at android.os.AsyncTask$2.call(AsyncTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)聽
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
at java.lang.Thread.run(Thread.java:761)聽
And it turned out, java.io.File.toPath() is only available from Android 8.0 onwards.
Choices ahead:
java.io.File.toPath()?Either way, feel free to contribute if you like, either fork my branch or roll your own PR.
Tried to fix the compatibility problem with "backported" commons-compress's 7zip to use FileChannel only, which should be adequate for our purposes (as of f0020166).
Though displays are incorrect, at least such modified code can run fine on Android emulator running 4.4 (API 19).
Will continue work on as time allows.
@TranceLove great! Really appreciate you finding time to work on it. I'll also check your code and see if I can be of any help.
Most helpful comment
Tried to fix the compatibility problem with "backported" commons-compress's 7zip to use
FileChannelonly, which should be adequate for our purposes (as of f0020166).Though displays are incorrect, at least such modified code can run fine on Android emulator running 4.4 (API 19).
Will continue work on as time allows.