Error when opening remote file with apps other than Material Files
So I got java.lang.ArrayIndexOutOfBoundsException: src.length=1 srcPos=0 dst.length=256 dstPos=-5 length=1 error when opening remote (SFTP) files with apps other than Material Files
How to reproduce:
- Open Material files.
- Setup remote SFTP file storage if you havent done so.
- Open any file inside the remote storage. Video: https://github.com/zhanghai/MaterialFiles/assets/169248210/a5b1aff2-db5d-41dd-8b4d-2b23e913373a
If the file is opened with Material Files (eg. Photo viewer, Text editor), it works But if i open it in apps other than Material Files (in the video below i choose Xed, but it can be any app), it will throw error like i mentioned above
The only way to fix the error is to restart the app (remove it from recent apps, then manually relaunch)
I'm using latest version 1.7.2 arm64 from play store
Likely an underlying issue in hierynomus/sshj, but I don't even use SFTP myself...
I also experience this issue already for a long time, exactly as explained. in my case, specifically if I try to open a remote PDF file using https://f-droid.org/packages/com.artifex.mupdf.viewer.app/ and a blank error appears because the remote file cannot be opened. interesting is that there is no good way to recover from this error once the issue appeared once. even closing the app and opening it again does not resolve it. it seems the SFTP connection is maintained and the server remains unreachable with this error. only when you wait for a while (probably when the ssh connection times out or is closed automatically after inactivity) material files is able to make a new connection and use the SFTP server again.
even if this is an issue with sshj, it would be great if material files could recover from this error.
this seems to be the same error as #851 .