From 9a22dc5636a230fba6ed28b598b1c98bfd94c74f Mon Sep 17 00:00:00 2001 From: WindowsMEMZ <45706356+WindowsMEMZ@users.noreply.github.com> Date: Thu, 16 Nov 2023 00:08:39 +0800 Subject: [PATCH] Update AboutView.swift --- DarockBili Watch App/Others/AboutView.swift | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/DarockBili Watch App/Others/AboutView.swift b/DarockBili Watch App/Others/AboutView.swift index 7e9411862..d3a2fe5b9 100644 --- a/DarockBili Watch App/Others/AboutView.swift +++ b/DarockBili Watch App/Others/AboutView.swift @@ -6,22 +6,24 @@ // import SwiftUI +import DarockKit struct AboutView: View { + @State var signVerifyStatus = "" + @State var verSign = "*Darock \(CodingTime.getCodingTime()) \(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String) \(Bundle.main.infoDictionary?["CFBundleVersion"] as! String) Salt*".DDMD5Encrypt(.lowercase16) var body: some View { NavigationStack { List { Section { Text("喵哩喵哩 v\(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String) Build \(Bundle.main.infoDictionary?["CFBundleVersion"] as! String)") Text("编译时间: \(CodingTime.getCodingTime())") - Text("版本签名:\n#1: \("*Darock \(CodingTime.getCodingTime()) \(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String) \(Bundle.main.infoDictionary?["CFBundleVersion"] as! String) Salt*".DDMD5Encrypt(.lowercase16))\n#2: \("*Darock \(CodingTime.getCodingTime()) \(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String) \(Bundle.main.infoDictionary?["CFBundleVersion"] as! String) Salt*".DDMD5Encrypt(.lowercase32))") + Text("版本签名:\(Text(verSign).foregroundColor(signVerifyStatus == "OK" ? .green : signVerifyStatus == "Fcuk" ? .red : .yellow))") Text("遇到问题?在设置页面点击“反馈问题”进行反馈,感谢您的支持!") } Section { Text("Credits:") Text("Darock Studio") Label("来自 \(Text("Darock Studio").bold()) 的消息:欢迎加群 248036605 获取最新消息谢谢喵!", systemImage: "arrowshape.up") - Text("ReX\n\(Text("帮助了点UI").font(.system(size: 14, weight: .regular)).foregroundColor(.gray))") } Section { NavigationLink(destination: {OpenSource()}, label: { @@ -31,6 +33,17 @@ struct AboutView: View { } .bold() } + .onAppear { + DarockKit.Network.shared.requestString("https://api.darock.top/bili/verify/list") { isSuccess, respStr in + if isSuccess { + if respStr.contains(verSign) { + signVerifyStatus = "OK" + } else { + signVerifyStatus = "Fcuk" + } + } + } + } } struct OpenSource: View { var body: some View {