Skip to content

Fix app crashes on android 6#64

Merged
LandWarderer2772 merged 2 commits into
develfrom
fix/63/app-crashes-on-android-6
May 9, 2026
Merged

Fix app crashes on android 6#64
LandWarderer2772 merged 2 commits into
develfrom
fix/63/app-crashes-on-android-6

Conversation

@onlyashd
Copy link
Copy Markdown
Member

@onlyashd onlyashd commented May 7, 2026

We had two problems on issue #63.

Issue 2: Android 6 "Bad position" (ICU Decoder) Bug

Android 6.0 (API 23) contains a system-level bug in the java.nio charset decoder (ICU). When decoding certain byte sequences from a network response into a String, the decoder can incorrectly flush its buffer, leading to an IllegalArgumentException: Bad position. This prevents the app from correctly detecting and handling Cloudflare protection on older devices.

Current Workaround:
I implemented a manual byte-peeking and decoding strategy in CloudFlareInterceptor.kt specifically for API 23 to bypass the buggy system decoder for basic protection detection.

While our interceptor now has a safety check, the core CloudFlareHelper within the kotatsu-parsers-redo library still relies on standard decoding methods that trigger this crash. To fully resolve this problem, Kotatsu-Redo team needs to update CloudFlareHelper to avoid triggering the ICU bug on Android 6 (e.g., by using a safer decoding approach or peeking the source).

Issue 2: Focus Search Crash

When hitting enter on the search bar the app would throw the following exception: java.lang.IllegalStateException: focus search returned a view that wasn't able to take focus!

Solution:
I've updated the item_extension.xml layout to make the root container explicitly focusable and clickable. This ensures that the list item itself serves as a stable focus target, preventing the focus-finder from failing when internal buttons disappear.


Fixes #63

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Debug APK built successfully!

Download artifact: debug-apk

Artifact will be available for 7 days

@LandWarderer2772
Copy link
Copy Markdown
Member

LGTM

@LandWarderer2772 LandWarderer2772 merged commit 7f2c2d4 into devel May 9, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Futon project May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

App crashes when I try to open sources or search for manga

2 participants