Skip to content

[SecurityUI] Add this framework, introduced in Xcode 16.3. #22446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Foundation/NSObject.mac.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public partial class NSObject {
static IntPtr be = Dlfcn.dlopen (Constants.BrowserEngineKitLibrary, 1);
static IntPtr ce = Dlfcn.dlopen (Constants.CoreHapticsLibrary, 1);
static IntPtr da = Dlfcn.dlopen (Constants.DataDetectionLibrary, 1);
static IntPtr su = Dlfcn.dlopen (Constants.SecurityUILibrary, 1);

#if !NET
[Obsolete ("Use PlatformAssembly for easier code sharing across platforms.")]
Expand Down
6 changes: 6 additions & 0 deletions src/build/dotnet/generator-frameworks.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ partial class Frameworks {
"SceneKit",
"ScreenTime",
"Security",
"SecurityUI",
"SensitiveContentAnalysis",
"SensorKit",
"SharedWithYou",
Expand Down Expand Up @@ -266,6 +267,7 @@ partial class Frameworks {
"ScriptingBridge",
"SearchKit",
"Security",
"SecurityUI",
"SensitiveContentAnalysis",
"ServiceManagement",
"SharedWithYou",
Expand Down Expand Up @@ -360,6 +362,7 @@ partial class Frameworks {
"ReplayKit",
"SceneKit",
"Security",
"SecurityUI",
"SharedWithYou",
"SharedWithYouCore",
"ShazamKit",
Expand Down Expand Up @@ -487,6 +490,7 @@ partial class Frameworks {
"ScreenCaptureKit",
"ScreenTime",
"Security",
"SecurityUI",
"SensitiveContentAnalysis",
"SensorKit",
"ServiceManagement",
Expand Down Expand Up @@ -651,6 +655,7 @@ partial class Frameworks {
bool? _ScriptingBridge;
bool? _SearchKit;
bool? _Security;
bool? _SecurityUI;
bool? _SensitiveContentAnalysis;
bool? _SensorKit;
bool? _ServiceManagement;
Expand Down Expand Up @@ -820,6 +825,7 @@ partial class Frameworks {
public bool HaveScriptingBridge { get { if (!_ScriptingBridge.HasValue) _ScriptingBridge = GetValue ("ScriptingBridge"); return _ScriptingBridge.Value; } }
public bool HaveSearchKit { get { if (!_SearchKit.HasValue) _SearchKit = GetValue ("SearchKit"); return _SearchKit.Value; } }
public bool HaveSecurity { get { if (!_Security.HasValue) _Security = GetValue ("Security"); return _Security.Value; } }
public bool HaveSecurityUI { get { if (!_SecurityUI.HasValue) _SecurityUI = GetValue ("SecurityUI"); return _SecurityUI.Value; } }
public bool HaveSensitiveContentAnalysis { get { if (!_SensitiveContentAnalysis.HasValue) _SensitiveContentAnalysis = GetValue ("SensitiveContentAnalysis"); return _SensitiveContentAnalysis.Value; } }
public bool HaveSensorKit { get { if (!_SensorKit.HasValue) _SensorKit = GetValue ("SensorKit"); return _SensorKit.Value; } }
public bool HaveServiceManagement { get { if (!_ServiceManagement.HasValue) _ServiceManagement = GetValue ("ServiceManagement"); return _ServiceManagement.Value; } }
Expand Down
4 changes: 4 additions & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -2145,6 +2145,7 @@ MACOS_FRAMEWORKS = \
SensitiveContentAnalysis \
ServiceManagement \
Security \
SecurityUI \
SharedWithYou \
SharedWithYouCore \
Social \
Expand Down Expand Up @@ -2257,6 +2258,7 @@ IOS_FRAMEWORKS = \
SafetyKit \
ScreenTime \
Security \
SecurityUI \
SensitiveContentAnalysis \
SensorKit \
SharedWithYou \
Expand Down Expand Up @@ -2327,6 +2329,7 @@ TVOS_FRAMEWORKS = \
PhotosUI \
ReplayKit \
Security \
SecurityUI \
SharedWithYou \
SharedWithYouCore \
SystemConfiguration \
Expand Down Expand Up @@ -2426,6 +2429,7 @@ MACCATALYST_FRAMEWORKS = \
ScreenCaptureKit \
ScreenTime \
Security \
SecurityUI \
SensitiveContentAnalysis \
SensorKit \
ServiceManagement \
Expand Down
1 change: 1 addition & 0 deletions src/rsp/dotnet/ios-defines-dotnet.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
-d:HAS_SCENEKIT
-d:HAS_SCREENTIME
-d:HAS_SECURITY
-d:HAS_SECURITYUI
-d:HAS_SENSITIVECONTENTANALYSIS
-d:HAS_SENSORKIT
-d:HAS_SHAREDWITHYOU
Expand Down
1 change: 1 addition & 0 deletions src/rsp/dotnet/maccatalyst-defines-dotnet.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
-d:HAS_SCREENCAPTUREKIT
-d:HAS_SCREENTIME
-d:HAS_SECURITY
-d:HAS_SECURITYUI
-d:HAS_SENSITIVECONTENTANALYSIS
-d:HAS_SENSORKIT
-d:HAS_SERVICEMANAGEMENT
Expand Down
1 change: 1 addition & 0 deletions src/rsp/dotnet/macos-defines-dotnet.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
-d:HAS_SCRIPTINGBRIDGE
-d:HAS_SEARCHKIT
-d:HAS_SECURITY
-d:HAS_SECURITYUI
-d:HAS_SENSITIVECONTENTANALYSIS
-d:HAS_SERVICEMANAGEMENT
-d:HAS_SHAREDWITHYOU
Expand Down
1 change: 1 addition & 0 deletions src/rsp/dotnet/tvos-defines-dotnet.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
-d:HAS_REPLAYKIT
-d:HAS_SCENEKIT
-d:HAS_SECURITY
-d:HAS_SECURITYUI
-d:HAS_SHAREDWITHYOU
-d:HAS_SHAREDWITHYOUCORE
-d:HAS_SHAZAMKIT
Expand Down
51 changes: 51 additions & 0 deletions src/securityui.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System;

#if HAS_APPKIT
using AppKit;
#endif

using Foundation;
using ObjCRuntime;
using Security;

#if HAS_UIKIT
using UIKit;
#endif

namespace SecurityUI {
[TV (18, 4), MacCatalyst (18, 4), Mac (15, 4), iOS (18, 4)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SFCertificatePresentation {
[Export ("initWithTrust:")]
[DesignatedInitializer]
NativeHandle Constructor (SecTrust trust);

#if __MACOS__
[NoTV, NoiOS, NoMacCatalyst]
[Export ("presentSheetInWindow:dismissHandler:")]
void PresentSheet (NSWindow window, [NullAllowed] Action dismissHandler);
#endif

#if !__MACOS__
[NoMac]
[Export ("presentSheetInViewController:dismissHandler:")]
void PresentSheet (UIViewController viewController, [NullAllowed] Action dismissHandler);
#endif

[Export ("dismissSheet")]
void DismissSheet ();

[Export ("trust", ArgumentSemantic.Assign)]
SecTrust Trust { get; }

[NullAllowed, Export ("title")]
string Title { get; set; }

[NullAllowed, Export ("message")]
string Message { get; set; }

[NullAllowed, Export ("helpURL", ArgumentSemantic.Copy)]
NSUrl HelpUrl { get; set; }
}
}
10 changes: 10 additions & 0 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9281,6 +9281,7 @@ F:ObjCRuntime.Constants.ScriptingBridgeLibrary
F:ObjCRuntime.Constants.SdkVersion
F:ObjCRuntime.Constants.SearchKitLibrary
F:ObjCRuntime.Constants.SecurityLibrary
F:ObjCRuntime.Constants.SecurityUILibrary
F:ObjCRuntime.Constants.SensitiveContentAnalysisLibrary
F:ObjCRuntime.Constants.SensorKitLibrary
F:ObjCRuntime.Constants.ServiceManagementLibrary
Expand Down Expand Up @@ -35589,6 +35590,10 @@ M:Security.SslContext.Write(System.Byte[],System.IntPtr@)
M:Security.SslStreamConnection.#ctor(System.IO.Stream)
M:Security.SslStreamConnection.Read(System.IntPtr,System.IntPtr@)
M:Security.SslStreamConnection.Write(System.IntPtr,System.IntPtr@)
M:SecurityUI.SFCertificatePresentation.#ctor(Security.SecTrust)
M:SecurityUI.SFCertificatePresentation.DismissSheet
M:SecurityUI.SFCertificatePresentation.PresentSheet(AppKit.NSWindow,System.Action)
M:SecurityUI.SFCertificatePresentation.PresentSheet(UIKit.UIViewController,System.Action)
M:SensitiveContentAnalysis.SCSensitivityAnalyzer.AnalyzeImageAsync(CoreGraphics.CGImage)
M:SensitiveContentAnalysis.SCSensitivityAnalyzer.AnalyzeImageAsync(Foundation.NSUrl)
M:SensitiveContentAnalysis.SCSensitivityAnalyzer.AnalyzeVideoAsync(Foundation.NSUrl,Foundation.NSProgress@)
Expand Down Expand Up @@ -55909,6 +55914,10 @@ P:Security.SecTrustResultKey.OrganizationName
P:Security.SecTrustResultKey.ResultValue
P:Security.SecTrustResultKey.RevocationChecked
P:Security.SecTrustResultKey.RevocationValidUntilDate
P:SecurityUI.SFCertificatePresentation.HelpUrl
P:SecurityUI.SFCertificatePresentation.Message
P:SecurityUI.SFCertificatePresentation.Title
P:SecurityUI.SFCertificatePresentation.Trust
P:SensitiveContentAnalysis.SCSensitivityAnalysis.Sensitive
P:SensorKit.SRSensorReader.Delegate
P:SensorKit.SRSensorReader.Sensor
Expand Down Expand Up @@ -66939,6 +66948,7 @@ T:Security.SslStreamConnection
T:Security.TlsCipherSuite
T:Security.TlsCipherSuiteGroup
T:Security.TlsProtocolVersion
T:SecurityUI.SFCertificatePresentation
T:SensitiveContentAnalysis.SCSensitivityAnalysisPolicy
T:SensorKit.ISRSensorReaderDelegate
T:SensorKit.SRAbsoluteTime
Expand Down

This file was deleted.

11 changes: 0 additions & 11 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-SecurityUI.todo

This file was deleted.

11 changes: 0 additions & 11 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-SecurityUI.todo

This file was deleted.

11 changes: 0 additions & 11 deletions tests/xtro-sharpie/api-annotations-dotnet/tvOS-SecurityUI.todo

This file was deleted.

5 changes: 5 additions & 0 deletions tools/common/Frameworks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ public static Frameworks MacFrameworks {
// FSKit was removed from Xcode 16 RC, but keeping it commented, because it's likely to return in a later release
// { "FSKit", "FSKit", 15, 0 },
{ "MediaExtension", "MediaExtension", 15, 0 },

{ "SecurityUI", "SecurityUI", 15, 4 },
};
}
return mac_frameworks;
Expand Down Expand Up @@ -471,6 +473,8 @@ public static Frameworks CreateiOSFrameworks (bool is_simulator_build)

{ "AccessorySetupKit", "AccessorySetupKit", 18, 0 },

{ "SecurityUI", "SecurityUI", 18, 4 },

// the above MUST be kept in sync with simlauncher
// see tools/mtouch/Makefile
// please also keep it sorted to ease comparison
Expand Down Expand Up @@ -585,6 +589,7 @@ public static Frameworks TVOSFrameworks {

{ "BackgroundAssets", "BackgroundAssets", 18, 4 },
{ "MetalFX", "MetalFX", new Version (18, 4), NotAvailableInSimulator },
{ "SecurityUI", "SecurityUI", 18, 4 },
};
}
return tvos_frameworks;
Expand Down
Loading