TeamAmaze / AmazeFileManager

Material design file manager for Android
https://teamamaze.xyz
GNU General Public License v3.0
5.37k stars 1.58k forks source link

App crash when viewing .7z archive from SMB connection #3775

Open Josh65-2201 opened 1 year ago

Josh65-2201 commented 1 year ago

Issue explanation (write below this line)

I attempted to open a .7z archive (not encrypted) from a Windows 11 smb share

Exception

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.VIEW dat=http://127.0.0.1:7871/... typ=application/x-7z-compressed cmp=pl.solidexplorer2/pl.solidexplorer.WebActivity } from ProcessRecord{47550da 1925:com.amaze.filemanager/u0a16} (pid=1925, uid=10016) not exported from uid 10238
    at android.os.Parcel.createExceptionOrNull(Parcel.java:2437)
    at android.os.Parcel.createException(Parcel.java:2421)
    at android.os.Parcel.readException(Parcel.java:2404)
    at android.os.Parcel.readException(Parcel.java:2346)
    at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:2897)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1743)
    at android.app.Activity.startActivityForResult(Activity.java:5473)
    at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:597)
    at android.app.Activity.startActivityForResult(Activity.java:5431)
    at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:583)
    at android.app.Activity.startActivity(Activity.java:5817)
    at android.app.Activity.startActivity(Activity.java:5770)
    at com.amaze.filemanager.filesystem.files.FileUtils$5.lambda$run$0(FileUtils.java:841)
    at com.amaze.filemanager.filesystem.files.FileUtils$5.$r8$lambda$V5PxxJdTLahRVRJARJkneRy7Zng(Unknown Source:0)
    at com.amaze.filemanager.filesystem.files.FileUtils$5$$ExternalSyntheticLambda0.run(Unknown Source:4)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.app.ActivityThread.main(ActivityThread.java:8669)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: android.os.RemoteException: Remote stack trace:
    at com.android.server.wm.ActivityTaskSupervisor.checkStartAnyActivityPermission(ActivityTaskSupervisor.java:1334)
    at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1262)
    at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:893)
    at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1873)
    at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1744)


TranceLove commented 1 year ago

When tapping the file directly, you should get that toast prompt you need to copy the archive to the device in order to view it. This is limitation that we are not able to process archives remotely.

However, similar route did gave me exception anyway, when I tried to open it using the context menu, as I was trying to open it using some app on the device:

io.reactivex.exceptions.CompositeException: 2 exceptions occurred. 
    at io.reactivex.internal.subscribers.LambdaSubscriber.onError(LambdaSubscriber.java:82)
    at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.checkTerminated(FlowableObserveOn.java:209)
    at io.reactivex.internal.operators.flowable.FlowableObserveOn$ObserveOnSubscriber.runAsync(FlowableObserveOn.java:399)
    at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.run(FlowableObserveOn.java:176)
    at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7872)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
  ComposedException 1 :
    org.apache.commons.compress.archivers.ArchiveException: 7zip archive /data/user/0/com.amaze.filemanager.debug/cache/archive.7z is corrupt
        at com.amaze.filemanager.asynchronous.asynctasks.compress.SevenZipHelperCallable.addElements(SevenZipHelperCallable.kt:87)
        at com.amaze.filemanager.asynchronous.asynctasks.compress.CompressedHelperCallable.call(CompressedHelperCallable.kt:42)
        at com.amaze.filemanager.asynchronous.asynctasks.compress.CompressedHelperCallable.call(CompressedHelperCallable.kt:29)
        at io.reactivex.internal.operators.flowable.FlowableFromCallable.subscribeActual(FlowableFromCallable.java:39)
        at io.reactivex.Flowable.subscribe(Flowable.java:14826)
        at io.reactivex.Flowable.subscribe(Flowable.java:14773)
        at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.run(FlowableSubscribeOn.java:82)
        at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
        at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
        at java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
        at java.lang.Thread.run(Thread.java:1012)
    Caused by: java.lang.IllegalStateException: Fragment CompressedExplorerFragment{805efa5} (18f074a5-8f71-45fb-a3b8-039476d105a3) not attached to a context.
        at androidx.fragment.app.Fragment.requireContext(Fragment.java:919)
        at com.amaze.filemanager.ui.fragments.CompressedExplorerFragment.archiveCorruptOrUnsupportedToast(CompressedExplorerFragment.kt:622)
        at com.amaze.filemanager.ui.fragments.CompressedExplorerFragment.changePath$lambda-22$lambda-21(CompressedExplorerFragment.kt:583)
        at com.amaze.filemanager.ui.fragments.CompressedExplorerFragment.$r8$lambda$fmscQU9YC5gGBMgAcmdKIXMPl08(Unknown Source:0)
        at com.amaze.filemanager.ui.fragments.CompressedExplorerFragment$$ExternalSyntheticLambda3.accept(Unknown Source:6)
        at io.reactivex.internal.subscribers.LambdaSubscriber.onError(LambdaSubscriber.java:79)
        at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.checkTerminated(FlowableObserveOn.java:209)
        at io.reactivex.internal.operators.flowable.FlowableObserveOn$ObserveOnSubscriber.runAsync(FlowableObserveOn.java:399)
        at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.run(FlowableObserveOn.java:176)
        at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
        at android.os.Handler.handleCallback(Handler.java:942)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7872)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
  ComposedException 2 :
    java.lang.IllegalStateException: Fragment CompressedExplorerFragment{805efa5} (18f074a5-8f71-45fb-a3b8-039476d105a3) not attached to a context.
        at androidx.fragment.app.Fragment.requireContext(Fragment.java:919)
        at com.amaze.filemanager.ui.fragments.CompressedExplorerFragment.archiveCorruptOrUnsupportedToast(CompressedExplorerFragment.kt:622)
        at com.amaze.filemanager.ui.fragments.CompressedExplorerFragment.changePath$lambda-22$lambda-21(CompressedExplorerFragment.kt:583)
        at com.amaze.filemanager.ui.fragments.CompressedExplorerFragment.$r8$lambda$fmscQU9YC5gGBMgAcmdKIXMPl08(Unknown Source:0)
        at com.amaze.filemanager.ui.fragments.CompressedExplorerFragment$$ExternalSyntheticLambda3.accept(Unknown Source:6)
        at io.reactivex.internal.subscribers.LambdaSubscriber.onError(LambdaSubscriber.java:79)
        at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.checkTerminated(FlowableObserveOn.java:209)
        at io.reactivex.internal.operators.flowable.FlowableObserveOn$ObserveOnSubscriber.runAsync(FlowableObserveOn.java:399)
        at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.run(FlowableObserveOn.java:176)
        at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
        at android.os.Handler.handleCallback(Handler.java:942)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7872)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Pixel 6 emulator running Android 13.