Giter Site home page Giter Site logo

Comments (15)

TranceLove avatar TranceLove commented on April 28, 2024 3

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 f002016).

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.

from amazefilemanager.

EmmanuelMess avatar EmmanuelMess commented on April 28, 2024 2

Not enough time, will see.

from amazefilemanager.

 avatar commented on April 28, 2024 1

It can be done with commons-compress...

from amazefilemanager.

yankejustin avatar yankejustin commented on April 28, 2024 1

@wb9688 What do you mean?

from amazefilemanager.

EmmanuelMess avatar EmmanuelMess commented on April 28, 2024 1

Commons compress is already implemented... Adding 7z to the decompression is not that difficult, see CompressedHelper.

from amazefilemanager.

EmmanuelMess avatar EmmanuelMess commented on April 28, 2024 1

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.

from amazefilemanager.

VishalNehra avatar VishalNehra commented on April 28, 2024 1

@EmmanuelMess maybe you can implement it? It's difficult for someone without the knowledge of java programming.

from amazefilemanager.

mirh avatar mirh commented on April 28, 2024

https://github.com/apache/commons-compress

from amazefilemanager.

B4rabbas avatar B4rabbas commented on April 28, 2024

Hello,
How do you add common compress to amaze or the android system ?
Thanks.

Best regards
B.

from amazefilemanager.

B4rabbas avatar B4rabbas commented on April 28, 2024

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;                   <

[...]

from amazefilemanager.

B4rabbas avatar B4rabbas commented on April 28, 2024

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

from amazefilemanager.

EmmanuelMess avatar EmmanuelMess commented on April 28, 2024

@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.

from amazefilemanager.

B4rabbas avatar B4rabbas commented on April 28, 2024

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).

from amazefilemanager.

TranceLove avatar TranceLove commented on April 28, 2024

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:

  • Make 7z support only available > Android 8.0, but let's face it, many of us still have Kitkats and Lollipops
  • Or some refactoring that can try to dodge java.io.File.toPath()?
  • Use other library if available... but read this SO entry too

Either way, feel free to contribute if you like, either fork my branch or roll your own PR.

from amazefilemanager.

VishalNehra avatar VishalNehra commented on April 28, 2024

@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.

from amazefilemanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.