diff --git a/DarockBili.xcodeproj/project.pbxproj b/DarockBili.xcodeproj/project.pbxproj index c1c3374a8..a49382e4d 100644 --- a/DarockBili.xcodeproj/project.pbxproj +++ b/DarockBili.xcodeproj/project.pbxproj @@ -8,6 +8,16 @@ /* Begin PBXBuildFile section */ 8C0557DF2B791B84009D9CD0 /* AZVideoPlayer in Frameworks */ = {isa = PBXBuildFile; productRef = 8C0557DE2B791B84009D9CD0 /* AZVideoPlayer */; }; + 8C617F412B92334B000A3687 /* SafariWebExtensionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C617F402B92334B000A3687 /* SafariWebExtensionHandler.swift */; }; + 8C617F442B92334B000A3687 /* _locales in Resources */ = {isa = PBXBuildFile; fileRef = 8C617F432B92334B000A3687 /* _locales */; }; + 8C617F462B92334B000A3687 /* images in Resources */ = {isa = PBXBuildFile; fileRef = 8C617F452B92334B000A3687 /* images */; }; + 8C617F482B92334B000A3687 /* manifest.json in Resources */ = {isa = PBXBuildFile; fileRef = 8C617F472B92334B000A3687 /* manifest.json */; }; + 8C617F4A2B92334B000A3687 /* background.js in Resources */ = {isa = PBXBuildFile; fileRef = 8C617F492B92334B000A3687 /* background.js */; }; + 8C617F4C2B92334B000A3687 /* content.js in Resources */ = {isa = PBXBuildFile; fileRef = 8C617F4B2B92334B000A3687 /* content.js */; }; + 8C617F4E2B92334B000A3687 /* popup.html in Resources */ = {isa = PBXBuildFile; fileRef = 8C617F4D2B92334B000A3687 /* popup.html */; }; + 8C617F502B92334B000A3687 /* popup.css in Resources */ = {isa = PBXBuildFile; fileRef = 8C617F4F2B92334B000A3687 /* popup.css */; }; + 8C617F522B92334B000A3687 /* popup.js in Resources */ = {isa = PBXBuildFile; fileRef = 8C617F512B92334B000A3687 /* popup.js */; }; + 8C617F562B92334B000A3687 /* SafariExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 8C617F3E2B92334B000A3687 /* SafariExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 8CA370D42B82690700CE0E9E /* Mixpanel in Frameworks */ = {isa = PBXBuildFile; productRef = 8CA370D32B82690700CE0E9E /* Mixpanel */; }; 8CA370D62B82691100CE0E9E /* Mixpanel in Frameworks */ = {isa = PBXBuildFile; productRef = 8CA370D52B82691100CE0E9E /* Mixpanel */; }; 8CA370DB2B82724400CE0E9E /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 8CA370D92B82724400CE0E9E /* PrivacyInfo.xcprivacy */; }; @@ -235,7 +245,6 @@ 8CC3D55D2B7CC936005636DC /* OCCodeExt.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CC3D55C2B7CC936005636DC /* OCCodeExt.m */; }; 8CC3D5632B7CCE57005636DC /* ScreenshotableView in Frameworks */ = {isa = PBXBuildFile; platformFilters = (ios, maccatalyst, ); productRef = 8CC3D5622B7CCE57005636DC /* ScreenshotableView */; settings = {ATTRIBUTES = (Required, ); }; }; 8CC3D5652B7CCF3C005636DC /* SelfQrCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CC3D5642B7CCF3C005636DC /* SelfQrCardView.swift */; }; - 8CC3D5672B7CDCE1005636DC /* Intents.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CC3D5662B7CDCE1005636DC /* Intents.framework */; }; 8CC5B6BE2B8652AF00BAD89E /* backtrace.c in Sources */ = {isa = PBXBuildFile; fileRef = 8CA7CC762B77AF4C008E587F /* backtrace.c */; }; 8CC5B6BF2B8652C000BAD89E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8CA7CBC62B77AC4C008E587F /* Assets.xcassets */; }; 8CC5B6C02B86539700BAD89E /* BiliFont.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8CA388A02B78B5D800F5F91F /* BiliFont.ttf */; }; @@ -320,6 +329,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 8C617F542B92334B000A3687 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B44689C42B4FC15A002CCEB2 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8C617F3D2B92334B000A3687; + remoteInfo = SafariExtension; + }; 8CA7CBD12B77AC4C008E587F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = B44689C42B4FC15A002CCEB2 /* Project object */; @@ -337,6 +353,17 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + 8C617F5A2B92334B000A3687 /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 8C617F562B92334B000A3687 /* SafariExtension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; 8CA7CBDF2B77AC4D008E587F /* Embed Watch Content */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -352,6 +379,17 @@ /* Begin PBXFileReference section */ 8C0557E02B7A0480009D9CD0 /* MeowBili.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MeowBili.entitlements; sourceTree = ""; }; + 8C617F3E2B92334B000A3687 /* SafariExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = SafariExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 8C617F402B92334B000A3687 /* SafariWebExtensionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariWebExtensionHandler.swift; sourceTree = ""; }; + 8C617F432B92334B000A3687 /* _locales */ = {isa = PBXFileReference; lastKnownFileType = folder; path = _locales; sourceTree = ""; }; + 8C617F452B92334B000A3687 /* images */ = {isa = PBXFileReference; lastKnownFileType = folder; path = images; sourceTree = ""; }; + 8C617F472B92334B000A3687 /* manifest.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = manifest.json; sourceTree = ""; }; + 8C617F492B92334B000A3687 /* background.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = background.js; sourceTree = ""; }; + 8C617F4B2B92334B000A3687 /* content.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = content.js; sourceTree = ""; }; + 8C617F4D2B92334B000A3687 /* popup.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = popup.html; sourceTree = ""; }; + 8C617F4F2B92334B000A3687 /* popup.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = popup.css; sourceTree = ""; }; + 8C617F512B92334B000A3687 /* popup.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = popup.js; sourceTree = ""; }; + 8C617F532B92334B000A3687 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8C72E32A2B6605B80087486E /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 8CA370D92B82724400CE0E9E /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 8CA370E82B83BB4F00CE0E9E /* MeowBili Vision App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "MeowBili Vision App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -441,6 +479,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 8C617F3B2B92334B000A3687 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 8CA370E52B83BB4F00CE0E9E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -472,7 +517,6 @@ 8CA7CCDF2B77BB5A008E587F /* AlertKit in Frameworks */, 8CA7CC192B77AC93008E587F /* SDWebImagePDFCoder in Frameworks */, 8CA7CC172B77AC93008E587F /* SDWebImageSVGCoder in Frameworks */, - 8CC3D5672B7CDCE1005636DC /* Intents.framework in Frameworks */, 8CA7CC232B77AC93008E587F /* DarockKit in Frameworks */, 8CC3D5632B7CCE57005636DC /* ScreenshotableView in Frameworks */, 8CA370D42B82690700CE0E9E /* Mixpanel in Frameworks */, @@ -550,6 +594,31 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 8C617F3F2B92334B000A3687 /* SafariExtension */ = { + isa = PBXGroup; + children = ( + 8C617F402B92334B000A3687 /* SafariWebExtensionHandler.swift */, + 8C617F532B92334B000A3687 /* Info.plist */, + 8C617F422B92334B000A3687 /* Resources */, + ); + path = SafariExtension; + sourceTree = ""; + }; + 8C617F422B92334B000A3687 /* Resources */ = { + isa = PBXGroup; + children = ( + 8C617F432B92334B000A3687 /* _locales */, + 8C617F452B92334B000A3687 /* images */, + 8C617F472B92334B000A3687 /* manifest.json */, + 8C617F492B92334B000A3687 /* background.js */, + 8C617F4B2B92334B000A3687 /* content.js */, + 8C617F4D2B92334B000A3687 /* popup.html */, + 8C617F4F2B92334B000A3687 /* popup.css */, + 8C617F512B92334B000A3687 /* popup.js */, + ); + path = Resources; + sourceTree = ""; + }; 8CA7CBC12B77AC4A008E587F /* MeowBili */ = { isa = PBXGroup; children = ( @@ -784,6 +853,7 @@ B4468A142B4FC24A002CCEB2 /* JSONReturnExamples */, 8CA7CBC12B77AC4A008E587F /* MeowBili */, 8CC5B7412B8749BC00BAD89E /* MeowBiliUITests */, + 8C617F3F2B92334B000A3687 /* SafariExtension */, B44689CB2B4FC15A002CCEB2 /* Products */, B4468A902B4FC8B7002CCEB2 /* Frameworks */, ); @@ -797,6 +867,7 @@ 8CA370E82B83BB4F00CE0E9E /* MeowBili Vision App.app */, 8CC5B6CC2B873E7500BAD89E /* MeowBili Mac App.app */, 8CC5B7402B8749BC00BAD89E /* MeowBiliUITests.xctest */, + 8C617F3E2B92334B000A3687 /* SafariExtension.appex */, ); name = Products; sourceTree = ""; @@ -822,6 +893,23 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 8C617F3D2B92334B000A3687 /* SafariExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8C617F572B92334B000A3687 /* Build configuration list for PBXNativeTarget "SafariExtension" */; + buildPhases = ( + 8C617F3A2B92334B000A3687 /* Sources */, + 8C617F3B2B92334B000A3687 /* Frameworks */, + 8C617F3C2B92334B000A3687 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SafariExtension; + productName = SafariExtension; + productReference = 8C617F3E2B92334B000A3687 /* SafariExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; 8CA370E72B83BB4F00CE0E9E /* MeowBili Vision App */ = { isa = PBXNativeTarget; buildConfigurationList = 8CA370F82B83BB5300CE0E9E /* Build configuration list for PBXNativeTarget "MeowBili Vision App" */; @@ -864,11 +952,13 @@ 8CA7CBBD2B77AC4A008E587F /* Frameworks */, 8CA7CBBE2B77AC4A008E587F /* Resources */, 8CA7CBDF2B77AC4D008E587F /* Embed Watch Content */, + 8C617F5A2B92334B000A3687 /* Embed Foundation Extensions */, ); buildRules = ( ); dependencies = ( 8CA7CBD22B77AC4C008E587F /* PBXTargetDependency */, + 8C617F552B92334B000A3687 /* PBXTargetDependency */, ); name = MeowBili; packageProductDependencies = ( @@ -1001,6 +1091,9 @@ LastSwiftUpdateCheck = 1520; LastUpgradeCheck = 1520; TargetAttributes = { + 8C617F3D2B92334B000A3687 = { + CreatedOnToolsVersion = 15.2; + }; 8CA370E72B83BB4F00CE0E9E = { CreatedOnToolsVersion = 15.2; }; @@ -1063,11 +1156,27 @@ 8CA370E72B83BB4F00CE0E9E /* MeowBili Vision App */, 8CC5B6CB2B873E7500BAD89E /* MeowBili Mac App */, 8CC5B73F2B8749BC00BAD89E /* MeowBiliUITests */, + 8C617F3D2B92334B000A3687 /* SafariExtension */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 8C617F3C2B92334B000A3687 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8C617F4A2B92334B000A3687 /* background.js in Resources */, + 8C617F502B92334B000A3687 /* popup.css in Resources */, + 8C617F4E2B92334B000A3687 /* popup.html in Resources */, + 8C617F462B92334B000A3687 /* images in Resources */, + 8C617F482B92334B000A3687 /* manifest.json in Resources */, + 8C617F442B92334B000A3687 /* _locales in Resources */, + 8C617F4C2B92334B000A3687 /* content.js in Resources */, + 8C617F522B92334B000A3687 /* popup.js in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 8CA370E62B83BB4F00CE0E9E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1182,6 +1291,14 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 8C617F3A2B92334B000A3687 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8C617F412B92334B000A3687 /* SafariWebExtensionHandler.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 8CA370E42B83BB4F00CE0E9E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1440,6 +1557,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 8C617F552B92334B000A3687 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8C617F3D2B92334B000A3687 /* SafariExtension */; + targetProxy = 8C617F542B92334B000A3687 /* PBXContainerItemProxy */; + }; 8CA7CBD22B77AC4C008E587F /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8CA7CBCE2B77AC4C008E587F /* MeowBili Watch App */; @@ -1453,6 +1575,69 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 8C617F582B92334B000A3687 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 881; + DEVELOPMENT_TEAM = B57D8PP775; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = SafariExtension/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = SafariExtension; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + OTHER_LDFLAGS = ( + "-framework", + SafariServices, + ); + PRODUCT_BUNDLE_IDENTIFIER = com.darock.DarockBili.SafariExtension; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 8C617F592B92334B000A3687 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 881; + DEVELOPMENT_TEAM = B57D8PP775; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = SafariExtension/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = SafariExtension; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + OTHER_LDFLAGS = ( + "-framework", + SafariServices, + ); + PRODUCT_BUNDLE_IDENTIFIER = com.darock.DarockBili.SafariExtension; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; 8CA370F92B83BB5300CE0E9E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1461,7 +1646,7 @@ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Vision App.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 848; + CURRENT_PROJECT_VERSION = 881; DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\""; DEVELOPMENT_TEAM = B57D8PP775; ENABLE_PREVIEWS = YES; @@ -1496,7 +1681,7 @@ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Vision App.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 848; + CURRENT_PROJECT_VERSION = 881; DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\""; DEVELOPMENT_TEAM = B57D8PP775; ENABLE_PREVIEWS = YES; @@ -1533,7 +1718,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = MeowBili/MeowBili.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 848; + CURRENT_PROJECT_VERSION = 881; DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\""; DEVELOPMENT_TEAM = B57D8PP775; ENABLE_PREVIEWS = YES; @@ -1580,7 +1765,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = MeowBili/MeowBili.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 848; + CURRENT_PROJECT_VERSION = 881; DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\""; DEVELOPMENT_TEAM = B57D8PP775; ENABLE_PREVIEWS = YES; @@ -1624,7 +1809,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIconWatch; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 848; + CURRENT_PROJECT_VERSION = 881; DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview\\ Content\""; DEVELOPMENT_TEAM = B57D8PP775; ENABLE_PREVIEWS = YES; @@ -1660,7 +1845,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIconWatch; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 848; + CURRENT_PROJECT_VERSION = 881; DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview\\ Content\""; DEVELOPMENT_TEAM = B57D8PP775; ENABLE_PREVIEWS = YES; @@ -1699,7 +1884,7 @@ CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Mac App.entitlements"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 848; + CURRENT_PROJECT_VERSION = 881; DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\""; DEVELOPMENT_TEAM = B57D8PP775; ENABLE_HARDENED_RUNTIME = YES; @@ -1732,7 +1917,7 @@ CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Mac App.entitlements"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 848; + CURRENT_PROJECT_VERSION = 881; DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\""; DEVELOPMENT_TEAM = B57D8PP775; ENABLE_HARDENED_RUNTIME = YES; @@ -1761,7 +1946,7 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 848; + CURRENT_PROJECT_VERSION = 881; DEVELOPMENT_TEAM = B57D8PP775; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.0; @@ -1784,7 +1969,7 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 848; + CURRENT_PROJECT_VERSION = 881; DEVELOPMENT_TEAM = B57D8PP775; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.0; @@ -1933,6 +2118,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 8C617F572B92334B000A3687 /* Build configuration list for PBXNativeTarget "SafariExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8C617F582B92334B000A3687 /* Debug */, + 8C617F592B92334B000A3687 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 8CA370F82B83BB5300CE0E9E /* Build configuration list for PBXNativeTarget "MeowBili Vision App" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/MeowBili/MeowBiliApp.swift b/MeowBili/MeowBiliApp.swift index f17c66d2f..95ef48524 100644 --- a/MeowBili/MeowBiliApp.swift +++ b/MeowBili/MeowBiliApp.swift @@ -262,6 +262,10 @@ struct DarockBili_Watch_AppApp: App { urlOpenVideoDetails.updateValue(String(kav[1]), forKey: String(kav[0])) } isUrlOpenVideoPresented = true + case "openbvid": + let bvid = spd[2] + urlOpenVideoDetails = ["Pic": "", "Title": "Loading...", "BV": String(bvid), "UP": "Loading...", "View": "1", "Danmaku": "1"] + isUrlOpenVideoPresented = true default: break } diff --git a/MeowBili/Video/VideoDetailView.swift b/MeowBili/Video/VideoDetailView.swift index a7ab7215a..d5d08adac 100644 --- a/MeowBili/Video/VideoDetailView.swift +++ b/MeowBili/Video/VideoDetailView.swift @@ -774,6 +774,11 @@ struct VideoDetailView: View { debugPrint("----------Prints from VideoDetailView.onAppear.*.requsetJSON(*/view)----------") debugPrint(respJson) if !CheckBApiError(from: respJson) { return } + videoDetails.updateValue(respJson["data"]["title"].string ?? "[加载失败]", forKey: "Title") + videoDetails.updateValue(respJson["data"]["pic"].string ?? "E", forKey: "Pic") + videoDetails.updateValue(String(respJson["data"]["stat"]["view"].int ?? 0), forKey: "View") + videoDetails.updateValue(String(respJson["data"]["stat"]["danmaku"].int ?? 0), forKey: "Danmaku") + owner = ["Name": respJson["data"]["owner"]["name"].string ?? "[加载失败]", "Face": respJson["data"]["owner"]["face"].string ?? "E", "ID": String(respJson["data"]["owner"]["mid"].int64 ?? -1)] stat = ["Like": String(respJson["data"]["stat"]["like"].int ?? -1), "Coin": String(respJson["data"]["stat"]["coin"].int ?? -1), "Favorite": String(respJson["data"]["stat"]["favorite"].int ?? -1)] videoDesc = respJson["data"]["desc"].string ?? "[加载失败]".replacingOccurrences(of: "\\n", with: "\n") diff --git a/MeowBili/Video/VideoPlayerView.swift b/MeowBili/Video/VideoPlayerView.swift index c8664d33c..f8bb44543 100644 --- a/MeowBili/Video/VideoPlayerView.swift +++ b/MeowBili/Video/VideoPlayerView.swift @@ -213,7 +213,7 @@ struct VideoPlayerView: View { player.seek(to: CMTime(seconds: UserDefaults.standard.double(forKey: "\(videoBvid)\(videoCID)PlayTime"), preferredTimescale: 1)) if let coverData = try? Data(contentsOf: URL(string: videoDetails["Pic"] ?? "") ?? URL(string: "http://example.com")!) { - let cover = UIImage(data: coverData)! + let cover = UIImage(data: coverData) ?? UIImage() NowPlayingExtension.setPlayingInfoTitle(videoDetails["Title"]!, artist: videoDetails["UP"]!, artwork: cover) } diff --git a/SafariExtension/Info.plist b/SafariExtension/Info.plist new file mode 100644 index 000000000..9ee504dc5 --- /dev/null +++ b/SafariExtension/Info.plist @@ -0,0 +1,13 @@ + + + + + NSExtension + + NSExtensionPointIdentifier + com.apple.Safari.web-extension + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).SafariWebExtensionHandler + + + diff --git a/SafariExtension/Resources/_locales/en/messages.json b/SafariExtension/Resources/_locales/en/messages.json new file mode 100644 index 000000000..2d51cf7b0 --- /dev/null +++ b/SafariExtension/Resources/_locales/en/messages.json @@ -0,0 +1,10 @@ +{ + "extension_name": { + "message": "喵哩喵哩", + "description": "喵哩喵哩 Safari 扩展" + }, + "extension_description": { + "message": "This is SafariExtension. You should tell us what your extension does here.", + "description": "Description of what the extension does." + } +} diff --git a/SafariExtension/Resources/background.js b/SafariExtension/Resources/background.js new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/SafariExtension/Resources/background.js @@ -0,0 +1 @@ + diff --git a/SafariExtension/Resources/content.js b/SafariExtension/Resources/content.js new file mode 100644 index 000000000..de0f545ab --- /dev/null +++ b/SafariExtension/Resources/content.js @@ -0,0 +1,5 @@ +console.log("%cMeowBili Extension Here!", "color: #66CCFF;"); +console.log("Current Link:", window.location.href); +var bvidSpdArr = window.location.href.split('/'); +var bvid = bvidSpdArr[bvidSpdArr.length - 1]; +window.location.href = "drkbili://openbvid/" + bvid; diff --git a/SafariExtension/Resources/images/icon-128.png b/SafariExtension/Resources/images/icon-128.png new file mode 100644 index 000000000..c919eb009 Binary files /dev/null and b/SafariExtension/Resources/images/icon-128.png differ diff --git a/SafariExtension/Resources/images/icon-256.png b/SafariExtension/Resources/images/icon-256.png new file mode 100644 index 000000000..6bd3d206a Binary files /dev/null and b/SafariExtension/Resources/images/icon-256.png differ diff --git a/SafariExtension/Resources/images/icon-48.png b/SafariExtension/Resources/images/icon-48.png new file mode 100644 index 000000000..353e8fbd5 Binary files /dev/null and b/SafariExtension/Resources/images/icon-48.png differ diff --git a/SafariExtension/Resources/images/icon-512.png b/SafariExtension/Resources/images/icon-512.png new file mode 100644 index 000000000..2200828bc Binary files /dev/null and b/SafariExtension/Resources/images/icon-512.png differ diff --git a/SafariExtension/Resources/images/icon-64.png b/SafariExtension/Resources/images/icon-64.png new file mode 100644 index 000000000..995689f72 Binary files /dev/null and b/SafariExtension/Resources/images/icon-64.png differ diff --git a/SafariExtension/Resources/images/icon-96.png b/SafariExtension/Resources/images/icon-96.png new file mode 100644 index 000000000..cb079d208 Binary files /dev/null and b/SafariExtension/Resources/images/icon-96.png differ diff --git a/SafariExtension/Resources/images/toolbar-icon-16.png b/SafariExtension/Resources/images/toolbar-icon-16.png new file mode 100644 index 000000000..ad014f6e2 Binary files /dev/null and b/SafariExtension/Resources/images/toolbar-icon-16.png differ diff --git a/SafariExtension/Resources/images/toolbar-icon-19.png b/SafariExtension/Resources/images/toolbar-icon-19.png new file mode 100644 index 000000000..33eb01e74 Binary files /dev/null and b/SafariExtension/Resources/images/toolbar-icon-19.png differ diff --git a/SafariExtension/Resources/images/toolbar-icon-32.png b/SafariExtension/Resources/images/toolbar-icon-32.png new file mode 100644 index 000000000..a71914b0a Binary files /dev/null and b/SafariExtension/Resources/images/toolbar-icon-32.png differ diff --git a/SafariExtension/Resources/images/toolbar-icon-38.png b/SafariExtension/Resources/images/toolbar-icon-38.png new file mode 100644 index 000000000..990e7f410 Binary files /dev/null and b/SafariExtension/Resources/images/toolbar-icon-38.png differ diff --git a/SafariExtension/Resources/images/toolbar-icon-48.png b/SafariExtension/Resources/images/toolbar-icon-48.png new file mode 100644 index 000000000..f4c70ad17 Binary files /dev/null and b/SafariExtension/Resources/images/toolbar-icon-48.png differ diff --git a/SafariExtension/Resources/images/toolbar-icon-72.png b/SafariExtension/Resources/images/toolbar-icon-72.png new file mode 100644 index 000000000..9bf6d4e6e Binary files /dev/null and b/SafariExtension/Resources/images/toolbar-icon-72.png differ diff --git a/SafariExtension/Resources/manifest.json b/SafariExtension/Resources/manifest.json new file mode 100644 index 000000000..20c260eb4 --- /dev/null +++ b/SafariExtension/Resources/manifest.json @@ -0,0 +1,39 @@ +{ + "manifest_version": 3, + "default_locale": "en", + + "name": "__MSG_extension_name__", + "description": "__MSG_extension_description__", + "version": "1.0.0", + + "icons": { + "48": "images/icon-48.png", + "96": "images/icon-96.png", + "128": "images/icon-128.png", + "256": "images/icon-256.png", + "512": "images/icon-512.png" + }, + + "background": { + "service_worker": "background.js" + }, + + "content_scripts": [{ + "js": [ "content.js" ], + "matches": [ "*://*.bilibili.com/video/BV*" ] + }], + + "action": { + "default_popup": "popup.html", + "default_icon": { + "16": "images/toolbar-icon-16.png", + "19": "images/toolbar-icon-19.png", + "32": "images/toolbar-icon-32.png", + "38": "images/toolbar-icon-38.png", + "48": "images/toolbar-icon-48.png", + "72": "images/toolbar-icon-72.png" + } + }, + + "permissions": [ ] +} diff --git a/SafariExtension/Resources/popup.css b/SafariExtension/Resources/popup.css new file mode 100644 index 000000000..e7ede2424 --- /dev/null +++ b/SafariExtension/Resources/popup.css @@ -0,0 +1,14 @@ +:root { + color-scheme: light dark; +} + +body { + padding: 10px; + + font-family: system-ui; + text-align: center; +} + +@media (prefers-color-scheme: dark) { + /* Dark Mode styles go here. */ +} diff --git a/SafariExtension/Resources/popup.html b/SafariExtension/Resources/popup.html new file mode 100644 index 000000000..474d69b4e --- /dev/null +++ b/SafariExtension/Resources/popup.html @@ -0,0 +1,11 @@ + + + + + + + + + 喵哩喵哩 Safari 扩展已生效 + + diff --git a/SafariExtension/Resources/popup.js b/SafariExtension/Resources/popup.js new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/SafariExtension/Resources/popup.js @@ -0,0 +1 @@ + diff --git a/SafariExtension/SafariWebExtensionHandler.swift b/SafariExtension/SafariWebExtensionHandler.swift new file mode 100644 index 000000000..955085973 --- /dev/null +++ b/SafariExtension/SafariWebExtensionHandler.swift @@ -0,0 +1,49 @@ +// +// +// SafariWebExtensionHandler.swift +// SafariExtension +// +// Created by memz233 on 2024/3/2. +// +//===----------------------------------------------------------------------===// +// +// This source file is part of the MeowBili open source project +// +// Copyright (c) 2024 Darock Studio and the MeowBili project authors +// Licensed under GNU General Public License v3 +// +// See https://darock.top/LICENSE.txt for license information +// +//===----------------------------------------------------------------------===// + +import SafariServices +import os.log + +class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling { + + func beginRequest(with context: NSExtensionContext) { + let request = context.inputItems.first as? NSExtensionItem + + let profile: UUID? + if #available(iOS 17.0, macOS 14.0, *) { + profile = request?.userInfo?[SFExtensionProfileKey] as? UUID + } else { + profile = request?.userInfo?["profile"] as? UUID + } + + let message: Any? + if #available(iOS 17.0, macOS 14.0, *) { + message = request?.userInfo?[SFExtensionMessageKey] + } else { + message = request?.userInfo?["message"] + } + + os_log(.default, "Received message from browser.runtime.sendNativeMessage: %@ (profile: %@)", String(describing: message), profile?.uuidString ?? "none") + + let response = NSExtensionItem() + response.userInfo = [ SFExtensionMessageKey: [ "echo": message ] ] + + context.completeRequest(returningItems: [ response ], completionHandler: nil) + } + +}