Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@ 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.8] - 2026-11-15

### πŸͺŸ Windows Silent Shortcut Overhaul, Dynamic Loopback Port Scanner & Chromium Loopback Unblock

#### πŸš€ Native Windows Silent Shortcut Pipeline
- **Eliminate Cluttering Desktop Batch Files:** Instead of creating standalone `.bat` files on the user's desktop, the launcher now in-place patches the official `Antigravity.lnk` shortcut on both **Desktop** and **Start Menu** with the official application icon (`Antigravity.exe,0`).
- **Zero-Flash Execution:** Leverages a lightweight Windows Script Host runner (`run.vbs` with `windowStyle = 0`) to execute the launcher engine silently without flashing a command prompt window.

#### ⚑ Dynamic Loopback Port Detection
- **Multi-Client Probing:** Probes active loopback proxy ports dynamically across v2rayN / Xray (`10808`, `10809`), Hiddify / NekoBox (`2080`, `2081`), Clash / Mihomo (`7890`), and standard SOCKS5 (`1080`) with short non-blocking timeouts (~50ms) instead of hardcoded values.

#### πŸ”“ Chromium Loopback & OAuth Gatekeeper Unblock
- **Loopback Proxy Bypass List:** Injects `--proxy-bypass-list="<-loopback>"` to prevent Chromium's default loopback bypass from dropping local OAuth callbacks and loopback proxy communication.
- **Environment Variable Parity:** Injects both uppercase and lowercase proxy variables (`ALL_PROXY`, `all_proxy`, `HTTP_PROXY`, `http_proxy`, `HTTPS_PROXY`, `https_proxy`) and `NO_PROXY=localhost,127.0.0.1` so that child processes (Node.js utility workers, gRPC clients, Language Server) properly inherit proxy routes on Windows.

