@@ -26,19 +26,33 @@ protocol UIApplicationDelegate {
26
26
}
27
27
28
28
class UIScene {
29
- class ConnectionOptions { }
29
+ class ConnectionOptions {
30
+ var userActivities : Set < NSUserActivity > { get { return Set ( ) } }
31
+ var urlContexts : Set < UIOpenURLContext > { get { return Set ( ) } }
32
+ }
30
33
}
31
34
32
35
class UISceneSession { }
33
36
34
- class NSUserActivity { }
37
+ class NSUserActivity : Hashable {
38
+ static func == ( lhs: NSUserActivity , rhs: NSUserActivity ) -> Bool {
39
+ return true ;
40
+ }
41
+
42
+ func hash( into hasher: inout Hasher ) { }
43
+
44
+ var webpageURL : URL ? { get { return nil } set { } }
45
+ var referrerURL : URL ? { get { return nil } set { } }
46
+ }
35
47
36
48
class UIOpenURLContext : Hashable {
37
49
static func == ( lhs: UIOpenURLContext , rhs: UIOpenURLContext ) -> Bool {
38
50
return true ;
39
51
}
40
52
41
53
func hash( into hasher: inout Hasher ) { }
54
+
55
+ var url : URL { get { return URL ( ) } }
42
56
}
43
57
44
58
protocol UISceneDelegate {
@@ -48,6 +62,8 @@ protocol UISceneDelegate {
48
62
func scene( _: UIScene , openURLContexts: Set < UIOpenURLContext > )
49
63
}
50
64
65
+ func sink( arg: Any ) { }
66
+
51
67
// --- tests ---
52
68
53
69
class AppDelegate : UIApplicationDelegate {
@@ -64,28 +80,88 @@ class AppDelegate: UIApplicationDelegate {
64
80
}
65
81
66
82
func application( _ application: UIApplication , didFinishLaunchingWithOptions launchOptions: [ UIApplication . LaunchOptionsKey : Any ] ? ) -> Bool {
67
- launchOptions ? [ . url] // $ source=remote
83
+ _ = launchOptions ? [ . url] // $ source=remote
68
84
return true
69
85
}
70
86
71
87
func application( _ application: UIApplication , willFinishLaunchingWithOptions launchOptions: [ UIApplication . LaunchOptionsKey : Any ] ? ) -> Bool {
72
- launchOptions ? [ . url] // $ source=remote
88
+ _ = launchOptions ? [ . url] // $ source=remote
73
89
return true
74
90
}
75
91
}
76
92
77
93
class SceneDelegate : UISceneDelegate {
78
- func scene( _: UIScene , willConnectTo: UISceneSession , options: UIScene . ConnectionOptions ) { } // $ source=remote
79
- func scene( _: UIScene , continue: NSUserActivity ) { } // $ source=remote
80
- func scene( _: UIScene , didUpdate: NSUserActivity ) { } // $ source=remote
81
- func scene( _: UIScene , openURLContexts: Set < UIOpenURLContext > ) { } // $ source=remote
94
+ func scene( _: UIScene , willConnectTo: UISceneSession , options: UIScene . ConnectionOptions ) { // $ source=remote
95
+ for userActivity in options. userActivities {
96
+ let x = userActivity. webpageURL
97
+ sink ( arg: x) // $ MISSING: tainted
98
+ let y = userActivity. referrerURL
99
+ sink ( arg: y) // $ MISSING: tainted
100
+ }
101
+
102
+ for urlContext in options. urlContexts {
103
+ let z = urlContext. url
104
+ sink ( arg: z) // $ MISSING: tainted
105
+ }
106
+ }
107
+
108
+ func scene( _: UIScene , continue: NSUserActivity ) { // $ source=remote
109
+ let x = `continue`. webpageURL
110
+ sink ( arg: x) // $ tainted
111
+ let y = `continue`. referrerURL
112
+ sink ( arg: y) // $ tainted
113
+ }
114
+
115
+ func scene( _: UIScene , didUpdate: NSUserActivity ) { // $ source=remote
116
+ let x = didUpdate. webpageURL
117
+ sink ( arg: x) // $ tainted
118
+ let y = didUpdate. referrerURL
119
+ sink ( arg: y) // $ tainted
120
+ }
121
+
122
+ func scene( _: UIScene , openURLContexts: Set < UIOpenURLContext > ) { // $ source=remote
123
+ for openURLContext in openURLContexts {
124
+ let x = openURLContext. url
125
+ sink ( arg: x) // $ MISSING: tainted
126
+ }
127
+ }
82
128
}
83
129
84
130
class Extended { }
85
131
86
132
extension Extended : UISceneDelegate {
87
- func scene( _: UIScene , willConnectTo: UISceneSession , options: UIScene . ConnectionOptions ) { } // $ source=remote
88
- func scene( _: UIScene , continue: NSUserActivity ) { } // $ source=remote
89
- func scene( _: UIScene , didUpdate: NSUserActivity ) { } // $ source=remote
90
- func scene( _: UIScene , openURLContexts: Set < UIOpenURLContext > ) { } // $ source=remote
133
+ func scene( _: UIScene , willConnectTo: UISceneSession , options: UIScene . ConnectionOptions ) { // $ source=remote
134
+ for userActivity in options. userActivities {
135
+ let x = userActivity. webpageURL
136
+ sink ( arg: x) // $ MISSING: tainted
137
+ let y = userActivity. referrerURL
138
+ sink ( arg: y) // $ MISSING: tainted
139
+ }
140
+
141
+ for urlContext in options. urlContexts {
142
+ let z = urlContext. url
143
+ sink ( arg: z) // $ MISSING: tainted
144
+ }
145
+ }
146
+
147
+ func scene( _: UIScene , continue: NSUserActivity ) { // $ source=remote
148
+ let x = `continue`. webpageURL
149
+ sink ( arg: x) // $ tainted
150
+ let y = `continue`. referrerURL
151
+ sink ( arg: y) // $ tainted
152
+ }
153
+
154
+ func scene( _: UIScene , didUpdate: NSUserActivity ) { // $ source=remote
155
+ let x = didUpdate. webpageURL
156
+ sink ( arg: x) // $ tainted
157
+ let y = didUpdate. referrerURL
158
+ sink ( arg: y) // $ tainted
159
+ }
160
+
161
+ func scene( _: UIScene , openURLContexts: Set < UIOpenURLContext > ) { // $ source=remote
162
+ for openURLContext in openURLContexts {
163
+ let x = openURLContext. url
164
+ sink ( arg: x) // $ MISSING: tainted
165
+ }
166
+ }
91
167
}
0 commit comments