Switch to 181 platform

This commit is contained in:
Vyacheslav Gerasimov
2018-04-27 18:25:17 +03:00
parent df59af8ee8
commit bc403ce744
673 changed files with 25853 additions and 922 deletions
+24
View File
@@ -0,0 +1,24 @@
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintSetJavaScriptEnabledInspection
import android.annotation.SuppressLint
import android.app.Activity
import android.webkit.WebView
@Suppress("UsePropertyAccessSyntax", "UNUSED_VARIABLE", "unused", "UNUSED_PARAMETER", "DEPRECATION")
public class HelloWebApp : Activity() {
fun test(webView: WebView) {
webView.settings.<warning descr="Using `setJavaScriptEnabled` can introduce XSS vulnerabilities into you application, review carefully.">javaScriptEnabled</warning> = true // bad
webView.getSettings().<warning descr="Using `setJavaScriptEnabled` can introduce XSS vulnerabilities into you application, review carefully.">setJavaScriptEnabled(true)</warning> // bad
webView.getSettings().setJavaScriptEnabled(false) // good
webView.loadUrl("file:///android_asset/www/index.html")
}
@SuppressLint("SetJavaScriptEnabled")
fun suppressed(webView: WebView) {
webView.getSettings().javaScriptEnabled = true; // bad
webView.getSettings().setJavaScriptEnabled(true) // bad
webView.getSettings().setJavaScriptEnabled(false); // good
webView.loadUrl("file:///android_asset/www/index.html");
}
}