Skip to content

Commit 2ca164c

Browse files
Generate androidx stubs and correct some models
1 parent bafd65b commit 2ca164c

File tree

7 files changed

+487
-603
lines changed

7 files changed

+487
-603
lines changed

java/ql/lib/ext/androidx.core.app.model.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extensions:
1111
- ["androidx.core.app", "NotificationManagerCompat", True, "notify", "(int,Notification)", "", "Argument[1]", "pending-intents", "manual"]
1212

1313
- ["androidx.core.app", "NotificationCompat$Action", True, "Action", "(int,CharSequence,PendingIntent)", "", "Argument[1..2]", "notification", "manual"]
14-
- ["androidx.core.app", "NotificationCompat$Action$Builder", True, "Builder", "(Icon,CharSequence,PendingIntent)", "", "Argument[1..2]", "notification", "manual"]
14+
- ["androidx.core.app", "NotificationCompat$Action$Builder", True, "Builder", "(IconCompat,CharSequence,PendingIntent)", "", "Argument[1..2]", "notification", "manual"]
1515
- ["androidx.core.app", "NotificationCompat$Action$Builder", True, "Builder", "(int,CharSequence,PendingIntent)", "", "Argument[1..2]", "notification", "manual"]
1616
- ["androidx.core.app", "NotificationCompat$Action$Builder", True, "addExtras", "(Bundle)", "", "Argument[0]", "notification", "manual"]
1717
- ["androidx.core.app", "NotificationCompat$BigPictureStyle", True, "setBigContentTitle", "(CharSequence)", "", "Argument[0]", "notification", "manual"]
@@ -47,8 +47,6 @@ extensions:
4747
- ["androidx.core.app", "NotificationCompat$InboxStyle", True, "addLine", "(CharSequence)", "", "Argument[0]", "notification", "manual"]
4848
- ["androidx.core.app", "NotificationCompat$InboxStyle", True, "setBigContentTitle", "(CharSequence)", "", "Argument[0]", "notification", "manual"]
4949
- ["androidx.core.app", "NotificationCompat$InboxStyle", True, "setSummaryText", "(CharSequence)", "", "Argument[0]", "notification", "manual"]
50-
- ["androidx.core.app", "NotificationCompat$MediaStyle", True, "setRemotePlaybackInfo", "(CharSequence,int,PendingIntent)", "", "Argument[0]", "notification", "manual"]
51-
- ["androidx.core.app", "NotificationCompat$MediaStyle", True, "setRemotePlaybackInfo", "(CharSequence,int,PendingIntent)", "", "Argument[2]", "notification", "manual"]
5250
- ["androidx.core.app", "NotificationCompat$MessagingStyle", True, "addMessage", "(CharSequence,long,CharSequence)", "", "Argument[0]", "notification", "manual"]
5351
- ["androidx.core.app", "NotificationCompat$MessagingStyle", True, "addMessage", "(CharSequence,long,CharSequence)", "", "Argument[2]", "notification", "manual"]
5452
- ["androidx.core.app", "NotificationCompat$MessagingStyle", True, "addMessage", "(CharSequence,long,Person)", "", "Argument[0]", "notification", "manual"]

java/ql/test/query-tests/security/CWE-200/semmle/tests/SensitiveNotification/Test.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import android.app.Activity;
22
import android.app.Notification;
3-
import android.app.Person;
43
import androidx.core.app.NotificationCompat;
54
import android.content.Intent;
65
import android.app.PendingIntent;
@@ -43,17 +42,17 @@ void test(String password) {
4342
.addLine(password) // $sensitive-notification
4443
.setBigContentTitle(password) // $sensitive-notification
4544
.setSummaryText(password)); // $sensitive-notification
46-
builder.setStyle(new Notification.MediaStyle()
47-
.setRemotePlaybackInfo(password, 0, null) // $sensitive-notification
48-
.setRemotePlaybackInfo("", 0, pintent)); // $MISSING: sensitive-notification
45+
// builder.setStyle(new Notification.MediaStyle()
46+
// .setRemotePlaybackInfo(password, 0, null) // $sensitive-notification
47+
// .setRemotePlaybackInfo("", 0, pintent)); // $MISSING: sensitive-notification
4948
builder.setStyle(
5049
new Notification.MessagingStyle(password) // $sensitive-notification
5150
.setConversationTitle(password) // $sensitive-notification
5251
.addMessage(password, 0, "") // $sensitive-notification
53-
.addMessage(password, 0, (Person)null) // $sensitive-notification
52+
.addMessage(password, 0, (android.app.Person)null) // $sensitive-notification
5453
.addMessage("", 0, password) // $sensitive-notification
5554
.addMessage(new Notification.MessagingStyle.Message(password, 0, "")) // $sensitive-notification
56-
.addMessage(new Notification.MessagingStyle.Message(password, 0, (Person)null)) // $sensitive-notification
55+
.addMessage(new Notification.MessagingStyle.Message(password, 0, (android.app.Person)null)) // $sensitive-notification
5756
.addMessage(new Notification.MessagingStyle.Message("", 0, password)) // $sensitive-notification
5857
);
5958

@@ -121,17 +120,14 @@ void test3(String password) {
121120
.addLine(password) // $sensitive-notification
122121
.setBigContentTitle(password) // $sensitive-notification
123122
.setSummaryText(password)); // $sensitive-notification
124-
builder.setStyle(new NotificationCompat.MediaStyle()
125-
.setRemotePlaybackInfo(password, 0, null) // $sensitive-notification
126-
.setRemotePlaybackInfo("", 0, pintent)); // $MISSING: sensitive-notification
127123
builder.setStyle(
128124
new NotificationCompat.MessagingStyle(password) // $sensitive-notification
129125
.setConversationTitle(password) // $sensitive-notification
130126
.addMessage(password, 0, "") // $sensitive-notification
131-
.addMessage(password, 0, (Person)null) // $sensitive-notification
127+
.addMessage(password, 0, (androidx.core.app.Person)null) // $sensitive-notification
132128
.addMessage("", 0, password) // $sensitive-notification
133129
.addMessage(new NotificationCompat.MessagingStyle.Message(password, 0, "")) // $sensitive-notification
134-
.addMessage(new NotificationCompat.MessagingStyle.Message(password, 0, (Person)null)) // $sensitive-notification
130+
.addMessage(new NotificationCompat.MessagingStyle.Message(password, 0, (androidx.core.app.Person)null)) // $sensitive-notification
135131
.addMessage(new NotificationCompat.MessagingStyle.Message("", 0, password)) // $sensitive-notification
136132
);
137133

java/ql/test/stubs/google-android-9.0.0/android/content/pm/ShortcutInfo.java

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)