Skip to content

Commit

Permalink
chore: alpha asset
Browse files Browse the repository at this point in the history
  • Loading branch information
mrFq1 committed May 21, 2024
1 parent 1510075 commit 90938ee
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions ClashX/General/AlphaMetaDownloader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ class AlphaMetaDownloader: NSObject {
static func assetName() -> String? {
switch GetMachineHardwareName() {
case "x86_64":
return "darwin-amd64"
return "amd64"
case "arm64":
return "darwin-arm64"
return "arm64"
default:
return nil
}
Expand Down Expand Up @@ -87,11 +87,16 @@ class AlphaMetaDownloader: NSObject {

guard let assetName,
let asset = assets.first(where: {
$0.name.contains(assetName) &&
!$0.name.contains("cgo") &&
!$0.name.contains("go120") &&
$0.state == "uploaded" &&
$0.contentType == "application/gzip"
guard $0.state == "uploaded", $0.contentType == "application/gzip" else { return false }

let names = $0.name.split(separator: "-").map(String.init)
guard names.count > 4,
names[0] == "mihomo",
names[1] == "darwin",
names[2] == assetName,
names[3] == "alpha" else { return false }

return true
}) else {
resolver.reject(errors.decodeReleaseInfoFailed)
return
Expand Down

0 comments on commit 90938ee

Please sign in to comment.