#### 🐧 Dynamic WSL (Windows Subsystem for Linux) Self-Healing & Mirrored Networking
- **Zero-Hardcoding Distro Discovery:** Dynamically discovers all installed WSL distributions via `\\wsl.localhost\`, `\\wsl$\`, and the Windows Registry (`HKCU\...\Lxss`), without hardcoding distribution names.
- **Linux ELF Bytecode Patching:** Recursively discovers and patches Linux ELF `language_server` binaries across all user homes inside all WSL distros with the IDA bytecode unlock (`hasValidAuth = 1`).
- **Mirrored Networking Auto-Configuration:** Deploys `networkingMode=mirrored`, `dnsTunneling=true`, and `autoProxy=true` in `%USERPROFILE%\.wslconfig` cleanly while preserving all existing user settings.
- **Dynamic Shell Bridge Injection:** Injects dynamic proxy environment variables idempotently into `.bashrc` and `.zshrc` across all WSL distribution users.

#### πŸ›‘οΈ Dynamic Binary Flag Probing & Exit Status 2 Crash Prevention (#48)
- **Runtime Flag Probing:** Dynamically probes binary `--help` output before injecting `-stubby_auth_mode` or `-use_snapshot_mendelfp` flags into enterprise and wrapper profiles.
- **Fail-Safe Startup:** Prevents `language_server` crashes with `exit status 2: flags provided but not defined` on newer and older Google Antigravity core engine builds.

---

## [5.4.7] - 2026-11-08

### ⚑ Extension 1.10.0 Support, Multi-Editor Discovery, Account Manager & Dynamic Launcher
Expand Down
9 changes: 8 additions & 1 deletion cmd/antigravity/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/tawroot/antigravity-cleaner/pkg/updater"
)

const Version = "5.4.7"
const Version = "5.4.8"

func init() {
patcher.RegisterPostInstallHook(func(logger patcher.LogFunc) {
Expand Down Expand Up @@ -480,6 +480,13 @@ func runQuickAutoFix() {
ui.PrintStatus("INFO", "Enterprise Wrapper", "Standalone mode (Core path detected on launch)")
}

// Dynamic WSL environment healing & mirrored networking on Windows
if runtime.GOOS == "windows" {
if wslReport, err := patcher.PatchAllWsl(nil); err == nil && len(wslReport.DistrosFound) > 0 {
ui.PrintStatus("OK", "WSL Environment", fmt.Sprintf("%d distros patched (Mirrored Networking active)", len(wslReport.DistrosFound)))
}
}

fmt.Println()
fmt.Println(lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("#FF79C6")).Render(" Step 4: Surgical Quota, DIPS & Network Cache Reset..."))
if removed, err := cleaner.SurgicalReset429("", false); err != nil {
Expand Down
8 changes: 5 additions & 3 deletions install.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ErrorActionPreference = "SilentlyContinue"
$GithubBaseUrl = "https://github.com/tawroot/antigravity-cleaner/releases/latest/download"
$GithubBaseUrl = "https://github.com/dalroot/antigravity-cleaner/releases/latest/download"
$ExeName = "antigravity-cleaner-windows-amd64.exe"

$HomePath = if ($IsWindows -or $env:OS -like "*Windows*") { $env:USERPROFILE } else { $env:HOME }
Expand Down Expand Up @@ -28,7 +28,7 @@ try {
catch {
Write-Host "Falling back to legacy PowerShell engine..." -ForegroundColor Gray
$LegacyScript = Join-Path $InstallDir "Antigravity.ps1"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/tawroot/antigravity-cleaner/main/legacy/Antigravity.ps1" -OutFile $LegacyScript -UseBasicParsing
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/dalroot/antigravity-cleaner/main/legacy/Antigravity.ps1" -OutFile $LegacyScript -UseBasicParsing
Start-Process powershell.exe -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$LegacyScript`""
exit 0
}
Expand All @@ -53,10 +53,12 @@ if ($UserPath -notlike "*$InstallDir*") {
[Environment]::SetEnvironmentVariable("PATH", "$UserPath;$InstallDir", "User")
Write-Host "Added $InstallDir to user PATH." -ForegroundColor Cyan
}
# Immediately update current session PATH
$env:PATH = "$env:PATH;$InstallDir"

Write-Host ""
Write-Host "Installation Complete! Launching Antigravity Cleaner..." -ForegroundColor Green
Write-Host "⭐ If this tool helped you, please star our repository on GitHub:" -ForegroundColor Yellow
Write-Host " https://github.com/tawroot/antigravity-cleaner" -ForegroundColor Cyan
Write-Host " https://github.com/dalroot/antigravity-cleaner" -ForegroundColor Cyan
Write-Host ""
Start-Process $TargetFile
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -e

APP_NAME="antigravity-cleaner"
INSTALL_DIR="${HOME}/.local/bin"
REPO="tawroot/antigravity-cleaner"
VERSION="v5.4.7"
REPO="dalroot/antigravity-cleaner"
VERSION="v5.4.8"

echo "===================================================="
echo " ⚑ Antigravity Cleaner β€” Universal AI Freedom Toolkit (${VERSION})"
Expand Down Expand Up @@ -78,5 +78,5 @@ fi

echo ""
echo -e "\033[1;33m⭐ If Antigravity Cleaner helped you, please give it a star on GitHub:\033[0m"
echo -e "\033[1;36m https://github.com/tawroot/antigravity-cleaner\033[0m"
echo -e "\033[1;36m https://github.com/dalroot/antigravity-cleaner\033[0m"
echo ""
8 changes: 7 additions & 1 deletion pkg/account/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ var hubDirs = []string{
"Local Storage",
"Session Storage",
"Partitions",
"Network",
}

