diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/Info.plist b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/Info.plist new file mode 100644 index 0000000..18cdb4c --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/Info.plist @@ -0,0 +1,80 @@ + + + + + AvailableLibraries + + + LibraryIdentifier + ios-arm64 + LibraryPath + Libbox.framework + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + Libbox.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + LibraryIdentifier + tvos-arm64 + LibraryPath + Libbox.framework + SupportedArchitectures + + arm64 + + SupportedPlatform + tvos + + + LibraryIdentifier + macos-arm64_x86_64 + LibraryPath + Libbox.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + macos + + + LibraryIdentifier + tvos-arm64_x86_64-simulator + LibraryPath + Libbox.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + tvos + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Headers b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Headers new file mode 100644 index 0000000..a177d2a --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Libbox b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Libbox new file mode 100644 index 0000000..97ad876 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Libbox @@ -0,0 +1 @@ +Versions/Current/Libbox \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Modules b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Modules new file mode 100644 index 0000000..5736f31 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Modules @@ -0,0 +1 @@ +Versions/Current/Modules \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Resources b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Resources new file mode 100644 index 0000000..953ee36 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Headers/Libbox.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Headers/Libbox.h new file mode 100644 index 0000000..7e3aff4 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Headers/Libbox.h @@ -0,0 +1,13 @@ + +// Objective-C API for talking to the following Go packages +// +// github.com/sagernet/sing-box/experimental/libbox +// +// File is generated by gomobile bind. Do not edit. +#ifndef __Libbox_FRAMEWORK_H__ +#define __Libbox_FRAMEWORK_H__ + +#include "Libbox.objc.h" +#include "Universe.objc.h" + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Headers/Libbox.objc.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Headers/Libbox.objc.h new file mode 100644 index 0000000..98f33b9 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Headers/Libbox.objc.h @@ -0,0 +1,811 @@ +// Objective-C API for talking to github.com/sagernet/sing-box/experimental/libbox Go package. +// gobind -lang=objc github.com/sagernet/sing-box/experimental/libbox +// +// File is generated by gobind. Do not edit. + +#ifndef __Libbox_H__ +#define __Libbox_H__ + +@import Foundation; +#include "ref.h" +#include "Universe.objc.h" + + +@class LibboxBoxService; +@class LibboxCommandClient; +@class LibboxCommandClientOptions; +@class LibboxCommandServer; +@class LibboxErrorMessage; +@class LibboxExchangeContext; +@class LibboxImportRemoteProfile; +@class LibboxNetworkInterface; +@class LibboxOutboundGroup; +@class LibboxOutboundGroupItem; +@class LibboxPProfServer; +@class LibboxProfileContent; +@class LibboxProfileContentRequest; +@class LibboxProfileDecoder; +@class LibboxProfileEncoder; +@class LibboxProfilePreview; +@class LibboxRoutePrefix; +@class LibboxStatusMessage; +@class LibboxSystemProxyStatus; +@class LibboxWIFIState; +@protocol LibboxCommandClientHandler; +@class LibboxCommandClientHandler; +@protocol LibboxCommandServerHandler; +@class LibboxCommandServerHandler; +@protocol LibboxFunc; +@class LibboxFunc; +@protocol LibboxHTTPClient; +@class LibboxHTTPClient; +@protocol LibboxHTTPRequest; +@class LibboxHTTPRequest; +@protocol LibboxHTTPResponse; +@class LibboxHTTPResponse; +@protocol LibboxInterfaceUpdateListener; +@class LibboxInterfaceUpdateListener; +@protocol LibboxLocalDNSTransport; +@class LibboxLocalDNSTransport; +@protocol LibboxNetworkInterfaceIterator; +@class LibboxNetworkInterfaceIterator; +@protocol LibboxOnDemandRule; +@class LibboxOnDemandRule; +@protocol LibboxOnDemandRuleIterator; +@class LibboxOnDemandRuleIterator; +@protocol LibboxOutboundGroupItemIterator; +@class LibboxOutboundGroupItemIterator; +@protocol LibboxOutboundGroupIterator; +@class LibboxOutboundGroupIterator; +@protocol LibboxPlatformInterface; +@class LibboxPlatformInterface; +@protocol LibboxProfilePreviewIterator; +@class LibboxProfilePreviewIterator; +@protocol LibboxRoutePrefixIterator; +@class LibboxRoutePrefixIterator; +@protocol LibboxStringIterator; +@class LibboxStringIterator; +@protocol LibboxTunInterface; +@class LibboxTunInterface; +@protocol LibboxTunOptions; +@class LibboxTunOptions; + +@protocol LibboxCommandClientHandler +- (void)clearLog; +- (void)connected; +- (void)disconnected:(NSString* _Nullable)message; +- (void)initializeClashMode:(id _Nullable)modeList currentMode:(NSString* _Nullable)currentMode; +- (void)updateClashMode:(NSString* _Nullable)newMode; +- (void)writeGroups:(id _Nullable)message; +- (void)writeLog:(NSString* _Nullable)message; +- (void)writeStatus:(LibboxStatusMessage* _Nullable)message; +@end + +@protocol LibboxCommandServerHandler +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus; +- (void)postServiceClose; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxFunc +- (BOOL)invoke:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxHTTPClient +- (void)close; +- (void)keepAlive; +- (void)modernTLS; +- (id _Nullable)newRequest; +- (void)pinnedSHA256:(NSString* _Nullable)sumHex; +- (void)pinnedTLS12; +- (void)restrictedTLS; +- (void)trySocks5:(int32_t)port; +@end + +@protocol LibboxHTTPRequest +- (id _Nullable)execute:(NSError* _Nullable* _Nullable)error; +- (void)randomUserAgent; +- (void)setContent:(NSData* _Nullable)content; +- (void)setContentString:(NSString* _Nullable)content; +- (void)setHeader:(NSString* _Nullable)key value:(NSString* _Nullable)value; +- (void)setMethod:(NSString* _Nullable)method; +- (BOOL)setURL:(NSString* _Nullable)link error:(NSError* _Nullable* _Nullable)error; +- (void)setUserAgent:(NSString* _Nullable)userAgent; +@end + +@protocol LibboxHTTPResponse +- (NSData* _Nullable)getContent:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)getContentString:(NSError* _Nullable* _Nullable)error; +- (BOOL)writeTo:(NSString* _Nullable)path error:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxInterfaceUpdateListener +- (void)updateDefaultInterface:(NSString* _Nullable)interfaceName interfaceIndex:(int32_t)interfaceIndex; +@end + +@protocol LibboxLocalDNSTransport +- (BOOL)exchange:(LibboxExchangeContext* _Nullable)ctx message:(NSData* _Nullable)message error:(NSError* _Nullable* _Nullable)error; +- (BOOL)lookup:(LibboxExchangeContext* _Nullable)ctx network:(NSString* _Nullable)network domain:(NSString* _Nullable)domain error:(NSError* _Nullable* _Nullable)error; +- (BOOL)raw; +@end + +@protocol LibboxNetworkInterfaceIterator +- (BOOL)hasNext; +- (LibboxNetworkInterface* _Nullable)next; +@end + +@protocol LibboxOnDemandRule +- (id _Nullable)dnsSearchDomainMatch; +- (id _Nullable)dnsServerAddressMatch; +- (int32_t)interfaceTypeMatch; +- (NSString* _Nonnull)probeURL; +- (id _Nullable)ssidMatch; +- (int32_t)target; +@end + +@protocol LibboxOnDemandRuleIterator +- (BOOL)hasNext; +- (id _Nullable)next; +@end + +@protocol LibboxOutboundGroupItemIterator +- (BOOL)hasNext; +- (LibboxOutboundGroupItem* _Nullable)next; +@end + +@protocol LibboxOutboundGroupIterator +- (BOOL)hasNext; +- (LibboxOutboundGroup* _Nullable)next; +@end + +@protocol LibboxPlatformInterface +- (BOOL)autoDetectInterfaceControl:(int32_t)fd error:(NSError* _Nullable* _Nullable)error; +- (void)clearDNSCache; +- (BOOL)closeDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)findConnectionOwner:(int32_t)ipProtocol sourceAddress:(NSString* _Nullable)sourceAddress sourcePort:(int32_t)sourcePort destinationAddress:(NSString* _Nullable)destinationAddress destinationPort:(int32_t)destinationPort ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getInterfaces:(NSError* _Nullable* _Nullable)error; +- (BOOL)includeAllNetworks; +- (BOOL)openTun:(id _Nullable)options ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)packageNameByUid:(int32_t)uid error:(NSError* _Nullable* _Nullable)error; +- (LibboxWIFIState* _Nullable)readWIFIState; +- (BOOL)startDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)uidByPackageName:(NSString* _Nullable)packageName ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (BOOL)underNetworkExtension; +- (BOOL)usePlatformAutoDetectInterfaceControl; +- (BOOL)usePlatformDefaultInterfaceMonitor; +- (BOOL)usePlatformInterfaceGetter; +- (BOOL)useProcFS; +- (void)writeLog:(NSString* _Nullable)message; +@end + +@protocol LibboxProfilePreviewIterator +- (BOOL)hasNext; +- (LibboxProfilePreview* _Nullable)next; +@end + +@protocol LibboxRoutePrefixIterator +- (BOOL)hasNext; +- (LibboxRoutePrefix* _Nullable)next; +@end + +@protocol LibboxStringIterator +- (BOOL)hasNext; +- (NSString* _Nonnull)next; +@end + +@protocol LibboxTunInterface +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (int32_t)fileDescriptor; +@end + +@protocol LibboxTunOptions +- (BOOL)getAutoRoute; +- (NSString* _Nonnull)getDNSServerAddress:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getExcludePackage; +- (id _Nullable)getHTTPProxyBypassDomain; +- (id _Nullable)getHTTPProxyMatchDomain; +- (NSString* _Nonnull)getHTTPProxyServer; +- (int32_t)getHTTPProxyServerPort; +- (id _Nullable)getIncludePackage; +- (id _Nullable)getInet4Address; +- (id _Nullable)getInet4RouteAddress; +- (id _Nullable)getInet4RouteExcludeAddress; +- (id _Nullable)getInet4RouteRange; +- (id _Nullable)getInet6Address; +- (id _Nullable)getInet6RouteAddress; +- (id _Nullable)getInet6RouteExcludeAddress; +- (id _Nullable)getInet6RouteRange; +- (int32_t)getMTU; +- (BOOL)getStrictRoute; +- (BOOL)isHTTPProxyEnabled; +@end + +@interface LibboxBoxService : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (BOOL)needWIFIState; +- (void)pause; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +- (void)wake; +@end + +@interface LibboxCommandClient : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(id _Nullable)handler options:(LibboxCommandClientOptions* _Nullable)options; +- (BOOL)closeConnections:(NSError* _Nullable* _Nullable)error; +- (BOOL)connect:(NSError* _Nullable* _Nullable)error; +- (BOOL)disconnect:(NSError* _Nullable* _Nullable)error; +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus:(NSError* _Nullable* _Nullable)error; +- (BOOL)selectOutbound:(NSString* _Nullable)groupTag outboundTag:(NSString* _Nullable)outboundTag error:(NSError* _Nullable* _Nullable)error; +- (BOOL)serviceClose:(NSError* _Nullable* _Nullable)error; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setClashMode:(NSString* _Nullable)newMode error:(NSError* _Nullable* _Nullable)error; +- (BOOL)setGroupExpand:(NSString* _Nullable)groupTag isExpand:(BOOL)isExpand error:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +- (BOOL)urlTest:(NSString* _Nullable)groupTag error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxCommandClientOptions : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int32_t command; +@property (nonatomic) int64_t statusInterval; +@end + +@interface LibboxCommandServer : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(id _Nullable)handler maxLines:(int32_t)maxLines; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (void)resetLog; +- (void)setService:(LibboxBoxService* _Nullable)newService; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +- (void)writeMessage:(NSString* _Nullable)message; +@end + +@interface LibboxErrorMessage : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull message; +- (NSData* _Nullable)encode; +@end + +@interface LibboxExchangeContext : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (void)errnoCode:(int32_t)code; +- (void)errorCode:(int32_t)code; +- (void)onCancel:(id _Nullable)callback; +- (void)rawSuccess:(NSData* _Nullable)result; +- (void)success:(NSString* _Nullable)result; +@end + +@interface LibboxImportRemoteProfile : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) NSString* _Nonnull url; +@property (nonatomic) NSString* _Nonnull host; +@end + +@interface LibboxNetworkInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int32_t index; +@property (nonatomic) int32_t mtu; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) id _Nullable addresses; +@end + +@interface LibboxOutboundGroup : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull tag; +@property (nonatomic) NSString* _Nonnull type; +@property (nonatomic) BOOL selectable; +@property (nonatomic) NSString* _Nonnull selected; +@property (nonatomic) BOOL isExpand; +- (id _Nullable)getItems; +@end + +@interface LibboxOutboundGroupItem : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull tag; +@property (nonatomic) NSString* _Nonnull type; +@property (nonatomic) int64_t urlTestTime; +@property (nonatomic) int32_t urlTestDelay; +@end + +@interface LibboxPProfServer : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(long)port; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxProfileContent : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) int32_t type; +@property (nonatomic) NSString* _Nonnull config; +@property (nonatomic) NSString* _Nonnull remotePath; +@property (nonatomic) BOOL autoUpdate; +@property (nonatomic) int32_t autoUpdateInterval; +@property (nonatomic) int64_t lastUpdated; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfileContentRequest : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t profileID; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfileDecoder : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (BOOL)decode:(NSData* _Nullable)data error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)iterator; +@end + +@interface LibboxProfileEncoder : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (void)append:(LibboxProfilePreview* _Nullable)profile; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfilePreview : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t profileID; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) int32_t type; +@end + +@interface LibboxRoutePrefix : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (NSString* _Nonnull)address; +- (NSString* _Nonnull)mask; +- (int32_t)prefix; +- (NSString* _Nonnull)string; +@end + +@interface LibboxStatusMessage : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t memory; +@property (nonatomic) int32_t goroutines; +@property (nonatomic) int32_t connectionsIn; +@property (nonatomic) int32_t connectionsOut; +@property (nonatomic) BOOL trafficAvailable; +@property (nonatomic) int64_t uplink; +@property (nonatomic) int64_t downlink; +@property (nonatomic) int64_t uplinkTotal; +@property (nonatomic) int64_t downlinkTotal; +@end + +@interface LibboxSystemProxyStatus : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) BOOL available; +@property (nonatomic) BOOL enabled; +@end + +@interface LibboxWIFIState : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(NSString* _Nullable)wifiSSID wifiBSSID:(NSString* _Nullable)wifiBSSID; +@property (nonatomic) NSString* _Nonnull ssid; +@property (nonatomic) NSString* _Nonnull bssid; +@end + +FOUNDATION_EXPORT const int32_t LibboxCommandClashMode; +FOUNDATION_EXPORT const int32_t LibboxCommandCloseConnections; +FOUNDATION_EXPORT const int32_t LibboxCommandGetSystemProxyStatus; +FOUNDATION_EXPORT const int32_t LibboxCommandGroup; +FOUNDATION_EXPORT const int32_t LibboxCommandGroupExpand; +FOUNDATION_EXPORT const int32_t LibboxCommandLog; +FOUNDATION_EXPORT const int32_t LibboxCommandSelectOutbound; +FOUNDATION_EXPORT const int32_t LibboxCommandServiceClose; +FOUNDATION_EXPORT const int32_t LibboxCommandServiceReload; +FOUNDATION_EXPORT const int32_t LibboxCommandSetClashMode; +FOUNDATION_EXPORT const int32_t LibboxCommandSetSystemProxyEnabled; +FOUNDATION_EXPORT const int32_t LibboxCommandStatus; +FOUNDATION_EXPORT const int32_t LibboxCommandURLTest; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeError; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileContent; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileContentRequest; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileList; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeLocal; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeRemote; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeiCloud; + +FOUNDATION_EXPORT BOOL LibboxCheckConfig(NSString* _Nullable configContent, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void LibboxClearServiceError(void); + +FOUNDATION_EXPORT LibboxErrorMessage* _Nullable LibboxDecodeErrorMessage(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT int32_t LibboxDecodeLengthChunk(NSData* _Nullable data); + +FOUNDATION_EXPORT LibboxProfileContent* _Nullable LibboxDecodeProfileContent(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT LibboxProfileContentRequest* _Nullable LibboxDecodeProfileContentRequest(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSData* _Nullable LibboxEncodeChunkedMessage(NSData* _Nullable data); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatBytes(int64_t length); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatConfig(NSString* _Nullable configContent, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatMemoryBytes(int64_t length); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxGenerateRemoteProfileImportLink(NSString* _Nullable name, NSString* _Nullable remoteURL); + +FOUNDATION_EXPORT int32_t LibboxGetTunnelFileDescriptor(void); + +FOUNDATION_EXPORT LibboxCommandClient* _Nullable LibboxNewCommandClient(id _Nullable handler, LibboxCommandClientOptions* _Nullable options); + +FOUNDATION_EXPORT LibboxCommandServer* _Nullable LibboxNewCommandServer(id _Nullable handler, int32_t maxLines); + +FOUNDATION_EXPORT id _Nullable LibboxNewHTTPClient(void); + +FOUNDATION_EXPORT LibboxPProfServer* _Nullable LibboxNewPProfServer(long port); + +FOUNDATION_EXPORT LibboxBoxService* _Nullable LibboxNewService(NSString* _Nullable configContent, id _Nullable platformInterface, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT LibboxCommandClient* _Nullable LibboxNewStandaloneCommandClient(void); + +FOUNDATION_EXPORT LibboxWIFIState* _Nullable LibboxNewWIFIState(NSString* _Nullable wifiSSID, NSString* _Nullable wifiBSSID); + +FOUNDATION_EXPORT LibboxImportRemoteProfile* _Nullable LibboxParseRemoteProfileImportLink(NSString* _Nullable importLink, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxProxyDisplayType(NSString* _Nullable proxyType); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxReadServiceError(NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT BOOL LibboxRedirectStderr(NSString* _Nullable path, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void LibboxRegisterLocalDNSTransport(id _Nullable transport); + +FOUNDATION_EXPORT void LibboxSetMemoryLimit(BOOL enabled); + +FOUNDATION_EXPORT void LibboxSetup(NSString* _Nullable basePath, NSString* _Nullable workingPath, NSString* _Nullable tempPath, BOOL isTVOS); + +FOUNDATION_EXPORT BOOL LibboxSetupWithUsername(NSString* _Nullable basePath, NSString* _Nullable workingPath, NSString* _Nullable tempPath, NSString* _Nullable username, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxVersion(void); + +FOUNDATION_EXPORT BOOL LibboxWriteServiceError(NSString* _Nullable message, NSError* _Nullable* _Nullable error); + +@class LibboxCommandClientHandler; + +@class LibboxCommandServerHandler; + +@class LibboxFunc; + +@class LibboxHTTPClient; + +@class LibboxHTTPRequest; + +@class LibboxHTTPResponse; + +@class LibboxInterfaceUpdateListener; + +@class LibboxLocalDNSTransport; + +@class LibboxNetworkInterfaceIterator; + +@class LibboxOnDemandRule; + +@class LibboxOnDemandRuleIterator; + +@class LibboxOutboundGroupItemIterator; + +@class LibboxOutboundGroupIterator; + +@class LibboxPlatformInterface; + +@class LibboxProfilePreviewIterator; + +@class LibboxRoutePrefixIterator; + +@class LibboxStringIterator; + +@class LibboxTunInterface; + +@class LibboxTunOptions; + +@interface LibboxCommandClientHandler : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)clearLog; +- (void)connected; +- (void)disconnected:(NSString* _Nullable)message; +- (void)initializeClashMode:(id _Nullable)modeList currentMode:(NSString* _Nullable)currentMode; +- (void)updateClashMode:(NSString* _Nullable)newMode; +- (void)writeGroups:(id _Nullable)message; +- (void)writeLog:(NSString* _Nullable)message; +- (void)writeStatus:(LibboxStatusMessage* _Nullable)message; +@end + +@interface LibboxCommandServerHandler : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus; +- (void)postServiceClose; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxFunc : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)invoke:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxHTTPClient : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)close; +- (void)keepAlive; +- (void)modernTLS; +- (id _Nullable)newRequest; +- (void)pinnedSHA256:(NSString* _Nullable)sumHex; +- (void)pinnedTLS12; +- (void)restrictedTLS; +- (void)trySocks5:(int32_t)port; +@end + +@interface LibboxHTTPRequest : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (id _Nullable)execute:(NSError* _Nullable* _Nullable)error; +- (void)randomUserAgent; +- (void)setContent:(NSData* _Nullable)content; +- (void)setContentString:(NSString* _Nullable)content; +- (void)setHeader:(NSString* _Nullable)key value:(NSString* _Nullable)value; +- (void)setMethod:(NSString* _Nullable)method; +- (BOOL)setURL:(NSString* _Nullable)link error:(NSError* _Nullable* _Nullable)error; +- (void)setUserAgent:(NSString* _Nullable)userAgent; +@end + +@interface LibboxHTTPResponse : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSData* _Nullable)getContent:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)getContentString:(NSError* _Nullable* _Nullable)error; +- (BOOL)writeTo:(NSString* _Nullable)path error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxInterfaceUpdateListener : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)updateDefaultInterface:(NSString* _Nullable)interfaceName interfaceIndex:(int32_t)interfaceIndex; +@end + +@interface LibboxLocalDNSTransport : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)exchange:(LibboxExchangeContext* _Nullable)ctx message:(NSData* _Nullable)message error:(NSError* _Nullable* _Nullable)error; +- (BOOL)lookup:(LibboxExchangeContext* _Nullable)ctx network:(NSString* _Nullable)network domain:(NSString* _Nullable)domain error:(NSError* _Nullable* _Nullable)error; +- (BOOL)raw; +@end + +@interface LibboxNetworkInterfaceIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxNetworkInterface* _Nullable)next; +@end + +@interface LibboxOnDemandRule : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (id _Nullable)dnsSearchDomainMatch; +- (id _Nullable)dnsServerAddressMatch; +- (int32_t)interfaceTypeMatch; +- (NSString* _Nonnull)probeURL; +- (id _Nullable)ssidMatch; +- (int32_t)target; +@end + +@interface LibboxOnDemandRuleIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (id _Nullable)next; +@end + +@interface LibboxOutboundGroupItemIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxOutboundGroupItem* _Nullable)next; +@end + +@interface LibboxOutboundGroupIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxOutboundGroup* _Nullable)next; +@end + +@interface LibboxPlatformInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)autoDetectInterfaceControl:(int32_t)fd error:(NSError* _Nullable* _Nullable)error; +- (void)clearDNSCache; +- (BOOL)closeDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)findConnectionOwner:(int32_t)ipProtocol sourceAddress:(NSString* _Nullable)sourceAddress sourcePort:(int32_t)sourcePort destinationAddress:(NSString* _Nullable)destinationAddress destinationPort:(int32_t)destinationPort ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getInterfaces:(NSError* _Nullable* _Nullable)error; +- (BOOL)includeAllNetworks; +- (BOOL)openTun:(id _Nullable)options ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)packageNameByUid:(int32_t)uid error:(NSError* _Nullable* _Nullable)error; +- (LibboxWIFIState* _Nullable)readWIFIState; +- (BOOL)startDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)uidByPackageName:(NSString* _Nullable)packageName ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (BOOL)underNetworkExtension; +- (BOOL)usePlatformAutoDetectInterfaceControl; +- (BOOL)usePlatformDefaultInterfaceMonitor; +- (BOOL)usePlatformInterfaceGetter; +- (BOOL)useProcFS; +- (void)writeLog:(NSString* _Nullable)message; +@end + +@interface LibboxProfilePreviewIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxProfilePreview* _Nullable)next; +@end + +@interface LibboxRoutePrefixIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxRoutePrefix* _Nullable)next; +@end + +@interface LibboxStringIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (NSString* _Nonnull)next; +@end + +@interface LibboxTunInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (int32_t)fileDescriptor; +@end + +@interface LibboxTunOptions : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)getAutoRoute; +- (NSString* _Nonnull)getDNSServerAddress:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getExcludePackage; +- (id _Nullable)getHTTPProxyBypassDomain; +- (id _Nullable)getHTTPProxyMatchDomain; +- (NSString* _Nonnull)getHTTPProxyServer; +- (int32_t)getHTTPProxyServerPort; +- (id _Nullable)getIncludePackage; +- (id _Nullable)getInet4Address; +- (id _Nullable)getInet4RouteAddress; +- (id _Nullable)getInet4RouteExcludeAddress; +- (id _Nullable)getInet4RouteRange; +- (id _Nullable)getInet6Address; +- (id _Nullable)getInet6RouteAddress; +- (id _Nullable)getInet6RouteExcludeAddress; +- (id _Nullable)getInet6RouteRange; +- (int32_t)getMTU; +- (BOOL)getStrictRoute; +- (BOOL)isHTTPProxyEnabled; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Headers/Universe.objc.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Headers/Universe.objc.h new file mode 100644 index 0000000..019e750 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Headers/Universe.objc.h @@ -0,0 +1,29 @@ +// Objective-C API for talking to Go package. +// gobind -lang=objc +// +// File is generated by gobind. Do not edit. + +#ifndef __Universe_H__ +#define __Universe_H__ + +@import Foundation; +#include "ref.h" + +@protocol Universeerror; +@class Universeerror; + +@protocol Universeerror +- (NSString* _Nonnull)error; +@end + +@class Universeerror; + +@interface Universeerror : NSError { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSString* _Nonnull)error; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Headers/ref.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Headers/ref.h new file mode 100644 index 0000000..b8036a4 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Headers/ref.h @@ -0,0 +1,35 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifndef __GO_REF_HDR__ +#define __GO_REF_HDR__ + +#include + +// GoSeqRef is an object tagged with an integer for passing back and +// forth across the language boundary. A GoSeqRef may represent either +// an instance of a Go object, or an Objective-C object passed to Go. +// The explicit allocation of a GoSeqRef is used to pin a Go object +// when it is passed to Objective-C. The Go seq package maintains a +// reference to the Go object in a map keyed by the refnum along with +// a reference count. When the reference count reaches zero, the Go +// seq package will clear the corresponding entry in the map. +@interface GoSeqRef : NSObject { +} +@property(readonly) int32_t refnum; +@property(strong) id obj; // NULL when representing a Go object. + +// new GoSeqRef object to proxy a Go object. The refnum must be +// provided from Go side. +- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj; + +- (int32_t)incNum; + +@end + +@protocol goSeqRefInterface +-(GoSeqRef*) _ref; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Libbox b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Libbox new file mode 100644 index 0000000..783e0cf Binary files /dev/null and b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Libbox differ diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Modules/module.modulemap b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..c2daf03 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module Libbox { + header "ref.h" + header "Libbox.objc.h" + header "Universe.objc.h" + export * +} \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Resources/Info.plist b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..0d1a4b8 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/Current b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/Current new file mode 100644 index 0000000..8c7e5a6 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64/Libbox.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Headers b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Headers new file mode 100644 index 0000000..a177d2a --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Libbox b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Libbox new file mode 100644 index 0000000..97ad876 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Libbox @@ -0,0 +1 @@ +Versions/Current/Libbox \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Modules b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Modules new file mode 100644 index 0000000..5736f31 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Modules @@ -0,0 +1 @@ +Versions/Current/Modules \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Resources b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Resources new file mode 100644 index 0000000..953ee36 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Libbox.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Libbox.h new file mode 100644 index 0000000..7e3aff4 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Libbox.h @@ -0,0 +1,13 @@ + +// Objective-C API for talking to the following Go packages +// +// github.com/sagernet/sing-box/experimental/libbox +// +// File is generated by gomobile bind. Do not edit. +#ifndef __Libbox_FRAMEWORK_H__ +#define __Libbox_FRAMEWORK_H__ + +#include "Libbox.objc.h" +#include "Universe.objc.h" + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Libbox.objc.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Libbox.objc.h new file mode 100644 index 0000000..98f33b9 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Libbox.objc.h @@ -0,0 +1,811 @@ +// Objective-C API for talking to github.com/sagernet/sing-box/experimental/libbox Go package. +// gobind -lang=objc github.com/sagernet/sing-box/experimental/libbox +// +// File is generated by gobind. Do not edit. + +#ifndef __Libbox_H__ +#define __Libbox_H__ + +@import Foundation; +#include "ref.h" +#include "Universe.objc.h" + + +@class LibboxBoxService; +@class LibboxCommandClient; +@class LibboxCommandClientOptions; +@class LibboxCommandServer; +@class LibboxErrorMessage; +@class LibboxExchangeContext; +@class LibboxImportRemoteProfile; +@class LibboxNetworkInterface; +@class LibboxOutboundGroup; +@class LibboxOutboundGroupItem; +@class LibboxPProfServer; +@class LibboxProfileContent; +@class LibboxProfileContentRequest; +@class LibboxProfileDecoder; +@class LibboxProfileEncoder; +@class LibboxProfilePreview; +@class LibboxRoutePrefix; +@class LibboxStatusMessage; +@class LibboxSystemProxyStatus; +@class LibboxWIFIState; +@protocol LibboxCommandClientHandler; +@class LibboxCommandClientHandler; +@protocol LibboxCommandServerHandler; +@class LibboxCommandServerHandler; +@protocol LibboxFunc; +@class LibboxFunc; +@protocol LibboxHTTPClient; +@class LibboxHTTPClient; +@protocol LibboxHTTPRequest; +@class LibboxHTTPRequest; +@protocol LibboxHTTPResponse; +@class LibboxHTTPResponse; +@protocol LibboxInterfaceUpdateListener; +@class LibboxInterfaceUpdateListener; +@protocol LibboxLocalDNSTransport; +@class LibboxLocalDNSTransport; +@protocol LibboxNetworkInterfaceIterator; +@class LibboxNetworkInterfaceIterator; +@protocol LibboxOnDemandRule; +@class LibboxOnDemandRule; +@protocol LibboxOnDemandRuleIterator; +@class LibboxOnDemandRuleIterator; +@protocol LibboxOutboundGroupItemIterator; +@class LibboxOutboundGroupItemIterator; +@protocol LibboxOutboundGroupIterator; +@class LibboxOutboundGroupIterator; +@protocol LibboxPlatformInterface; +@class LibboxPlatformInterface; +@protocol LibboxProfilePreviewIterator; +@class LibboxProfilePreviewIterator; +@protocol LibboxRoutePrefixIterator; +@class LibboxRoutePrefixIterator; +@protocol LibboxStringIterator; +@class LibboxStringIterator; +@protocol LibboxTunInterface; +@class LibboxTunInterface; +@protocol LibboxTunOptions; +@class LibboxTunOptions; + +@protocol LibboxCommandClientHandler +- (void)clearLog; +- (void)connected; +- (void)disconnected:(NSString* _Nullable)message; +- (void)initializeClashMode:(id _Nullable)modeList currentMode:(NSString* _Nullable)currentMode; +- (void)updateClashMode:(NSString* _Nullable)newMode; +- (void)writeGroups:(id _Nullable)message; +- (void)writeLog:(NSString* _Nullable)message; +- (void)writeStatus:(LibboxStatusMessage* _Nullable)message; +@end + +@protocol LibboxCommandServerHandler +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus; +- (void)postServiceClose; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxFunc +- (BOOL)invoke:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxHTTPClient +- (void)close; +- (void)keepAlive; +- (void)modernTLS; +- (id _Nullable)newRequest; +- (void)pinnedSHA256:(NSString* _Nullable)sumHex; +- (void)pinnedTLS12; +- (void)restrictedTLS; +- (void)trySocks5:(int32_t)port; +@end + +@protocol LibboxHTTPRequest +- (id _Nullable)execute:(NSError* _Nullable* _Nullable)error; +- (void)randomUserAgent; +- (void)setContent:(NSData* _Nullable)content; +- (void)setContentString:(NSString* _Nullable)content; +- (void)setHeader:(NSString* _Nullable)key value:(NSString* _Nullable)value; +- (void)setMethod:(NSString* _Nullable)method; +- (BOOL)setURL:(NSString* _Nullable)link error:(NSError* _Nullable* _Nullable)error; +- (void)setUserAgent:(NSString* _Nullable)userAgent; +@end + +@protocol LibboxHTTPResponse +- (NSData* _Nullable)getContent:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)getContentString:(NSError* _Nullable* _Nullable)error; +- (BOOL)writeTo:(NSString* _Nullable)path error:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxInterfaceUpdateListener +- (void)updateDefaultInterface:(NSString* _Nullable)interfaceName interfaceIndex:(int32_t)interfaceIndex; +@end + +@protocol LibboxLocalDNSTransport +- (BOOL)exchange:(LibboxExchangeContext* _Nullable)ctx message:(NSData* _Nullable)message error:(NSError* _Nullable* _Nullable)error; +- (BOOL)lookup:(LibboxExchangeContext* _Nullable)ctx network:(NSString* _Nullable)network domain:(NSString* _Nullable)domain error:(NSError* _Nullable* _Nullable)error; +- (BOOL)raw; +@end + +@protocol LibboxNetworkInterfaceIterator +- (BOOL)hasNext; +- (LibboxNetworkInterface* _Nullable)next; +@end + +@protocol LibboxOnDemandRule +- (id _Nullable)dnsSearchDomainMatch; +- (id _Nullable)dnsServerAddressMatch; +- (int32_t)interfaceTypeMatch; +- (NSString* _Nonnull)probeURL; +- (id _Nullable)ssidMatch; +- (int32_t)target; +@end + +@protocol LibboxOnDemandRuleIterator +- (BOOL)hasNext; +- (id _Nullable)next; +@end + +@protocol LibboxOutboundGroupItemIterator +- (BOOL)hasNext; +- (LibboxOutboundGroupItem* _Nullable)next; +@end + +@protocol LibboxOutboundGroupIterator +- (BOOL)hasNext; +- (LibboxOutboundGroup* _Nullable)next; +@end + +@protocol LibboxPlatformInterface +- (BOOL)autoDetectInterfaceControl:(int32_t)fd error:(NSError* _Nullable* _Nullable)error; +- (void)clearDNSCache; +- (BOOL)closeDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)findConnectionOwner:(int32_t)ipProtocol sourceAddress:(NSString* _Nullable)sourceAddress sourcePort:(int32_t)sourcePort destinationAddress:(NSString* _Nullable)destinationAddress destinationPort:(int32_t)destinationPort ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getInterfaces:(NSError* _Nullable* _Nullable)error; +- (BOOL)includeAllNetworks; +- (BOOL)openTun:(id _Nullable)options ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)packageNameByUid:(int32_t)uid error:(NSError* _Nullable* _Nullable)error; +- (LibboxWIFIState* _Nullable)readWIFIState; +- (BOOL)startDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)uidByPackageName:(NSString* _Nullable)packageName ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (BOOL)underNetworkExtension; +- (BOOL)usePlatformAutoDetectInterfaceControl; +- (BOOL)usePlatformDefaultInterfaceMonitor; +- (BOOL)usePlatformInterfaceGetter; +- (BOOL)useProcFS; +- (void)writeLog:(NSString* _Nullable)message; +@end + +@protocol LibboxProfilePreviewIterator +- (BOOL)hasNext; +- (LibboxProfilePreview* _Nullable)next; +@end + +@protocol LibboxRoutePrefixIterator +- (BOOL)hasNext; +- (LibboxRoutePrefix* _Nullable)next; +@end + +@protocol LibboxStringIterator +- (BOOL)hasNext; +- (NSString* _Nonnull)next; +@end + +@protocol LibboxTunInterface +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (int32_t)fileDescriptor; +@end + +@protocol LibboxTunOptions +- (BOOL)getAutoRoute; +- (NSString* _Nonnull)getDNSServerAddress:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getExcludePackage; +- (id _Nullable)getHTTPProxyBypassDomain; +- (id _Nullable)getHTTPProxyMatchDomain; +- (NSString* _Nonnull)getHTTPProxyServer; +- (int32_t)getHTTPProxyServerPort; +- (id _Nullable)getIncludePackage; +- (id _Nullable)getInet4Address; +- (id _Nullable)getInet4RouteAddress; +- (id _Nullable)getInet4RouteExcludeAddress; +- (id _Nullable)getInet4RouteRange; +- (id _Nullable)getInet6Address; +- (id _Nullable)getInet6RouteAddress; +- (id _Nullable)getInet6RouteExcludeAddress; +- (id _Nullable)getInet6RouteRange; +- (int32_t)getMTU; +- (BOOL)getStrictRoute; +- (BOOL)isHTTPProxyEnabled; +@end + +@interface LibboxBoxService : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (BOOL)needWIFIState; +- (void)pause; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +- (void)wake; +@end + +@interface LibboxCommandClient : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(id _Nullable)handler options:(LibboxCommandClientOptions* _Nullable)options; +- (BOOL)closeConnections:(NSError* _Nullable* _Nullable)error; +- (BOOL)connect:(NSError* _Nullable* _Nullable)error; +- (BOOL)disconnect:(NSError* _Nullable* _Nullable)error; +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus:(NSError* _Nullable* _Nullable)error; +- (BOOL)selectOutbound:(NSString* _Nullable)groupTag outboundTag:(NSString* _Nullable)outboundTag error:(NSError* _Nullable* _Nullable)error; +- (BOOL)serviceClose:(NSError* _Nullable* _Nullable)error; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setClashMode:(NSString* _Nullable)newMode error:(NSError* _Nullable* _Nullable)error; +- (BOOL)setGroupExpand:(NSString* _Nullable)groupTag isExpand:(BOOL)isExpand error:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +- (BOOL)urlTest:(NSString* _Nullable)groupTag error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxCommandClientOptions : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int32_t command; +@property (nonatomic) int64_t statusInterval; +@end + +@interface LibboxCommandServer : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(id _Nullable)handler maxLines:(int32_t)maxLines; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (void)resetLog; +- (void)setService:(LibboxBoxService* _Nullable)newService; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +- (void)writeMessage:(NSString* _Nullable)message; +@end + +@interface LibboxErrorMessage : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull message; +- (NSData* _Nullable)encode; +@end + +@interface LibboxExchangeContext : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (void)errnoCode:(int32_t)code; +- (void)errorCode:(int32_t)code; +- (void)onCancel:(id _Nullable)callback; +- (void)rawSuccess:(NSData* _Nullable)result; +- (void)success:(NSString* _Nullable)result; +@end + +@interface LibboxImportRemoteProfile : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) NSString* _Nonnull url; +@property (nonatomic) NSString* _Nonnull host; +@end + +@interface LibboxNetworkInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int32_t index; +@property (nonatomic) int32_t mtu; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) id _Nullable addresses; +@end + +@interface LibboxOutboundGroup : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull tag; +@property (nonatomic) NSString* _Nonnull type; +@property (nonatomic) BOOL selectable; +@property (nonatomic) NSString* _Nonnull selected; +@property (nonatomic) BOOL isExpand; +- (id _Nullable)getItems; +@end + +@interface LibboxOutboundGroupItem : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull tag; +@property (nonatomic) NSString* _Nonnull type; +@property (nonatomic) int64_t urlTestTime; +@property (nonatomic) int32_t urlTestDelay; +@end + +@interface LibboxPProfServer : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(long)port; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxProfileContent : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) int32_t type; +@property (nonatomic) NSString* _Nonnull config; +@property (nonatomic) NSString* _Nonnull remotePath; +@property (nonatomic) BOOL autoUpdate; +@property (nonatomic) int32_t autoUpdateInterval; +@property (nonatomic) int64_t lastUpdated; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfileContentRequest : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t profileID; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfileDecoder : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (BOOL)decode:(NSData* _Nullable)data error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)iterator; +@end + +@interface LibboxProfileEncoder : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (void)append:(LibboxProfilePreview* _Nullable)profile; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfilePreview : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t profileID; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) int32_t type; +@end + +@interface LibboxRoutePrefix : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (NSString* _Nonnull)address; +- (NSString* _Nonnull)mask; +- (int32_t)prefix; +- (NSString* _Nonnull)string; +@end + +@interface LibboxStatusMessage : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t memory; +@property (nonatomic) int32_t goroutines; +@property (nonatomic) int32_t connectionsIn; +@property (nonatomic) int32_t connectionsOut; +@property (nonatomic) BOOL trafficAvailable; +@property (nonatomic) int64_t uplink; +@property (nonatomic) int64_t downlink; +@property (nonatomic) int64_t uplinkTotal; +@property (nonatomic) int64_t downlinkTotal; +@end + +@interface LibboxSystemProxyStatus : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) BOOL available; +@property (nonatomic) BOOL enabled; +@end + +@interface LibboxWIFIState : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(NSString* _Nullable)wifiSSID wifiBSSID:(NSString* _Nullable)wifiBSSID; +@property (nonatomic) NSString* _Nonnull ssid; +@property (nonatomic) NSString* _Nonnull bssid; +@end + +FOUNDATION_EXPORT const int32_t LibboxCommandClashMode; +FOUNDATION_EXPORT const int32_t LibboxCommandCloseConnections; +FOUNDATION_EXPORT const int32_t LibboxCommandGetSystemProxyStatus; +FOUNDATION_EXPORT const int32_t LibboxCommandGroup; +FOUNDATION_EXPORT const int32_t LibboxCommandGroupExpand; +FOUNDATION_EXPORT const int32_t LibboxCommandLog; +FOUNDATION_EXPORT const int32_t LibboxCommandSelectOutbound; +FOUNDATION_EXPORT const int32_t LibboxCommandServiceClose; +FOUNDATION_EXPORT const int32_t LibboxCommandServiceReload; +FOUNDATION_EXPORT const int32_t LibboxCommandSetClashMode; +FOUNDATION_EXPORT const int32_t LibboxCommandSetSystemProxyEnabled; +FOUNDATION_EXPORT const int32_t LibboxCommandStatus; +FOUNDATION_EXPORT const int32_t LibboxCommandURLTest; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeError; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileContent; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileContentRequest; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileList; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeLocal; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeRemote; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeiCloud; + +FOUNDATION_EXPORT BOOL LibboxCheckConfig(NSString* _Nullable configContent, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void LibboxClearServiceError(void); + +FOUNDATION_EXPORT LibboxErrorMessage* _Nullable LibboxDecodeErrorMessage(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT int32_t LibboxDecodeLengthChunk(NSData* _Nullable data); + +FOUNDATION_EXPORT LibboxProfileContent* _Nullable LibboxDecodeProfileContent(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT LibboxProfileContentRequest* _Nullable LibboxDecodeProfileContentRequest(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSData* _Nullable LibboxEncodeChunkedMessage(NSData* _Nullable data); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatBytes(int64_t length); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatConfig(NSString* _Nullable configContent, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatMemoryBytes(int64_t length); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxGenerateRemoteProfileImportLink(NSString* _Nullable name, NSString* _Nullable remoteURL); + +FOUNDATION_EXPORT int32_t LibboxGetTunnelFileDescriptor(void); + +FOUNDATION_EXPORT LibboxCommandClient* _Nullable LibboxNewCommandClient(id _Nullable handler, LibboxCommandClientOptions* _Nullable options); + +FOUNDATION_EXPORT LibboxCommandServer* _Nullable LibboxNewCommandServer(id _Nullable handler, int32_t maxLines); + +FOUNDATION_EXPORT id _Nullable LibboxNewHTTPClient(void); + +FOUNDATION_EXPORT LibboxPProfServer* _Nullable LibboxNewPProfServer(long port); + +FOUNDATION_EXPORT LibboxBoxService* _Nullable LibboxNewService(NSString* _Nullable configContent, id _Nullable platformInterface, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT LibboxCommandClient* _Nullable LibboxNewStandaloneCommandClient(void); + +FOUNDATION_EXPORT LibboxWIFIState* _Nullable LibboxNewWIFIState(NSString* _Nullable wifiSSID, NSString* _Nullable wifiBSSID); + +FOUNDATION_EXPORT LibboxImportRemoteProfile* _Nullable LibboxParseRemoteProfileImportLink(NSString* _Nullable importLink, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxProxyDisplayType(NSString* _Nullable proxyType); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxReadServiceError(NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT BOOL LibboxRedirectStderr(NSString* _Nullable path, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void LibboxRegisterLocalDNSTransport(id _Nullable transport); + +FOUNDATION_EXPORT void LibboxSetMemoryLimit(BOOL enabled); + +FOUNDATION_EXPORT void LibboxSetup(NSString* _Nullable basePath, NSString* _Nullable workingPath, NSString* _Nullable tempPath, BOOL isTVOS); + +FOUNDATION_EXPORT BOOL LibboxSetupWithUsername(NSString* _Nullable basePath, NSString* _Nullable workingPath, NSString* _Nullable tempPath, NSString* _Nullable username, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxVersion(void); + +FOUNDATION_EXPORT BOOL LibboxWriteServiceError(NSString* _Nullable message, NSError* _Nullable* _Nullable error); + +@class LibboxCommandClientHandler; + +@class LibboxCommandServerHandler; + +@class LibboxFunc; + +@class LibboxHTTPClient; + +@class LibboxHTTPRequest; + +@class LibboxHTTPResponse; + +@class LibboxInterfaceUpdateListener; + +@class LibboxLocalDNSTransport; + +@class LibboxNetworkInterfaceIterator; + +@class LibboxOnDemandRule; + +@class LibboxOnDemandRuleIterator; + +@class LibboxOutboundGroupItemIterator; + +@class LibboxOutboundGroupIterator; + +@class LibboxPlatformInterface; + +@class LibboxProfilePreviewIterator; + +@class LibboxRoutePrefixIterator; + +@class LibboxStringIterator; + +@class LibboxTunInterface; + +@class LibboxTunOptions; + +@interface LibboxCommandClientHandler : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)clearLog; +- (void)connected; +- (void)disconnected:(NSString* _Nullable)message; +- (void)initializeClashMode:(id _Nullable)modeList currentMode:(NSString* _Nullable)currentMode; +- (void)updateClashMode:(NSString* _Nullable)newMode; +- (void)writeGroups:(id _Nullable)message; +- (void)writeLog:(NSString* _Nullable)message; +- (void)writeStatus:(LibboxStatusMessage* _Nullable)message; +@end + +@interface LibboxCommandServerHandler : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus; +- (void)postServiceClose; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxFunc : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)invoke:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxHTTPClient : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)close; +- (void)keepAlive; +- (void)modernTLS; +- (id _Nullable)newRequest; +- (void)pinnedSHA256:(NSString* _Nullable)sumHex; +- (void)pinnedTLS12; +- (void)restrictedTLS; +- (void)trySocks5:(int32_t)port; +@end + +@interface LibboxHTTPRequest : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (id _Nullable)execute:(NSError* _Nullable* _Nullable)error; +- (void)randomUserAgent; +- (void)setContent:(NSData* _Nullable)content; +- (void)setContentString:(NSString* _Nullable)content; +- (void)setHeader:(NSString* _Nullable)key value:(NSString* _Nullable)value; +- (void)setMethod:(NSString* _Nullable)method; +- (BOOL)setURL:(NSString* _Nullable)link error:(NSError* _Nullable* _Nullable)error; +- (void)setUserAgent:(NSString* _Nullable)userAgent; +@end + +@interface LibboxHTTPResponse : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSData* _Nullable)getContent:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)getContentString:(NSError* _Nullable* _Nullable)error; +- (BOOL)writeTo:(NSString* _Nullable)path error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxInterfaceUpdateListener : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)updateDefaultInterface:(NSString* _Nullable)interfaceName interfaceIndex:(int32_t)interfaceIndex; +@end + +@interface LibboxLocalDNSTransport : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)exchange:(LibboxExchangeContext* _Nullable)ctx message:(NSData* _Nullable)message error:(NSError* _Nullable* _Nullable)error; +- (BOOL)lookup:(LibboxExchangeContext* _Nullable)ctx network:(NSString* _Nullable)network domain:(NSString* _Nullable)domain error:(NSError* _Nullable* _Nullable)error; +- (BOOL)raw; +@end + +@interface LibboxNetworkInterfaceIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxNetworkInterface* _Nullable)next; +@end + +@interface LibboxOnDemandRule : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (id _Nullable)dnsSearchDomainMatch; +- (id _Nullable)dnsServerAddressMatch; +- (int32_t)interfaceTypeMatch; +- (NSString* _Nonnull)probeURL; +- (id _Nullable)ssidMatch; +- (int32_t)target; +@end + +@interface LibboxOnDemandRuleIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (id _Nullable)next; +@end + +@interface LibboxOutboundGroupItemIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxOutboundGroupItem* _Nullable)next; +@end + +@interface LibboxOutboundGroupIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxOutboundGroup* _Nullable)next; +@end + +@interface LibboxPlatformInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)autoDetectInterfaceControl:(int32_t)fd error:(NSError* _Nullable* _Nullable)error; +- (void)clearDNSCache; +- (BOOL)closeDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)findConnectionOwner:(int32_t)ipProtocol sourceAddress:(NSString* _Nullable)sourceAddress sourcePort:(int32_t)sourcePort destinationAddress:(NSString* _Nullable)destinationAddress destinationPort:(int32_t)destinationPort ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getInterfaces:(NSError* _Nullable* _Nullable)error; +- (BOOL)includeAllNetworks; +- (BOOL)openTun:(id _Nullable)options ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)packageNameByUid:(int32_t)uid error:(NSError* _Nullable* _Nullable)error; +- (LibboxWIFIState* _Nullable)readWIFIState; +- (BOOL)startDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)uidByPackageName:(NSString* _Nullable)packageName ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (BOOL)underNetworkExtension; +- (BOOL)usePlatformAutoDetectInterfaceControl; +- (BOOL)usePlatformDefaultInterfaceMonitor; +- (BOOL)usePlatformInterfaceGetter; +- (BOOL)useProcFS; +- (void)writeLog:(NSString* _Nullable)message; +@end + +@interface LibboxProfilePreviewIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxProfilePreview* _Nullable)next; +@end + +@interface LibboxRoutePrefixIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxRoutePrefix* _Nullable)next; +@end + +@interface LibboxStringIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (NSString* _Nonnull)next; +@end + +@interface LibboxTunInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (int32_t)fileDescriptor; +@end + +@interface LibboxTunOptions : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)getAutoRoute; +- (NSString* _Nonnull)getDNSServerAddress:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getExcludePackage; +- (id _Nullable)getHTTPProxyBypassDomain; +- (id _Nullable)getHTTPProxyMatchDomain; +- (NSString* _Nonnull)getHTTPProxyServer; +- (int32_t)getHTTPProxyServerPort; +- (id _Nullable)getIncludePackage; +- (id _Nullable)getInet4Address; +- (id _Nullable)getInet4RouteAddress; +- (id _Nullable)getInet4RouteExcludeAddress; +- (id _Nullable)getInet4RouteRange; +- (id _Nullable)getInet6Address; +- (id _Nullable)getInet6RouteAddress; +- (id _Nullable)getInet6RouteExcludeAddress; +- (id _Nullable)getInet6RouteRange; +- (int32_t)getMTU; +- (BOOL)getStrictRoute; +- (BOOL)isHTTPProxyEnabled; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Universe.objc.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Universe.objc.h new file mode 100644 index 0000000..019e750 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Universe.objc.h @@ -0,0 +1,29 @@ +// Objective-C API for talking to Go package. +// gobind -lang=objc +// +// File is generated by gobind. Do not edit. + +#ifndef __Universe_H__ +#define __Universe_H__ + +@import Foundation; +#include "ref.h" + +@protocol Universeerror; +@class Universeerror; + +@protocol Universeerror +- (NSString* _Nonnull)error; +@end + +@class Universeerror; + +@interface Universeerror : NSError { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSString* _Nonnull)error; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/ref.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/ref.h new file mode 100644 index 0000000..b8036a4 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/ref.h @@ -0,0 +1,35 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifndef __GO_REF_HDR__ +#define __GO_REF_HDR__ + +#include + +// GoSeqRef is an object tagged with an integer for passing back and +// forth across the language boundary. A GoSeqRef may represent either +// an instance of a Go object, or an Objective-C object passed to Go. +// The explicit allocation of a GoSeqRef is used to pin a Go object +// when it is passed to Objective-C. The Go seq package maintains a +// reference to the Go object in a map keyed by the refnum along with +// a reference count. When the reference count reaches zero, the Go +// seq package will clear the corresponding entry in the map. +@interface GoSeqRef : NSObject { +} +@property(readonly) int32_t refnum; +@property(strong) id obj; // NULL when representing a Go object. + +// new GoSeqRef object to proxy a Go object. The refnum must be +// provided from Go side. +- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj; + +- (int32_t)incNum; + +@end + +@protocol goSeqRefInterface +-(GoSeqRef*) _ref; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Libbox b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Libbox new file mode 100644 index 0000000..e81ff5d Binary files /dev/null and b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Libbox differ diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Modules/module.modulemap b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..c2daf03 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module Libbox { + header "ref.h" + header "Libbox.objc.h" + header "Universe.objc.h" + export * +} \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Resources/Info.plist b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..0d1a4b8 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/Current b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/Current new file mode 100644 index 0000000..8c7e5a6 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/ios-arm64_x86_64-simulator/Libbox.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Headers b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Headers new file mode 100644 index 0000000..a177d2a --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Libbox b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Libbox new file mode 100644 index 0000000..97ad876 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Libbox @@ -0,0 +1 @@ +Versions/Current/Libbox \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Modules b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Modules new file mode 100644 index 0000000..5736f31 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Modules @@ -0,0 +1 @@ +Versions/Current/Modules \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Resources b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Resources new file mode 100644 index 0000000..953ee36 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Headers/Libbox.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Headers/Libbox.h new file mode 100644 index 0000000..7e3aff4 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Headers/Libbox.h @@ -0,0 +1,13 @@ + +// Objective-C API for talking to the following Go packages +// +// github.com/sagernet/sing-box/experimental/libbox +// +// File is generated by gomobile bind. Do not edit. +#ifndef __Libbox_FRAMEWORK_H__ +#define __Libbox_FRAMEWORK_H__ + +#include "Libbox.objc.h" +#include "Universe.objc.h" + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Headers/Libbox.objc.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Headers/Libbox.objc.h new file mode 100644 index 0000000..98f33b9 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Headers/Libbox.objc.h @@ -0,0 +1,811 @@ +// Objective-C API for talking to github.com/sagernet/sing-box/experimental/libbox Go package. +// gobind -lang=objc github.com/sagernet/sing-box/experimental/libbox +// +// File is generated by gobind. Do not edit. + +#ifndef __Libbox_H__ +#define __Libbox_H__ + +@import Foundation; +#include "ref.h" +#include "Universe.objc.h" + + +@class LibboxBoxService; +@class LibboxCommandClient; +@class LibboxCommandClientOptions; +@class LibboxCommandServer; +@class LibboxErrorMessage; +@class LibboxExchangeContext; +@class LibboxImportRemoteProfile; +@class LibboxNetworkInterface; +@class LibboxOutboundGroup; +@class LibboxOutboundGroupItem; +@class LibboxPProfServer; +@class LibboxProfileContent; +@class LibboxProfileContentRequest; +@class LibboxProfileDecoder; +@class LibboxProfileEncoder; +@class LibboxProfilePreview; +@class LibboxRoutePrefix; +@class LibboxStatusMessage; +@class LibboxSystemProxyStatus; +@class LibboxWIFIState; +@protocol LibboxCommandClientHandler; +@class LibboxCommandClientHandler; +@protocol LibboxCommandServerHandler; +@class LibboxCommandServerHandler; +@protocol LibboxFunc; +@class LibboxFunc; +@protocol LibboxHTTPClient; +@class LibboxHTTPClient; +@protocol LibboxHTTPRequest; +@class LibboxHTTPRequest; +@protocol LibboxHTTPResponse; +@class LibboxHTTPResponse; +@protocol LibboxInterfaceUpdateListener; +@class LibboxInterfaceUpdateListener; +@protocol LibboxLocalDNSTransport; +@class LibboxLocalDNSTransport; +@protocol LibboxNetworkInterfaceIterator; +@class LibboxNetworkInterfaceIterator; +@protocol LibboxOnDemandRule; +@class LibboxOnDemandRule; +@protocol LibboxOnDemandRuleIterator; +@class LibboxOnDemandRuleIterator; +@protocol LibboxOutboundGroupItemIterator; +@class LibboxOutboundGroupItemIterator; +@protocol LibboxOutboundGroupIterator; +@class LibboxOutboundGroupIterator; +@protocol LibboxPlatformInterface; +@class LibboxPlatformInterface; +@protocol LibboxProfilePreviewIterator; +@class LibboxProfilePreviewIterator; +@protocol LibboxRoutePrefixIterator; +@class LibboxRoutePrefixIterator; +@protocol LibboxStringIterator; +@class LibboxStringIterator; +@protocol LibboxTunInterface; +@class LibboxTunInterface; +@protocol LibboxTunOptions; +@class LibboxTunOptions; + +@protocol LibboxCommandClientHandler +- (void)clearLog; +- (void)connected; +- (void)disconnected:(NSString* _Nullable)message; +- (void)initializeClashMode:(id _Nullable)modeList currentMode:(NSString* _Nullable)currentMode; +- (void)updateClashMode:(NSString* _Nullable)newMode; +- (void)writeGroups:(id _Nullable)message; +- (void)writeLog:(NSString* _Nullable)message; +- (void)writeStatus:(LibboxStatusMessage* _Nullable)message; +@end + +@protocol LibboxCommandServerHandler +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus; +- (void)postServiceClose; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxFunc +- (BOOL)invoke:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxHTTPClient +- (void)close; +- (void)keepAlive; +- (void)modernTLS; +- (id _Nullable)newRequest; +- (void)pinnedSHA256:(NSString* _Nullable)sumHex; +- (void)pinnedTLS12; +- (void)restrictedTLS; +- (void)trySocks5:(int32_t)port; +@end + +@protocol LibboxHTTPRequest +- (id _Nullable)execute:(NSError* _Nullable* _Nullable)error; +- (void)randomUserAgent; +- (void)setContent:(NSData* _Nullable)content; +- (void)setContentString:(NSString* _Nullable)content; +- (void)setHeader:(NSString* _Nullable)key value:(NSString* _Nullable)value; +- (void)setMethod:(NSString* _Nullable)method; +- (BOOL)setURL:(NSString* _Nullable)link error:(NSError* _Nullable* _Nullable)error; +- (void)setUserAgent:(NSString* _Nullable)userAgent; +@end + +@protocol LibboxHTTPResponse +- (NSData* _Nullable)getContent:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)getContentString:(NSError* _Nullable* _Nullable)error; +- (BOOL)writeTo:(NSString* _Nullable)path error:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxInterfaceUpdateListener +- (void)updateDefaultInterface:(NSString* _Nullable)interfaceName interfaceIndex:(int32_t)interfaceIndex; +@end + +@protocol LibboxLocalDNSTransport +- (BOOL)exchange:(LibboxExchangeContext* _Nullable)ctx message:(NSData* _Nullable)message error:(NSError* _Nullable* _Nullable)error; +- (BOOL)lookup:(LibboxExchangeContext* _Nullable)ctx network:(NSString* _Nullable)network domain:(NSString* _Nullable)domain error:(NSError* _Nullable* _Nullable)error; +- (BOOL)raw; +@end + +@protocol LibboxNetworkInterfaceIterator +- (BOOL)hasNext; +- (LibboxNetworkInterface* _Nullable)next; +@end + +@protocol LibboxOnDemandRule +- (id _Nullable)dnsSearchDomainMatch; +- (id _Nullable)dnsServerAddressMatch; +- (int32_t)interfaceTypeMatch; +- (NSString* _Nonnull)probeURL; +- (id _Nullable)ssidMatch; +- (int32_t)target; +@end + +@protocol LibboxOnDemandRuleIterator +- (BOOL)hasNext; +- (id _Nullable)next; +@end + +@protocol LibboxOutboundGroupItemIterator +- (BOOL)hasNext; +- (LibboxOutboundGroupItem* _Nullable)next; +@end + +@protocol LibboxOutboundGroupIterator +- (BOOL)hasNext; +- (LibboxOutboundGroup* _Nullable)next; +@end + +@protocol LibboxPlatformInterface +- (BOOL)autoDetectInterfaceControl:(int32_t)fd error:(NSError* _Nullable* _Nullable)error; +- (void)clearDNSCache; +- (BOOL)closeDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)findConnectionOwner:(int32_t)ipProtocol sourceAddress:(NSString* _Nullable)sourceAddress sourcePort:(int32_t)sourcePort destinationAddress:(NSString* _Nullable)destinationAddress destinationPort:(int32_t)destinationPort ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getInterfaces:(NSError* _Nullable* _Nullable)error; +- (BOOL)includeAllNetworks; +- (BOOL)openTun:(id _Nullable)options ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)packageNameByUid:(int32_t)uid error:(NSError* _Nullable* _Nullable)error; +- (LibboxWIFIState* _Nullable)readWIFIState; +- (BOOL)startDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)uidByPackageName:(NSString* _Nullable)packageName ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (BOOL)underNetworkExtension; +- (BOOL)usePlatformAutoDetectInterfaceControl; +- (BOOL)usePlatformDefaultInterfaceMonitor; +- (BOOL)usePlatformInterfaceGetter; +- (BOOL)useProcFS; +- (void)writeLog:(NSString* _Nullable)message; +@end + +@protocol LibboxProfilePreviewIterator +- (BOOL)hasNext; +- (LibboxProfilePreview* _Nullable)next; +@end + +@protocol LibboxRoutePrefixIterator +- (BOOL)hasNext; +- (LibboxRoutePrefix* _Nullable)next; +@end + +@protocol LibboxStringIterator +- (BOOL)hasNext; +- (NSString* _Nonnull)next; +@end + +@protocol LibboxTunInterface +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (int32_t)fileDescriptor; +@end + +@protocol LibboxTunOptions +- (BOOL)getAutoRoute; +- (NSString* _Nonnull)getDNSServerAddress:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getExcludePackage; +- (id _Nullable)getHTTPProxyBypassDomain; +- (id _Nullable)getHTTPProxyMatchDomain; +- (NSString* _Nonnull)getHTTPProxyServer; +- (int32_t)getHTTPProxyServerPort; +- (id _Nullable)getIncludePackage; +- (id _Nullable)getInet4Address; +- (id _Nullable)getInet4RouteAddress; +- (id _Nullable)getInet4RouteExcludeAddress; +- (id _Nullable)getInet4RouteRange; +- (id _Nullable)getInet6Address; +- (id _Nullable)getInet6RouteAddress; +- (id _Nullable)getInet6RouteExcludeAddress; +- (id _Nullable)getInet6RouteRange; +- (int32_t)getMTU; +- (BOOL)getStrictRoute; +- (BOOL)isHTTPProxyEnabled; +@end + +@interface LibboxBoxService : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (BOOL)needWIFIState; +- (void)pause; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +- (void)wake; +@end + +@interface LibboxCommandClient : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(id _Nullable)handler options:(LibboxCommandClientOptions* _Nullable)options; +- (BOOL)closeConnections:(NSError* _Nullable* _Nullable)error; +- (BOOL)connect:(NSError* _Nullable* _Nullable)error; +- (BOOL)disconnect:(NSError* _Nullable* _Nullable)error; +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus:(NSError* _Nullable* _Nullable)error; +- (BOOL)selectOutbound:(NSString* _Nullable)groupTag outboundTag:(NSString* _Nullable)outboundTag error:(NSError* _Nullable* _Nullable)error; +- (BOOL)serviceClose:(NSError* _Nullable* _Nullable)error; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setClashMode:(NSString* _Nullable)newMode error:(NSError* _Nullable* _Nullable)error; +- (BOOL)setGroupExpand:(NSString* _Nullable)groupTag isExpand:(BOOL)isExpand error:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +- (BOOL)urlTest:(NSString* _Nullable)groupTag error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxCommandClientOptions : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int32_t command; +@property (nonatomic) int64_t statusInterval; +@end + +@interface LibboxCommandServer : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(id _Nullable)handler maxLines:(int32_t)maxLines; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (void)resetLog; +- (void)setService:(LibboxBoxService* _Nullable)newService; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +- (void)writeMessage:(NSString* _Nullable)message; +@end + +@interface LibboxErrorMessage : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull message; +- (NSData* _Nullable)encode; +@end + +@interface LibboxExchangeContext : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (void)errnoCode:(int32_t)code; +- (void)errorCode:(int32_t)code; +- (void)onCancel:(id _Nullable)callback; +- (void)rawSuccess:(NSData* _Nullable)result; +- (void)success:(NSString* _Nullable)result; +@end + +@interface LibboxImportRemoteProfile : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) NSString* _Nonnull url; +@property (nonatomic) NSString* _Nonnull host; +@end + +@interface LibboxNetworkInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int32_t index; +@property (nonatomic) int32_t mtu; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) id _Nullable addresses; +@end + +@interface LibboxOutboundGroup : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull tag; +@property (nonatomic) NSString* _Nonnull type; +@property (nonatomic) BOOL selectable; +@property (nonatomic) NSString* _Nonnull selected; +@property (nonatomic) BOOL isExpand; +- (id _Nullable)getItems; +@end + +@interface LibboxOutboundGroupItem : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull tag; +@property (nonatomic) NSString* _Nonnull type; +@property (nonatomic) int64_t urlTestTime; +@property (nonatomic) int32_t urlTestDelay; +@end + +@interface LibboxPProfServer : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(long)port; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxProfileContent : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) int32_t type; +@property (nonatomic) NSString* _Nonnull config; +@property (nonatomic) NSString* _Nonnull remotePath; +@property (nonatomic) BOOL autoUpdate; +@property (nonatomic) int32_t autoUpdateInterval; +@property (nonatomic) int64_t lastUpdated; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfileContentRequest : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t profileID; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfileDecoder : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (BOOL)decode:(NSData* _Nullable)data error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)iterator; +@end + +@interface LibboxProfileEncoder : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (void)append:(LibboxProfilePreview* _Nullable)profile; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfilePreview : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t profileID; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) int32_t type; +@end + +@interface LibboxRoutePrefix : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (NSString* _Nonnull)address; +- (NSString* _Nonnull)mask; +- (int32_t)prefix; +- (NSString* _Nonnull)string; +@end + +@interface LibboxStatusMessage : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t memory; +@property (nonatomic) int32_t goroutines; +@property (nonatomic) int32_t connectionsIn; +@property (nonatomic) int32_t connectionsOut; +@property (nonatomic) BOOL trafficAvailable; +@property (nonatomic) int64_t uplink; +@property (nonatomic) int64_t downlink; +@property (nonatomic) int64_t uplinkTotal; +@property (nonatomic) int64_t downlinkTotal; +@end + +@interface LibboxSystemProxyStatus : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) BOOL available; +@property (nonatomic) BOOL enabled; +@end + +@interface LibboxWIFIState : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(NSString* _Nullable)wifiSSID wifiBSSID:(NSString* _Nullable)wifiBSSID; +@property (nonatomic) NSString* _Nonnull ssid; +@property (nonatomic) NSString* _Nonnull bssid; +@end + +FOUNDATION_EXPORT const int32_t LibboxCommandClashMode; +FOUNDATION_EXPORT const int32_t LibboxCommandCloseConnections; +FOUNDATION_EXPORT const int32_t LibboxCommandGetSystemProxyStatus; +FOUNDATION_EXPORT const int32_t LibboxCommandGroup; +FOUNDATION_EXPORT const int32_t LibboxCommandGroupExpand; +FOUNDATION_EXPORT const int32_t LibboxCommandLog; +FOUNDATION_EXPORT const int32_t LibboxCommandSelectOutbound; +FOUNDATION_EXPORT const int32_t LibboxCommandServiceClose; +FOUNDATION_EXPORT const int32_t LibboxCommandServiceReload; +FOUNDATION_EXPORT const int32_t LibboxCommandSetClashMode; +FOUNDATION_EXPORT const int32_t LibboxCommandSetSystemProxyEnabled; +FOUNDATION_EXPORT const int32_t LibboxCommandStatus; +FOUNDATION_EXPORT const int32_t LibboxCommandURLTest; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeError; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileContent; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileContentRequest; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileList; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeLocal; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeRemote; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeiCloud; + +FOUNDATION_EXPORT BOOL LibboxCheckConfig(NSString* _Nullable configContent, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void LibboxClearServiceError(void); + +FOUNDATION_EXPORT LibboxErrorMessage* _Nullable LibboxDecodeErrorMessage(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT int32_t LibboxDecodeLengthChunk(NSData* _Nullable data); + +FOUNDATION_EXPORT LibboxProfileContent* _Nullable LibboxDecodeProfileContent(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT LibboxProfileContentRequest* _Nullable LibboxDecodeProfileContentRequest(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSData* _Nullable LibboxEncodeChunkedMessage(NSData* _Nullable data); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatBytes(int64_t length); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatConfig(NSString* _Nullable configContent, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatMemoryBytes(int64_t length); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxGenerateRemoteProfileImportLink(NSString* _Nullable name, NSString* _Nullable remoteURL); + +FOUNDATION_EXPORT int32_t LibboxGetTunnelFileDescriptor(void); + +FOUNDATION_EXPORT LibboxCommandClient* _Nullable LibboxNewCommandClient(id _Nullable handler, LibboxCommandClientOptions* _Nullable options); + +FOUNDATION_EXPORT LibboxCommandServer* _Nullable LibboxNewCommandServer(id _Nullable handler, int32_t maxLines); + +FOUNDATION_EXPORT id _Nullable LibboxNewHTTPClient(void); + +FOUNDATION_EXPORT LibboxPProfServer* _Nullable LibboxNewPProfServer(long port); + +FOUNDATION_EXPORT LibboxBoxService* _Nullable LibboxNewService(NSString* _Nullable configContent, id _Nullable platformInterface, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT LibboxCommandClient* _Nullable LibboxNewStandaloneCommandClient(void); + +FOUNDATION_EXPORT LibboxWIFIState* _Nullable LibboxNewWIFIState(NSString* _Nullable wifiSSID, NSString* _Nullable wifiBSSID); + +FOUNDATION_EXPORT LibboxImportRemoteProfile* _Nullable LibboxParseRemoteProfileImportLink(NSString* _Nullable importLink, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxProxyDisplayType(NSString* _Nullable proxyType); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxReadServiceError(NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT BOOL LibboxRedirectStderr(NSString* _Nullable path, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void LibboxRegisterLocalDNSTransport(id _Nullable transport); + +FOUNDATION_EXPORT void LibboxSetMemoryLimit(BOOL enabled); + +FOUNDATION_EXPORT void LibboxSetup(NSString* _Nullable basePath, NSString* _Nullable workingPath, NSString* _Nullable tempPath, BOOL isTVOS); + +FOUNDATION_EXPORT BOOL LibboxSetupWithUsername(NSString* _Nullable basePath, NSString* _Nullable workingPath, NSString* _Nullable tempPath, NSString* _Nullable username, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxVersion(void); + +FOUNDATION_EXPORT BOOL LibboxWriteServiceError(NSString* _Nullable message, NSError* _Nullable* _Nullable error); + +@class LibboxCommandClientHandler; + +@class LibboxCommandServerHandler; + +@class LibboxFunc; + +@class LibboxHTTPClient; + +@class LibboxHTTPRequest; + +@class LibboxHTTPResponse; + +@class LibboxInterfaceUpdateListener; + +@class LibboxLocalDNSTransport; + +@class LibboxNetworkInterfaceIterator; + +@class LibboxOnDemandRule; + +@class LibboxOnDemandRuleIterator; + +@class LibboxOutboundGroupItemIterator; + +@class LibboxOutboundGroupIterator; + +@class LibboxPlatformInterface; + +@class LibboxProfilePreviewIterator; + +@class LibboxRoutePrefixIterator; + +@class LibboxStringIterator; + +@class LibboxTunInterface; + +@class LibboxTunOptions; + +@interface LibboxCommandClientHandler : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)clearLog; +- (void)connected; +- (void)disconnected:(NSString* _Nullable)message; +- (void)initializeClashMode:(id _Nullable)modeList currentMode:(NSString* _Nullable)currentMode; +- (void)updateClashMode:(NSString* _Nullable)newMode; +- (void)writeGroups:(id _Nullable)message; +- (void)writeLog:(NSString* _Nullable)message; +- (void)writeStatus:(LibboxStatusMessage* _Nullable)message; +@end + +@interface LibboxCommandServerHandler : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus; +- (void)postServiceClose; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxFunc : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)invoke:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxHTTPClient : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)close; +- (void)keepAlive; +- (void)modernTLS; +- (id _Nullable)newRequest; +- (void)pinnedSHA256:(NSString* _Nullable)sumHex; +- (void)pinnedTLS12; +- (void)restrictedTLS; +- (void)trySocks5:(int32_t)port; +@end + +@interface LibboxHTTPRequest : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (id _Nullable)execute:(NSError* _Nullable* _Nullable)error; +- (void)randomUserAgent; +- (void)setContent:(NSData* _Nullable)content; +- (void)setContentString:(NSString* _Nullable)content; +- (void)setHeader:(NSString* _Nullable)key value:(NSString* _Nullable)value; +- (void)setMethod:(NSString* _Nullable)method; +- (BOOL)setURL:(NSString* _Nullable)link error:(NSError* _Nullable* _Nullable)error; +- (void)setUserAgent:(NSString* _Nullable)userAgent; +@end + +@interface LibboxHTTPResponse : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSData* _Nullable)getContent:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)getContentString:(NSError* _Nullable* _Nullable)error; +- (BOOL)writeTo:(NSString* _Nullable)path error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxInterfaceUpdateListener : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)updateDefaultInterface:(NSString* _Nullable)interfaceName interfaceIndex:(int32_t)interfaceIndex; +@end + +@interface LibboxLocalDNSTransport : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)exchange:(LibboxExchangeContext* _Nullable)ctx message:(NSData* _Nullable)message error:(NSError* _Nullable* _Nullable)error; +- (BOOL)lookup:(LibboxExchangeContext* _Nullable)ctx network:(NSString* _Nullable)network domain:(NSString* _Nullable)domain error:(NSError* _Nullable* _Nullable)error; +- (BOOL)raw; +@end + +@interface LibboxNetworkInterfaceIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxNetworkInterface* _Nullable)next; +@end + +@interface LibboxOnDemandRule : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (id _Nullable)dnsSearchDomainMatch; +- (id _Nullable)dnsServerAddressMatch; +- (int32_t)interfaceTypeMatch; +- (NSString* _Nonnull)probeURL; +- (id _Nullable)ssidMatch; +- (int32_t)target; +@end + +@interface LibboxOnDemandRuleIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (id _Nullable)next; +@end + +@interface LibboxOutboundGroupItemIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxOutboundGroupItem* _Nullable)next; +@end + +@interface LibboxOutboundGroupIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxOutboundGroup* _Nullable)next; +@end + +@interface LibboxPlatformInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)autoDetectInterfaceControl:(int32_t)fd error:(NSError* _Nullable* _Nullable)error; +- (void)clearDNSCache; +- (BOOL)closeDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)findConnectionOwner:(int32_t)ipProtocol sourceAddress:(NSString* _Nullable)sourceAddress sourcePort:(int32_t)sourcePort destinationAddress:(NSString* _Nullable)destinationAddress destinationPort:(int32_t)destinationPort ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getInterfaces:(NSError* _Nullable* _Nullable)error; +- (BOOL)includeAllNetworks; +- (BOOL)openTun:(id _Nullable)options ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)packageNameByUid:(int32_t)uid error:(NSError* _Nullable* _Nullable)error; +- (LibboxWIFIState* _Nullable)readWIFIState; +- (BOOL)startDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)uidByPackageName:(NSString* _Nullable)packageName ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (BOOL)underNetworkExtension; +- (BOOL)usePlatformAutoDetectInterfaceControl; +- (BOOL)usePlatformDefaultInterfaceMonitor; +- (BOOL)usePlatformInterfaceGetter; +- (BOOL)useProcFS; +- (void)writeLog:(NSString* _Nullable)message; +@end + +@interface LibboxProfilePreviewIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxProfilePreview* _Nullable)next; +@end + +@interface LibboxRoutePrefixIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxRoutePrefix* _Nullable)next; +@end + +@interface LibboxStringIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (NSString* _Nonnull)next; +@end + +@interface LibboxTunInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (int32_t)fileDescriptor; +@end + +@interface LibboxTunOptions : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)getAutoRoute; +- (NSString* _Nonnull)getDNSServerAddress:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getExcludePackage; +- (id _Nullable)getHTTPProxyBypassDomain; +- (id _Nullable)getHTTPProxyMatchDomain; +- (NSString* _Nonnull)getHTTPProxyServer; +- (int32_t)getHTTPProxyServerPort; +- (id _Nullable)getIncludePackage; +- (id _Nullable)getInet4Address; +- (id _Nullable)getInet4RouteAddress; +- (id _Nullable)getInet4RouteExcludeAddress; +- (id _Nullable)getInet4RouteRange; +- (id _Nullable)getInet6Address; +- (id _Nullable)getInet6RouteAddress; +- (id _Nullable)getInet6RouteExcludeAddress; +- (id _Nullable)getInet6RouteRange; +- (int32_t)getMTU; +- (BOOL)getStrictRoute; +- (BOOL)isHTTPProxyEnabled; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Headers/Universe.objc.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Headers/Universe.objc.h new file mode 100644 index 0000000..019e750 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Headers/Universe.objc.h @@ -0,0 +1,29 @@ +// Objective-C API for talking to Go package. +// gobind -lang=objc +// +// File is generated by gobind. Do not edit. + +#ifndef __Universe_H__ +#define __Universe_H__ + +@import Foundation; +#include "ref.h" + +@protocol Universeerror; +@class Universeerror; + +@protocol Universeerror +- (NSString* _Nonnull)error; +@end + +@class Universeerror; + +@interface Universeerror : NSError { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSString* _Nonnull)error; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Headers/ref.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Headers/ref.h new file mode 100644 index 0000000..b8036a4 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Headers/ref.h @@ -0,0 +1,35 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifndef __GO_REF_HDR__ +#define __GO_REF_HDR__ + +#include + +// GoSeqRef is an object tagged with an integer for passing back and +// forth across the language boundary. A GoSeqRef may represent either +// an instance of a Go object, or an Objective-C object passed to Go. +// The explicit allocation of a GoSeqRef is used to pin a Go object +// when it is passed to Objective-C. The Go seq package maintains a +// reference to the Go object in a map keyed by the refnum along with +// a reference count. When the reference count reaches zero, the Go +// seq package will clear the corresponding entry in the map. +@interface GoSeqRef : NSObject { +} +@property(readonly) int32_t refnum; +@property(strong) id obj; // NULL when representing a Go object. + +// new GoSeqRef object to proxy a Go object. The refnum must be +// provided from Go side. +- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj; + +- (int32_t)incNum; + +@end + +@protocol goSeqRefInterface +-(GoSeqRef*) _ref; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Libbox b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Libbox new file mode 100644 index 0000000..c4bb880 Binary files /dev/null and b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Libbox differ diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Modules/module.modulemap b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..c2daf03 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module Libbox { + header "ref.h" + header "Libbox.objc.h" + header "Universe.objc.h" + export * +} \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Resources/Info.plist b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..0d1a4b8 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/Current b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/Current new file mode 100644 index 0000000..8c7e5a6 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/macos-arm64_x86_64/Libbox.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Headers b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Headers new file mode 100644 index 0000000..a177d2a --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Libbox b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Libbox new file mode 100644 index 0000000..97ad876 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Libbox @@ -0,0 +1 @@ +Versions/Current/Libbox \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Modules b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Modules new file mode 100644 index 0000000..5736f31 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Modules @@ -0,0 +1 @@ +Versions/Current/Modules \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Resources b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Resources new file mode 100644 index 0000000..953ee36 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Headers/Libbox.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Headers/Libbox.h new file mode 100644 index 0000000..7e3aff4 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Headers/Libbox.h @@ -0,0 +1,13 @@ + +// Objective-C API for talking to the following Go packages +// +// github.com/sagernet/sing-box/experimental/libbox +// +// File is generated by gomobile bind. Do not edit. +#ifndef __Libbox_FRAMEWORK_H__ +#define __Libbox_FRAMEWORK_H__ + +#include "Libbox.objc.h" +#include "Universe.objc.h" + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Headers/Libbox.objc.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Headers/Libbox.objc.h new file mode 100644 index 0000000..98f33b9 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Headers/Libbox.objc.h @@ -0,0 +1,811 @@ +// Objective-C API for talking to github.com/sagernet/sing-box/experimental/libbox Go package. +// gobind -lang=objc github.com/sagernet/sing-box/experimental/libbox +// +// File is generated by gobind. Do not edit. + +#ifndef __Libbox_H__ +#define __Libbox_H__ + +@import Foundation; +#include "ref.h" +#include "Universe.objc.h" + + +@class LibboxBoxService; +@class LibboxCommandClient; +@class LibboxCommandClientOptions; +@class LibboxCommandServer; +@class LibboxErrorMessage; +@class LibboxExchangeContext; +@class LibboxImportRemoteProfile; +@class LibboxNetworkInterface; +@class LibboxOutboundGroup; +@class LibboxOutboundGroupItem; +@class LibboxPProfServer; +@class LibboxProfileContent; +@class LibboxProfileContentRequest; +@class LibboxProfileDecoder; +@class LibboxProfileEncoder; +@class LibboxProfilePreview; +@class LibboxRoutePrefix; +@class LibboxStatusMessage; +@class LibboxSystemProxyStatus; +@class LibboxWIFIState; +@protocol LibboxCommandClientHandler; +@class LibboxCommandClientHandler; +@protocol LibboxCommandServerHandler; +@class LibboxCommandServerHandler; +@protocol LibboxFunc; +@class LibboxFunc; +@protocol LibboxHTTPClient; +@class LibboxHTTPClient; +@protocol LibboxHTTPRequest; +@class LibboxHTTPRequest; +@protocol LibboxHTTPResponse; +@class LibboxHTTPResponse; +@protocol LibboxInterfaceUpdateListener; +@class LibboxInterfaceUpdateListener; +@protocol LibboxLocalDNSTransport; +@class LibboxLocalDNSTransport; +@protocol LibboxNetworkInterfaceIterator; +@class LibboxNetworkInterfaceIterator; +@protocol LibboxOnDemandRule; +@class LibboxOnDemandRule; +@protocol LibboxOnDemandRuleIterator; +@class LibboxOnDemandRuleIterator; +@protocol LibboxOutboundGroupItemIterator; +@class LibboxOutboundGroupItemIterator; +@protocol LibboxOutboundGroupIterator; +@class LibboxOutboundGroupIterator; +@protocol LibboxPlatformInterface; +@class LibboxPlatformInterface; +@protocol LibboxProfilePreviewIterator; +@class LibboxProfilePreviewIterator; +@protocol LibboxRoutePrefixIterator; +@class LibboxRoutePrefixIterator; +@protocol LibboxStringIterator; +@class LibboxStringIterator; +@protocol LibboxTunInterface; +@class LibboxTunInterface; +@protocol LibboxTunOptions; +@class LibboxTunOptions; + +@protocol LibboxCommandClientHandler +- (void)clearLog; +- (void)connected; +- (void)disconnected:(NSString* _Nullable)message; +- (void)initializeClashMode:(id _Nullable)modeList currentMode:(NSString* _Nullable)currentMode; +- (void)updateClashMode:(NSString* _Nullable)newMode; +- (void)writeGroups:(id _Nullable)message; +- (void)writeLog:(NSString* _Nullable)message; +- (void)writeStatus:(LibboxStatusMessage* _Nullable)message; +@end + +@protocol LibboxCommandServerHandler +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus; +- (void)postServiceClose; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxFunc +- (BOOL)invoke:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxHTTPClient +- (void)close; +- (void)keepAlive; +- (void)modernTLS; +- (id _Nullable)newRequest; +- (void)pinnedSHA256:(NSString* _Nullable)sumHex; +- (void)pinnedTLS12; +- (void)restrictedTLS; +- (void)trySocks5:(int32_t)port; +@end + +@protocol LibboxHTTPRequest +- (id _Nullable)execute:(NSError* _Nullable* _Nullable)error; +- (void)randomUserAgent; +- (void)setContent:(NSData* _Nullable)content; +- (void)setContentString:(NSString* _Nullable)content; +- (void)setHeader:(NSString* _Nullable)key value:(NSString* _Nullable)value; +- (void)setMethod:(NSString* _Nullable)method; +- (BOOL)setURL:(NSString* _Nullable)link error:(NSError* _Nullable* _Nullable)error; +- (void)setUserAgent:(NSString* _Nullable)userAgent; +@end + +@protocol LibboxHTTPResponse +- (NSData* _Nullable)getContent:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)getContentString:(NSError* _Nullable* _Nullable)error; +- (BOOL)writeTo:(NSString* _Nullable)path error:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxInterfaceUpdateListener +- (void)updateDefaultInterface:(NSString* _Nullable)interfaceName interfaceIndex:(int32_t)interfaceIndex; +@end + +@protocol LibboxLocalDNSTransport +- (BOOL)exchange:(LibboxExchangeContext* _Nullable)ctx message:(NSData* _Nullable)message error:(NSError* _Nullable* _Nullable)error; +- (BOOL)lookup:(LibboxExchangeContext* _Nullable)ctx network:(NSString* _Nullable)network domain:(NSString* _Nullable)domain error:(NSError* _Nullable* _Nullable)error; +- (BOOL)raw; +@end + +@protocol LibboxNetworkInterfaceIterator +- (BOOL)hasNext; +- (LibboxNetworkInterface* _Nullable)next; +@end + +@protocol LibboxOnDemandRule +- (id _Nullable)dnsSearchDomainMatch; +- (id _Nullable)dnsServerAddressMatch; +- (int32_t)interfaceTypeMatch; +- (NSString* _Nonnull)probeURL; +- (id _Nullable)ssidMatch; +- (int32_t)target; +@end + +@protocol LibboxOnDemandRuleIterator +- (BOOL)hasNext; +- (id _Nullable)next; +@end + +@protocol LibboxOutboundGroupItemIterator +- (BOOL)hasNext; +- (LibboxOutboundGroupItem* _Nullable)next; +@end + +@protocol LibboxOutboundGroupIterator +- (BOOL)hasNext; +- (LibboxOutboundGroup* _Nullable)next; +@end + +@protocol LibboxPlatformInterface +- (BOOL)autoDetectInterfaceControl:(int32_t)fd error:(NSError* _Nullable* _Nullable)error; +- (void)clearDNSCache; +- (BOOL)closeDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)findConnectionOwner:(int32_t)ipProtocol sourceAddress:(NSString* _Nullable)sourceAddress sourcePort:(int32_t)sourcePort destinationAddress:(NSString* _Nullable)destinationAddress destinationPort:(int32_t)destinationPort ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getInterfaces:(NSError* _Nullable* _Nullable)error; +- (BOOL)includeAllNetworks; +- (BOOL)openTun:(id _Nullable)options ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)packageNameByUid:(int32_t)uid error:(NSError* _Nullable* _Nullable)error; +- (LibboxWIFIState* _Nullable)readWIFIState; +- (BOOL)startDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)uidByPackageName:(NSString* _Nullable)packageName ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (BOOL)underNetworkExtension; +- (BOOL)usePlatformAutoDetectInterfaceControl; +- (BOOL)usePlatformDefaultInterfaceMonitor; +- (BOOL)usePlatformInterfaceGetter; +- (BOOL)useProcFS; +- (void)writeLog:(NSString* _Nullable)message; +@end + +@protocol LibboxProfilePreviewIterator +- (BOOL)hasNext; +- (LibboxProfilePreview* _Nullable)next; +@end + +@protocol LibboxRoutePrefixIterator +- (BOOL)hasNext; +- (LibboxRoutePrefix* _Nullable)next; +@end + +@protocol LibboxStringIterator +- (BOOL)hasNext; +- (NSString* _Nonnull)next; +@end + +@protocol LibboxTunInterface +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (int32_t)fileDescriptor; +@end + +@protocol LibboxTunOptions +- (BOOL)getAutoRoute; +- (NSString* _Nonnull)getDNSServerAddress:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getExcludePackage; +- (id _Nullable)getHTTPProxyBypassDomain; +- (id _Nullable)getHTTPProxyMatchDomain; +- (NSString* _Nonnull)getHTTPProxyServer; +- (int32_t)getHTTPProxyServerPort; +- (id _Nullable)getIncludePackage; +- (id _Nullable)getInet4Address; +- (id _Nullable)getInet4RouteAddress; +- (id _Nullable)getInet4RouteExcludeAddress; +- (id _Nullable)getInet4RouteRange; +- (id _Nullable)getInet6Address; +- (id _Nullable)getInet6RouteAddress; +- (id _Nullable)getInet6RouteExcludeAddress; +- (id _Nullable)getInet6RouteRange; +- (int32_t)getMTU; +- (BOOL)getStrictRoute; +- (BOOL)isHTTPProxyEnabled; +@end + +@interface LibboxBoxService : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (BOOL)needWIFIState; +- (void)pause; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +- (void)wake; +@end + +@interface LibboxCommandClient : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(id _Nullable)handler options:(LibboxCommandClientOptions* _Nullable)options; +- (BOOL)closeConnections:(NSError* _Nullable* _Nullable)error; +- (BOOL)connect:(NSError* _Nullable* _Nullable)error; +- (BOOL)disconnect:(NSError* _Nullable* _Nullable)error; +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus:(NSError* _Nullable* _Nullable)error; +- (BOOL)selectOutbound:(NSString* _Nullable)groupTag outboundTag:(NSString* _Nullable)outboundTag error:(NSError* _Nullable* _Nullable)error; +- (BOOL)serviceClose:(NSError* _Nullable* _Nullable)error; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setClashMode:(NSString* _Nullable)newMode error:(NSError* _Nullable* _Nullable)error; +- (BOOL)setGroupExpand:(NSString* _Nullable)groupTag isExpand:(BOOL)isExpand error:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +- (BOOL)urlTest:(NSString* _Nullable)groupTag error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxCommandClientOptions : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int32_t command; +@property (nonatomic) int64_t statusInterval; +@end + +@interface LibboxCommandServer : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(id _Nullable)handler maxLines:(int32_t)maxLines; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (void)resetLog; +- (void)setService:(LibboxBoxService* _Nullable)newService; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +- (void)writeMessage:(NSString* _Nullable)message; +@end + +@interface LibboxErrorMessage : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull message; +- (NSData* _Nullable)encode; +@end + +@interface LibboxExchangeContext : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (void)errnoCode:(int32_t)code; +- (void)errorCode:(int32_t)code; +- (void)onCancel:(id _Nullable)callback; +- (void)rawSuccess:(NSData* _Nullable)result; +- (void)success:(NSString* _Nullable)result; +@end + +@interface LibboxImportRemoteProfile : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) NSString* _Nonnull url; +@property (nonatomic) NSString* _Nonnull host; +@end + +@interface LibboxNetworkInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int32_t index; +@property (nonatomic) int32_t mtu; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) id _Nullable addresses; +@end + +@interface LibboxOutboundGroup : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull tag; +@property (nonatomic) NSString* _Nonnull type; +@property (nonatomic) BOOL selectable; +@property (nonatomic) NSString* _Nonnull selected; +@property (nonatomic) BOOL isExpand; +- (id _Nullable)getItems; +@end + +@interface LibboxOutboundGroupItem : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull tag; +@property (nonatomic) NSString* _Nonnull type; +@property (nonatomic) int64_t urlTestTime; +@property (nonatomic) int32_t urlTestDelay; +@end + +@interface LibboxPProfServer : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(long)port; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxProfileContent : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) int32_t type; +@property (nonatomic) NSString* _Nonnull config; +@property (nonatomic) NSString* _Nonnull remotePath; +@property (nonatomic) BOOL autoUpdate; +@property (nonatomic) int32_t autoUpdateInterval; +@property (nonatomic) int64_t lastUpdated; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfileContentRequest : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t profileID; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfileDecoder : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (BOOL)decode:(NSData* _Nullable)data error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)iterator; +@end + +@interface LibboxProfileEncoder : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (void)append:(LibboxProfilePreview* _Nullable)profile; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfilePreview : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t profileID; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) int32_t type; +@end + +@interface LibboxRoutePrefix : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (NSString* _Nonnull)address; +- (NSString* _Nonnull)mask; +- (int32_t)prefix; +- (NSString* _Nonnull)string; +@end + +@interface LibboxStatusMessage : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t memory; +@property (nonatomic) int32_t goroutines; +@property (nonatomic) int32_t connectionsIn; +@property (nonatomic) int32_t connectionsOut; +@property (nonatomic) BOOL trafficAvailable; +@property (nonatomic) int64_t uplink; +@property (nonatomic) int64_t downlink; +@property (nonatomic) int64_t uplinkTotal; +@property (nonatomic) int64_t downlinkTotal; +@end + +@interface LibboxSystemProxyStatus : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) BOOL available; +@property (nonatomic) BOOL enabled; +@end + +@interface LibboxWIFIState : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(NSString* _Nullable)wifiSSID wifiBSSID:(NSString* _Nullable)wifiBSSID; +@property (nonatomic) NSString* _Nonnull ssid; +@property (nonatomic) NSString* _Nonnull bssid; +@end + +FOUNDATION_EXPORT const int32_t LibboxCommandClashMode; +FOUNDATION_EXPORT const int32_t LibboxCommandCloseConnections; +FOUNDATION_EXPORT const int32_t LibboxCommandGetSystemProxyStatus; +FOUNDATION_EXPORT const int32_t LibboxCommandGroup; +FOUNDATION_EXPORT const int32_t LibboxCommandGroupExpand; +FOUNDATION_EXPORT const int32_t LibboxCommandLog; +FOUNDATION_EXPORT const int32_t LibboxCommandSelectOutbound; +FOUNDATION_EXPORT const int32_t LibboxCommandServiceClose; +FOUNDATION_EXPORT const int32_t LibboxCommandServiceReload; +FOUNDATION_EXPORT const int32_t LibboxCommandSetClashMode; +FOUNDATION_EXPORT const int32_t LibboxCommandSetSystemProxyEnabled; +FOUNDATION_EXPORT const int32_t LibboxCommandStatus; +FOUNDATION_EXPORT const int32_t LibboxCommandURLTest; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeError; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileContent; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileContentRequest; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileList; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeLocal; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeRemote; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeiCloud; + +FOUNDATION_EXPORT BOOL LibboxCheckConfig(NSString* _Nullable configContent, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void LibboxClearServiceError(void); + +FOUNDATION_EXPORT LibboxErrorMessage* _Nullable LibboxDecodeErrorMessage(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT int32_t LibboxDecodeLengthChunk(NSData* _Nullable data); + +FOUNDATION_EXPORT LibboxProfileContent* _Nullable LibboxDecodeProfileContent(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT LibboxProfileContentRequest* _Nullable LibboxDecodeProfileContentRequest(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSData* _Nullable LibboxEncodeChunkedMessage(NSData* _Nullable data); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatBytes(int64_t length); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatConfig(NSString* _Nullable configContent, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatMemoryBytes(int64_t length); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxGenerateRemoteProfileImportLink(NSString* _Nullable name, NSString* _Nullable remoteURL); + +FOUNDATION_EXPORT int32_t LibboxGetTunnelFileDescriptor(void); + +FOUNDATION_EXPORT LibboxCommandClient* _Nullable LibboxNewCommandClient(id _Nullable handler, LibboxCommandClientOptions* _Nullable options); + +FOUNDATION_EXPORT LibboxCommandServer* _Nullable LibboxNewCommandServer(id _Nullable handler, int32_t maxLines); + +FOUNDATION_EXPORT id _Nullable LibboxNewHTTPClient(void); + +FOUNDATION_EXPORT LibboxPProfServer* _Nullable LibboxNewPProfServer(long port); + +FOUNDATION_EXPORT LibboxBoxService* _Nullable LibboxNewService(NSString* _Nullable configContent, id _Nullable platformInterface, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT LibboxCommandClient* _Nullable LibboxNewStandaloneCommandClient(void); + +FOUNDATION_EXPORT LibboxWIFIState* _Nullable LibboxNewWIFIState(NSString* _Nullable wifiSSID, NSString* _Nullable wifiBSSID); + +FOUNDATION_EXPORT LibboxImportRemoteProfile* _Nullable LibboxParseRemoteProfileImportLink(NSString* _Nullable importLink, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxProxyDisplayType(NSString* _Nullable proxyType); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxReadServiceError(NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT BOOL LibboxRedirectStderr(NSString* _Nullable path, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void LibboxRegisterLocalDNSTransport(id _Nullable transport); + +FOUNDATION_EXPORT void LibboxSetMemoryLimit(BOOL enabled); + +FOUNDATION_EXPORT void LibboxSetup(NSString* _Nullable basePath, NSString* _Nullable workingPath, NSString* _Nullable tempPath, BOOL isTVOS); + +FOUNDATION_EXPORT BOOL LibboxSetupWithUsername(NSString* _Nullable basePath, NSString* _Nullable workingPath, NSString* _Nullable tempPath, NSString* _Nullable username, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxVersion(void); + +FOUNDATION_EXPORT BOOL LibboxWriteServiceError(NSString* _Nullable message, NSError* _Nullable* _Nullable error); + +@class LibboxCommandClientHandler; + +@class LibboxCommandServerHandler; + +@class LibboxFunc; + +@class LibboxHTTPClient; + +@class LibboxHTTPRequest; + +@class LibboxHTTPResponse; + +@class LibboxInterfaceUpdateListener; + +@class LibboxLocalDNSTransport; + +@class LibboxNetworkInterfaceIterator; + +@class LibboxOnDemandRule; + +@class LibboxOnDemandRuleIterator; + +@class LibboxOutboundGroupItemIterator; + +@class LibboxOutboundGroupIterator; + +@class LibboxPlatformInterface; + +@class LibboxProfilePreviewIterator; + +@class LibboxRoutePrefixIterator; + +@class LibboxStringIterator; + +@class LibboxTunInterface; + +@class LibboxTunOptions; + +@interface LibboxCommandClientHandler : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)clearLog; +- (void)connected; +- (void)disconnected:(NSString* _Nullable)message; +- (void)initializeClashMode:(id _Nullable)modeList currentMode:(NSString* _Nullable)currentMode; +- (void)updateClashMode:(NSString* _Nullable)newMode; +- (void)writeGroups:(id _Nullable)message; +- (void)writeLog:(NSString* _Nullable)message; +- (void)writeStatus:(LibboxStatusMessage* _Nullable)message; +@end + +@interface LibboxCommandServerHandler : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus; +- (void)postServiceClose; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxFunc : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)invoke:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxHTTPClient : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)close; +- (void)keepAlive; +- (void)modernTLS; +- (id _Nullable)newRequest; +- (void)pinnedSHA256:(NSString* _Nullable)sumHex; +- (void)pinnedTLS12; +- (void)restrictedTLS; +- (void)trySocks5:(int32_t)port; +@end + +@interface LibboxHTTPRequest : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (id _Nullable)execute:(NSError* _Nullable* _Nullable)error; +- (void)randomUserAgent; +- (void)setContent:(NSData* _Nullable)content; +- (void)setContentString:(NSString* _Nullable)content; +- (void)setHeader:(NSString* _Nullable)key value:(NSString* _Nullable)value; +- (void)setMethod:(NSString* _Nullable)method; +- (BOOL)setURL:(NSString* _Nullable)link error:(NSError* _Nullable* _Nullable)error; +- (void)setUserAgent:(NSString* _Nullable)userAgent; +@end + +@interface LibboxHTTPResponse : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSData* _Nullable)getContent:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)getContentString:(NSError* _Nullable* _Nullable)error; +- (BOOL)writeTo:(NSString* _Nullable)path error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxInterfaceUpdateListener : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)updateDefaultInterface:(NSString* _Nullable)interfaceName interfaceIndex:(int32_t)interfaceIndex; +@end + +@interface LibboxLocalDNSTransport : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)exchange:(LibboxExchangeContext* _Nullable)ctx message:(NSData* _Nullable)message error:(NSError* _Nullable* _Nullable)error; +- (BOOL)lookup:(LibboxExchangeContext* _Nullable)ctx network:(NSString* _Nullable)network domain:(NSString* _Nullable)domain error:(NSError* _Nullable* _Nullable)error; +- (BOOL)raw; +@end + +@interface LibboxNetworkInterfaceIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxNetworkInterface* _Nullable)next; +@end + +@interface LibboxOnDemandRule : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (id _Nullable)dnsSearchDomainMatch; +- (id _Nullable)dnsServerAddressMatch; +- (int32_t)interfaceTypeMatch; +- (NSString* _Nonnull)probeURL; +- (id _Nullable)ssidMatch; +- (int32_t)target; +@end + +@interface LibboxOnDemandRuleIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (id _Nullable)next; +@end + +@interface LibboxOutboundGroupItemIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxOutboundGroupItem* _Nullable)next; +@end + +@interface LibboxOutboundGroupIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxOutboundGroup* _Nullable)next; +@end + +@interface LibboxPlatformInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)autoDetectInterfaceControl:(int32_t)fd error:(NSError* _Nullable* _Nullable)error; +- (void)clearDNSCache; +- (BOOL)closeDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)findConnectionOwner:(int32_t)ipProtocol sourceAddress:(NSString* _Nullable)sourceAddress sourcePort:(int32_t)sourcePort destinationAddress:(NSString* _Nullable)destinationAddress destinationPort:(int32_t)destinationPort ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getInterfaces:(NSError* _Nullable* _Nullable)error; +- (BOOL)includeAllNetworks; +- (BOOL)openTun:(id _Nullable)options ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)packageNameByUid:(int32_t)uid error:(NSError* _Nullable* _Nullable)error; +- (LibboxWIFIState* _Nullable)readWIFIState; +- (BOOL)startDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)uidByPackageName:(NSString* _Nullable)packageName ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (BOOL)underNetworkExtension; +- (BOOL)usePlatformAutoDetectInterfaceControl; +- (BOOL)usePlatformDefaultInterfaceMonitor; +- (BOOL)usePlatformInterfaceGetter; +- (BOOL)useProcFS; +- (void)writeLog:(NSString* _Nullable)message; +@end + +@interface LibboxProfilePreviewIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxProfilePreview* _Nullable)next; +@end + +@interface LibboxRoutePrefixIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxRoutePrefix* _Nullable)next; +@end + +@interface LibboxStringIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (NSString* _Nonnull)next; +@end + +@interface LibboxTunInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (int32_t)fileDescriptor; +@end + +@interface LibboxTunOptions : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)getAutoRoute; +- (NSString* _Nonnull)getDNSServerAddress:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getExcludePackage; +- (id _Nullable)getHTTPProxyBypassDomain; +- (id _Nullable)getHTTPProxyMatchDomain; +- (NSString* _Nonnull)getHTTPProxyServer; +- (int32_t)getHTTPProxyServerPort; +- (id _Nullable)getIncludePackage; +- (id _Nullable)getInet4Address; +- (id _Nullable)getInet4RouteAddress; +- (id _Nullable)getInet4RouteExcludeAddress; +- (id _Nullable)getInet4RouteRange; +- (id _Nullable)getInet6Address; +- (id _Nullable)getInet6RouteAddress; +- (id _Nullable)getInet6RouteExcludeAddress; +- (id _Nullable)getInet6RouteRange; +- (int32_t)getMTU; +- (BOOL)getStrictRoute; +- (BOOL)isHTTPProxyEnabled; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Headers/Universe.objc.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Headers/Universe.objc.h new file mode 100644 index 0000000..019e750 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Headers/Universe.objc.h @@ -0,0 +1,29 @@ +// Objective-C API for talking to Go package. +// gobind -lang=objc +// +// File is generated by gobind. Do not edit. + +#ifndef __Universe_H__ +#define __Universe_H__ + +@import Foundation; +#include "ref.h" + +@protocol Universeerror; +@class Universeerror; + +@protocol Universeerror +- (NSString* _Nonnull)error; +@end + +@class Universeerror; + +@interface Universeerror : NSError { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSString* _Nonnull)error; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Headers/ref.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Headers/ref.h new file mode 100644 index 0000000..b8036a4 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Headers/ref.h @@ -0,0 +1,35 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifndef __GO_REF_HDR__ +#define __GO_REF_HDR__ + +#include + +// GoSeqRef is an object tagged with an integer for passing back and +// forth across the language boundary. A GoSeqRef may represent either +// an instance of a Go object, or an Objective-C object passed to Go. +// The explicit allocation of a GoSeqRef is used to pin a Go object +// when it is passed to Objective-C. The Go seq package maintains a +// reference to the Go object in a map keyed by the refnum along with +// a reference count. When the reference count reaches zero, the Go +// seq package will clear the corresponding entry in the map. +@interface GoSeqRef : NSObject { +} +@property(readonly) int32_t refnum; +@property(strong) id obj; // NULL when representing a Go object. + +// new GoSeqRef object to proxy a Go object. The refnum must be +// provided from Go side. +- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj; + +- (int32_t)incNum; + +@end + +@protocol goSeqRefInterface +-(GoSeqRef*) _ref; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Libbox b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Libbox new file mode 100644 index 0000000..8ed4612 Binary files /dev/null and b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Libbox differ diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Modules/module.modulemap b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..c2daf03 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module Libbox { + header "ref.h" + header "Libbox.objc.h" + header "Universe.objc.h" + export * +} \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Resources/Info.plist b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..0d1a4b8 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/Current b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/Current new file mode 100644 index 0000000..8c7e5a6 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64/Libbox.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Headers b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Headers new file mode 100644 index 0000000..a177d2a --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Libbox b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Libbox new file mode 100644 index 0000000..97ad876 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Libbox @@ -0,0 +1 @@ +Versions/Current/Libbox \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Modules b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Modules new file mode 100644 index 0000000..5736f31 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Modules @@ -0,0 +1 @@ +Versions/Current/Modules \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Resources b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Resources new file mode 100644 index 0000000..953ee36 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Libbox.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Libbox.h new file mode 100644 index 0000000..7e3aff4 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Libbox.h @@ -0,0 +1,13 @@ + +// Objective-C API for talking to the following Go packages +// +// github.com/sagernet/sing-box/experimental/libbox +// +// File is generated by gomobile bind. Do not edit. +#ifndef __Libbox_FRAMEWORK_H__ +#define __Libbox_FRAMEWORK_H__ + +#include "Libbox.objc.h" +#include "Universe.objc.h" + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Libbox.objc.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Libbox.objc.h new file mode 100644 index 0000000..98f33b9 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Libbox.objc.h @@ -0,0 +1,811 @@ +// Objective-C API for talking to github.com/sagernet/sing-box/experimental/libbox Go package. +// gobind -lang=objc github.com/sagernet/sing-box/experimental/libbox +// +// File is generated by gobind. Do not edit. + +#ifndef __Libbox_H__ +#define __Libbox_H__ + +@import Foundation; +#include "ref.h" +#include "Universe.objc.h" + + +@class LibboxBoxService; +@class LibboxCommandClient; +@class LibboxCommandClientOptions; +@class LibboxCommandServer; +@class LibboxErrorMessage; +@class LibboxExchangeContext; +@class LibboxImportRemoteProfile; +@class LibboxNetworkInterface; +@class LibboxOutboundGroup; +@class LibboxOutboundGroupItem; +@class LibboxPProfServer; +@class LibboxProfileContent; +@class LibboxProfileContentRequest; +@class LibboxProfileDecoder; +@class LibboxProfileEncoder; +@class LibboxProfilePreview; +@class LibboxRoutePrefix; +@class LibboxStatusMessage; +@class LibboxSystemProxyStatus; +@class LibboxWIFIState; +@protocol LibboxCommandClientHandler; +@class LibboxCommandClientHandler; +@protocol LibboxCommandServerHandler; +@class LibboxCommandServerHandler; +@protocol LibboxFunc; +@class LibboxFunc; +@protocol LibboxHTTPClient; +@class LibboxHTTPClient; +@protocol LibboxHTTPRequest; +@class LibboxHTTPRequest; +@protocol LibboxHTTPResponse; +@class LibboxHTTPResponse; +@protocol LibboxInterfaceUpdateListener; +@class LibboxInterfaceUpdateListener; +@protocol LibboxLocalDNSTransport; +@class LibboxLocalDNSTransport; +@protocol LibboxNetworkInterfaceIterator; +@class LibboxNetworkInterfaceIterator; +@protocol LibboxOnDemandRule; +@class LibboxOnDemandRule; +@protocol LibboxOnDemandRuleIterator; +@class LibboxOnDemandRuleIterator; +@protocol LibboxOutboundGroupItemIterator; +@class LibboxOutboundGroupItemIterator; +@protocol LibboxOutboundGroupIterator; +@class LibboxOutboundGroupIterator; +@protocol LibboxPlatformInterface; +@class LibboxPlatformInterface; +@protocol LibboxProfilePreviewIterator; +@class LibboxProfilePreviewIterator; +@protocol LibboxRoutePrefixIterator; +@class LibboxRoutePrefixIterator; +@protocol LibboxStringIterator; +@class LibboxStringIterator; +@protocol LibboxTunInterface; +@class LibboxTunInterface; +@protocol LibboxTunOptions; +@class LibboxTunOptions; + +@protocol LibboxCommandClientHandler +- (void)clearLog; +- (void)connected; +- (void)disconnected:(NSString* _Nullable)message; +- (void)initializeClashMode:(id _Nullable)modeList currentMode:(NSString* _Nullable)currentMode; +- (void)updateClashMode:(NSString* _Nullable)newMode; +- (void)writeGroups:(id _Nullable)message; +- (void)writeLog:(NSString* _Nullable)message; +- (void)writeStatus:(LibboxStatusMessage* _Nullable)message; +@end + +@protocol LibboxCommandServerHandler +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus; +- (void)postServiceClose; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxFunc +- (BOOL)invoke:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxHTTPClient +- (void)close; +- (void)keepAlive; +- (void)modernTLS; +- (id _Nullable)newRequest; +- (void)pinnedSHA256:(NSString* _Nullable)sumHex; +- (void)pinnedTLS12; +- (void)restrictedTLS; +- (void)trySocks5:(int32_t)port; +@end + +@protocol LibboxHTTPRequest +- (id _Nullable)execute:(NSError* _Nullable* _Nullable)error; +- (void)randomUserAgent; +- (void)setContent:(NSData* _Nullable)content; +- (void)setContentString:(NSString* _Nullable)content; +- (void)setHeader:(NSString* _Nullable)key value:(NSString* _Nullable)value; +- (void)setMethod:(NSString* _Nullable)method; +- (BOOL)setURL:(NSString* _Nullable)link error:(NSError* _Nullable* _Nullable)error; +- (void)setUserAgent:(NSString* _Nullable)userAgent; +@end + +@protocol LibboxHTTPResponse +- (NSData* _Nullable)getContent:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)getContentString:(NSError* _Nullable* _Nullable)error; +- (BOOL)writeTo:(NSString* _Nullable)path error:(NSError* _Nullable* _Nullable)error; +@end + +@protocol LibboxInterfaceUpdateListener +- (void)updateDefaultInterface:(NSString* _Nullable)interfaceName interfaceIndex:(int32_t)interfaceIndex; +@end + +@protocol LibboxLocalDNSTransport +- (BOOL)exchange:(LibboxExchangeContext* _Nullable)ctx message:(NSData* _Nullable)message error:(NSError* _Nullable* _Nullable)error; +- (BOOL)lookup:(LibboxExchangeContext* _Nullable)ctx network:(NSString* _Nullable)network domain:(NSString* _Nullable)domain error:(NSError* _Nullable* _Nullable)error; +- (BOOL)raw; +@end + +@protocol LibboxNetworkInterfaceIterator +- (BOOL)hasNext; +- (LibboxNetworkInterface* _Nullable)next; +@end + +@protocol LibboxOnDemandRule +- (id _Nullable)dnsSearchDomainMatch; +- (id _Nullable)dnsServerAddressMatch; +- (int32_t)interfaceTypeMatch; +- (NSString* _Nonnull)probeURL; +- (id _Nullable)ssidMatch; +- (int32_t)target; +@end + +@protocol LibboxOnDemandRuleIterator +- (BOOL)hasNext; +- (id _Nullable)next; +@end + +@protocol LibboxOutboundGroupItemIterator +- (BOOL)hasNext; +- (LibboxOutboundGroupItem* _Nullable)next; +@end + +@protocol LibboxOutboundGroupIterator +- (BOOL)hasNext; +- (LibboxOutboundGroup* _Nullable)next; +@end + +@protocol LibboxPlatformInterface +- (BOOL)autoDetectInterfaceControl:(int32_t)fd error:(NSError* _Nullable* _Nullable)error; +- (void)clearDNSCache; +- (BOOL)closeDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)findConnectionOwner:(int32_t)ipProtocol sourceAddress:(NSString* _Nullable)sourceAddress sourcePort:(int32_t)sourcePort destinationAddress:(NSString* _Nullable)destinationAddress destinationPort:(int32_t)destinationPort ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getInterfaces:(NSError* _Nullable* _Nullable)error; +- (BOOL)includeAllNetworks; +- (BOOL)openTun:(id _Nullable)options ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)packageNameByUid:(int32_t)uid error:(NSError* _Nullable* _Nullable)error; +- (LibboxWIFIState* _Nullable)readWIFIState; +- (BOOL)startDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)uidByPackageName:(NSString* _Nullable)packageName ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (BOOL)underNetworkExtension; +- (BOOL)usePlatformAutoDetectInterfaceControl; +- (BOOL)usePlatformDefaultInterfaceMonitor; +- (BOOL)usePlatformInterfaceGetter; +- (BOOL)useProcFS; +- (void)writeLog:(NSString* _Nullable)message; +@end + +@protocol LibboxProfilePreviewIterator +- (BOOL)hasNext; +- (LibboxProfilePreview* _Nullable)next; +@end + +@protocol LibboxRoutePrefixIterator +- (BOOL)hasNext; +- (LibboxRoutePrefix* _Nullable)next; +@end + +@protocol LibboxStringIterator +- (BOOL)hasNext; +- (NSString* _Nonnull)next; +@end + +@protocol LibboxTunInterface +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (int32_t)fileDescriptor; +@end + +@protocol LibboxTunOptions +- (BOOL)getAutoRoute; +- (NSString* _Nonnull)getDNSServerAddress:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getExcludePackage; +- (id _Nullable)getHTTPProxyBypassDomain; +- (id _Nullable)getHTTPProxyMatchDomain; +- (NSString* _Nonnull)getHTTPProxyServer; +- (int32_t)getHTTPProxyServerPort; +- (id _Nullable)getIncludePackage; +- (id _Nullable)getInet4Address; +- (id _Nullable)getInet4RouteAddress; +- (id _Nullable)getInet4RouteExcludeAddress; +- (id _Nullable)getInet4RouteRange; +- (id _Nullable)getInet6Address; +- (id _Nullable)getInet6RouteAddress; +- (id _Nullable)getInet6RouteExcludeAddress; +- (id _Nullable)getInet6RouteRange; +- (int32_t)getMTU; +- (BOOL)getStrictRoute; +- (BOOL)isHTTPProxyEnabled; +@end + +@interface LibboxBoxService : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (BOOL)needWIFIState; +- (void)pause; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +- (void)wake; +@end + +@interface LibboxCommandClient : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(id _Nullable)handler options:(LibboxCommandClientOptions* _Nullable)options; +- (BOOL)closeConnections:(NSError* _Nullable* _Nullable)error; +- (BOOL)connect:(NSError* _Nullable* _Nullable)error; +- (BOOL)disconnect:(NSError* _Nullable* _Nullable)error; +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus:(NSError* _Nullable* _Nullable)error; +- (BOOL)selectOutbound:(NSString* _Nullable)groupTag outboundTag:(NSString* _Nullable)outboundTag error:(NSError* _Nullable* _Nullable)error; +- (BOOL)serviceClose:(NSError* _Nullable* _Nullable)error; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setClashMode:(NSString* _Nullable)newMode error:(NSError* _Nullable* _Nullable)error; +- (BOOL)setGroupExpand:(NSString* _Nullable)groupTag isExpand:(BOOL)isExpand error:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +- (BOOL)urlTest:(NSString* _Nullable)groupTag error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxCommandClientOptions : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int32_t command; +@property (nonatomic) int64_t statusInterval; +@end + +@interface LibboxCommandServer : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(id _Nullable)handler maxLines:(int32_t)maxLines; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (void)resetLog; +- (void)setService:(LibboxBoxService* _Nullable)newService; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +- (void)writeMessage:(NSString* _Nullable)message; +@end + +@interface LibboxErrorMessage : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull message; +- (NSData* _Nullable)encode; +@end + +@interface LibboxExchangeContext : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (void)errnoCode:(int32_t)code; +- (void)errorCode:(int32_t)code; +- (void)onCancel:(id _Nullable)callback; +- (void)rawSuccess:(NSData* _Nullable)result; +- (void)success:(NSString* _Nullable)result; +@end + +@interface LibboxImportRemoteProfile : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) NSString* _Nonnull url; +@property (nonatomic) NSString* _Nonnull host; +@end + +@interface LibboxNetworkInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int32_t index; +@property (nonatomic) int32_t mtu; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) id _Nullable addresses; +@end + +@interface LibboxOutboundGroup : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull tag; +@property (nonatomic) NSString* _Nonnull type; +@property (nonatomic) BOOL selectable; +@property (nonatomic) NSString* _Nonnull selected; +@property (nonatomic) BOOL isExpand; +- (id _Nullable)getItems; +@end + +@interface LibboxOutboundGroupItem : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull tag; +@property (nonatomic) NSString* _Nonnull type; +@property (nonatomic) int64_t urlTestTime; +@property (nonatomic) int32_t urlTestDelay; +@end + +@interface LibboxPProfServer : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(long)port; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (BOOL)start:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxProfileContent : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) int32_t type; +@property (nonatomic) NSString* _Nonnull config; +@property (nonatomic) NSString* _Nonnull remotePath; +@property (nonatomic) BOOL autoUpdate; +@property (nonatomic) int32_t autoUpdateInterval; +@property (nonatomic) int64_t lastUpdated; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfileContentRequest : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t profileID; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfileDecoder : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (BOOL)decode:(NSData* _Nullable)data error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)iterator; +@end + +@interface LibboxProfileEncoder : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (void)append:(LibboxProfilePreview* _Nullable)profile; +- (NSData* _Nullable)encode; +@end + +@interface LibboxProfilePreview : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t profileID; +@property (nonatomic) NSString* _Nonnull name; +@property (nonatomic) int32_t type; +@end + +@interface LibboxRoutePrefix : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +- (NSString* _Nonnull)address; +- (NSString* _Nonnull)mask; +- (int32_t)prefix; +- (NSString* _Nonnull)string; +@end + +@interface LibboxStatusMessage : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) int64_t memory; +@property (nonatomic) int32_t goroutines; +@property (nonatomic) int32_t connectionsIn; +@property (nonatomic) int32_t connectionsOut; +@property (nonatomic) BOOL trafficAvailable; +@property (nonatomic) int64_t uplink; +@property (nonatomic) int64_t downlink; +@property (nonatomic) int64_t uplinkTotal; +@property (nonatomic) int64_t downlinkTotal; +@end + +@interface LibboxSystemProxyStatus : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nonnull instancetype)init; +@property (nonatomic) BOOL available; +@property (nonatomic) BOOL enabled; +@end + +@interface LibboxWIFIState : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (nullable instancetype)init:(NSString* _Nullable)wifiSSID wifiBSSID:(NSString* _Nullable)wifiBSSID; +@property (nonatomic) NSString* _Nonnull ssid; +@property (nonatomic) NSString* _Nonnull bssid; +@end + +FOUNDATION_EXPORT const int32_t LibboxCommandClashMode; +FOUNDATION_EXPORT const int32_t LibboxCommandCloseConnections; +FOUNDATION_EXPORT const int32_t LibboxCommandGetSystemProxyStatus; +FOUNDATION_EXPORT const int32_t LibboxCommandGroup; +FOUNDATION_EXPORT const int32_t LibboxCommandGroupExpand; +FOUNDATION_EXPORT const int32_t LibboxCommandLog; +FOUNDATION_EXPORT const int32_t LibboxCommandSelectOutbound; +FOUNDATION_EXPORT const int32_t LibboxCommandServiceClose; +FOUNDATION_EXPORT const int32_t LibboxCommandServiceReload; +FOUNDATION_EXPORT const int32_t LibboxCommandSetClashMode; +FOUNDATION_EXPORT const int32_t LibboxCommandSetSystemProxyEnabled; +FOUNDATION_EXPORT const int32_t LibboxCommandStatus; +FOUNDATION_EXPORT const int32_t LibboxCommandURLTest; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeError; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileContent; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileContentRequest; +FOUNDATION_EXPORT const int64_t LibboxMessageTypeProfileList; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeLocal; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeRemote; +FOUNDATION_EXPORT const int32_t LibboxProfileTypeiCloud; + +FOUNDATION_EXPORT BOOL LibboxCheckConfig(NSString* _Nullable configContent, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void LibboxClearServiceError(void); + +FOUNDATION_EXPORT LibboxErrorMessage* _Nullable LibboxDecodeErrorMessage(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT int32_t LibboxDecodeLengthChunk(NSData* _Nullable data); + +FOUNDATION_EXPORT LibboxProfileContent* _Nullable LibboxDecodeProfileContent(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT LibboxProfileContentRequest* _Nullable LibboxDecodeProfileContentRequest(NSData* _Nullable data, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSData* _Nullable LibboxEncodeChunkedMessage(NSData* _Nullable data); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatBytes(int64_t length); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatConfig(NSString* _Nullable configContent, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxFormatMemoryBytes(int64_t length); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxGenerateRemoteProfileImportLink(NSString* _Nullable name, NSString* _Nullable remoteURL); + +FOUNDATION_EXPORT int32_t LibboxGetTunnelFileDescriptor(void); + +FOUNDATION_EXPORT LibboxCommandClient* _Nullable LibboxNewCommandClient(id _Nullable handler, LibboxCommandClientOptions* _Nullable options); + +FOUNDATION_EXPORT LibboxCommandServer* _Nullable LibboxNewCommandServer(id _Nullable handler, int32_t maxLines); + +FOUNDATION_EXPORT id _Nullable LibboxNewHTTPClient(void); + +FOUNDATION_EXPORT LibboxPProfServer* _Nullable LibboxNewPProfServer(long port); + +FOUNDATION_EXPORT LibboxBoxService* _Nullable LibboxNewService(NSString* _Nullable configContent, id _Nullable platformInterface, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT LibboxCommandClient* _Nullable LibboxNewStandaloneCommandClient(void); + +FOUNDATION_EXPORT LibboxWIFIState* _Nullable LibboxNewWIFIState(NSString* _Nullable wifiSSID, NSString* _Nullable wifiBSSID); + +FOUNDATION_EXPORT LibboxImportRemoteProfile* _Nullable LibboxParseRemoteProfileImportLink(NSString* _Nullable importLink, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxProxyDisplayType(NSString* _Nullable proxyType); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxReadServiceError(NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT BOOL LibboxRedirectStderr(NSString* _Nullable path, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void LibboxRegisterLocalDNSTransport(id _Nullable transport); + +FOUNDATION_EXPORT void LibboxSetMemoryLimit(BOOL enabled); + +FOUNDATION_EXPORT void LibboxSetup(NSString* _Nullable basePath, NSString* _Nullable workingPath, NSString* _Nullable tempPath, BOOL isTVOS); + +FOUNDATION_EXPORT BOOL LibboxSetupWithUsername(NSString* _Nullable basePath, NSString* _Nullable workingPath, NSString* _Nullable tempPath, NSString* _Nullable username, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT NSString* _Nonnull LibboxVersion(void); + +FOUNDATION_EXPORT BOOL LibboxWriteServiceError(NSString* _Nullable message, NSError* _Nullable* _Nullable error); + +@class LibboxCommandClientHandler; + +@class LibboxCommandServerHandler; + +@class LibboxFunc; + +@class LibboxHTTPClient; + +@class LibboxHTTPRequest; + +@class LibboxHTTPResponse; + +@class LibboxInterfaceUpdateListener; + +@class LibboxLocalDNSTransport; + +@class LibboxNetworkInterfaceIterator; + +@class LibboxOnDemandRule; + +@class LibboxOnDemandRuleIterator; + +@class LibboxOutboundGroupItemIterator; + +@class LibboxOutboundGroupIterator; + +@class LibboxPlatformInterface; + +@class LibboxProfilePreviewIterator; + +@class LibboxRoutePrefixIterator; + +@class LibboxStringIterator; + +@class LibboxTunInterface; + +@class LibboxTunOptions; + +@interface LibboxCommandClientHandler : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)clearLog; +- (void)connected; +- (void)disconnected:(NSString* _Nullable)message; +- (void)initializeClashMode:(id _Nullable)modeList currentMode:(NSString* _Nullable)currentMode; +- (void)updateClashMode:(NSString* _Nullable)newMode; +- (void)writeGroups:(id _Nullable)message; +- (void)writeLog:(NSString* _Nullable)message; +- (void)writeStatus:(LibboxStatusMessage* _Nullable)message; +@end + +@interface LibboxCommandServerHandler : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (LibboxSystemProxyStatus* _Nullable)getSystemProxyStatus; +- (void)postServiceClose; +- (BOOL)serviceReload:(NSError* _Nullable* _Nullable)error; +- (BOOL)setSystemProxyEnabled:(BOOL)isEnabled error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxFunc : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)invoke:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxHTTPClient : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)close; +- (void)keepAlive; +- (void)modernTLS; +- (id _Nullable)newRequest; +- (void)pinnedSHA256:(NSString* _Nullable)sumHex; +- (void)pinnedTLS12; +- (void)restrictedTLS; +- (void)trySocks5:(int32_t)port; +@end + +@interface LibboxHTTPRequest : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (id _Nullable)execute:(NSError* _Nullable* _Nullable)error; +- (void)randomUserAgent; +- (void)setContent:(NSData* _Nullable)content; +- (void)setContentString:(NSString* _Nullable)content; +- (void)setHeader:(NSString* _Nullable)key value:(NSString* _Nullable)value; +- (void)setMethod:(NSString* _Nullable)method; +- (BOOL)setURL:(NSString* _Nullable)link error:(NSError* _Nullable* _Nullable)error; +- (void)setUserAgent:(NSString* _Nullable)userAgent; +@end + +@interface LibboxHTTPResponse : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSData* _Nullable)getContent:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)getContentString:(NSError* _Nullable* _Nullable)error; +- (BOOL)writeTo:(NSString* _Nullable)path error:(NSError* _Nullable* _Nullable)error; +@end + +@interface LibboxInterfaceUpdateListener : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (void)updateDefaultInterface:(NSString* _Nullable)interfaceName interfaceIndex:(int32_t)interfaceIndex; +@end + +@interface LibboxLocalDNSTransport : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)exchange:(LibboxExchangeContext* _Nullable)ctx message:(NSData* _Nullable)message error:(NSError* _Nullable* _Nullable)error; +- (BOOL)lookup:(LibboxExchangeContext* _Nullable)ctx network:(NSString* _Nullable)network domain:(NSString* _Nullable)domain error:(NSError* _Nullable* _Nullable)error; +- (BOOL)raw; +@end + +@interface LibboxNetworkInterfaceIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxNetworkInterface* _Nullable)next; +@end + +@interface LibboxOnDemandRule : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (id _Nullable)dnsSearchDomainMatch; +- (id _Nullable)dnsServerAddressMatch; +- (int32_t)interfaceTypeMatch; +- (NSString* _Nonnull)probeURL; +- (id _Nullable)ssidMatch; +- (int32_t)target; +@end + +@interface LibboxOnDemandRuleIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (id _Nullable)next; +@end + +@interface LibboxOutboundGroupItemIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxOutboundGroupItem* _Nullable)next; +@end + +@interface LibboxOutboundGroupIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxOutboundGroup* _Nullable)next; +@end + +@interface LibboxPlatformInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)autoDetectInterfaceControl:(int32_t)fd error:(NSError* _Nullable* _Nullable)error; +- (void)clearDNSCache; +- (BOOL)closeDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)findConnectionOwner:(int32_t)ipProtocol sourceAddress:(NSString* _Nullable)sourceAddress sourcePort:(int32_t)sourcePort destinationAddress:(NSString* _Nullable)destinationAddress destinationPort:(int32_t)destinationPort ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getInterfaces:(NSError* _Nullable* _Nullable)error; +- (BOOL)includeAllNetworks; +- (BOOL)openTun:(id _Nullable)options ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (NSString* _Nonnull)packageNameByUid:(int32_t)uid error:(NSError* _Nullable* _Nullable)error; +- (LibboxWIFIState* _Nullable)readWIFIState; +- (BOOL)startDefaultInterfaceMonitor:(id _Nullable)listener error:(NSError* _Nullable* _Nullable)error; +- (BOOL)uidByPackageName:(NSString* _Nullable)packageName ret0_:(int32_t* _Nullable)ret0_ error:(NSError* _Nullable* _Nullable)error; +- (BOOL)underNetworkExtension; +- (BOOL)usePlatformAutoDetectInterfaceControl; +- (BOOL)usePlatformDefaultInterfaceMonitor; +- (BOOL)usePlatformInterfaceGetter; +- (BOOL)useProcFS; +- (void)writeLog:(NSString* _Nullable)message; +@end + +@interface LibboxProfilePreviewIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxProfilePreview* _Nullable)next; +@end + +@interface LibboxRoutePrefixIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (LibboxRoutePrefix* _Nullable)next; +@end + +@interface LibboxStringIterator : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)hasNext; +- (NSString* _Nonnull)next; +@end + +@interface LibboxTunInterface : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)close:(NSError* _Nullable* _Nullable)error; +- (int32_t)fileDescriptor; +@end + +@interface LibboxTunOptions : NSObject { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (BOOL)getAutoRoute; +- (NSString* _Nonnull)getDNSServerAddress:(NSError* _Nullable* _Nullable)error; +- (id _Nullable)getExcludePackage; +- (id _Nullable)getHTTPProxyBypassDomain; +- (id _Nullable)getHTTPProxyMatchDomain; +- (NSString* _Nonnull)getHTTPProxyServer; +- (int32_t)getHTTPProxyServerPort; +- (id _Nullable)getIncludePackage; +- (id _Nullable)getInet4Address; +- (id _Nullable)getInet4RouteAddress; +- (id _Nullable)getInet4RouteExcludeAddress; +- (id _Nullable)getInet4RouteRange; +- (id _Nullable)getInet6Address; +- (id _Nullable)getInet6RouteAddress; +- (id _Nullable)getInet6RouteExcludeAddress; +- (id _Nullable)getInet6RouteRange; +- (int32_t)getMTU; +- (BOOL)getStrictRoute; +- (BOOL)isHTTPProxyEnabled; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Universe.objc.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Universe.objc.h new file mode 100644 index 0000000..019e750 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/Universe.objc.h @@ -0,0 +1,29 @@ +// Objective-C API for talking to Go package. +// gobind -lang=objc +// +// File is generated by gobind. Do not edit. + +#ifndef __Universe_H__ +#define __Universe_H__ + +@import Foundation; +#include "ref.h" + +@protocol Universeerror; +@class Universeerror; + +@protocol Universeerror +- (NSString* _Nonnull)error; +@end + +@class Universeerror; + +@interface Universeerror : NSError { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSString* _Nonnull)error; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/ref.h b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/ref.h new file mode 100644 index 0000000..b8036a4 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Headers/ref.h @@ -0,0 +1,35 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifndef __GO_REF_HDR__ +#define __GO_REF_HDR__ + +#include + +// GoSeqRef is an object tagged with an integer for passing back and +// forth across the language boundary. A GoSeqRef may represent either +// an instance of a Go object, or an Objective-C object passed to Go. +// The explicit allocation of a GoSeqRef is used to pin a Go object +// when it is passed to Objective-C. The Go seq package maintains a +// reference to the Go object in a map keyed by the refnum along with +// a reference count. When the reference count reaches zero, the Go +// seq package will clear the corresponding entry in the map. +@interface GoSeqRef : NSObject { +} +@property(readonly) int32_t refnum; +@property(strong) id obj; // NULL when representing a Go object. + +// new GoSeqRef object to proxy a Go object. The refnum must be +// provided from Go side. +- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj; + +- (int32_t)incNum; + +@end + +@protocol goSeqRefInterface +-(GoSeqRef*) _ref; +@end + +#endif diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Libbox b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Libbox new file mode 100644 index 0000000..6c6b518 Binary files /dev/null and b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Libbox differ diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Modules/module.modulemap b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..c2daf03 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module Libbox { + header "ref.h" + header "Libbox.objc.h" + header "Universe.objc.h" + export * +} \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Resources/Info.plist b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..0d1a4b8 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/Current b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/Current new file mode 100644 index 0000000..8c7e5a6 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Libbox.xcframework/tvos-arm64_x86_64-simulator/Libbox.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/iOS-SwiftUI-Code/LibboxLocal/Package.swift b/iOS-SwiftUI-Code/LibboxLocal/Package.swift new file mode 100644 index 0000000..a4e88c5 --- /dev/null +++ b/iOS-SwiftUI-Code/LibboxLocal/Package.swift @@ -0,0 +1,16 @@ +// swift-tools-version: 5.7 +import PackageDescription + +let package = Package( + name: "LibboxLocal", + platforms: [.iOS(.v15), .macOS(.v13), .tvOS(.v17)], + products: [ + .library(name: "Libbox", targets: ["Libbox"]), + ], + targets: [ + .binaryTarget( + name: "Libbox", + path: "Libbox.xcframework" + ), + ] +) diff --git a/iOS-SwiftUI-Code/uuvpn.xcodeproj/project.pbxproj b/iOS-SwiftUI-Code/uuvpn.xcodeproj/project.pbxproj index 872f46d..011e159 100644 --- a/iOS-SwiftUI-Code/uuvpn.xcodeproj/project.pbxproj +++ b/iOS-SwiftUI-Code/uuvpn.xcodeproj/project.pbxproj @@ -175,8 +175,6 @@ C0DDD6782CB907F300AE1C0A /* 5a519db7.json in Resources */ = {isa = PBXBuildFile; fileRef = C0DDD6762CB907F300AE1C0A /* 5a519db7.json */; }; C0DDD67B2CB908B200AE1C0A /* 12c853b3.json in Resources */ = {isa = PBXBuildFile; fileRef = C0DDD67A2CB908B200AE1C0A /* 12c853b3.json */; }; C0DDD6922CB9110900AE1C0A /* View+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0DDD6882CB9110900AE1C0A /* View+Extensions.swift */; }; - C0E540152CA17EBF0054BC97 /* Libbox.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0E540142CA17EBF0054BC97 /* Libbox.xcframework */; }; - C0E540162CA17EBF0054BC98 /* Libbox.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0E540142CA17EBF0054BC97 /* Libbox.xcframework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -469,7 +467,6 @@ C0DDD6762CB907F300AE1C0A /* 5a519db7.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = 5a519db7.json; sourceTree = ""; }; C0DDD67A2CB908B200AE1C0A /* 12c853b3.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = 12c853b3.json; sourceTree = ""; }; C0DDD6882CB9110900AE1C0A /* View+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "View+Extensions.swift"; sourceTree = ""; }; - C0E540142CA17EBF0054BC97 /* Libbox.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = Libbox.xcframework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -505,7 +502,6 @@ buildActionMask = 2147483647; files = ( 3A9759202A4EB69C00E4404B /* Library.framework in Frameworks */, - C0E540152CA17EBF0054BC97 /* Libbox.xcframework in Frameworks */, 3A4EAD372A4FEC20005435B3 /* ApplicationLibrary.framework in Frameworks */, 044AE9732CC9D33B00F5813E /* Crisp in Frameworks */, C01BFABD2E80052E00D8ACA6 /* Vision.framework in Frameworks */, @@ -517,7 +513,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C0E540162CA17EC10054BC98 /* Libbox.xcframework in Frameworks */, 0451E1D62CC3AE2800E9A49F /* GRDB in Frameworks */, 3A7E90382A46778E00D53052 /* BinaryCodable in Frameworks */, 3AF3A3D22B2207F3001FD7C1 /* libresolv.tbd in Frameworks */, @@ -702,7 +697,6 @@ 3AEC20BC2A45991900A63465 = { isa = PBXGroup; children = ( - C0E540142CA17EBF0054BC97 /* Libbox.xcframework */, 3AEC20F42A459AB400A63465 /* XiaoXiong */, 3AEC211E2A459B4700A63465 /* Library */, 3A4EAD112A4FEAE6005435B3 /* ApplicationLibrary */, @@ -1089,6 +1083,7 @@ packageProductDependencies = ( 3A7E90372A46778E00D53052 /* BinaryCodable */, 0451E1D52CC3AE2800E9A49F /* GRDB */, + C0E540312CA27EC10054BCA2 /* Libbox */, ); productName = Library; productReference = 3AEC211D2A459B4700A63465 /* Library.framework */; @@ -1187,6 +1182,7 @@ C0DDD6422CB7E0F000AE1C0A /* XCRemoteSwiftPackageReference "lottie-ios" */, 0451E1D42CC3ADDF00E9A49F /* XCLocalSwiftPackageReference "GRDB.swift-6.29.3" */, 044AE9712CC9D33B00F5813E /* XCLocalSwiftPackageReference "crisp-sdk-ios" */, + C0E540302CA27EC10054BCA1 /* XCLocalSwiftPackageReference "LibboxLocal" */, ); productRefGroup = 3AEC20C72A45991900A63465 /* Products */; projectDirPath = ""; @@ -2335,6 +2331,13 @@ }; /* End XCRemoteSwiftPackageReference section */ +/* Begin XCLocalSwiftPackageReference section */ + C0E540302CA27EC10054BCA1 /* XCLocalSwiftPackageReference "LibboxLocal" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = LibboxLocal; + }; +/* End XCLocalSwiftPackageReference section */ + /* Begin XCSwiftPackageProductDependency section */ 044AE9722CC9D33B00F5813E /* Crisp */ = { isa = XCSwiftPackageProductDependency; @@ -2360,6 +2363,11 @@ package = C0DDD6422CB7E0F000AE1C0A /* XCRemoteSwiftPackageReference "lottie-ios" */; productName = Lottie; }; + C0E540312CA27EC10054BCA2 /* Libbox */ = { + isa = XCSwiftPackageProductDependency; + package = C0E540302CA27EC10054BCA1 /* XCLocalSwiftPackageReference "LibboxLocal" */; + productName = Libbox; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 3AEC20BD2A45991900A63465 /* Project object */;