diff --git a/DarockBili.xcodeproj/project.pbxproj b/DarockBili.xcodeproj/project.pbxproj index 555d241af..59cb5c707 100644 --- a/DarockBili.xcodeproj/project.pbxproj +++ b/DarockBili.xcodeproj/project.pbxproj @@ -363,7 +363,7 @@ 8CB0D0232B88CEC40057EF1C /* ci_post_xcodebuild.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = ci_post_xcodebuild.sh; sourceTree = ""; }; 8CB0D0242B88D20F0057EF1C /* ci_pre_xcodebuild.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = ci_pre_xcodebuild.sh; sourceTree = ""; }; 8CB0D0252B88D67D0057EF1C /* CurrentChannel.drkdatac */ = {isa = PBXFileReference; lastKnownFileType = text; path = CurrentChannel.drkdatac; sourceTree = ""; }; - 8CB1769F2BB7E41C00CEC05C /* MeowBiliAlternative.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MeowBiliAlternative.entitlements; sourceTree = ""; }; + 8CB1769F2BB7E41C00CEC05C /* Alternative.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Alternative.entitlements; sourceTree = ""; }; 8CBFF1272B86188D00350E0F /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = ""; }; 8CC3D5572B7CA209005636DC /* UserDynamicListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDynamicListView.swift; sourceTree = ""; }; 8CC3D5592B7CB95D005636DC /* NowPlayingExtension.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NowPlayingExtension.m; sourceTree = ""; }; @@ -377,6 +377,8 @@ 8CC5B7422B8749BC00BAD89E /* MeowBiliUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeowBiliUITests.swift; sourceTree = ""; }; 8CC5B74B2B8749FC00BAD89E /* MeowBili.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = MeowBili.xctestplan; sourceTree = ""; }; 8CD9463A2B64CD0F005D00D0 /* Bangumi_Detail_Season.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = Bangumi_Detail_Season.json; sourceTree = ""; }; + 8CFB6B652C650FED007C7BAA /* Watch Debug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Watch Debug.entitlements"; sourceTree = ""; }; + 8CFB6B662C650FFE007C7BAA /* Watch Release.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Watch Release.entitlements"; sourceTree = ""; }; B4468A152B4FC24A002CCEB2 /* Dynamic_Feed_All.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = Dynamic_Feed_All.json; sourceTree = ""; }; B4468A162B4FC24A002CCEB2 /* Search_With_UP_V2.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = Search_With_UP_V2.json; sourceTree = ""; }; B4DAF0DB2B80725800755F0C /* LinkDetectText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkDetectText.swift; sourceTree = ""; }; @@ -513,8 +515,6 @@ 8CA7CBC12B77AC4A008E587F /* MeowBili */ = { isa = PBXGroup; children = ( - 8CB1769F2BB7E41C00CEC05C /* MeowBiliAlternative.entitlements */, - 8C0557E02B7A0480009D9CD0 /* MeowBili.entitlements */, 8CA7CC632B77AD5B008E587F /* Info.plist */, 8CC5B6DC2B873EF600BAD89E /* MeowBili-Mac-App-Info.plist */, 8CA7CC752B77AF4B008E587F /* MeowBili-Bridging-Header.h */, @@ -738,6 +738,17 @@ path = MeowBiliUITests; sourceTree = ""; }; + 8CFB6B672C6512D1007C7BAA /* Entitlements */ = { + isa = PBXGroup; + children = ( + 8C0557E02B7A0480009D9CD0 /* MeowBili.entitlements */, + 8CB1769F2BB7E41C00CEC05C /* Alternative.entitlements */, + 8CFB6B652C650FED007C7BAA /* Watch Debug.entitlements */, + 8CFB6B662C650FFE007C7BAA /* Watch Release.entitlements */, + ); + path = Entitlements; + sourceTree = ""; + }; B44689C32B4FC15A002CCEB2 = { isa = PBXGroup; children = ( @@ -751,6 +762,7 @@ 8C82F82F2BB70AA7009AEFD2 /* .github */, 8CB0D0222B88CE980057EF1C /* ci_scripts */, B4468A142B4FC24A002CCEB2 /* JSONReturnExamples */, + 8CFB6B672C6512D1007C7BAA /* Entitlements */, 8CA7CBC12B77AC4A008E587F /* MeowBili */, 8C8578A62C5A18AA00AF93D1 /* MeowBiliTests */, 8CC5B7412B8749BC00BAD89E /* MeowBiliUITests */, @@ -1497,7 +1509,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = MeowBili/MeowBiliAlternative.entitlements; + CODE_SIGN_ENTITLEMENTS = Entitlements/Alternative.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1351; DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\""; @@ -1529,9 +1541,10 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_DISABLE_SAFETY_CHECKS = YES; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_BRIDGING_HEADER = "MeowBili/MeowBili-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Osize"; + SWIFT_OPTIMIZATION_LEVEL = "-Ounchecked"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,6"; VALIDATE_PRODUCT = YES; @@ -1564,9 +1577,10 @@ PRODUCT_NAME = "喵哩喵哩"; SDKROOT = watchos; SKIP_INSTALL = YES; + SWIFT_DISABLE_SAFETY_CHECKS = YES; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_BRIDGING_HEADER = "MeowBili/MeowBili-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Osize"; + SWIFT_OPTIMIZATION_LEVEL = "-Ounchecked"; SWIFT_VERSION = 5.0; SYSTEM_FRAMEWORK_SEARCH_PATHS = ""; TARGETED_DEVICE_FAMILY = 4; @@ -1669,7 +1683,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = MeowBili/MeowBili.entitlements; + CODE_SIGN_ENTITLEMENTS = Entitlements/MeowBili.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1351; DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\""; @@ -1701,9 +1715,10 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_DISABLE_SAFETY_CHECKS = YES; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_BRIDGING_HEADER = "MeowBili/MeowBili-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_OPTIMIZATION_LEVEL = "-Ounchecked"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,6"; }; @@ -1715,7 +1730,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = MeowBili/MeowBili.entitlements; + CODE_SIGN_ENTITLEMENTS = Entitlements/MeowBili.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1351; DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\""; @@ -1747,9 +1762,10 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_DISABLE_SAFETY_CHECKS = YES; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_BRIDGING_HEADER = "MeowBili/MeowBili-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Osize"; + SWIFT_OPTIMIZATION_LEVEL = "-Ounchecked"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,6"; VALIDATE_PRODUCT = YES; @@ -1761,6 +1777,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIconWatch; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "Entitlements/Watch Debug.entitlements"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1351; DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview\\ Content\""; @@ -1782,8 +1799,10 @@ PRODUCT_NAME = "喵哩喵哩"; SDKROOT = watchos; SKIP_INSTALL = YES; + SWIFT_DISABLE_SAFETY_CHECKS = YES; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_BRIDGING_HEADER = "MeowBili/MeowBili-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Ounchecked"; SWIFT_VERSION = 5.0; SYSTEM_FRAMEWORK_SEARCH_PATHS = ""; TARGETED_DEVICE_FAMILY = 4; @@ -1797,6 +1816,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIconWatch; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "Entitlements/Watch Release.entitlements"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1351; DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview\\ Content\""; @@ -1818,9 +1838,10 @@ PRODUCT_NAME = "喵哩喵哩"; SDKROOT = watchos; SKIP_INSTALL = YES; + SWIFT_DISABLE_SAFETY_CHECKS = YES; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_BRIDGING_HEADER = "MeowBili/MeowBili-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Osize"; + SWIFT_OPTIMIZATION_LEVEL = "-Ounchecked"; SWIFT_VERSION = 5.0; SYSTEM_FRAMEWORK_SEARCH_PATHS = ""; TARGETED_DEVICE_FAMILY = 4; diff --git a/MeowBili/MeowBiliAlternative.entitlements b/Entitlements/Alternative.entitlements similarity index 100% rename from MeowBili/MeowBiliAlternative.entitlements rename to Entitlements/Alternative.entitlements diff --git a/MeowBili/MeowBili.entitlements b/Entitlements/MeowBili.entitlements similarity index 100% rename from MeowBili/MeowBili.entitlements rename to Entitlements/MeowBili.entitlements diff --git a/Entitlements/Watch Debug.entitlements b/Entitlements/Watch Debug.entitlements new file mode 100644 index 000000000..2c5b7c569 --- /dev/null +++ b/Entitlements/Watch Debug.entitlements @@ -0,0 +1,14 @@ + + + + + com.apple.developer.associated-domains + + applinks:darock.top + + com.apple.security.application-groups + + group.darockst + + + diff --git a/Entitlements/Watch Release.entitlements b/Entitlements/Watch Release.entitlements new file mode 100644 index 000000000..2c5b7c569 --- /dev/null +++ b/Entitlements/Watch Release.entitlements @@ -0,0 +1,14 @@ + + + + + com.apple.developer.associated-domains + + applinks:darock.top + + com.apple.security.application-groups + + group.darockst + + + diff --git a/MeowBili/MeowBiliApp.swift b/MeowBili/MeowBiliApp.swift index 8a246721d..78219c8a3 100644 --- a/MeowBili/MeowBiliApp.swift +++ b/MeowBili/MeowBiliApp.swift @@ -419,6 +419,12 @@ struct DarockBili_Watch_AppApp: App { shouldPushVideoView = true } } + .onContinueUserActivity(NSUserActivityTypeBrowsingWeb) { activity in + if let url = activity.webpageURL, let bvid = url.absoluteString.split(separator: "darock.top/meowbili/video/", maxSplits: 1)[from: 1] { + urlOpenVideoDetails = ["Pic": "", "Title": "Loading...", "BV": String(bvid), "UP": "Loading...", "View": "1", "Danmaku": "1"] + isUrlOpenVideoPresented = true + } + } } } .onChange(of: scenePhase) { @@ -433,7 +439,6 @@ struct DarockBili_Watch_AppApp: App { SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared) SDImageCodersManager.shared.addCoder(SDImageSVGCoder.shared) SDImageCodersManager.shared.addCoder(SDImagePDFCoder.shared) - SDImageCache.shared.config.maxMemoryCost = 1024 * 1024 * 10 SDImageCache.shared.config.shouldCacheImagesInMemory = false SDImageCache.shared.config.shouldUseWeakMemoryCache = true SDImageCache.shared.clearMemory() @@ -459,6 +464,8 @@ struct DarockBili_Watch_AppApp: App { } } } + + UserDefaults(suiteName: "group.darockst")?.set(true, forKey: "DCIsMeowBiliInstalled") @unknown default: break }