Skip to content

Commit

Permalink
Merge pull request #395 from Darock-Studio/feat/db-connectity
Browse files Browse the repository at this point in the history
feat: Added connectity for Darock Browser
  • Loading branch information
Mark Chan authored Aug 8, 2024
2 parents a049b1f + 277d750 commit 11f9e3c
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 12 deletions.
43 changes: 32 additions & 11 deletions DarockBili.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@
8CB0D0232B88CEC40057EF1C /* ci_post_xcodebuild.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = ci_post_xcodebuild.sh; sourceTree = "<group>"; };
8CB0D0242B88D20F0057EF1C /* ci_pre_xcodebuild.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = ci_pre_xcodebuild.sh; sourceTree = "<group>"; };
8CB0D0252B88D67D0057EF1C /* CurrentChannel.drkdatac */ = {isa = PBXFileReference; lastKnownFileType = text; path = CurrentChannel.drkdatac; sourceTree = "<group>"; };
8CB1769F2BB7E41C00CEC05C /* MeowBiliAlternative.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MeowBiliAlternative.entitlements; sourceTree = "<group>"; };
8CB1769F2BB7E41C00CEC05C /* Alternative.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Alternative.entitlements; sourceTree = "<group>"; };
8CBFF1272B86188D00350E0F /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = "<group>"; };
8CC3D5572B7CA209005636DC /* UserDynamicListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDynamicListView.swift; sourceTree = "<group>"; };
8CC3D5592B7CB95D005636DC /* NowPlayingExtension.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NowPlayingExtension.m; sourceTree = "<group>"; };
Expand All @@ -377,6 +377,8 @@
8CC5B7422B8749BC00BAD89E /* MeowBiliUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeowBiliUITests.swift; sourceTree = "<group>"; };
8CC5B74B2B8749FC00BAD89E /* MeowBili.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = MeowBili.xctestplan; sourceTree = "<group>"; };
8CD9463A2B64CD0F005D00D0 /* Bangumi_Detail_Season.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = Bangumi_Detail_Season.json; sourceTree = "<group>"; };
8CFB6B652C650FED007C7BAA /* Watch Debug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Watch Debug.entitlements"; sourceTree = "<group>"; };
8CFB6B662C650FFE007C7BAA /* Watch Release.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Watch Release.entitlements"; sourceTree = "<group>"; };
B4468A152B4FC24A002CCEB2 /* Dynamic_Feed_All.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = Dynamic_Feed_All.json; sourceTree = "<group>"; };
B4468A162B4FC24A002CCEB2 /* Search_With_UP_V2.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = Search_With_UP_V2.json; sourceTree = "<group>"; };
B4DAF0DB2B80725800755F0C /* LinkDetectText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkDetectText.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -738,6 +738,17 @@
path = MeowBiliUITests;
sourceTree = "<group>";
};
8CFB6B672C6512D1007C7BAA /* Entitlements */ = {
isa = PBXGroup;
children = (
8C0557E02B7A0480009D9CD0 /* MeowBili.entitlements */,
8CB1769F2BB7E41C00CEC05C /* Alternative.entitlements */,
8CFB6B652C650FED007C7BAA /* Watch Debug.entitlements */,
8CFB6B662C650FFE007C7BAA /* Watch Release.entitlements */,
);
path = Entitlements;
sourceTree = "<group>";
};
B44689C32B4FC15A002CCEB2 = {
isa = PBXGroup;
children = (
Expand All @@ -751,6 +762,7 @@
8C82F82F2BB70AA7009AEFD2 /* .github */,
8CB0D0222B88CE980057EF1C /* ci_scripts */,
B4468A142B4FC24A002CCEB2 /* JSONReturnExamples */,
8CFB6B672C6512D1007C7BAA /* Entitlements */,
8CA7CBC12B77AC4A008E587F /* MeowBili */,
8C8578A62C5A18AA00AF93D1 /* MeowBiliTests */,
8CC5B7412B8749BC00BAD89E /* MeowBiliUITests */,
Expand Down Expand Up @@ -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\"";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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\"";
Expand Down Expand Up @@ -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";
};
Expand All @@ -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\"";
Expand Down Expand Up @@ -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;
Expand All @@ -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\"";
Expand All @@ -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;
Expand All @@ -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\"";
Expand All @@ -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;
Expand Down
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions Entitlements/Watch Debug.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:darock.top</string>
</array>
<key>com.apple.security.application-groups</key>
<array>
<string>group.darockst</string>
</array>
</dict>
</plist>
14 changes: 14 additions & 0 deletions Entitlements/Watch Release.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:darock.top</string>
</array>
<key>com.apple.security.application-groups</key>
<array>
<string>group.darockst</string>
</array>
</dict>
</plist>
9 changes: 8 additions & 1 deletion MeowBili/MeowBiliApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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()
Expand All @@ -459,6 +464,8 @@ struct DarockBili_Watch_AppApp: App {
}
}
}

UserDefaults(suiteName: "group.darockst")?.set(true, forKey: "DCIsMeowBiliInstalled")
@unknown default:
break
}
Expand Down

0 comments on commit 11f9e3c

Please sign in to comment.