rspec/rules/S4507/kotlin/rule.adoc
Pierre-Loup d608b6dedb
Revert "Update S4507: Add kotlin code examples (SONARKT-580) (#4708)" (#4755)
This reverts commit d63f01a9b137c9a010f1f81a29cf800fba5cf438.
2025-03-17 12:36:22 +00:00

48 lines
1.1 KiB
Plaintext

include::../description.adoc[]
include::../ask-yourself.adoc[]
== Recommended Secure Coding Practices
Do not enable debugging features on applications distributed to end users.
== Sensitive Code Example
https://developer.android.com/reference/android/webkit/WebView#setWebContentsDebuggingEnabled(boolean)[WebView.setWebContentsDebuggingEnabled(true)] for Android enables debugging support:
[source,kotlin]
----
import android.webkit.WebView
WebView.setWebContentsDebuggingEnabled(true) // Sensitive
----
== Compliant Solution
https://developer.android.com/reference/android/webkit/WebView#setWebContentsDebuggingEnabled(boolean)[WebView.setWebContentsDebuggingEnabled(false)] for Android disables debugging support:
[source,kotlin]
----
import android.webkit.WebView
WebView.setWebContentsDebuggingEnabled(false)
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]