Files
sing-box-for-apple/SFT/ApplicationDelegate.swift
T
2024-12-28 15:11:12 +08:00

31 lines
991 B
Swift

import ApplicationLibrary
import Foundation
import Libbox
import Library
import UIKit
class ApplicationDelegate: NSObject, UIApplicationDelegate {
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
NSLog("Here I stand")
let options = LibboxSetupOptions()
options.basePath = FilePath.sharedDirectory.relativePath
options.workingPath = FilePath.workingDirectory.relativePath
options.tempPath = FilePath.cacheDirectory.relativePath
options.isTVOS = true
var error: NSError?
LibboxSetup(options, &error)
LibboxSetLocale(Locale.current.identifier)
setup()
return true
}
private func setup() {
do {
try UIProfileUpdateTask.configure()
NSLog("setup background task success")
} catch {
NSLog("setup background task error: \(error.localizedDescription)")
}
}
}