Skip to content

Commit 84504a8

Browse files
committed
Fix tests by adding AndroidManifest.xml
1 parent a706046 commit 84504a8

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="app" android:versionCode="1" android:versionName="1.0">
3+
<application>
4+
<activity android:name=".UnsafeAndroidAccess">
5+
<intent-filter>
6+
<action android:name="android.intent.action.MAIN" />
7+
<category android:name="android.intent.category.LAUNCHER" />
8+
</intent-filter>
9+
</activity>
10+
</application>
11+
</manifest>

java/ql/test/query-tests/security/CWE-749/UnsafeAndroidAccess.java renamed to java/ql/test/query-tests/security/CWE-749/app/UnsafeAndroidAccess.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package app;
2+
13
import android.app.Activity;
24
import android.os.Bundle;
35
import android.webkit.WebSettings;
@@ -29,7 +31,7 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) {
2931
});
3032

3133
String thisUrl = getIntent().getExtras().getString("url");
32-
wv.loadUrl(thisUrl); // hasUnsafeAndroidAccess
34+
wv.loadUrl(thisUrl); // $hasUnsafeAndroidAccess
3335
wv.loadUrl("https://www.mycorp.com/" + thisUrl); // Safe
3436
wv.loadUrl("https://www.mycorp.com"); // Safe
3537
}
@@ -48,8 +50,8 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) {
4850
});
4951

5052
String thisUrl = getIntent().getStringExtra("url");
51-
wv.loadUrl(thisUrl); // hasUnsafeAndroidAccess
52-
wv.loadUrl("https://www.mycorp.com/" + thisUrl); // hasUnsafeAndroidAccess
53+
wv.loadUrl(thisUrl); // $hasUnsafeAndroidAccess
54+
wv.loadUrl("https://www.mycorp.com/" + thisUrl); // Safe
5355
wv.loadUrl("https://www.mycorp.com"); // Safe
5456
}
5557

0 commit comments

Comments
 (0)