@@ -11,7 +11,7 @@ public void sendBroadcast1(Context context, String token, String refreshToken) {
11
11
intent .setAction ("com.example.custom_action" );
12
12
intent .putExtra ("token" , token );
13
13
intent .putExtra ("refreshToken" , refreshToken );
14
- context .sendBroadcast (intent );
14
+ context .sendBroadcast (intent ); // $ hasTaintFlow
15
15
}
16
16
17
17
// BAD - Tests broadcast of sensitive user information with intent extra.
@@ -23,7 +23,7 @@ public void sendBroadcast2(Context context) {
23
23
intent .setAction ("com.example.custom_action" );
24
24
intent .putExtra ("name" , userName );
25
25
intent .putExtra ("pwd" , password );
26
- context .sendBroadcast (intent );
26
+ context .sendBroadcast (intent ); // $ hasTaintFlow
27
27
}
28
28
29
29
// BAD - Tests broadcast of email information with extra bundle.
@@ -35,7 +35,7 @@ public void sendBroadcast3(Context context) {
35
35
Bundle bundle = new Bundle ();
36
36
bundle .putString ("email" , email );
37
37
intent .putExtras (bundle );
38
- context .sendBroadcast (intent );
38
+ context .sendBroadcast (intent ); // $ hasTaintFlow
39
39
}
40
40
41
41
// BAD - Tests broadcast of sensitive user information with null permission.
@@ -49,7 +49,7 @@ public void sendBroadcast4(Context context) {
49
49
userinfo .add (username );
50
50
userinfo .add (password );
51
51
intent .putStringArrayListExtra ("userinfo" , userinfo );
52
- context .sendBroadcast (intent , null );
52
+ context .sendBroadcast (intent , null ); // $ hasTaintFlow
53
53
}
54
54
55
55
// GOOD - Tests broadcast of sensitive user information with permission using string literal.
@@ -72,7 +72,7 @@ public void sendBroadcast6(Context context) {
72
72
intent .setAction ("com.example.custom_action" );
73
73
intent .putExtra ("ticket" , ticket );
74
74
String perm = "com.example.user_permission" ;
75
- context .sendBroadcast (intent , perm );
75
+ context .sendBroadcast (intent , perm ); // $ hasTaintFlow
76
76
}
77
77
78
78
// GOOD - Tests broadcast of sensitive user information to a specific application.
@@ -95,7 +95,7 @@ public void sendBroadcast8(Context context) {
95
95
Intent intent = new Intent ();
96
96
intent .setAction ("com.example.custom_action" );
97
97
intent .putExtra ("ticket" , ticket );
98
- context .sendBroadcastWithMultiplePermissions (intent , new String []{});
98
+ context .sendBroadcastWithMultiplePermissions (intent , new String []{}); // $ hasTaintFlow
99
99
}
100
100
101
101
// BAD - Tests broadcast of sensitive user information with multiple permissions using empty array initialization through a variable.
@@ -108,7 +108,7 @@ public void sendBroadcast9(Context context) {
108
108
intent .putExtra ("name" , username );
109
109
intent .putExtra ("pwd" , passcode );
110
110
String [] perms = new String [0 ];
111
- context .sendBroadcastWithMultiplePermissions (intent , perms );
111
+ context .sendBroadcastWithMultiplePermissions (intent , perms ); // $ hasTaintFlow
112
112
}
113
113
114
114
// GOOD - Tests broadcast of sensitive user information with multiple permissions.
@@ -133,11 +133,11 @@ public void sendBroadcast11(Context context) {
133
133
intent .setAction ("com.example.custom_action" );
134
134
Bundle bundle = new Bundle ();
135
135
bundle .putString ("name" , username );
136
- bundle .putString ("pwd" , passwd );
136
+ bundle .putString ("pwd" , passwd );
137
137
intent .putExtras (bundle );
138
138
String [] perms = new String [0 ];
139
139
String [] perms2 = perms ;
140
- context .sendBroadcastWithMultiplePermissions (intent , perms2 );
140
+ context .sendBroadcastWithMultiplePermissions (intent , perms2 ); // $ hasTaintFlow
141
141
}
142
142
143
143
/**
@@ -156,7 +156,7 @@ public void sendBroadcast12(Context context) {
156
156
intent .getExtras ().putString ("pwd" , password );
157
157
String [] perms = new String [0 ];
158
158
String [] perms2 = perms ;
159
- context .sendBroadcastWithMultiplePermissions (intent , perms2 );
159
+ context .sendBroadcastWithMultiplePermissions (intent , perms2 ); // $ hasTaintFlow
160
160
}
161
161
162
162
// GOOD - Tests broadcast of sensitive user information with ordered broadcast.
0 commit comments