App crashes when file has "%" in the name
- Dominant language
- Kotlin
- Stars
- 5.6k
- Forks
- 2k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 92
Description
### ⚠️ Before posting ⚠️
- [x] This is a **bug**, not a question or an enhancement.
- [x] I've [searched for similar issues](https://github.com/nextcloud/android/issues) and didn't find a duplicate.
- [x] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- [x] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/).
### Steps to reproduce
1. Name a file something like, "65% on Sonic Wave"
2. Open the directory containing that file in the NextCloud Android app
3. App crashes when that file loads
### Expected behaviour
The file should display with the name "65% on Sonic Wave"
### Actual behaviour
The app crashes.
### Android version
15
### Device brand and model
Samsung SM-S926U
### Stock or custom OS?
Stock
### Nextcloud android app version
3.33.0
### Nextcloud server version
Nextcloud Hub 10 (31.0.8)
### Using a reverse proxy?
No
### Android logs
### Cause of error
```java
Exception in thread "main" java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern : % o
at java.net.URLDecoder.decode(URLDecoder.java:214)
at java.net.URLDecoder.decode(URLDecoder.java:143)
at com.owncloud.android.utils.FileStorageUtils.containsBidiControlCharacters(FileStorageUtils.java:82)
at com.owncloud.android.ui.adapter.OCFileListAdapter.handleGridMode(OCFileListAdapter.java:575)
at com.owncloud.android.ui.adapter.OCFileListAdapter.setFilenameAndExtension(OCFileListAdapter.java:568)
at com.owncloud.android.ui.adapter.OCFileListAdapter.onBindViewHolder(OCFileListAdapter.java:482)
at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7747)
at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7847)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6646)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6917)
at androidx.recyclerview.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:288)
at androidx.recyclerview.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:345)
at androidx.recyclerview.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:361)
at androidx.recyclerview.widget.GapWorker.prefetch(GapWorker.java:368)
at androidx.recyclerview.widget.GapWorker.run(GapWorker.java:399)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:257)
at android.os.Looper.loop(Looper.java:342)
at android.app.ActivityThread.main(ActivityThread.java:9634)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:619)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)
```
### App information
* ID: `com.nextcloud.client`
* Version: `30330090`
* Build flavor: `gplay`
### Device information
* Brand: `samsung`
* Device: `e2q`
* Model: `SM-S926U`
* Id: `AP3A.240905.015.A2`
* Product: `e2qsqw`
### Firmware
* SDK: `35`
* Release: `15`
* Incremental: `S926USQS4BYG2`
### Server error logs
```bash
```
### Additional information
It looks like the app is just trying to convert the text into some other character using a hex escape code and failing because "% o" isn't a valid character. The issue does not persist in the browser.
Contributor guide
Assessment
This issue has not been assessed yet.