-
Notifications
You must be signed in to change notification settings - Fork 0
V2.0.1 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
V2.0.1 #5
Conversation
| GlamArLogger.d("Glam_myApp", "onCreate: ") | ||
|
|
||
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | ||
| WebView.setWebContentsDebuggingEnabled(true) |
Check failure
Code scanning / CodeQL
Android Webview debugging enabled High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 25 days ago
To fix the issue, we should ensure that WebView debugging is enabled only during debug builds. This is typically done by checking the ApplicationInfo.FLAG_DEBUGGABLE flag at runtime. In Kotlin, within an Application subclass, you can obtain this by evaluating the following condition:
if (0 != applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE)We need to change the block (lines 16-18) to perform this conditional check instead of always enabling debugging. No additional imports are needed unless android.content.pm.ApplicationInfo is referenced by name, but in this case ApplicationInfo is accessible via android.app.Application. So only the specific lines need adjustment, and no extra methods or variable definitions are required.
-
Copy modified lines R17-R19
| @@ -14,7 +14,9 @@ | ||
| GlamArLogger.d("Glam_myApp", "onCreate: ") | ||
|
|
||
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | ||
| WebView.setWebContentsDebuggingEnabled(true) | ||
| if (0 != applicationInfo.flags and android.content.pm.ApplicationInfo.FLAG_DEBUGGABLE) { | ||
| WebView.setWebContentsDebuggingEnabled(true) | ||
| } | ||
| } | ||
|
|
||
| val webView = WebView( |
No description provided.