mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Renamed to AndroidIntentRedirection
Added qhelp
This commit is contained in:
@@ -5,50 +5,50 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
public class AndroidIntentRedirectTest extends Activity {
|
||||
AndroidIntentRedirectTest(Context base) {
|
||||
public class AndroidIntentRedirectionTest extends Activity {
|
||||
AndroidIntentRedirectionTest(Context base) {
|
||||
super(base);
|
||||
}
|
||||
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
{
|
||||
Intent intent = (Intent) getIntent().getParcelableExtra("forward_intent");
|
||||
startActivities(new Intent[] {intent}); // $ hasAndroidIntentRedirect
|
||||
startActivities(new Intent[] {intent}, null); // $ hasAndroidIntentRedirect
|
||||
startActivity(intent); // $ hasAndroidIntentRedirect
|
||||
startActivity(intent, null); // $ hasAndroidIntentRedirect
|
||||
startActivityAsUser(intent, null); // $ hasAndroidIntentRedirect
|
||||
startActivityAsUser(intent, null, null); // $ hasAndroidIntentRedirect
|
||||
startActivityAsCaller(intent, null, false, 0); // $ hasAndroidIntentRedirect
|
||||
startActivityAsUserFromFragment(null, intent, 0, null, null); // $ hasAndroidIntentRedirect
|
||||
startActivityForResult(intent, 0); // $ hasAndroidIntentRedirect
|
||||
startActivityForResult(intent, 0, null); // $ hasAndroidIntentRedirect
|
||||
startActivityForResult(null, intent, 0, null); // $ hasAndroidIntentRedirect
|
||||
startActivityForResultAsUser(intent, null, 0, null, null); // $ hasAndroidIntentRedirect
|
||||
startActivityForResultAsUser(intent, 0, null, null); // $ hasAndroidIntentRedirect
|
||||
startActivityForResultAsUser(intent, 0, null); // $ hasAndroidIntentRedirect
|
||||
startActivities(new Intent[] {intent}); // $ hasAndroidIntentRedirection
|
||||
startActivities(new Intent[] {intent}, null); // $ hasAndroidIntentRedirection
|
||||
startActivity(intent); // $ hasAndroidIntentRedirection
|
||||
startActivity(intent, null); // $ hasAndroidIntentRedirection
|
||||
startActivityAsUser(intent, null); // $ hasAndroidIntentRedirection
|
||||
startActivityAsUser(intent, null, null); // $ hasAndroidIntentRedirection
|
||||
startActivityAsCaller(intent, null, false, 0); // $ hasAndroidIntentRedirection
|
||||
startActivityAsUserFromFragment(null, intent, 0, null, null); // $ hasAndroidIntentRedirection
|
||||
startActivityForResult(intent, 0); // $ hasAndroidIntentRedirection
|
||||
startActivityForResult(intent, 0, null); // $ hasAndroidIntentRedirection
|
||||
startActivityForResult(null, intent, 0, null); // $ hasAndroidIntentRedirection
|
||||
startActivityForResultAsUser(intent, null, 0, null, null); // $ hasAndroidIntentRedirection
|
||||
startActivityForResultAsUser(intent, 0, null, null); // $ hasAndroidIntentRedirection
|
||||
startActivityForResultAsUser(intent, 0, null); // $ hasAndroidIntentRedirection
|
||||
}
|
||||
{
|
||||
Intent intent = (Intent) getIntent().getParcelableExtra("forward_intent");
|
||||
startService(intent); // $ hasAndroidIntentRedirect
|
||||
startServiceAsUser(intent, null); // $ hasAndroidIntentRedirect
|
||||
startService(intent); // $ hasAndroidIntentRedirection
|
||||
startServiceAsUser(intent, null); // $ hasAndroidIntentRedirection
|
||||
}
|
||||
{
|
||||
Intent intent = (Intent) getIntent().getParcelableExtra("forward_intent");
|
||||
sendBroadcast(intent); // $ hasAndroidIntentRedirect
|
||||
sendBroadcast(intent, null); // $ hasAndroidIntentRedirect
|
||||
sendBroadcast(intent, null, null); // $ hasAndroidIntentRedirect
|
||||
sendBroadcast(intent, null, 0); // $ hasAndroidIntentRedirect
|
||||
sendBroadcastAsUser(intent, null); // $ hasAndroidIntentRedirect
|
||||
sendBroadcastAsUser(intent, null, null); // $ hasAndroidIntentRedirect
|
||||
sendBroadcastAsUser(intent, null, null, null); // $ hasAndroidIntentRedirect
|
||||
sendBroadcastAsUser(intent, null, null, 0); // $ hasAndroidIntentRedirect
|
||||
sendBroadcastAsUserMultiplePermissions(intent, null, null); // $ hasAndroidIntentRedirect
|
||||
sendStickyBroadcast(intent); // $ hasAndroidIntentRedirect
|
||||
sendStickyBroadcastAsUser(intent, null); // $ hasAndroidIntentRedirect
|
||||
sendStickyBroadcastAsUser(intent, null, null); // $ hasAndroidIntentRedirect
|
||||
sendStickyOrderedBroadcast(intent, null, null, 0, null, null); // $ hasAndroidIntentRedirect
|
||||
sendStickyOrderedBroadcastAsUser(intent, null, null, null, 0, null, null); // $ hasAndroidIntentRedirect
|
||||
sendBroadcast(intent); // $ hasAndroidIntentRedirection
|
||||
sendBroadcast(intent, null); // $ hasAndroidIntentRedirection
|
||||
sendBroadcast(intent, null, null); // $ hasAndroidIntentRedirection
|
||||
sendBroadcast(intent, null, 0); // $ hasAndroidIntentRedirection
|
||||
sendBroadcastAsUser(intent, null); // $ hasAndroidIntentRedirection
|
||||
sendBroadcastAsUser(intent, null, null); // $ hasAndroidIntentRedirection
|
||||
sendBroadcastAsUser(intent, null, null, null); // $ hasAndroidIntentRedirection
|
||||
sendBroadcastAsUser(intent, null, null, 0); // $ hasAndroidIntentRedirection
|
||||
sendBroadcastAsUserMultiplePermissions(intent, null, null); // $ hasAndroidIntentRedirection
|
||||
sendStickyBroadcast(intent); // $ hasAndroidIntentRedirection
|
||||
sendStickyBroadcastAsUser(intent, null); // $ hasAndroidIntentRedirection
|
||||
sendStickyBroadcastAsUser(intent, null, null); // $ hasAndroidIntentRedirection
|
||||
sendStickyOrderedBroadcast(intent, null, null, 0, null, null); // $ hasAndroidIntentRedirection
|
||||
sendStickyOrderedBroadcastAsUser(intent, null, null, null, 0, null, null); // $ hasAndroidIntentRedirection
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
import java
|
||||
import semmle.code.java.security.AndroidIntentRedirectQuery
|
||||
import semmle.code.java.security.AndroidIntentRedirectionQuery
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class HasAndroidIntentRedirectTest extends InlineExpectationsTest {
|
||||
HasAndroidIntentRedirectTest() { this = "HasAndroidIntentRedirectTest" }
|
||||
class HasAndroidIntentRedirectionTest extends InlineExpectationsTest {
|
||||
HasAndroidIntentRedirectionTest() { this = "HasAndroidIntentRedirectionTest" }
|
||||
|
||||
override string getARelevantTag() { result = "hasAndroidIntentRedirect" }
|
||||
override string getARelevantTag() { result = "hasAndroidIntentRedirection" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "hasAndroidIntentRedirect" and
|
||||
exists(DataFlow::Node src, DataFlow::Node sink, IntentRedirectConfiguration conf |
|
||||
tag = "hasAndroidIntentRedirection" and
|
||||
exists(DataFlow::Node src, DataFlow::Node sink, IntentRedirectionConfiguration conf |
|
||||
conf.hasFlow(src, sink)
|
||||
|
|
||||
sink.getLocation() = location and
|
||||
@@ -9,7 +9,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" >
|
||||
<activity
|
||||
android:name=".AndroidIntentRedirectTest"
|
||||
android:name=".AndroidIntentRedirectionTest"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name">
|
||||
<intent-filter>
|
||||
|
||||
Reference in New Issue
Block a user