TeamAmaze / AmazeFileManager

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

Crash when open directoy with @ sign #3792

Open Offerel opened 1 year ago

Offerel commented 1 year ago

Describe the bug On my SFTP server, i have folders where the name of the folder contains an @ sign. If i open this folder with Amaze Filemanager, it crashes.

To Reproduce Steps to reproduce the behavior:

  1. Create SFTP connection
  2. Open the connection
  3. Open folder
  4. Open folder with a @ sign in name
  5. App crashes

Expected behavior Folder can be opened

Smartphone (please complete the following information):

Additional context If I create a symlink to the same folder, without the @ sign, i can open the folder. I don't know, if other signs are effected also.

java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$4.done(AsyncTask.java:415)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:381)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:250)
    at java.util.concurrent.FutureTask.run(FutureTask.java:269)
    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.StringIndexOutOfBoundsException: begin 104, end 10, length 115
    at java.lang.String.checkBoundsBeginEnd(String.java:3942)
    at java.lang.String.substring(String.java:2467)
    at com.amaze.filemanager.filesystem.ftp.NetCopyClientConnectionPool$ConnectionInfo.<init>(NetCopyClientConnectionPool.kt:406)
    at com.amaze.filemanager.filesystem.ftp.NetCopyClientConnectionPool.createSshClient(NetCopyClientConnectionPool.kt:252)
    at com.amaze.filemanager.filesystem.ftp.NetCopyClientConnectionPool.access$createSshClient(NetCopyClientConnectionPool.kt:48)
    at com.amaze.filemanager.filesystem.ftp.NetCopyClientConnectionPool$createNetCopyClient$1.invoke(NetCopyClientConnectionPool.kt:175)
    at com.amaze.filemanager.filesystem.ftp.NetCopyClientConnectionPool$createNetCopyClient$1.invoke(NetCopyClientConnectionPool.kt:173)
    at com.amaze.filemanager.filesystem.ftp.NetCopyClientConnectionPool.getConnection(NetCopyClientConnectionPool.kt:88)
    at com.amaze.filemanager.filesystem.ftp.NetCopyClientUtils.execute(NetCopyClientUtils.kt:83)
    at com.amaze.filemanager.filesystem.HybridFile.forEachChildrenFile(HybridFile.java:938)
    at com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.listSftp(LoadFilesListTask.java:626)
    at com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.doInBackground(LoadFilesListTask.java:157)
    at com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.doInBackground(LoadFilesListTask.java:85)
    at android.os.AsyncTask$3.call(AsyncTask.java:394)
    at java.util.concurrent.FutureTask.run(FutureTask.java:264)
    ... 3 more
Offerel commented 1 year ago

Update: When i manually enter the directory name and us %40 instead of @, i can access the directory. But clicking such a directory leads to a crash. I have no skills in Java programming, but i assume, the filenames should properly urlencoded. Then it should work.

TranceLove commented 1 year ago

Should be fixed by #3661 for 4.0. Let's see it.

device-2023-04-30-132251

Offerel commented 1 year ago

Is there any release or pre-release date or can be downloaded from github actions?

VishalNehra commented 1 year ago

Is there any release or pre-release date or can be downloaded from github actions?

You can download from this github action. Release date isn't yet set.

VishalNehra commented 1 year ago

Is there any release or pre-release date or can be downloaded from github actions?

You can also join our telegram channel for the apk. https://t.me/TeamAmaze

Offerel commented 1 year ago

Many thx. After testing, my issue with the @ sign is solved in this version. But a other dorectory is listed as empty. If I look at the server, this seems to be a bind mount. I'm not sure if this is responsible for not displaying the directory content. I will try to find the reason tomorrow.

Other file managers like Solid Explorer and Material Files can list the content of the directory. I will report if I find more info.

VishalNehra commented 1 year ago

Many thx. After testing, my issue with the @ sign is solved in this version. But a other dorectory is listed as empty. If I look at the server, this seems to be a bind mount. I'm not sure if this is responsible for not displaying the directory content. I will try to find the reason tomorrow.

Other file managers like Solid Explorer and Material Files can list the content of the directory. I will report if I find more info.

@TranceLove

Offerel commented 1 year ago

Additionally hint: when I download a file via SFTP (SCP is not allowed there), the speed seems to be slow. I get around 4MB/s, the same as with Material Files. With Solid Explorer and the same connection and file, i have around 8MB/s. I haven't tested SCP for now.

Offerel commented 1 year ago

Many thx. After testing, my issue with the @ sign is solved in this version. But a other dorectory is listed as empty. If I look at the server, this seems to be a bind mount. I'm not sure if this is responsible for not displaying the directory content. I will try to find the reason tomorrow.

Other file managers like Solid Explorer and Material Files can list the content of the directory. I will report if I find more info.

I have found more. Its not this special directory. If i open this directory directly after logging in, all is fine. However, when i have accessed a folder with this new version and i go back or up a directory, this appears as empty. All folders appears as empty, when i go back or up one level. Maybe its only a listing-refresh issue?