@@ -26,19 +26,33 @@ protocol UIApplicationDelegate {
2626}
2727
2828class UIScene {
29- class ConnectionOptions { }
29+ class ConnectionOptions {
30+ var userActivities : Set < NSUserActivity > { get { return Set ( ) } }
31+ var urlContexts : Set < UIOpenURLContext > { get { return Set ( ) } }
32+ }
3033}
3134
3235class UISceneSession { }
3336
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+ }
3547
3648class UIOpenURLContext : Hashable {
3749 static func == ( lhs: UIOpenURLContext , rhs: UIOpenURLContext ) -> Bool {
3850 return true ;
3951 }
4052
4153 func hash( into hasher: inout Hasher ) { }
54+
55+ var url : URL { get { return URL ( ) } }
4256}
4357
4458protocol UISceneDelegate {
@@ -64,28 +78,88 @@ class AppDelegate: UIApplicationDelegate {
6478 }
6579
6680 func application( _ application: UIApplication , didFinishLaunchingWithOptions launchOptions: [ UIApplication . LaunchOptionsKey : Any ] ? ) -> Bool {
67- launchOptions ? [ . url] // $ source=remote
81+ _ = launchOptions ? [ . url] // $ source=remote
6882 return true
6983 }
7084
7185 func application( _ application: UIApplication , willFinishLaunchingWithOptions launchOptions: [ UIApplication . LaunchOptionsKey : Any ] ? ) -> Bool {
72- launchOptions ? [ . url] // $ source=remote
86+ _ = launchOptions ? [ . url] // $ source=remote
7387 return true
7488 }
7589}
7690
7791class 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
92+ func scene( _: UIScene , willConnectTo: UISceneSession , options: UIScene . ConnectionOptions ) { // $ source=remote
93+ for userActivity in options. userActivities {
94+ let x = userActivity. webpageURL
95+ x // $ MISSING: tainted
96+ let y = userActivity. referrerURL
97+ y // $ MISSING: tainted
98+ }
99+
100+ for urlContext in options. urlContexts {
101+ let z = urlContext. url
102+ z // $ MISSING: tainted
103+ }
104+ }
105+
106+ func scene( _: UIScene , continue: NSUserActivity ) { // $ source=remote
107+ let x = `continue`. webpageURL
108+ x // $ tainted
109+ let y = `continue`. referrerURL
110+ y // $ MISSING: tainted
111+ }
112+
113+ func scene( _: UIScene , didUpdate: NSUserActivity ) { // $ source=remote
114+ let x = didUpdate. webpageURL
115+ x // $ tainted
116+ let y = didUpdate. referrerURL
117+ y // $ MISSING: tainted
118+ }
119+
120+ func scene( _: UIScene , openURLContexts: Set < UIOpenURLContext > ) { // $ source=remote
121+ for openURLContext in openURLContexts {
122+ let x = openURLContext. url
123+ x // $ MISSING: tainted
124+ }
125+ }
82126}
83127
84128class Extended { }
85129
86130extension 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
131+ func scene( _: UIScene , willConnectTo: UISceneSession , options: UIScene . ConnectionOptions ) { // $ source=remote
132+ for userActivity in options. userActivities {
133+ let x = userActivity. webpageURL
134+ x // $ MISSING: tainted
135+ let y = userActivity. referrerURL
136+ y // $ MISSING: tainted
137+ }
138+
139+ for urlContext in options. urlContexts {
140+ let z = urlContext. url
141+ z // $ MISSING: tainted
142+ }
143+ }
144+
145+ func scene( _: UIScene , continue: NSUserActivity ) { // $ source=remote
146+ let x = `continue`. webpageURL
147+ x // $ tainted
148+ let y = `continue`. referrerURL
149+ y // $ MISSING: tainted
150+ }
151+
152+ func scene( _: UIScene , didUpdate: NSUserActivity ) { // $ source=remote
153+ let x = didUpdate. webpageURL
154+ x // $ tainted
155+ let y = didUpdate. referrerURL
156+ y // $ MISSING: tainted
157+ }
158+
159+ func scene( _: UIScene , openURLContexts: Set < UIOpenURLContext > ) { // $ source=remote
160+ for openURLContext in openURLContexts {
161+ let x = openURLContext. url
162+ x // $ MISSING: tainted
163+ }
164+ }
91165}
0 commit comments