book-reader/app/src/main
Dimitris Dafnis c0d0e57e79
fix(webview): gate setWebContentsDebuggingEnabled on BuildConfig.DEBUG and drop unused allowFileAccess in MathMLRenderer (#303)
Three WebView setup paths exist in the app. MyApplication.kt already wraps
setWebContentsDebuggingEnabled in 'if (BuildConfig.DEBUG)'. The other two
paths were missing the guard:

  - MainActivity.onCreate calls WebView.setWebContentsDebuggingEnabled(true)
    unconditionally at the end of onCreate. On a release build that leaves
    chrome://inspect attachable from any USB-connected machine for any
    WebView the app spawns later. CWE-489.

  - MathMLRenderer.setupWebView does the same thing before constructing
    the renderer WebView. Same exposure.

While in MathMLRenderer, drop settings.allowFileAccess = true. The
renderer only ever loads file:///android_asset/MathML-template.html, and
the android_asset scheme is permitted on every supported Android version
even when setAllowFileAccess(false) is in force. The flag is dead and
the WebView is set up with javaScriptEnabled = true + a JS bridge, so
leaving it on widens the surface for no benefit.

ChapterWebView intentionally keeps allowFileAccess = true because the
custom-font path renders @font-face src: url('file://<path>') against
the user-picked font file.
2026-05-14 12:26:38 +05:30
..
assets v1.0.47 (#279) 2026-05-04 21:55:38 +05:30
cpp Windows (#291) 2026-05-10 10:07:37 +05:30
java/com/aryan/reader fix(webview): gate setWebContentsDebuggingEnabled on BuildConfig.DEBUG and drop unused allowFileAccess in MathMLRenderer (#303) 2026-05-14 12:26:38 +05:30
res Add screen capture protection (#292) 2026-05-10 10:18:48 +05:30
AndroidManifest.xml v1.0.45-oss (#221) 2026-04-22 14:11:52 +05:30
ic_launcher-playstore.png Initial commit 2026-02-24 17:37:40 +05:30