Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StringIndexOutOfBoundsException on CompressedHelper#getFileName #4146

Open
amaze-issue-automation bot opened this issue Apr 7, 2024 · 4 comments · May be fixed by #4176
Open

StringIndexOutOfBoundsException on CompressedHelper#getFileName #4146

amaze-issue-automation bot opened this issue Apr 7, 2024 · 4 comments · May be fixed by #4176
Labels
From-Email This is from an email, probably lacking replication info Issue-Bug Related unexpected behavior or something worth investigating. Issue-Easy (good first issue) Beginners welcome! Issues with relative low difficulty.

Comments

@amaze-issue-automation
Copy link

Issue explanation (write below this line)

Exception

  • App Name: Amaze File Manager
  • Package: com.amaze.filemanager
  • Version: 3.10
  • User Action: UI Error
  • Request: Application crash
  • OS: Linux Android 14 - 34
  • Device: OP533FL1
  • Model: CPH2363
  • Product: CPH2363T2
Crash log

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 android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
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.lang.StringIndexOutOfBoundsException: begin 0, end -1,
length 3
at java.lang.String.checkBoundsBeginEnd(String.java:4466)
at java.lang.String.substring(String.java:2517)
at
com.amaze.filemanager.filesystem.compressed.CompressedHelper.getFileName(CompressedHelper.java:218)
at
com.amaze.filemanager.asynchronous.services.ExtractService$DoWork.doInBackground(ExtractService.java:258)
at
com.amaze.filemanager.asynchronous.services.ExtractService$DoWork.doInBackground(ExtractService.java:234)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
... 4 more


@amaze-issue-automation amaze-issue-automation bot added the From-Email This is from an email, probably lacking replication info label Apr 7, 2024
@VishnuSanal VishnuSanal changed the title Crash reported by Noviar StringIndexOutOfBoundsException on CompressedHelper#getFileName Apr 7, 2024
@VishnuSanal VishnuSanal added Issue-Bug Related unexpected behavior or something worth investigating. Issue-Easy (good first issue) Beginners welcome! Issues with relative low difficulty. labels Apr 7, 2024
@pratikmhatre
Copy link

pratikmhatre commented May 21, 2024

I have found the steps to reproduce the issue and though it is very straight forward, it exposes a major issue in whole codebase. Please refer to following video.
@VishnuSanal

Screenrecorder-2024-05-21-16-30-46-773.mp4

@pratikmhatre pratikmhatre linked a pull request May 21, 2024 that will close this issue
4 tasks
@pratikmhatre
Copy link

pratikmhatre commented May 21, 2024

@VishnuSanal

Please refer video rec below, the app treats every file ending with any of zip/tar/7z/rar as a compressed file and and shows extract option for it, even though there is no . separating the filename and the extension.

Screenrecorder-2024-05-21-16-38-42-211.mp4

@VishnuSanal
Copy link
Member

Yep, thanks for the investigation! Must be some issue with us parsing the name/extension.

@TranceLove
Copy link
Collaborator

Awch... so edge case 🫠

A quick reference from my Linux Mint Cinnamon using FileRoller: if extracting an archive without file extension, the directory name becomes <archive name>_FILES

i.e. when the archive is named foobar extracting it FileRoller will create foobar_FILES then put the archive contents inside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
From-Email This is from an email, probably lacking replication info Issue-Bug Related unexpected behavior or something worth investigating. Issue-Easy (good first issue) Beginners welcome! Issues with relative low difficulty.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants