CustomWebView (app/src/main/java/app/simple/inure/decorations/views/CustomWebView.kt) routes off-asset URLs out via startActivity inside shouldOverrideUrlLoading:
override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean {
val url = request.url.toString()
if (url.contains("asset/")) {
view.loadUrl(url)
} else {
val intent = Intent(Intent.ACTION_VIEW, request.url)
context.startActivity(intent)
}
return true
}
If nothing on the device can handle Intent.ACTION_VIEW for the URL, startActivity raises ActivityNotFoundException and whichever activity is hosting the CustomWebView (the Changelog / Credits / Trackers / preference web pages, etc.) crashes. There is no catch-all around this path - the exception just propagates out of WebViewClient.
This is easiest to hit when the user follows a mailto: link from the Credits screen on a device with no mail app installed, or any external link on a ROM that has the default browser disabled.
Suggested fix
Wrap context.startActivity(intent) in a try / catch for ActivityNotFoundException and log a warning. The link click becomes a no-op instead of a crash, which matches what a missing handler usually does on Android.
A small PR with that change is at #485.
CustomWebView(app/src/main/java/app/simple/inure/decorations/views/CustomWebView.kt) routes off-asset URLs out viastartActivityinsideshouldOverrideUrlLoading:If nothing on the device can handle
Intent.ACTION_VIEWfor the URL,startActivityraisesActivityNotFoundExceptionand whichever activity is hosting theCustomWebView(the Changelog / Credits / Trackers / preference web pages, etc.) crashes. There is no catch-all around this path - the exception just propagates out ofWebViewClient.This is easiest to hit when the user follows a
mailto:link from the Credits screen on a device with no mail app installed, or any external link on a ROM that has the default browser disabled.Suggested fix
Wrap
context.startActivity(intent)in a try / catch forActivityNotFoundExceptionand log a warning. The link click becomes a no-op instead of a crash, which matches what a missing handler usually does on Android.A small PR with that change is at #485.