├── .gitignore
├── AndroidManifest.xml
├── build.xml
├── proguard-project.txt
├── project.properties
├── res
├── drawable-hdpi
│ └── ic_launcher.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ └── ic_launcher.png
├── layout
│ └── activity_main.xml
├── menu
│ └── main.xml
├── values-sw600dp
│ └── dimens.xml
├── values-sw720dp-land
│ └── dimens.xml
├── values-v11
│ └── styles.xml
├── values-v14
│ └── styles.xml
└── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
└── src
└── org
└── droidsec
└── vulnwebview
├── MainActivity.java
└── WebAppInterface.java
/.gitignore:
--------------------------------------------------------------------------------
1 | # built application files
2 | *.apk
3 | *.ap_
4 | *.jar
5 |
6 | # files for the dex VM
7 | *.dex
8 |
9 | # Java class files
10 | *.class
11 |
12 | # generated files
13 | bin/
14 | gen/
15 | obj/
16 |
17 | # Local configuration file (sdk path, etc)
18 | local.properties
19 |
20 | # Eclipse project files
21 | .classpath
22 | .project
23 | .settings
24 |
25 | # other stuff
26 | no-dist
27 |
28 |
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
12 |
17 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
29 |
30 |
31 |
35 |
36 |
37 |
38 |
39 |
40 |
49 |
50 |
51 |
52 |
56 |
57 |
69 |
70 |
71 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-17
15 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jduck/VulnWebView/ac4ce37275cfe5198c905b1ae38a6aacda8c8e39/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jduck/VulnWebView/ac4ce37275cfe5198c905b1ae38a6aacda8c8e39/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jduck/VulnWebView/ac4ce37275cfe5198c905b1ae38a6aacda8c8e39/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
16 |
17 |
23 |
24 |
--------------------------------------------------------------------------------
/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/res/values-sw600dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/values-sw720dp-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | 128dp
8 |
9 |
10 |
--------------------------------------------------------------------------------
/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | VulnWebView
5 | Settings
6 | Hello world!
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/org/droidsec/vulnwebview/MainActivity.java:
--------------------------------------------------------------------------------
1 | package org.droidsec.vulnwebview;
2 |
3 | import android.os.Bundle;
4 | import android.annotation.SuppressLint;
5 | import android.app.Activity;
6 | import android.view.Menu;
7 | import android.view.View;
8 | import android.webkit.WebSettings;
9 | import android.webkit.WebView;
10 | import android.widget.Button;
11 |
12 | @SuppressLint("SetJavaScriptEnabled")
13 | public class MainActivity extends Activity {
14 |
15 | @Override
16 | protected void onCreate(Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 | setContentView(R.layout.activity_main);
19 |
20 | final Button button = (Button) findViewById(R.id.button1);
21 | button.setOnClickListener(new View.OnClickListener() {
22 | public void onClick(View v) {
23 | // Perform action on click
24 | WebView myWebView = (WebView) findViewById(R.id.webView1);
25 | myWebView.reload();
26 | }
27 | });
28 |
29 | WebView myWebView = (WebView) findViewById(R.id.webView1);
30 |
31 | // not a good idea!
32 | WebSettings webSettings = myWebView.getSettings();
33 | webSettings.setJavaScriptEnabled(true);
34 |
35 | // terrible idea!
36 | myWebView.addJavascriptInterface(new WebAppInterface(this), "Android");
37 |
38 | // woot.
39 | myWebView.loadUrl("http://www.droidsec.org/tests/addjsif/");
40 | }
41 |
42 | @Override
43 | public boolean onCreateOptionsMenu(Menu menu) {
44 | // Inflate the menu; this adds items to the action bar if it is present.
45 | getMenuInflater().inflate(R.menu.main, menu);
46 | return true;
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/src/org/droidsec/vulnwebview/WebAppInterface.java:
--------------------------------------------------------------------------------
1 | package org.droidsec.vulnwebview;
2 |
3 | import android.content.Context;
4 | import android.widget.Toast;
5 |
6 | public class WebAppInterface {
7 | Context mContext;
8 | //private String mWTF = "lolz";
9 |
10 | /** Instantiate the interface and set the context */
11 | WebAppInterface(Context c) {
12 | mContext = c;
13 | }
14 |
15 | /** Show a toast from the web page */
16 | public void showToast(String toast) {
17 | Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
18 | }
19 | }
20 |
--------------------------------------------------------------------------------