Open new SMB Connection crashes
Describe the bug Tried to open up a SMB connection, but crash happens when clicking on the option.
I'm on grapheneOS, where permissons might be stricter. If testes it with all availabe permissions enabled though, which would be 'Network', 'Notifications', 'Sensors'.
To Reproduce Steps to reproduce the behavior:
- Click on '+'
- Click on 'Cloud Connection'
- Select 'SMB Connection'
- See crash log
Exception
- App Name: Amaze File Manager
- Package: com.amaze.filemanager
- Version: 3.10
- User Action: UI Error
- Request: Application crash
- OS: Linux Android 15 - 35
- Device: akita
- Model: Pixel 8a
- Product: akita
Crash log
io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | java.io.IOException: sendto failed: EPERM (Operation not permitted)
at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)
at io.reactivex.internal.observers.LambdaObserver.onError(LambdaObserver.java:77)
at io.reactivex.internal.operators.observable.ObservableDoOnEach$DoOnEachObserver.onError(ObservableDoOnEach.java:117)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.checkTerminated(ObservableObserveOn.java:281)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:172)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255)
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:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.io.IOException: sendto failed: EPERM (Operation not permitted)
at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:721)
at libcore.io.IoBridge.sendto(IoBridge.java:688)
at java.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java:126)
at java.net.DatagramSocket.send(DatagramSocket.java:723)
at com.amaze.filemanager.utils.smb.WsddDiscoverDeviceStrategy.multicastForDevice(WsddDiscoverDeviceStrategy.kt:128)
at com.amaze.filemanager.utils.smb.WsddDiscoverDeviceStrategy.discoverDevices(WsddDiscoverDeviceStrategy.kt:96)
at com.amaze.filemanager.utils.smb.SmbDeviceScannerObservable.subscribeActual$lambda$1$lambda$0(SmbDeviceScannerObservable.kt:89)
at com.amaze.filemanager.utils.smb.SmbDeviceScannerObservable.$r8$lambda$3Q3UXszuikPQxo-e_j1qIR2is2M(Unknown Source:0)
at com.amaze.filemanager.utils.smb.SmbDeviceScannerObservable$$ExternalSyntheticLambda0.call(Unknown Source:4)
at io.reactivex.internal.operators.observable.ObservableFromCallable.subscribeActual(ObservableFromCallable.java:43)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
... 7 more
Caused by: android.system.ErrnoException: sendto failed: EPERM (Operation not permitted)
at libcore.io.Linux.sendtoBytes(Native Method)
at libcore.io.Linux.sendto(Linux.java:235)
at libcore.io.ForwardingOs.sendto(ForwardingOs.java:718)
at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:398)
at libcore.io.ForwardingOs.sendto(ForwardingOs.java:718)
at libcore.io.IoBridge.sendto(IoBridge.java:686)
... 18 more
Seems this is not related to hardened Androids - more like a general for newer Androids, as read from here
https://github.com/resourcepool/ssdp-client/issues/28
Let's see if adding a check at NetworkUtil.getLocalInetAddress() would help.
Still crashing on the latest version, unfortunately couldn't find a work-around. GrapheneOS as well , Pixel 8, latest version.
Edit: Moved to Material Files instead since I don't feel like building from source.