TeamAmaze / TeamAmaze/AmazeFileManager
`StringIndexOutOfBoundsException` on `HybridFile#getParent`
Open
Nobody has claimed this yet.
From-Email
Issue-Bug
Issue-Easy (good first issue)
- Dominant language
- Kotlin
- Stars
- 6.4k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
Issue explanation (write below this line)
Exception
- App Name: Amaze File Manager
- Package: com.amaze.filemanager
- Version: 3.6.7
- User Action: UI Error
- Request: Application crash
- OS: Linux Android 12 - 31
- Device: barbet
- Model: Pixel 5a
- Product: barbet
Crash log
java.lang.StringIndexOutOfBoundsException: String index out of range: -5
at java.lang.String.substring(String.java:2064)
at
com.amaze.filemanager.filesystem.HybridFile.getParent(HybridFile.java:455)
at
com.amaze.filemanager.ui.fragments.MainFragment.goBack(MainFragment.java:1082)
at
com.amaze.filemanager.ui.activities.MainActivity.lambda$onBackPressed$6(MainActivity.java:859)
at
com.amaze.filemanager.ui.activities.-$$Lambda$MainActivity$fKbQXJTjmE3tEXFhvzq2Q8y2c_E.apply(Unknown
Source:2)
at
com.amaze.filemanager.ui.activities.MainActivity.executeWithMainFragment(MainActivity.java:2373)
at
com.amaze.filemanager.ui.activities.MainActivity.executeWithMainFragment(MainActivity.java:2365)
at
com.amaze.filemanager.ui.activities.MainActivity.onBackPressed(MainActivity.java:857)
at android.app.Activity.onKeyUp(Activity.java:3836)
at android.view.KeyEvent.dispatch(KeyEvent.java:2878)
at android.app.Activity.dispatchKeyEvent(Activity.java:4161)
at
androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:122)
at
androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84)
at
androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140)
at
androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:569)
at
androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
at
androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3054)
at
androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
at
com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:404)
at
android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6275)
at
android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6141)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5623)
at
android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5680)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5646)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5811)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5654)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5868)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5627)
at
android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5680)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5646)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5654)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5627)
at
android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5680)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5646)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5844)
at
android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:6002)
at
android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3158)
at
android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2722)
at
android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2713)
at
android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3135)
at
android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:154)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:161)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7838)
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:1003)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at HybridFile.getParent in the reported HybridFile.java line 455 and trace the call from MainFragment.goBack at line 1082 through MainActivity.onBackPressed. Reproduce the reported back-navigation crash on Android 12 if possible. Done means the reported StringIndexOutOfBoundsException no longer occurs during this flow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100