feat(ui): rebrand to G Launcher, add side server selector, update wallpaper and app icon, integrate GaCy-GO PS
This commit is contained in:
1 parent
023ae32b58
commit
25843372ad
21 files changed
+2418
-2144
No files matched your search
@@ -40,9 +40,11 @@ func (g *GitService) GetLatestLauncherVersion() (bool, string, string) {
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to Gitea/Forgejo/GitHub Releases API
|
||||
client := &http.Client{Timeout: 10 * time.Second}
|
||||
|
||||
// Fallback to Gitea Releases API
|
||||
if constant.LauncherGitUrl != "" {
|
||||
resp, err := http.Get(constant.LauncherGitUrl)
|
||||
resp, err := client.Get(constant.LauncherGitUrl)
|
||||
if err == nil {
|
||||
defer resp.Body.Close()
|
||||
body, readErr := io.ReadAll(resp.Body)
|
||||
@@ -55,7 +57,23 @@ func (g *GitService) GetLatestLauncherVersion() (bool, string, string) {
|
||||
}
|
||||
}
|
||||
|
||||
return false, "", "no launcher updates found"
|
||||
// Fallback to Gitea Tags API
|
||||
tagsURL := "https://gaytea.cod-algieba.ts.net/api/v1/repos/GaCy/G-Launcher/tags"
|
||||
resp, err := client.Get(tagsURL)
|
||||
if err == nil {
|
||||
defer resp.Body.Close()
|
||||
body, readErr := io.ReadAll(resp.Body)
|
||||
if readErr == nil {
|
||||
var tags []struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
if json.Unmarshal(body, &tags) == nil && len(tags) > 0 {
|
||||
return true, tags[0].Name, ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true, constant.CurrentLauncherVersion, ""
|
||||
}
|
||||
|
||||
func (g *GitService) UpdateLauncherProgress(version string) (bool, string) {
|
||||
|
||||
Reference in new issue
Block a user