From 4462fcb25359b672aa75e395104c465144c8a050 Mon Sep 17 00:00:00 2001 From: dalroot Date: Wed, 4 Nov 2026 17:56:51 +0330 Subject: [PATCH 1/6] fix: support minified vscode extension 1.10.0 (#46) and isolate socks proxy from HTTPS_PROXY --- pkg/patcher/vscode.go | 31 +++++++++---- pkg/patcher/vscode_test.go | 92 ++++++++++++++++++++++++++++++++++++++ pkg/proxy/detector_test.go | 25 +++++++++-- pkg/proxy/launcher.go | 85 ++++++++++++++++++++++++++--------- 4 files changed, 201 insertions(+), 32 deletions(-) create mode 100644 pkg/patcher/vscode_test.go diff --git a/pkg/patcher/vscode.go b/pkg/patcher/vscode.go index 309b107..8dcdb5e 100644 --- a/pkg/patcher/vscode.go +++ b/pkg/patcher/vscode.go @@ -10,10 +10,11 @@ import ( ) var ( - channelChangedRe = regexp.MustCompile(`const\s+isChannelChanged\s*=\s*manifestFetched\s*&&\s*lastInstalledUrl\s*!==\s*releaseBaseUrl;`) - channelPatched = `const isChannelChanged = false;` + channelChangedRe = regexp.MustCompile(`const\s+isChannelChanged\s*=\s*manifestFetched\s*&&\s*lastInstalledUrl\s*!==\s*releaseBaseUrl;`) + channelChangedMinifiedRe = regexp.MustCompile(`let\s+([a-zA-Z0-9_$]+)\s*=\s*[^;]+;\s*([a-zA-Z0-9_$]+\s*&&\s*[a-zA-Z0-9_$]+\.appendLine\(\s*[` + "`" + `'"]\[INSTALL\]\s*Release channel change detected)`) + channelPatched = `const isChannelChanged = false; /*patched:channel_lock*/` - downloadGuardTarget = regexp.MustCompile(`(outputChannel\.appendLine\(\s*['"]\[INSTALL\]\s*Checking Antigravity releases\.\.\.['"]\s*\);)`) + downloadGuardTarget = regexp.MustCompile(`([a-zA-Z0-9_$]+\.appendLine\(\s*['"]\[INSTALL\]\s*Checking Antigravity releases\.\.\.['"]\s*\);)`) downloadGuardCode = `{const __primary=options.targetPathOverride||getInstalledTargetPath(); const __candidates=[__primary, (0,path_1.join)((0,path_1.dirname)(__primary),'antigravity'+((0,path_1.extname)(__primary)||''))]; for(const __p of __candidates){if(__p&&await pathExists(__p)){ outputChannel.appendLine('[INSTALL] Existing binary found at '+__p+'. Skipping version check and re-download.');return __p;}}}` ) @@ -100,17 +101,29 @@ func PatchVsCodeExtension(extPath string) (string, error) { } content := string(data) - if strings.Contains(content, channelPatched) && strings.Contains(content, "Skipping version check and re-download") { + alreadyPatched := (strings.Contains(content, channelPatched) && strings.Contains(content, "Skipping version check and re-download")) || + strings.Contains(content, "/*patched:channel_lock*/") + if alreadyPatched { return fmt.Sprintf("Already patched: %s", filepath.Base(filepath.Dir(extPath))), nil } - // Apply Part 1: Channel lock - patched := channelChangedRe.ReplaceAllString(content, channelPatched) - channelApplied := patched != content || strings.Contains(content, channelPatched) + // Apply Part 1: Channel lock (Classic unminified and v1.10.0+ minified) + patched := content + channelApplied := false + + if channelChangedRe.MatchString(patched) { + patched = channelChangedRe.ReplaceAllString(patched, channelPatched) + channelApplied = true + } else if channelChangedMinifiedRe.MatchString(patched) { + patched = channelChangedMinifiedRe.ReplaceAllString(patched, "let $1 = false; /*patched:channel_lock*/ $2") + channelApplied = true + } else if strings.Contains(content, channelPatched) || strings.Contains(content, "/*patched:channel_lock*/") { + channelApplied = true + } - // Apply Part 2: Re-download guard injection + // Apply Part 2: Re-download guard injection (if unminified AST present) guardApplied := strings.Contains(patched, "Skipping version check and re-download") - if downloadGuardTarget.MatchString(patched) { + if !guardApplied && downloadGuardTarget.MatchString(patched) && strings.Contains(patched, "options.targetPathOverride") { patched = downloadGuardTarget.ReplaceAllString(patched, "$1\n"+downloadGuardCode) guardApplied = true } diff --git a/pkg/patcher/vscode_test.go b/pkg/patcher/vscode_test.go new file mode 100644 index 0000000..467b770 --- /dev/null +++ b/pkg/patcher/vscode_test.go @@ -0,0 +1,92 @@ +package patcher + +import ( + "os" + "path/filepath" + "strings" + "testing" +) + +func TestPatchVsCodeExtensionClassic(t *testing.T) { + tempDir := t.TempDir() + extJs := filepath.Join(tempDir, "extension.js") + + fakeContent := ` +const isChannelChanged = manifestFetched && lastInstalledUrl !== releaseBaseUrl; +outputChannel.appendLine('[INSTALL] Checking Antigravity releases...'); +const target = options.targetPathOverride; +` + if err := os.WriteFile(extJs, []byte(fakeContent), 0644); err != nil { + t.Fatalf("failed to write fake extension.js: %v", err) + } + + res, err := PatchVsCodeExtension(extJs) + if err != nil { + t.Fatalf("PatchVsCodeExtension failed: %v", err) + } + if !strings.Contains(res, "Successfully patched") { + t.Errorf("unexpected result: %s", res) + } + + // Test already patched + res2, err2 := PatchVsCodeExtension(extJs) + if err2 != nil || !strings.Contains(res2, "Already patched") { + t.Errorf("expected already patched, got res: %s, err: %v", res2, err2) + } +} + +func TestPatchVsCodeExtensionV110Minified(t *testing.T) { + tempDir := t.TempDir() + extJs := filepath.Join(tempDir, "extension.js") + + fakeContent := ` +let Sc=Qa&&Md&&a&&!ed;Sc&&g.appendLine(` + "`" + `[INSTALL] Release channel change detected (last installed URL: '${sc}', target URL: '${Na}'). Forcing backend binary re-download.` + "`" + `); +if(!Sc&&Qa) return B; +` + if err := os.WriteFile(extJs, []byte(fakeContent), 0644); err != nil { + t.Fatalf("failed to write fake extension.js: %v", err) + } + + res, err := PatchVsCodeExtension(extJs) + if err != nil { + t.Fatalf("PatchVsCodeExtension failed on 1.10.0 minified: %v", err) + } + if !strings.Contains(res, "Successfully patched") { + t.Errorf("unexpected result: %s", res) + } + + // Test already patched + res2, err2 := PatchVsCodeExtension(extJs) + if err2 != nil || !strings.Contains(res2, "Already patched") { + t.Errorf("expected already patched, got res: %s, err: %v", res2, err2) + } +} + +func TestPatchVsCodeExtensionReal110File(t *testing.T) { + realPath := "/tmp/ext-1.10.0/extension/extension.js" + if _, err := os.Stat(realPath); os.IsNotExist(err) { + t.Skip("real 1.10.0 file not found, skipping") + } + + tempDir := t.TempDir() + testCopy := filepath.Join(tempDir, "extension.js") + data, err := os.ReadFile(realPath) + if err != nil { + t.Fatalf("failed to read real file: %v", err) + } + if err := os.WriteFile(testCopy, data, 0644); err != nil { + t.Fatalf("failed to copy real file: %v", err) + } + + res, err := PatchVsCodeExtension(testCopy) + if err != nil { + t.Fatalf("PatchVsCodeExtension failed on real 1.10.0: %v", err) + } + t.Logf("Result on real 1.10.0: %s", res) + + // Verify idempotency + res2, err2 := PatchVsCodeExtension(testCopy) + if err2 != nil || !strings.Contains(res2, "Already patched") { + t.Errorf("expected already patched on real 1.10.0, got: %s (err: %v)", res2, err2) + } +} diff --git a/pkg/proxy/detector_test.go b/pkg/proxy/detector_test.go index 67cd156..42a7df1 100644 --- a/pkg/proxy/detector_test.go +++ b/pkg/proxy/detector_test.go @@ -25,18 +25,37 @@ func TestCleanHostPort(t *testing.T) { } func TestBuildProxyEnv(t *testing.T) { - env := BuildProxyEnv("socks5h://127.0.0.1:10808") + // 1. SOCKS proxy: ALL_PROXY should be set, but HTTPS_PROXY must not be set to socks (prevents Undici crash) + socksEnv := BuildProxyEnv("socks5://127.0.0.1:10808") var foundAllProxy bool - for _, e := range env { + for _, e := range socksEnv { if strings.HasPrefix(e, "ALL_PROXY=") { foundAllProxy = true if !strings.Contains(e, "127.0.0.1:10808") { t.Errorf("ALL_PROXY does not contain target proxy: %s", e) } } + if strings.HasPrefix(strings.ToUpper(e), "HTTPS_PROXY=") || strings.HasPrefix(strings.ToUpper(e), "HTTP_PROXY=") { + t.Errorf("HTTPS_PROXY / HTTP_PROXY should not be set for socks proxies, got: %s", e) + } } if !foundAllProxy { - t.Errorf("BuildProxyEnv did not produce ALL_PROXY") + t.Errorf("BuildProxyEnv did not produce ALL_PROXY for socks") + } + + // 2. HTTP proxy: ALL_PROXY, HTTPS_PROXY, and HTTP_PROXY should be set + httpEnv := BuildProxyEnv("http://127.0.0.1:7890") + var foundHttpsProxy bool + for _, e := range httpEnv { + if strings.HasPrefix(e, "HTTPS_PROXY=") { + foundHttpsProxy = true + if !strings.Contains(e, "127.0.0.1:7890") { + t.Errorf("HTTPS_PROXY does not contain target proxy: %s", e) + } + } + } + if !foundHttpsProxy { + t.Errorf("BuildProxyEnv did not produce HTTPS_PROXY for http") } } diff --git a/pkg/proxy/launcher.go b/pkg/proxy/launcher.go index af653b2..ae3f8bd 100644 --- a/pkg/proxy/launcher.go +++ b/pkg/proxy/launcher.go @@ -122,14 +122,15 @@ func BuildProxyEnv(proxyURL string) []string { var httpProxy string var socksProxy string - if strings.HasPrefix(proxyURL, "socks") { + isSocks := strings.HasPrefix(proxyURL, "socks") + if isSocks { socksProxy = proxyURL // If socks5h, ensure Go and curl understand remote DNS if !strings.HasPrefix(proxyURL, "socks5h://") && strings.HasPrefix(proxyURL, "socks5://") { socksProxy = strings.Replace(proxyURL, "socks5://", "socks5h://", 1) } - // Also provide standard HTTP proxy fallback if possible - httpProxy = socksProxy + // Notice: Node.js (undici) throws UND_ERR_INVALID_ARG if HTTPS_PROXY contains socks5:// or socks5h://. + // Therefore, httpProxy remains empty when using SOCKS; Chromium uses --proxy-server directly. } else { httpProxy = proxyURL socksProxy = proxyURL @@ -138,15 +139,18 @@ func BuildProxyEnv(proxyURL string) []string { overrides := map[string]string{ "ALL_PROXY": socksProxy, "all_proxy": socksProxy, - "HTTPS_PROXY": httpProxy, - "https_proxy": httpProxy, - "HTTP_PROXY": httpProxy, - "http_proxy": httpProxy, - "GRPC_PROXY": httpProxy, "SSH_CONNECTION": "127.0.0.1 1234 127.0.0.1 22", // Remote environment spoofing: switches language_server to file-token mode "SSH_CLIENT": "127.0.0.1 1234 22", } + if httpProxy != "" { + overrides["HTTPS_PROXY"] = httpProxy + overrides["https_proxy"] = httpProxy + overrides["HTTP_PROXY"] = httpProxy + overrides["http_proxy"] = httpProxy + overrides["GRPC_PROXY"] = httpProxy + } + // Filter existing proxy envs and sensitive leak variables leakKeys := map[string]bool{ "JETSKI_OAUTH_TOKEN": true, @@ -156,13 +160,24 @@ func BuildProxyEnv(proxyURL string) []string { "GOOGLE_APPLICATION_CREDENTIALS": true, } + // Proxy keys to remove if we are overriding or if using socks (to prevent inherited socks5h from breaking Node.js) + stripProxyKeys := map[string]bool{ + "ALL_PROXY": true, + "all_proxy": true, + "HTTPS_PROXY": true, + "https_proxy": true, + "HTTP_PROXY": true, + "http_proxy": true, + "GRPC_PROXY": true, + } + var cleanEnv []string for _, e := range env { parts := strings.SplitN(e, "=", 2) if len(parts) > 0 { key := parts[0] keyUpper := strings.ToUpper(key) - if _, isProxy := overrides[keyUpper]; isProxy { + if stripProxyKeys[key] || stripProxyKeys[keyUpper] { continue } if leakKeys[key] || leakKeys[keyUpper] { @@ -309,9 +324,14 @@ if [ "$ACTIVE_PORT" = "10809" ] || [ "$ACTIVE_PORT" = "2081" ]; then PROXY_TYPE="http" fi -export ALL_PROXY="${PROXY_TYPE}h://127.0.0.1:${ACTIVE_PORT}" -export HTTPS_PROXY="${PROXY_TYPE}h://127.0.0.1:${ACTIVE_PORT}" -export HTTP_PROXY="${PROXY_TYPE}h://127.0.0.1:${ACTIVE_PORT}" +if [ "$PROXY_TYPE" = "http" ]; then + export ALL_PROXY="http://127.0.0.1:${ACTIVE_PORT}" + export HTTPS_PROXY="http://127.0.0.1:${ACTIVE_PORT}" + export HTTP_PROXY="http://127.0.0.1:${ACTIVE_PORT}" +else + export ALL_PROXY="socks5h://127.0.0.1:${ACTIVE_PORT}" + unset HTTPS_PROXY HTTP_PROXY https_proxy http_proxy +fi # 4. Remote environment spoofing: switches language_server to file-token mode & reduces cloud fraud friction export SSH_CONNECTION="127.0.0.1 1234 127.0.0.1 22" @@ -412,13 +432,24 @@ if [ -z "$ACTIVE_PORT" ]; then ACTIVE_PORT="10808" fi -export ALL_PROXY="socks5h://127.0.0.1:${ACTIVE_PORT}" -export HTTPS_PROXY="socks5h://127.0.0.1:${ACTIVE_PORT}" -export HTTP_PROXY="socks5h://127.0.0.1:${ACTIVE_PORT}" +PROXY_TYPE="socks5" +if [ "$ACTIVE_PORT" = "7890" ] || [ "$ACTIVE_PORT" = "10809" ] || [ "$ACTIVE_PORT" = "2081" ]; then + PROXY_TYPE="http" +fi + +if [ "$PROXY_TYPE" = "http" ]; then + export ALL_PROXY="http://127.0.0.1:${ACTIVE_PORT}" + export HTTPS_PROXY="http://127.0.0.1:${ACTIVE_PORT}" + export HTTP_PROXY="http://127.0.0.1:${ACTIVE_PORT}" +else + export ALL_PROXY="socks5h://127.0.0.1:${ACTIVE_PORT}" + unset HTTPS_PROXY HTTP_PROXY https_proxy http_proxy +fi + export SSH_CONNECTION="127.0.0.1 1234 127.0.0.1 22" export SSH_CLIENT="127.0.0.1 1234 22" -exec "$APP_PATH" --proxy-server="socks5://127.0.0.1:${ACTIVE_PORT}" "$@" +exec "$APP_PATH" --proxy-server="${PROXY_TYPE}://127.0.0.1:${ACTIVE_PORT}" "$@" `, appPath) if err := os.WriteFile(cmdPath, []byte(content), 0755); err != nil { @@ -430,14 +461,28 @@ exec "$APP_PATH" --proxy-server="socks5://127.0.0.1:${ACTIVE_PORT}" "$@" if runtime.GOOS == "windows" { chromiumProxy := CleanChromiumProxyURL(proxyURL) batPath := filepath.Join(home, "Desktop", "Antigravity-NoTUN.bat") - content := fmt.Sprintf(`@echo off -set "ALL_PROXY=%s" + + var proxyEnvLines string + if strings.HasPrefix(proxyURL, "socks") { + socksProxy := proxyURL + if !strings.HasPrefix(socksProxy, "socks5h://") && strings.HasPrefix(socksProxy, "socks5://") { + socksProxy = strings.Replace(socksProxy, "socks5://", "socks5h://", 1) + } + proxyEnvLines = fmt.Sprintf(`set "ALL_PROXY=%s" +set "HTTPS_PROXY=" +set "HTTP_PROXY="`, socksProxy) + } else { + proxyEnvLines = fmt.Sprintf(`set "ALL_PROXY=%s" set "HTTPS_PROXY=%s" -set "HTTP_PROXY=%s" +set "HTTP_PROXY=%s"`, proxyURL, proxyURL, proxyURL) + } + + content := fmt.Sprintf(`@echo off +%s set "SSH_CONNECTION=127.0.0.1 1234 127.0.0.1 22" set "SSH_CLIENT=127.0.0.1 1234 22" start "" "%s" --proxy-server=%s -`, proxyURL, proxyURL, proxyURL, appPath, chromiumProxy) +`, proxyEnvLines, appPath, chromiumProxy) if err := os.WriteFile(batPath, []byte(content), 0755); err != nil { return "", err From 2607a5f538ae5d56b7dc1a92b01e68eae1704b0c Mon Sep 17 00:00:00 2001 From: dalroot Date: Thu, 5 Nov 2026 23:49:42 +0330 Subject: [PATCH 2/6] fix(account): prevent SyncTokenBridge from stomping active token and sync jetski file in SwitchAccount --- pkg/account/manager.go | 44 ++++++++++++++++++++++++++++++------- pkg/account/token_bridge.go | 12 +++++++--- 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/pkg/account/manager.go b/pkg/account/manager.go index 46e15f2..9e82a1f 100644 --- a/pkg/account/manager.go +++ b/pkg/account/manager.go @@ -182,16 +182,24 @@ func SaveAccount(name string, dbPath string) error { } } - // Capture OS Keyring token payload (gemini / antigravity) + // Capture OS Keyring token payload (gemini / antigravity) or fallback to file token var keyringSecret string if krVal, err := keyring.Get("gemini", "antigravity"); err == nil && krVal != "" { keyringSecret = krVal - if email == "" || email == "Google User (Antigravity Hub)" { - if match := emailRe.FindString(krVal); match != "" { - email = match + } + tokenFilePath := StandaloneTokenFilePath() + if tokenFilePath != "" { + if fileData, err := os.ReadFile(tokenFilePath); err == nil && len(fileData) > 0 { + if keyringSecret == "" { + keyringSecret = string(fileData) } } } + if keyringSecret != "" && (email == "" || email == "Google User (Antigravity Hub)") { + if match := emailRe.FindString(keyringSecret); match != "" { + email = match + } + } if email == "" { email = "Google User (Antigravity Hub)" @@ -199,6 +207,12 @@ func SaveAccount(name string, dbPath string) error { _ = os.MkdirAll(accountProfileDir, 0700) + if tokenFilePath != "" { + if fileData, err := os.ReadFile(tokenFilePath); err == nil && len(fileData) > 0 { + _ = os.WriteFile(filepath.Join(accountProfileDir, "jetski-standalone-oauth-token"), fileData, 0600) + } + } + // Backup Hub files for _, f := range hubFiles { src := filepath.Join(hubDir, f) @@ -322,10 +336,24 @@ func SwitchAccount(name string, dbPath string) error { } // 0. Restore OS Keyring credentials if present (gemini / antigravity) - if account.KeyringSecret != "" { - _ = keyring.Set("gemini", "antigravity", account.KeyringSecret) - } else if krBytes, err := os.ReadFile(filepath.Join(accountProfileDir, "keyring_secret.json")); err == nil { - _ = keyring.Set("gemini", "antigravity", string(krBytes)) + secret := account.KeyringSecret + if secret == "" { + if krBytes, err := os.ReadFile(filepath.Join(accountProfileDir, "keyring_secret.json")); err == nil { + secret = string(krBytes) + } else if tokBytes, err := os.ReadFile(filepath.Join(accountProfileDir, "jetski-standalone-oauth-token")); err == nil { + secret = string(tokBytes) + } + } + + if secret != "" { + _ = keyring.Set("gemini", "antigravity", secret) + } + + // 0b. Restore ~/.gemini/jetski-standalone-oauth-token for file-token mode (SSH spoofing) + tokenFilePath := StandaloneTokenFilePath() + if tokenFilePath != "" && secret != "" { + _ = os.MkdirAll(filepath.Dir(tokenFilePath), 0700) + _ = os.WriteFile(tokenFilePath, []byte(secret), 0600) } // 1. Restore Hub files diff --git a/pkg/account/token_bridge.go b/pkg/account/token_bridge.go index 2db6ab9..cc99140 100644 --- a/pkg/account/token_bridge.go +++ b/pkg/account/token_bridge.go @@ -82,13 +82,19 @@ func SyncTokenBridge(logger func(format string, args ...interface{})) error { return nil } - // If both have valid tokens but are different, update file to match active keyring + // If both have valid tokens but are different: + // Prioritize file storage because in SSH spoofing mode (which Antigravity runs with), + // Google's language_server reads and updates jetski-standalone-oauth-token directly, + // while OS Keyring remains untouched. Overwriting file with Keyring clobbers fresh logins! if krHasValidToken && fileHasValidToken { krHash := sha256.Sum256([]byte(krVal)) fileHash := sha256.Sum256(fileBytes) if krHash != fileHash { - _ = os.WriteFile(tokenFilePath, []byte(krVal), 0600) - logger("Updated file token storage with latest active OS Keyring credentials") + if err := keyring.Set("gemini", "antigravity", string(fileBytes)); err != nil { + logger("Warning: failed to sync file token to OS Keyring: %v", err) + } else { + logger("Synced active file token storage to OS Keyring") + } } } From 2e612ef6d76ffc8a4068eba92b5e5ad76bb88e7c Mon Sep 17 00:00:00 2001 From: dalroot Date: Fri, 6 Nov 2026 00:19:50 +0330 Subject: [PATCH 3/6] feat(patcher): support Cursor, Windsurf, VSCodium extensions and alternative ID prefixes (#45) --- pkg/patcher/vscode.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/patcher/vscode.go b/pkg/patcher/vscode.go index 8dcdb5e..d192579 100644 --- a/pkg/patcher/vscode.go +++ b/pkg/patcher/vscode.go @@ -18,7 +18,7 @@ var ( downloadGuardCode = `{const __primary=options.targetPathOverride||getInstalledTargetPath(); const __candidates=[__primary, (0,path_1.join)((0,path_1.dirname)(__primary),'antigravity'+((0,path_1.extname)(__primary)||''))]; for(const __p of __candidates){if(__p&&await pathExists(__p)){ outputChannel.appendLine('[INSTALL] Existing binary found at '+__p+'. Skipping version check and re-download.');return __p;}}}` ) -// FindVsCodeExtension finds the extension.js of google.google-antigravity +// FindVsCodeExtension finds the extension.js of google.google-antigravity or related forks (Cursor, Windsurf, VSCodium) func FindVsCodeExtension() string { home, _ := os.UserHomeDir() candidateDirs := []string{ @@ -26,6 +26,11 @@ func FindVsCodeExtension() string { filepath.Join(home, ".vscode-insiders", "extensions"), filepath.Join(home, ".vscode-oss", "extensions"), filepath.Join(home, ".vscode-server", "extensions"), + filepath.Join(home, ".cursor", "extensions"), + filepath.Join(home, ".cursor-server", "extensions"), + filepath.Join(home, ".windsurf", "extensions"), + filepath.Join(home, ".windsurf-server", "extensions"), + filepath.Join(home, ".vscodium", "extensions"), filepath.Join(home, ".antigravity-ide", "extensions"), filepath.Join(home, ".antigravity", "extensions"), } @@ -36,6 +41,8 @@ func FindVsCodeExtension() string { filepath.Join(localApp, "Programs", "Antigravity IDE", "resources", "app", "extensions"), filepath.Join(localApp, "Programs", "Antigravity", "resources", "app", "extensions"), filepath.Join(localApp, "Programs", "antigravity", "resources", "app", "extensions"), + filepath.Join(localApp, "Programs", "cursor", "resources", "app", "extensions"), + filepath.Join(localApp, "Programs", "Cursor", "resources", "app", "extensions"), ) } else if runtime.GOOS == "linux" { candidateDirs = append(candidateDirs, @@ -43,6 +50,7 @@ func FindVsCodeExtension() string { "/usr/share/antigravity-ide/resources/app/extensions", "/opt/antigravity/resources/app/extensions", "/opt/Antigravity IDE/resources/app/extensions", + "/opt/Cursor/resources/app/extensions", ) } @@ -70,7 +78,7 @@ func FindVsCodeExtension() string { continue } for _, e := range entries { - if e.IsDir() && (strings.HasPrefix(e.Name(), "google.google-antigravity-") || strings.EqualFold(e.Name(), "agy") || strings.HasPrefix(e.Name(), "agy-")) { + if e.IsDir() && (strings.HasPrefix(e.Name(), "google.google-antigravity-") || strings.HasPrefix(e.Name(), "google.antigravity-") || strings.HasPrefix(e.Name(), "antigravity-") || strings.EqualFold(e.Name(), "agy") || strings.HasPrefix(e.Name(), "agy-")) { for _, sub := range []string{"extension.js", filepath.Join("dist", "extension.js")} { extJs := filepath.Join(dir, e.Name(), sub) if fi, err := os.Stat(extJs); err == nil && !fi.IsDir() { From cd8f28254db52e6f0b7103ad17d4c12a1046733a Mon Sep 17 00:00:00 2001 From: dalroot Date: Sat, 7 Nov 2026 16:54:57 +0330 Subject: [PATCH 4/6] fix(launcher): add dynamic target selection and include extension patch in autofix --- cmd/antigravity/main.go | 43 ++++++++++++++++++++++++++++++++++++-- pkg/proxy/launcher.go | 38 ++++++++++++++++++++++++++------- pkg/proxy/launcher_test.go | 15 +++++++++++++ 3 files changed, 87 insertions(+), 9 deletions(-) diff --git a/cmd/antigravity/main.go b/cmd/antigravity/main.go index 4303c7a..a6138eb 100644 --- a/cmd/antigravity/main.go +++ b/cmd/antigravity/main.go @@ -263,7 +263,18 @@ func handleSubcommand(cmd string, args []string) { fs := flag.NewFlagSet("launch", flag.ExitOnError) fs.StringVar(&proxyURL, "proxy", "", "Custom proxy URL (e.g. socks5h://127.0.0.1:10808)") _ = fs.Parse(args) - _ = proxy.LaunchAntigravityWithProxy("", proxyURL, fs.Args()) + + var preference string + remaining := fs.Args() + if len(remaining) > 0 { + switch strings.ToLower(remaining[0]) { + case "ide", "app", "standalone": + preference = remaining[0] + remaining = remaining[1:] + } + } + appPath := proxy.FindTargetExecutable(preference) + _ = proxy.LaunchAntigravityWithProxy(appPath, proxyURL, remaining) case "gui": runGui() case "clean": @@ -417,6 +428,12 @@ func runQuickAutoFix() { coreSuccess = true } + if res, err := patcher.PatchVsCodeExtension(""); err != nil { + ui.PrintStatus("INFO", "VS Code / IDE Extension", "No external extensions folder found (optional)") + } else { + ui.PrintStatus("OK", "VS Code / IDE Extension", res) + } + if res, err := patcher.PatchAsarZeroLog(""); err != nil { ui.PrintStatus("INFO", "Zero-Log ASAR", "Antigravity Standalone (app.asar optional)") } else { @@ -546,9 +563,31 @@ func runLaunchProxy() { } ui.PrintStatus("OK", "Proxy Detected", fmt.Sprintf("%s (%s)", best.URL, best.Provider)) + + targets := proxy.FindAllAntigravityExecutables() + selectedExe := "" + if len(targets) > 1 { + fmt.Println() + fmt.Println(lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("#00F0FF")).Render(" ℹ Multiple Antigravity installations detected:")) + for i, t := range targets { + fmt.Printf(" [%d] %s (%s)\n", i+1, lipgloss.NewStyle().Bold(true).Render(t.Name), t.ExePath) + } + fmt.Println() + choice := ui.ReadInput(fmt.Sprintf("Select target to launch [1-%d] (default: 1)", len(targets))) + idx := 0 + if choice != "" { + if n, err := strconv.Atoi(strings.TrimSpace(choice)); err == nil && n >= 1 && n <= len(targets) { + idx = n - 1 + } + } + selectedExe = targets[idx].ExePath + } else if len(targets) == 1 { + selectedExe = targets[0].ExePath + } + fmt.Printf(" %s\n", lipgloss.NewStyle().Foreground(lipgloss.Color("#6272A4")).Render("Starting Antigravity with injected environment...")) - if err := proxy.LaunchAntigravityWithProxy("", best.URL, nil); err != nil { + if err := proxy.LaunchAntigravityWithProxy(selectedExe, best.URL, nil); err != nil { ui.PrintStatus("FAIL", "Launch Error", err.Error()) } else { ui.PrintStatus("OK", "Process Spawned", "Antigravity launched successfully without TUN mode!") diff --git a/pkg/proxy/launcher.go b/pkg/proxy/launcher.go index ae3f8bd..2494791 100644 --- a/pkg/proxy/launcher.go +++ b/pkg/proxy/launcher.go @@ -97,24 +97,48 @@ func FindAllAntigravityExecutables() []AppTarget { add("Antigravity IDE", path, true) } - return targets + // Sort targets so Antigravity IDE appears first, followed by standalone Antigravity + var ideTargets []AppTarget + var standardTargets []AppTarget + for _, t := range targets { + if t.IsIDE { + ideTargets = append(ideTargets, t) + } else { + standardTargets = append(standardTargets, t) + } + } + return append(ideTargets, standardTargets...) } -// FindAntigravityExecutable finds the main Antigravity GUI application -func FindAntigravityExecutable() string { +// FindTargetExecutable finds an Antigravity executable matching preference ("ide", "app"/"standalone", or empty for default) +func FindTargetExecutable(preference string) string { targets := FindAllAntigravityExecutables() if len(targets) == 0 { return "" } - // Prefer standard Antigravity if available, otherwise IDE - for _, t := range targets { - if !t.IsIDE { - return t.ExePath + prefLower := strings.ToLower(strings.TrimSpace(preference)) + if prefLower == "ide" { + for _, t := range targets { + if t.IsIDE { + return t.ExePath + } + } + } else if prefLower == "app" || prefLower == "standalone" { + for _, t := range targets { + if !t.IsIDE { + return t.ExePath + } } } + // Default: Return the first target (IDE takes precedence if installed, else standalone) return targets[0].ExePath } +// FindAntigravityExecutable finds the primary Antigravity GUI application +func FindAntigravityExecutable() string { + return FindTargetExecutable("") +} + // BuildProxyEnv constructs clean proxy environment variables for child processes func BuildProxyEnv(proxyURL string) []string { env := os.Environ() diff --git a/pkg/proxy/launcher_test.go b/pkg/proxy/launcher_test.go index a422a3f..1cb1f10 100644 --- a/pkg/proxy/launcher_test.go +++ b/pkg/proxy/launcher_test.go @@ -31,4 +31,19 @@ func TestFindAllAntigravityExecutables(t *testing.T) { for _, target := range targets { t.Logf(" - Target: %s, ExePath: %s, IsIDE: %v", target.Name, target.ExePath, target.IsIDE) } + + // Test FindTargetExecutable and FindAntigravityExecutable + defaultExe := FindAntigravityExecutable() + ideExe := FindTargetExecutable("ide") + appExe := FindTargetExecutable("app") + + t.Logf("Default Exe: %s", defaultExe) + t.Logf("IDE Exe: %s", ideExe) + t.Logf("App Exe: %s", appExe) + + if len(targets) > 0 { + if defaultExe == "" { + t.Fatalf("expected non-empty default executable when targets exist") + } + } } From c7eb35b676a87d0c2a31dc2c27b61809ae569e96 Mon Sep 17 00:00:00 2001 From: dalroot Date: Sat, 7 Nov 2026 20:02:53 +0330 Subject: [PATCH 5/6] docs(seo): improve discoverability and keyword clarity in readme and website --- README.md | 4 ++-- website/index.html | 20 ++++++++++---------- website/locales/en.json | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 25e508f..13f38a8 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@

⚡ Antigravity Cleaner, Fixer & Patcher Pro (v5.4.3)

- Autonomous Sanction Bypass, Zero-Telemetry Engine & Direct No-TUN Proxy Injector for Google Antigravity + The Best 1-Click Autonomous Region Fixer, Sanction Bypass & Direct No-TUN Proxy Injector for Google Antigravity (Ubuntu/Linux, Windows, macOS)

@@ -150,7 +150,7 @@ Run `ag-cleaner` in your terminal for an interactive Lipgloss dashboard, and sel Google Region Restriction Notice

-**Antigravity Cleaner, Fixer & Patcher Pro** is a specialized, open-source systems utility engineered in **pure Go** that neutralizes region blocking, account eligibility barriers, telemetry phone-home beacons, and HTTP 429 quota locks across: +**Antigravity Fixer, Cleaner & Patcher** is the best open-source autonomous utility designed to remove region restrictions, bypass Google sanctions, and resolve **"Your current account is not eligible" (Error 403)**, **Region Locks**, and **HTTP 429 Quota locks** across Ubuntu/Linux, Windows, and macOS: - **Google Antigravity 2.x** - **Antigravity IDE** - **Antigravity CLI (`agy`)** diff --git a/website/index.html b/website/index.html index e761826..f1a459d 100644 --- a/website/index.html +++ b/website/index.html @@ -3,9 +3,9 @@ - Antigravity Cleaner, Fixer & Patcher — 403 Bypass, Region Unlocker & Process Proxy - - + Bypass Antigravity Region Lock & 403 Error | Best 1-Click Fixer + + @@ -19,18 +19,18 @@ - + - - + + - - + + @@ -482,8 +482,8 @@

Linux

⭐ Free & Open-Source Community

Help Us Keep Antigravity Unchained

- Antigravity Cleaner is completely free, 100% offline, and open-source under Apache-2.0. - Give us a star on GitHub to support ongoing machine-code patches and anti-sanction updates! + Bypass Google region blocks and resolve Error 403 permanently with 100% offline, open-source tools. + Star us on GitHub to support continuous machine-code patches and anti-sanction updates!

diff --git a/website/locales/en.json b/website/locales/en.json index 13d7634..e0f564e 100644 --- a/website/locales/en.json +++ b/website/locales/en.json @@ -45,7 +45,7 @@ "cta": { "badge": "⭐ Free & Open-Source Community", "title": "Help Us Keep Antigravity Unchained", - "text": "Antigravity Cleaner is completely free, 100% offline, and open-source under Apache-2.0. Give us a star on GitHub to support ongoing machine-code patches and anti-sanction updates!", + "text": "Bypass Google region blocks and resolve Error 403 permanently with 100% offline, open-source tools. Star us on GitHub to support continuous machine-code patches and anti-sanction updates!", "starBtn": "Star on GitHub", "downloadBtn": "Download Latest Release" }, From 63206e765f6c20e55e5d96d843d6893bffb5c4c4 Mon Sep 17 00:00:00 2001 From: dalroot Date: Sun, 8 Nov 2026 18:27:20 +0330 Subject: [PATCH 6/6] chore(release): bump version to v5.4.7 and document changelog --- CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ Makefile | 2 +- cmd/antigravity/main.go | 2 +- pkg/gui/assets/index.html | 4 ++-- pkg/gui/server.go | 2 +- 5 files changed, 38 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90baa05..3503686 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,39 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.4.7] - 2026-11-08 + +### ⚡ Extension 1.10.0 Support, Multi-Editor Discovery, Account Manager & Dynamic Launcher + +#### 🧩 VS Code Extension 1.10.0 Minification Fix (#46) +- **Atomic Regex Matching:** Replaced regex backreferences with atomic pattern to reliably match minified variants of the extension in version 1.10.0. +- **SOCKS5 Isolation:** Resolved `UND_ERR_INVALID_ARG` in Node.js (undici) by isolating SOCKS5/SOCKS5h loopback from `HTTPS_PROXY` environment variables. + +#### 👤 Multi-Account Manager & Token Bridge Hardening +- **Token Protection:** Prevented `SyncTokenBridge` from stomping the active `jetski-standalone-oauth-token` when running under SSH connection spoofing. +- **Bi-Directional Sync:** Synchronized active tokens between file storage and OS Keyring in `SaveAccount` and `SwitchAccount`. + +#### 🔍 Editor & IDE Discovery Expansion (#45) +- **Multi-Editor Extension Support:** Added discovery and patching support for **Cursor** (`~/.cursor/extensions`), **Windsurf** (`~/.windsurf/extensions`), and **VSCodium** across Linux, macOS, and Windows. +- **Alternative Extension Prefixes:** Added support for alternative extension ID prefixes (`google.antigravity-` and `antigravity-`). + +#### 🚀 Dynamic Target Selection & Auto-Fix +- **Auto-Fix Extension Coverage:** Included `PatchVsCodeExtension` in `runQuickAutoFix` (Option 1) so 1-click auto-fix covers all IDE extensions without requiring manual individual patch commands. +- **Dynamic Launcher Selection:** Prompt dynamically when multiple Antigravity targets are installed, with CLI target flags (`launch ide` / `launch app`). + +--- + +## [5.4.6] - 2026-11-04 + +### 🛡️ AMFI SIGTERM Resolution, Chromium & SQLite Session Purge & V8 Bytecode Optimization + +- **macOS AMFI SIGTERM Resolution (#37):** Added `HealDarwinBinaries` to auto-purge legacy shell script wrappers, restore native Mach-O `language_server` with ad-hoc codesign, and keep native binary intact to prevent AMFI SIGTERM aborts. +- **Chromium & Session Purge (#44):** Deep wipe modern Chromium `Network/` subdirectories (`Cookies`, `Trust Tokens`, `TransportSecurity`, `Persistent State`), `WebStorage/`, and safely reset `antigravityUnifiedStateSync.oauthToken` in `state.vscdb`. +- **V8 Cache & Bundled IDE:** Deep clean V8 Code Cache (`js`/`wasm`, Partitions) and support `dist/main.js` to prevent stale bytecode execution in Antigravity IDE. +- **CLI (agy):** Fully dynamic zero-hardcode binary detection for `agy 1.4.12` with bytecode multi-gate bypass. + +--- + ## [5.4.5] - 2026-11-02 ### 🚑 Stability & Self-Healing Hotfix: Windows Binary Restoration, macOS CodeSign & Flag Modernization diff --git a/Makefile b/Makefile index 59f446f..6a1ed38 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ APP_NAME := antigravity-cleaner -VERSION := 5.4.6 +VERSION := 5.4.7 BUILD_DIR := dist .PHONY: all build clean test release diff --git a/cmd/antigravity/main.go b/cmd/antigravity/main.go index a6138eb..9e473de 100644 --- a/cmd/antigravity/main.go +++ b/cmd/antigravity/main.go @@ -23,7 +23,7 @@ import ( "github.com/tawroot/antigravity-cleaner/pkg/updater" ) -const Version = "5.4.6" +const Version = "5.4.7" func init() { patcher.RegisterPostInstallHook(func(logger patcher.LogFunc) { diff --git a/pkg/gui/assets/index.html b/pkg/gui/assets/index.html index 022826c..0996136 100644 --- a/pkg/gui/assets/index.html +++ b/pkg/gui/assets/index.html @@ -2,7 +2,7 @@ - Antigravity Patcher v5.4.6 - by dalroot + Antigravity Patcher v5.4.7 - by dalroot