Advertisement
goroh_kun

WebViewの脆弱性を含んだアクティビティのサンプル

Oct 6th, 2012
1,728
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. package com.example.webviewtest1;
  2.  
  3. import android.os.Bundle;
  4. import android.app.Activity;
  5. import android.webkit.WebView;
  6.  
  7. public class MainActivity extends Activity {
  8.     private WebView webView;
  9.    
  10.     public class MyJSInterface implements Cloneable {
  11.     }
  12.    
  13.     @Override
  14.     public void onCreate(Bundle savedInstanceState) {
  15.         super.onCreate(savedInstanceState);
  16.  
  17.         setContentView(R.layout.activity_main);
  18.         webView = (WebView) findViewById(R.id.demoWebView);
  19.         webView.getSettings().setJavaScriptEnabled(true);
  20.         webView.addJavascriptInterface(new MyJSInterface(), "myJSInterface");
  21.         webView.loadUrl("file:///sdcard/mytest.html");
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement