-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Fixed issues(see issues page for details), added analyze(and p… (
#247) * chore: Fixed issues(see issues page for details), added analyze(and privacy settings for it) * fix(Building): Fixed 'DarockBili Watch App' target missing library issue * fix(Building): Fixed build issues * fix(Building): Fixed build issues
- Loading branch information
1 parent
640d555
commit e9bf66c
Showing
26 changed files
with
788 additions
and
305 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
DarockBili Watch App/Assets.xcassets/QRCard.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "QRCard 2.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "QRCard.png", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "QRCard 1.png", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ | |
|
||
import AVKit | ||
import SwiftUI | ||
import BPlayer | ||
import Alamofire | ||
|
||
struct BangumiPlayerView: View { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// | ||
// | ||
// SelfQrCodeView.swift | ||
// DarockBili Watch App | ||
// | ||
// Created by memz233 on 2024/2/18. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This source file is part of the MeowBili open source project | ||
// | ||
// Copyright (c) 2023 Darock Studio and the MeowBili project authors | ||
// Licensed under GNU General Public License v3 | ||
// | ||
// See https://darock.top/LICENSE.txt for license information | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
import UIKit | ||
import SwiftUI | ||
import EFQRCode | ||
import DarockKit | ||
import Alamofire | ||
import SwiftyJSON | ||
import SDWebImageSwiftUI | ||
|
||
struct SelfQrCardView: View { | ||
@AppStorage("DedeUserID") var dedeUserID = "" | ||
@AppStorage("DedeUserID__ckMd5") var dedeUserID__ckMd5 = "" | ||
@AppStorage("SESSDATA") var sessdata = "" | ||
@AppStorage("bili_jct") var biliJct = "" | ||
@State var shotting = false | ||
@State var username = "" | ||
@State var userFaceUrl = "" | ||
@State var qrcodeImg: CGImage? | ||
var body: some View { | ||
VStack { | ||
HStack { | ||
WebImage(url: URL(string: userFaceUrl)) | ||
.resizable() | ||
.frame(width: 20, height: 20) | ||
.clipShape(Circle()) | ||
VStack { | ||
Text(username) | ||
.font(.system(size: 12)) | ||
.foregroundColor(.black) | ||
Text("UID: \(dedeUserID)") | ||
.font(.system(size: 12)) | ||
.foregroundColor(.black) | ||
} | ||
Spacer() | ||
} | ||
if let img = qrcodeImg { | ||
Image(uiImage: UIImage(cgImage: img)) | ||
.resizable() | ||
.frame(width: 80, height: 80) | ||
.offset(y: 20) | ||
} | ||
} | ||
.frame(maxWidth: .infinity, maxHeight: .infinity) | ||
.background(Color(hex: 0xFAFAFD)) | ||
.ignoresSafeArea() | ||
.onAppear { | ||
qrcodeImg = EFQRCode.generate(for: "https://space.bilibili.com/\(dedeUserID)", foregroundColor: Color(hex: 0x2b4785).cgColor!) | ||
|
||
getBuvid(url: "https://api.bilibili.com/x/space/wbi/acc/info".urlEncoded()) { buvid3, buvid4, _uuid, resp in | ||
let headers: HTTPHeaders = [ | ||
"cookie": "SESSDATA=\(sessdata); innersign=0; buvid3=\(buvid3); b_nut=1704873471; i-wanna-go-back=-1; b_ut=7; b_lsid=9910433CB_18CF260AB89; _uuid=\(_uuid); enable_web_push=DISABLE; header_theme_version=undefined; home_feed_column=4; browser_resolution=3440-1440; buvid4=\(buvid4);", | ||
"User-Agent": "Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" | ||
] | ||
biliWbiSign(paramEncoded: "mid=\(dedeUserID)".base64Encoded()) { signed in | ||
if let signed { | ||
debugPrint(signed) | ||
autoRetryRequestApi("https://api.bilibili.com/x/space/wbi/acc/info?\(signed)", headers: headers) { respJson, isSuccess in | ||
if isSuccess { | ||
debugPrint(respJson) | ||
if !CheckBApiError(from: respJson) { return } | ||
username = respJson["data"]["name"].string ?? "" | ||
userFaceUrl = respJson["data"]["face"].string ?? "E" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
SelfQrCardView() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.