From fb2058bec7cb496d3eefc90ad6a1ee6f3eef55c4 Mon Sep 17 00:00:00 2001 From: linshujie Date: Sat, 25 Jul 2026 09:15:53 +0800 Subject: [PATCH] - FLEX - PrivacyInfo --- .gitignore | 26 ++++++++++++++++ Podfile | 2 +- Podfile.lock | 10 +++++- QuickLocation.xcodeproj/project.pbxproj | 8 +++-- QuickLocation/Common/Constant.swift | 4 +-- .../Extension/UIApplicationExtension.swift | 10 +++++- QuickLocation/Core/Wrapper.swift | 6 ++-- .../Main/BaseService/ListService.swift | 3 +- .../BaseViewController.swift | 8 ++--- QuickLocation/Manager/URL/URLManager.swift | 12 +++---- QuickLocation/PrivacyInfo.xcprivacy | 31 +++++++++++++++++++ QuickLocation/RxSwift/Action.swift | 3 +- QuickLocation/RxSwift/InputSubject.swift | 3 +- 13 files changed, 103 insertions(+), 23 deletions(-) create mode 100644 QuickLocation/PrivacyInfo.xcprivacy diff --git a/.gitignore b/.gitignore index 77a5a6af..6b7678fd 100644 --- a/.gitignore +++ b/.gitignore @@ -112,3 +112,29 @@ screenshot/ .opencode/skills/writing-great-skills/GLOSSARY.md .opencode/skills/writing-great-skills/SKILL.md .opencode/skills/writing-great-skills/agents/openai.yaml +.cursor/commands/opsx-apply.md +.cursor/commands/opsx-archive.md +.cursor/commands/opsx-explore.md +.cursor/commands/opsx-propose.md +.cursor/commands/opsx-sync.md +.cursor/commands/opsx-update.md +.cursor/skills/openspec-apply-change/SKILL.md +.cursor/skills/openspec-archive-change/SKILL.md +.cursor/skills/openspec-explore/SKILL.md +.cursor/skills/openspec-propose/SKILL.md +.cursor/skills/openspec-sync-specs/SKILL.md +.cursor/skills/openspec-update-change/SKILL.md +.opencode/commands/opsx-apply.md +.opencode/commands/opsx-archive.md +.opencode/commands/opsx-explore.md +.opencode/commands/opsx-propose.md +.opencode/commands/opsx-sync.md +.opencode/commands/opsx-update.md +.opencode/skills/openspec-apply-change/SKILL.md +.opencode/skills/openspec-archive-change/SKILL.md +.opencode/skills/openspec-explore/SKILL.md +.opencode/skills/openspec-propose/SKILL.md +.opencode/skills/openspec-sync-specs/SKILL.md +.opencode/skills/openspec-update-change/SKILL.md +openspec/config.yaml +openspec/CONVENTIONS.md diff --git a/Podfile b/Podfile index b8c985bc..d9975def 100644 --- a/Podfile +++ b/Podfile @@ -25,7 +25,7 @@ target 'QuickLocation' do #工具 - #pod 'FLEX', :configurations => ['Debug', 'AdHoc'] + pod 'FLEX', :git => 'https://github.com/FLEXTool/FLEX.git', :configurations => ['Debug'] pod 'HXPHPicker' pod 'SwiftKeychainWrapper' pod 'SGQRCode', '~> 4.1.0' #扫描 diff --git a/Podfile.lock b/Podfile.lock index 3273693d..94a60268 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -26,6 +26,7 @@ PODS: - CocoaMQTT/Core (2.2.5): - MqttCocoaAsyncSocket (~> 1.0.8) - Differentiator (5.0.0) + - FLEX (5.22.10) - GTCommonSDK (3.2.3.0): - ZXSDK - GYSDK (3.1.3.0): @@ -199,6 +200,7 @@ DEPENDENCIES: - BRPickerView - CocoaLumberjack/Swift - CocoaMQTT + - FLEX (from `https://github.com/FLEXTool/FLEX.git`) - GYSDK - HXPHPicker - IQKeyboardManagerSwift @@ -297,10 +299,15 @@ SPEC REPOS: - ZXSDK EXTERNAL SOURCES: + FLEX: + :git: https://github.com/FLEXTool/FLEX.git MBProgressHUD: :git: https://github.com/jdg/MBProgressHUD.git CHECKOUT OPTIONS: + FLEX: + :commit: 63a6f588841e94e4c3adaa045ff16eb8163f0bb4 + :git: https://github.com/FLEXTool/FLEX.git MBProgressHUD: :commit: 4a7c5f3e53cdea77c5dcb8578c2ee5acacdf6781 :git: https://github.com/jdg/MBProgressHUD.git @@ -316,6 +323,7 @@ SPEC CHECKSUMS: CocoaLumberjack: e4ba3b414dfca8c1916c6303d37f63b3a95134c6 CocoaMQTT: 1e2fa493d57045d66fb1eba2bb5ffb8d77039c60 Differentiator: e8497ceab83c1b10ca233716d547b9af21b9344d + FLEX: 6ec7816b9f392fb4c635cf50381e6bd4fb15541d GTCommonSDK: 238c6735add91e654f8564638854686ee3dcb4ac GYSDK: db5f4b3aae8df06201be5e786076211ec11791be HXPHPicker: 451f6af62845d60d5dd2235f4665d81f2688a51b @@ -366,6 +374,6 @@ SPEC CHECKSUMS: YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54 ZXSDK: 786338c0a18e98e03eda00699c3bfd2700b97117 -PODFILE CHECKSUM: 439991fe5523a65e07f0df7135995adfc31f6cb3 +PODFILE CHECKSUM: f676321d820ce55c18e69318732ac59e39a57e43 COCOAPODS: 1.16.2 diff --git a/QuickLocation.xcodeproj/project.pbxproj b/QuickLocation.xcodeproj/project.pbxproj index 444bb7d5..885e10f0 100644 --- a/QuickLocation.xcodeproj/project.pbxproj +++ b/QuickLocation.xcodeproj/project.pbxproj @@ -298,6 +298,7 @@ 30EFF3E82FCA8C7000227D26 /* AuthenticationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30EFF3E92FCA8C7000227D26 /* AuthenticationServices.framework */; }; 55BF752D2FFE53F70055DA57 /* LocationPermissionPopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55BF752C2FFE53F70055DA57 /* LocationPermissionPopView.swift */; }; 55BF75352FFF91690055DA57 /* InteractionEmojiCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55BF75342FFF91690055DA57 /* InteractionEmojiCell.swift */; }; + A1B2C3D42FDABC8C009215C1 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = A1B2C3D52FDABC8C009215C1 /* PrivacyInfo.xcprivacy */; }; D698E9C56D6F2C152772131D /* Pods_QuickLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 475D33CAFA1E1911EB1F8D9F /* Pods_QuickLocation.framework */; }; /* End PBXBuildFile section */ @@ -606,6 +607,7 @@ 475D33CAFA1E1911EB1F8D9F /* Pods_QuickLocation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_QuickLocation.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 55BF752C2FFE53F70055DA57 /* LocationPermissionPopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationPermissionPopView.swift; sourceTree = ""; }; 55BF75342FFF91690055DA57 /* InteractionEmojiCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InteractionEmojiCell.swift; sourceTree = ""; }; + A1B2C3D52FDABC8C009215C1 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; DA16D49AA46D4F6838340B55 /* Pods-QuickLocation.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickLocation.debug.xcconfig"; path = "Target Support Files/Pods-QuickLocation/Pods-QuickLocation.debug.xcconfig"; sourceTree = ""; }; E483B9929C03809ADEDE8341 /* Pods-QuickLocation.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickLocation.release.xcconfig"; path = "Target Support Files/Pods-QuickLocation/Pods-QuickLocation.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -1253,6 +1255,7 @@ 305A767E2FCA8C7000227D26 /* AppDelegate.swift */, 305A767F2FCA8C7000227D26 /* Assets.xcassets */, 305A76802FCA8C7000227D26 /* Info.plist */, + A1B2C3D52FDABC8C009215C1 /* PrivacyInfo.xcprivacy */, 305A76822FCA8C7000227D26 /* LaunchScreen.storyboard */, 305A76842FCA8C7000227D26 /* Main.storyboard */, 305A76852FCA8C7000227D26 /* QuickLocation-Bridging-Header.h */, @@ -1755,6 +1758,7 @@ 305A77222FCA8C7000227D26 /* YouSheBiaoTiHei.ttf in Resources */, 305A77232FCA8C7000227D26 /* zihunbiantaoti-r.ttf in Resources */, 305A77F92FCA8C7000227D26 /* Assets.xcassets in Resources */, + A1B2C3D42FDABC8C009215C1 /* PrivacyInfo.xcprivacy in Resources */, 305A77FB2FCA8C7000227D26 /* LaunchScreen.storyboard in Resources */, 305A77FC2FCA8C7000227D26 /* Main.storyboard in Resources */, ); @@ -2183,7 +2187,7 @@ SWIFT_OBJC_BRIDGING_HEADER = "QuickLocation/QuickLocation-Bridging-Header.h"; SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = 1; }; name = Debug; }; @@ -2236,7 +2240,7 @@ SWIFT_OBJC_BRIDGING_HEADER = "QuickLocation/QuickLocation-Bridging-Header.h"; SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = 1; }; name = Release; }; diff --git a/QuickLocation/Common/Constant.swift b/QuickLocation/Common/Constant.swift index f105da79..b7d18bf5 100644 --- a/QuickLocation/Common/Constant.swift +++ b/QuickLocation/Common/Constant.swift @@ -60,9 +60,7 @@ public let kScreenHeight = UIScreen.main.bounds.size.height /// 状态栏高度 public var kStatusBarHeight: CGFloat { if #available(iOS 13.0, *) { - let statusBarHeight = UIApplication.shared.windows - .filter { $0.isKeyWindow } - .first? + let statusBarHeight = kKeyWindow? .windowScene? .statusBarManager? .statusBarFrame diff --git a/QuickLocation/Core/Extension/UIApplicationExtension.swift b/QuickLocation/Core/Extension/UIApplicationExtension.swift index 10e8ec9f..a83be414 100644 --- a/QuickLocation/Core/Extension/UIApplicationExtension.swift +++ b/QuickLocation/Core/Extension/UIApplicationExtension.swift @@ -10,7 +10,15 @@ import UIKit public extension UIApplication { static var keyWindow: UIWindow? { - shared.windows.filter { $0.isKeyWindow }.first + if #available(iOS 15.0, *) { + return UIApplication.shared.connectedScenes + .filter { $0.activationState == .foregroundActive } + .compactMap { $0 as? UIWindowScene } + .first?.windows + .first { $0.isKeyWindow } + } else { + return UIApplication.shared.windows.first { $0.isKeyWindow } + } } static func delegate() -> T? { diff --git a/QuickLocation/Core/Wrapper.swift b/QuickLocation/Core/Wrapper.swift index 048d8530..26f7499d 100644 --- a/QuickLocation/Core/Wrapper.swift +++ b/QuickLocation/Core/Wrapper.swift @@ -7,9 +7,11 @@ import Foundation -public class DL {} +nonisolated public class DL {} -public class DLWrapper { +// nonisolated: 退出工程默认的 MainActor 隔离。 +// 该通用包装类会在 Release(-O) 归档时触发 EarlyPerfInliner 对合成 deinit 的编译器崩溃。 +nonisolated public class DLWrapper { /// 原始对象 public private(set) var base: Base diff --git a/QuickLocation/Main/BaseService/ListService.swift b/QuickLocation/Main/BaseService/ListService.swift index 565e2ebc..94acd577 100644 --- a/QuickLocation/Main/BaseService/ListService.swift +++ b/QuickLocation/Main/BaseService/ListService.swift @@ -29,7 +29,8 @@ enum PagingRequestType { typealias RefreshResult = (status: RefreshStatus, isEmpty: Bool) /// ListType: 列表数据泛型类,例: ListService> -class ListService: ListServiceType where ListType: ListModelType, ListType.Item: Mappable { +// nonisolated: 泛型类在默认 MainActor 隔离下,Release(-O) 归档会触发 EarlyPerfInliner 编译器崩溃 +nonisolated class ListService: ListServiceType where ListType: ListModelType, ListType.Item: Mappable { typealias BaseListModel = ListType typealias BaseItem = ListType.Item diff --git a/QuickLocation/Main/BaseViewController/BaseViewController.swift b/QuickLocation/Main/BaseViewController/BaseViewController.swift index 04fc45f6..4ea4240c 100644 --- a/QuickLocation/Main/BaseViewController/BaseViewController.swift +++ b/QuickLocation/Main/BaseViewController/BaseViewController.swift @@ -10,8 +10,8 @@ import RxCocoa import RxSwift import YBImageBrowser import UMCommon -#if DEBUG || AdHoc -//import FLEX +#if DEBUG +import FLEX #endif class BaseViewController: UIViewController { @@ -187,8 +187,8 @@ extension BaseViewController { // MARK: - FLEX extension BaseViewController { private func setupFlex() { -#if DEBUG || AdHoc -// FLEXManager.shared.showExplorer() +#if DEBUG + FLEXManager.shared.showExplorer() #endif } diff --git a/QuickLocation/Manager/URL/URLManager.swift b/QuickLocation/Manager/URL/URLManager.swift index a32b7013..5e772fd6 100644 --- a/QuickLocation/Manager/URL/URLManager.swift +++ b/QuickLocation/Manager/URL/URLManager.swift @@ -49,16 +49,16 @@ extension DefaultsKeys { func setupNetworkMode() { #if DEBUG setupApiEnv(1) - openIM_API = "https://imapi.zuom8.cn" - openIM_WS = "ws://imws.zuom8.cn" + openIM_API = "https://imapi.zuom8.cn" // http://38.207.176.65:10002 + openIM_WS = "ws://imws.zuom8.cn" // ws://38.207.176.65:10010 #elseif AdHoc setupApiEnv(-1) - openIM_API = "http://38.207.176.65:10002" - openIM_WS = "ws://38.207.176.65:10010" + openIM_API = "https://imapi.zuom8.cn" + openIM_WS = "ws://imws.zuom8.cn" #else setupApiEnv(1) - openIM_API = "http://38.207.176.65:10002" - openIM_WS = "ws://38.207.176.65:10010" + openIM_API = "https://imapi.zuom8.cn" + openIM_WS = "ws://imws.zuom8.cn" #endif } diff --git a/QuickLocation/PrivacyInfo.xcprivacy b/QuickLocation/PrivacyInfo.xcprivacy new file mode 100644 index 00000000..215a9bbb --- /dev/null +++ b/QuickLocation/PrivacyInfo.xcprivacy @@ -0,0 +1,31 @@ + + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + + + + + diff --git a/QuickLocation/RxSwift/Action.swift b/QuickLocation/RxSwift/Action.swift index 56ccc30b..7664a7b1 100644 --- a/QuickLocation/RxSwift/Action.swift +++ b/QuickLocation/RxSwift/Action.swift @@ -19,7 +19,8 @@ and produces an Observable as its output. When this excuted via execute() or inputs subject, it passes its parameter to this closure and subscribes to the work. */ -public final class Action { +// nonisolated: 泛型类在默认 MainActor 隔离下,Release(-O) 归档会触发 EarlyPerfInliner 编译器崩溃 +nonisolated public final class Action { public typealias WorkFactory = (Input) -> Observable public let _enabledIf: Observable diff --git a/QuickLocation/RxSwift/InputSubject.swift b/QuickLocation/RxSwift/InputSubject.swift index cd163e46..46d4c036 100644 --- a/QuickLocation/RxSwift/InputSubject.swift +++ b/QuickLocation/RxSwift/InputSubject.swift @@ -2,7 +2,8 @@ import Foundation import RxSwift /// A special subject for Action.inputs. It only emits `.next` event. -public class InputSubject: ObservableType, Cancelable, SubjectType, ObserverType { +// nonisolated: 泛型类在默认 MainActor 隔离下,Release(-O) 归档会触发 EarlyPerfInliner 编译器崩溃 +nonisolated public class InputSubject: ObservableType, Cancelable, SubjectType, ObserverType { public typealias E = Element typealias Key = UInt