book-reader/app/src/main/java/com/aryan/reader
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
..
data Windows (#291) 2026-05-10 10:07:37 +05:30
epub Windows (#291) 2026-05-10 10:07:37 +05:30
epubreader Windows (#291) 2026-05-10 10:07:37 +05:30
feedback v1.0.47 (#279) 2026-05-04 21:55:38 +05:30
ml V1.0.46 oss (#253) 2026-04-29 16:37:53 +05:30
opds Windows (#291) 2026-05-10 10:07:37 +05:30
paginatedreader fix(webview): gate setWebContentsDebuggingEnabled on BuildConfig.DEBUG and drop unused allowFileAccess in MathMLRenderer (#303) 2026-05-14 12:26:38 +05:30
pdf Windows (#291) 2026-05-10 10:07:37 +05:30
tts Windows (#291) 2026-05-10 10:07:37 +05:30
ui/theme v1.0.45-oss (#221) 2026-04-22 14:11:52 +05:30
AiSettingsScreen.kt v1.0.47 (#279) 2026-05-04 21:55:38 +05:30
AndroidFolderPathResolver.kt v1.0.47 (#279) 2026-05-04 21:55:38 +05:30
AppNavigation.kt v1.0.47 (#279) 2026-05-04 21:55:38 +05:30
AppUiModels.kt Add screen capture protection (#292) 2026-05-10 10:18:48 +05:30
BookImporter.kt Update readme (#3) 2026-02-25 21:30:28 +05:30
Common.kt v1.0.47 (#279) 2026-05-04 21:55:38 +05:30
FileHasher.kt Update readme (#3) 2026-02-25 21:30:28 +05:30
FileTypeResolver.kt Windows (#291) 2026-05-10 10:07:37 +05:30
FolderSyncWorker.kt Windows (#291) 2026-05-10 10:07:37 +05:30
FontsScreen.kt New languages (#256) 2026-04-29 18:35:23 +05:30
HomeScreen.kt Add screen capture protection (#292) 2026-05-10 10:18:48 +05:30
LibraryModels.kt v1.0.47 (#279) 2026-05-04 21:55:38 +05:30
LibraryScreen.kt Windows (#291) 2026-05-10 10:07:37 +05:30
LibraryStateProjector.kt Windows (#291) 2026-05-10 10:07:37 +05:30
MainActivity.kt fix(webview): gate setWebContentsDebuggingEnabled on BuildConfig.DEBUG and drop unused allowFileAccess in MathMLRenderer (#303) 2026-05-14 12:26:38 +05:30
MainPreferenceKeys.kt v1.0.47 (#279) 2026-05-04 21:55:38 +05:30
MainScreen.kt v1.0.47 (#279) 2026-05-04 21:55:38 +05:30
MainViewModel.kt Add screen capture protection (#292) 2026-05-10 10:18:48 +05:30
MetadataExtractionWorker.kt v1.0.47 (#279) 2026-05-04 21:55:38 +05:30
MyApplication.kt Update readme (#3) 2026-02-25 21:30:28 +05:30
NonReaderScreenModels.kt v1.0.47 (#279) 2026-05-04 21:55:38 +05:30
ProScreen.kt New languages (#256) 2026-04-29 18:35:23 +05:30
ReaderPerfLog.kt v1.0.47 (#279) 2026-05-04 21:55:38 +05:30
SharedComposables.kt New languages (#256) 2026-04-29 18:35:23 +05:30
SharedModelMappers.kt Windows (#291) 2026-05-10 10:07:37 +05:30
StorageTracker.kt Bug and crash fixes (#132) 2026-03-30 21:19:27 +05:30
TtsReplacementStore.kt Windows (#291) 2026-05-10 10:07:37 +05:30
TtsWordReplacementsSheet.kt Windows (#291) 2026-05-10 10:07:37 +05:30
UiLabelResources.kt v1.0.47 (#279) 2026-05-04 21:55:38 +05:30