var hubCacheExcludes = []string{
Expand Down Expand Up @@ -349,12 +350,17 @@ func SwitchAccount(name string, dbPath string) error {
_ = keyring.Set("gemini", "antigravity", secret)
}

// 0b. Restore ~/.gemini/jetski-standalone-oauth-token for file-token mode (SSH spoofing)
// 0b. Restore ~/.gemini/jetski-standalone-oauth-token and Hub dir for file-token mode (SSH spoofing)
tokenFilePath := StandaloneTokenFilePath()
if tokenFilePath != "" && secret != "" {
_ = os.MkdirAll(filepath.Dir(tokenFilePath), 0700)
_ = os.WriteFile(tokenFilePath, []byte(secret), 0600)
}
if hubDir != "" && secret != "" {
_ = os.WriteFile(filepath.Join(hubDir, "jetski-standalone-oauth-token"), []byte(secret), 0600)
_ = os.MkdirAll(filepath.Join(hubDir, "User"), 0700)
_ = os.WriteFile(filepath.Join(hubDir, "User", "jetski-standalone-oauth-token"), []byte(secret), 0600)
}

// 1. Restore Hub files
for _, f := range hubFiles {
Expand Down
22 changes: 21 additions & 1 deletion pkg/patcher/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func scanWindowsProcess(targetName string) string {
cleanName := strings.TrimSuffix(targetName, ".exe")
filter := fmt.Sprintf("*%s*", cleanName)
cmd := exec.Command("powershell", "-NoProfile", "-NonInteractive", "-Command",
fmt.Sprintf("(Get-Process | Where-Object { $_.Name -like '%s' -or $_.ProcessName -like '%s' } | Select-Object -ExpandProperty Path -ErrorAction SilentlyContinue)", filter, filter))
fmt.Sprintf("(Get-Process -Name '%s' -ErrorAction SilentlyContinue).Path", filter))
out, err := cmd.Output()
if err == nil {
lines := strings.Split(strings.TrimSpace(string(out)), "\n")
Expand Down Expand Up @@ -535,6 +535,8 @@ func GetStandardLanguageServerCandidates() []string {
filepath.Join(os.Getenv("LOCALAPPDATA"), "Programs", "Antigravity IDE"),
filepath.Join(os.Getenv("PROGRAMFILES"), "Antigravity"),
filepath.Join(os.Getenv("ProgramFiles(x86)"), "Antigravity"),
filepath.Join(home, "scoop", "apps", "antigravity-ide", "current"),
filepath.Join(home, "scoop", "apps", "antigravity", "current"),
filepath.Join(home, "antigravity"),
}

Expand Down Expand Up @@ -698,7 +700,13 @@ func FindAllLanguageServers(logger LogFunc) []string {
filepath.Join(os.Getenv("LOCALAPPDATA"), "Programs", "Antigravity IDE"),
filepath.Join(os.Getenv("PROGRAMFILES"), "Antigravity"),
filepath.Join(os.Getenv("ProgramFiles(x86)"), "Antigravity"),
filepath.Join(home, "scoop", "apps", "antigravity-ide", "current"),
filepath.Join(home, "scoop", "apps", "antigravity", "current"),
)
// Scan all registered and active WSL distributions for Linux language_server ELF binaries
for _, wslServer := range FindAllWslLanguageServers(logger) {
add(wslServer)
}
} else if runtime.GOOS == "linux" {
candidateRoots = append(candidateRoots,
filepath.Join(home, "Applications", "Antigravity"),
Expand Down Expand Up @@ -778,6 +786,18 @@ func FindLanguageServerModular(logger LogFunc) string {
func FindRunningLanguageServerPID() int {
selfPid := os.Getpid()

if runtime.GOOS == "windows" {
cmd := exec.Command("powershell", "-NoProfile", "-NonInteractive", "-Command",
"(Get-Process -Name '*language_server*' -ErrorAction SilentlyContinue | Select-Object -First 1).Id")
if out, err := cmd.Output(); err == nil {
var pid int
if _, err := fmt.Sscanf(strings.TrimSpace(string(out)), "%d", &pid); err == nil && pid > 0 {
return pid
}
}
return 0
}

if runtime.GOOS == "linux" {
entries, err := os.ReadDir("/proc")
if err == nil {
Expand Down
107 changes: 107 additions & 0 deletions pkg/patcher/flags.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
package patcher

import (
"bufio"
"bytes"
"context"
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
"strings"
"time"
)

// defaultFlagsLogger provides structured logging with [FLAGS] tag
Expand Down Expand Up @@ -136,6 +144,105 @@ func BuildServerFlags(opts EnterpriseFlagsOptions, logger LogFunc) []string {
return flags
}

// DetectSupportedFlags inspects a language_server binary to determine which CLI flags it natively supports.
// It executes '<binPath> --help' with a short timeout and parses the usage declaration.
// This prevents fatal Go runtime exits (status 2: 'flags provided but not defined') across different core builds (Issue #48).
func DetectSupportedFlags(binPath string) (map[string]bool, error) {
if binPath == "" {
return nil, fmt.Errorf("empty binary path")
}
if fi, err := os.Stat(binPath); err != nil || fi.IsDir() {
return nil, fmt.Errorf("invalid binary path %q: %w", binPath, err)
}

supported := make(map[string]bool)

// 1. Proactive execution probe with --help
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()

cmd := exec.CommandContext(ctx, binPath, "--help")
output, _ := cmd.CombinedOutput()
if len(output) > 0 {
scanner := bufio.NewScanner(bytes.NewReader(output))
for scanner.Scan() {
line := strings.TrimSpace(scanner.Text())
if strings.HasPrefix(line, "-") {
parts := strings.SplitN(line, ":", 2)
flagPart := strings.TrimLeft(parts[0], "-")
flagName := strings.TrimSpace(strings.SplitN(flagPart, "=", 2)[0])
if flagName != "" {
supported[flagName] = true
}
}
}
}

if len(supported) > 0 {
return supported, nil
}

// 2. Fallback: Scan binary content for known flag string markers if --help yielded nothing
data, err := os.ReadFile(binPath)
if err != nil {
return nil, err
}

candidateMarkers := []string{
"disable_telemetry",
"is_google_internal",
"jetbox_release_channel",
"stubby_auth_mode",
"use_stubby_auth",
"use_local_chrome",
"browser_eval_env",
"local_chrome_headless",
}

for _, m := range candidateMarkers {
if bytes.Contains(data, []byte(m)) {
supported[m] = true
}
}

return supported, nil
}

// FilterSupportedFlags validates candidate flags against the binary's actual registered flags.
// If supported flags cannot be probed (e.g. non-binary or mock test file), candidates are retained.
func FilterSupportedFlags(binPath string, candidateFlags []string, logger LogFunc) []string {
if binPath == "" || len(candidateFlags) == 0 {
return candidateFlags
}

supported, err := DetectSupportedFlags(binPath)
if err != nil || len(supported) == 0 {
return candidateFlags
}

binBase := filepath.Base(binPath)
var filtered []string
for _, flag := range candidateFlags {
flagName := strings.TrimLeft(flag, "-")
flagName = strings.TrimSpace(strings.SplitN(flagName, "=", 2)[0])
if supported[flagName] {
filtered = append(filtered, flag)
} else {
if logger != nil {
logger("Probed %s: filtered unsupported runtime flag %s (preventing status 2 crash, closes #48)", binBase, flag)
}
}
}

return filtered
}

// BuildServerFlagsForBinary generates safe, verified CLI arguments specifically tailored for the target binary.
func BuildServerFlagsForBinary(binPath string, opts EnterpriseFlagsOptions, logger LogFunc) []string {
candidateFlags := BuildServerFlags(opts, logger)
return FilterSupportedFlags(binPath, candidateFlags, logger)
}


// MergeLaunchArguments merges recommended flags into an existing argument list without duplicates
func MergeLaunchArguments(existingArgs []string, opts EnterpriseFlagsOptions, logger LogFunc) []string {
Expand Down
Loading
Loading