123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502 |
- //
- // AppDelegate.swift
- // PDF Reader Pro
- //
- // Created by Niehaoyu on 2022/9/23.
- //
- import Cocoa
- import UserNotifications
- import KMComponentLibrary
- @main
- class AppDelegate: NSObject, NSApplicationDelegate, iRateDelegate{
-
- var rateWindowVC: KMRateWindowController!
-
- func applicationWillFinishLaunching(_ notification: Notification) {
- #if VERSION_FREE
- #if VERSION_DMG
-
- CPDFConvertKit.setLicenseKey("d/nxJMNuCxxkHSwLM0ZdNce/rfLLR/Zd4rIX5WYwyfDcsm6dSdNtSUiv13bO8R4ETaEAX5s0Zv9RWOhjgXdRzHAduf7IP6TApYIwvbc/4Wbhm7GLSWUo2vOXw2G5jlkAokntq5+SKv5430RX0ZrxQ9x2VTUBxdUy36Pugm8nUhxilBbDnuicJIN6FWAsq6WLAMc/w2WIlAQ5BjepEYuMs1Vg6D8GBhrSoVMEa86Hg59j9TlN3HVIvLfUp+9q3cBR8A3t2RE3IXoSi3liVfegl03jN17hspcQnTjYRJGarPQ+mAN8tVXV8bO9fDh1/g0pYxge5uxzyTiVXgU9d8cqSq8kD+Q9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zszTXi8P1RGbs2t6D//Sowj62gyYAbZ2QqbLiIvwPt6N9mO4+kppY6mjsHQYLJIM4qyVkdOLyrRoET55leUlys2xv/vAuxkQ8RqQJYgFv0WhmC+IpenDmk3/XrKPcvGsERUyEuLO4FifqOncSuh6GHy4bbo0PkSWJhKZASN8hmzTMkKtI79ppkJ6CgjxZewhelUbJM07e0wdmJR9DF1x0EIntYoXxZ6z1fc6cjsRblPhDGEcUBTvbF6DMGXXRzJxlUFMzG7ka5InMav4dBW5CFLNpSEpGnzWO99DFwA9L4XZdGV2vKMNLXBhmYQF1PibTWu0lH1oY17eVN2TRW5amzrZsD0yy20WxEXrssgDJq7xPzi1sOZ56C+jdE/8p9tNUW4KYJ5GoqCVh5w0Ajkc3xRqWrpmJXUollqL+u9K6VDPiGAwpSBmox6oux68kbF7jkiCZDxHK7wfU3XrdhO8pmKn37TM/hBROJ3ufWlCiyNQy5AlRqzN1AAIKVmJzmOQCOcohtAQS/ULdkM2FO7GcxWLAf1YhWUmCAiDfm1c1lrdjqG0V0XpnGga69npgRspIG1y9kaZz89k1E7lWRj5bPVsGo+cInV8gEE9jyu1d/w+z+IoMv/64lho9GX2iJoq9a2ZlLQs3Nchtt3ztkLOIrL83eqpD+OFl7xBMsabCVNViM2vieVHPpj+ryaMGUv809szrKYrmDEsg4RKbxuXysKB3jpAHRMF+rSFAwQSTXQlmZfbxpitFoKX83UBkha60z3+yyZvjzxnVmPLWTnX0u13CDIXEvC3V6mR2aaKvVJnE5h5fVw9F2s3H5Q55YkTYg==")
-
- ComPDFUIConfig.initializeUIConfig()
-
- ComponentLibrary.shared.parserExcel(withPath: "")
- }
-
- func applicationDidFinishLaunching(_ aNotification: Notification) {
- // Insert code here to initialize your application
-
- KMNThumbnailManager.clearCacheThumImage() //清除页面缩图缓存
- //通知
- UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in
- if granted {
- KMPrint("User authorized notifications")
- } else {
- KMPrint("User denied notifications")
- }
- }
-
- DispatchQueue.main.async {
- NSApplication.shared.registerForRemoteNotifications()
- }
-
- #if VERSION_DMG
- let updater = SUUpdater.shared()
- updater?.delegate = self
- updater?.automaticallyChecksForUpdates = true
- #else
- #endif
-
- //Firebase RemoteConfig
- #if VERSION_FREE
- KMKdanRemoteConfig.remoteConfig.fetch { _status, error in
-
- }
- #endif
-
- let versionString = MainBundle.infoDictionary?[kCFBundleVersionKey as String] as? String ?? ""
- let lastVersionString = KMDataManager.ud_string(forKey: SKLastVersionLaunchedKey)
- if lastVersionString == nil || SKVersionNumber.compareVersionString(lastVersionString, toVersionString: versionString) == .orderedAscending {
- let sud = UserDefaults.standard
- if versionString.isEmpty == false {
- sud.set(versionString, forKey: SKLastVersionLaunchedKey)
- }
- // [sud setBool:NO forKey:@"kShowRecentGuideKey"];
- // [sud removeObjectForKey:@"kToolbarTipIsShow"];
- // [sud removeObjectForKey:@"kShowNoPermissionAlertKey"];
- // [sud removeObjectForKey:@"KMTabbingHintShowFlag"];
- // [sud removeObjectForKey:@"KMConverthHaveOpenConvertDetails"];
- sud.synchronize()
- }
- UserDefaults.standard.register(defaults: ["NSApplicationCrashOnExceptions" : true])
-
- NSApp.servicesProvider = self
-
- KMStatusBar.system()
-
- // MARK: 广告数据初始化
- var appName: KMAdvertisementAppNameType = .PDFReaderProMac
- #if VERSION_FREE
-
- #if VERSION_DMG
- appName = .PDFReaderProMacDMG
- #else
-
- #endif
-
- #else
- appName = .PDFReaderProMacPro
- #endif
-
-
- KMAdvertisementManager.manager.initConfig(appName: appName,
- subscribeType: .unknow,
- platform: .Mac)
- // 测试模式,默认false
- KMAdvertisementManager.manager.debug = true
-
- NSApp.appearance = NSAppearance.current
- KMAnalytics.configure()
-
- //第一次开启app
- let info = UserDefaults.standard.value(forKey: "kFirstOpenAppCount")
- var count = 0
- if info != nil {
- count = info as? Int ?? 0
- }
- count += 1
- UserDefaults.standard.set(count, forKey: "kFirstOpenAppCount")
- UserDefaults.standard.synchronize()
-
-
- self.initMainMenu()
-
-
- reopenDocument(forPaths: [])
-
- self.initiRateData()
-
- let appleEventManager = NSAppleEventManager.shared()
- appleEventManager.setEventHandler(self,
- andSelector: #selector(handleGetURLEvent(_:withReplyEvent:)),
- forEventClass: AEEventClass(kInternetEventClass),
- andEventID: AEEventID(kAEGetURL))
-
- DistributedNotificationCenter.default().addObserver(self, selector: #selector(_themeChanged), name: NSApplication.interfaceThemeChangedNotification, object: nil)
-
- #if VERSION_DMG
- VerificationManager.default()
- KMDMGProductsManager.shareInstance.getProductDatas()
- #else
- self.initiVersionData()
- IAPProductsManager.default().initIAP()
- #endif
-
- //AI相关
- AIInfoManager.default()
- NotificationCenter.default.addObserver(self, selector: #selector(AIDeviceStatusChangeNotification), name: NSNotification.Name(rawValue: "kDeviceAIStatusChangeNotification"), object: nil)
-
- for string in ["Ubuntu-Bold","Ubuntu-Medium"] {
- let fontURL = Bundle.main.url(forResource: string, withExtension: "ttf")
- var error: Unmanaged<CFError>?
- if !CTFontManagerRegisterFontsForURL(fontURL! as CFURL, .process, &error) {
- print("Failed to register font!")
- } else {
- print("Font registered successfully!")
- }
-
- }
-
- NotificationCenter.default.addObserver(self, selector: #selector(deviceActivateStatusChangeNotification), name: NSNotification.Name(rawValue: "kDeviceActivateNotification"), object: nil)
- }
-
- func initiRateData() {
- iRate.sharedInstance().delegate = self
- #if VERSION_FREE
- iRate.sharedInstance().appStoreID = 919472673
- #else
- iRate.sharedInstance().appStoreID = 825459243
- #endif
- iRate.sharedInstance().onlyPromptIfLatestVersion = false
- iRate.sharedInstance().onlyPromptIfMainWindowIsAvailable = true
- }
-
- //MARK: iRateDelegate
- func iRateUserDidDeclineToRateApp() {
- KMVerificationWindowController.verificationFeedback()
- }
-
- func iRateShouldPromptForRating() -> Bool {
- let notShow: Bool = UserDefaults.standard.bool(forKey: "kUserHaveClickRateUsKey")
- if !notShow {
- UserDefaults.standard.setValue(true, forKey: "kUserHaveClickRateUsKey")
- UserDefaults.standard.synchronize()
- NotificationCenter.default.post(name: Notification.Name(rawValue: "kUserHaveClickRateUsNotification"), object: self)
- }
-
- self.rateWindowVC = KMRateWindowController.init(windowNibName: "KMRateWindowController")
-
- self.rateWindowVC.closeBlock = { wc in
-
- }
- self.rateWindowVC.closeBlock = { wc in
-
- }
- self.rateWindowVC.showWindow(nil)
- return false
- }
-
- @objc func handleGetURLEvent(_ event: NSAppleEventDescriptor, withReplyEvent replyEvent: NSAppleEventDescriptor) {
- if let urlString = event.paramDescriptor(forKeyword: AEKeyword(keyDirectObject))?.stringValue,
- let url = URL(string: urlString) {
- // 在这里处理收到的 URL Scheme
- KMPrint("Received URL Scheme: \(url.scheme ?? "")")
- KMPrint("Path: \(url.path)")
-
- if NSApp.mainWindow == nil {
- let bundleIdentifier: String = Bundle.main.bundleIdentifier ?? ""
- launchApp(bundleIdentifier: bundleIdentifier)
- }
-
- DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.3) {
- #if VERSION_DMG
- // 执行相应的操作
- if url.scheme == "subscriptiondmgschemes" {
-
- }
- #endif
-
- #if VERSION_FREE
- // 执行相应的操作
- if url.scheme == "subscriptionSchemes" {
-
- if url.path == "/open" {
- // 执行打开操作
- } else if url.path == "/close" {
- // 执行关闭操作
- }
- }
- #endif
- }
- }
- }
-
- func launchApp(bundleIdentifier: String) {
- let workspace = NSWorkspace.shared
-
- // Launch the application with the specified bundle identifier
- if let appURL = NSWorkspace.shared.urlForApplication(withBundleIdentifier: bundleIdentifier) {
- do {
- try workspace.launchApplication(at: appURL, options: .default, configuration: [:])
- } catch {
- print("Error launching the application: \(error)")
- }
- } else {
- print("Application with bundle identifier '\(bundleIdentifier)' not found.")
- }
- }
-
-
-
- func application(_ application: NSApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
- let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
- print("Device token:", token)
- }
-
- func application(_ application: NSApplication, didReceiveRemoteNotification userInfo: [String : Any]) {
-
- }
-
- func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
- if !flag {
- let browser: KMBrowser = KMBrowser.init()
- browser.windowController = KMBrowserWindowController.init(browser: browser)
- browser.addHomeTabContents()
- browser.windowController.window?.center()
- browser.windowController.showWindow(self)
- }
- return flag
- }
-
- func applicationShouldOpenUntitledFile(_ sender: NSApplication) -> Bool {
- if (SettingsManager.sharedInstance.reopenFileWhenAppStart == false) {
- return false
- }
-
- let filepaths = KMPreferenceManager.shared.lastOpenFilepaths
- if (filepaths == nil || filepaths!.count == 0) {
- return false
- }
-
- DispatchQueue.main.async {
- for filepath in filepaths! {
- NSDocumentController.shared.km_safe_openDocument(withContentsOf: URL(fileURLWithPath: filepath), display: true) { _, _, _ in
-
- }
- }
- }
- return false
- }
-
- func applicationWillTerminate(_ aNotification: Notification) {
- if (NSDocumentController.shared.documents.count > 0) {
- var filepaths: [String] = []
- for document in NSDocumentController.shared.documents {
- // KMPrint(document.fileURL as Any)
- if (document.fileURL?.path != nil) {
- filepaths.append((document.fileURL?.path)!)
- }
- }
- KMPreferenceManager.shared.lastOpenFilepaths = filepaths
- } else {
- KMPreferenceManager.shared.lastOpenFilepaths = nil
- }
- }
-
- func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
- return true
- }
-
- // MARK: private
-
- func reopenDocument(forPaths paths: [String]) -> Void {
- let browser = KMBrowser.init() as KMBrowser
- browser.windowController = KMBrowserWindowController.init(browser: browser)
-
- var frame = browser.windowController?.window?.frame ?? CGRectZero
- frame.size.width = 1280
- frame.size.height = 800
- browser.windowController?.window?.setFrame(frame, display: true)
-
- browser.addHomeTabContents()
- browser.windowController.showWindow(self)
- }
-
- //MARK: - iVersion
- func initiVersionData() -> Void{
- #if VERSION_DMG
-
- #else
- let tVersion = iVersion.sharedInstance()
- tVersion?.applicationBundleID = Bundle.main.bundleIdentifier
-
- var tStr = "New Update Available"
- tVersion?.updateAvailableTitle = (tVersion?.localizedString(forKey: tStr, withDefault: tStr) ?? "") + "\n"
- tVersion?.versionLabelFormat = ""
- tVersion?.groupNotesByVersion = true
- tVersion?.showOnFirstLaunch = false
-
- tVersion?.checkPeriod = 2
- tVersion?.remindPeriod = 5
-
- let infoDictionary = Bundle .main.infoDictionary!
- var appName: String = infoDictionary["CFBundleDisplayName"] as! String
- if appName.count < 1 {
- appName = infoDictionary["CFBundleName"] as! String
- }
-
- tStr = "The new version of %@ is available now. Go update for new features.";
- tStr = (tVersion?.localizedString(forKey: tStr, withDefault: tStr))!
- tStr = String(format: tStr, appName)
-
- tVersion?.inThisVersionTitle = tStr
-
- tStr = "UPDATE NOW";
- tVersion!.downloadButtonLabel = tVersion?.localizedString(forKey: tStr, withDefault: tStr)
-
- tStr = "LATER";
- tVersion!.remindButtonLabel = tVersion?.localizedString(forKey: tStr, withDefault: tStr)
- tVersion!.ignoreButtonLabel = ""
- #endif
- }
-
- func mainViewController() -> KMMainViewController? {
- guard let _windowC = NSApp.mainWindow?.windowController as? KMBrowserWindowController else {
- return nil
- }
-
- let isHome: Bool = _windowC.browser?.activeTabContents()?.isHome ?? true
- if isHome {
- return nil
- }
-
- guard let document: KMMainDocument = _windowC.activeTabContents() as? KMMainDocument else {
- return nil
- }
-
- if let data = document.mainViewController {
- return data
- }
-
- return nil
- }
-
- func homeViewController() -> KMNHomeViewController? {
- guard let _windowC = NSApp.mainWindow?.windowController as? KMBrowserWindowController else {
- return nil
- }
-
- let isHome: Bool = _windowC.browser?.activeTabContents()?.isHome ?? true
- if isHome == false {
- return nil
- }
-
- guard let document: KMMainDocument = _windowC.activeTabContents() as? KMMainDocument else {
- return nil
- }
-
- if let data = document.homeViewController {
- return data
- }
-
- return nil
- }
-
- }
- // MARK: - SUUpdaterDelegate
- #if VERSION_DMG
- extension AppDelegate : SUUpdaterDelegate {
- func updaterWillRelaunchApplication(_ updater: SUUpdater) {
- }
-
- func feedURLString(for updater: SUUpdater) -> String? {
- var hostURL = "https://www.pdfreaderpro.com/downloads/"
- #if DEBUG
- hostURL = "http://test-pdf-pro.kdan.cn:3021/downloads/"
- #else
- hostURL = "https://www.pdfreaderpro.com/downloads/"
- #endif
- return hostURL+NSLocalizedString("pdfreaderprocast.xml", comment: "")
- }
-
- func updaterShouldPromptForPermissionToCheck(forUpdates updater: SUUpdater) -> Bool {
- return false
- }
-
- func upgradeAPP(with updater: SUUpdater) {
- let string = "macappstore://apps.apple.com/app/id825459243?mt=12"
- let url: URL = URL(string: string)!
- NSWorkspace.shared.open(url)
- }
-
- func upgradeButtonString(for updater: SUUpdater) -> String {
- return NSLocalizedString("PDF Reader Pro", comment: "")
- }
- }
- #endif
- // MARK: - Services Support
- extension AppDelegate {
- func openDocumentFromURLOnPboard(_ pboard: NSPasteboard, userData: String?, error errorString: inout String?) {
- var error: NSError?
- if let _ = NSDocumentController.shared.openDocumentWithURLFromPasteboard(pboard, showNotes: false, outError: &error) {
- // Document opened successfully
- } else if let error = error {
- errorString = error.localizedDescription
- }
- }
-
- func openDocumentFromDataOnPboard(_ pboard: NSPasteboard, userData: String?, error errorString: inout String?) {
- var error: NSError?
- if let _ = NSDocumentController.shared.openDocumentWithImageFromPasteboard(pboard, error: &error) {
- // Document opened successfully
- } else if let error = error {
- errorString = error.localizedDescription
- }
- }
-
- func openNotesDocumentFromURLOnPboard(_ pboard: NSPasteboard, userData: String?, error errorString: inout String?) {
- var error: NSError?
- if let _ = NSDocumentController.shared.openDocumentWithURLFromPasteboard(pboard, showNotes: true, outError: &error) {
- // Document opened successfully
- } else if let error = error {
- errorString = error.localizedDescription
- }
- }
- }
- //MARK: - UNUserNotificationCenterDelegate
- extension AppDelegate: UNUserNotificationCenterDelegate {
- func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
- // 处理用户点击推送通知的操作
- completionHandler()
- }
- }
- //MARK: - Notification
- extension AppDelegate {
- @objc private func _themeChanged(_ sender: Notification) {
- let isDarkModel = KMAdvertisementConfig.isDarkModel()
- if isDarkModel {
- NSApp.appearance = NSAppearance(named: .darkAqua)
- } else {
- NSApp.appearance = NSAppearance(named: .aqua)
- }
- NotificationCenter.default.post(name: Notification.Name(rawValue: "kEffectiveAppearance"), object: nil)
- }
-
- @objc func AIDeviceStatusChangeNotification() {
- DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.3) {
-
- }
- }
-
- @objc func deviceActivateStatusChangeNotification() {
-
- }
- }
|