Skip to content

feat: introduce dedicated Antigravity CLI (agy) path setting with multi-architecture eligibility patcher#3252

Open
yhan-sun wants to merge 2 commits into
lbjlaq:mainfrom
yhan-sun:main
Open

feat: introduce dedicated Antigravity CLI (agy) path setting with multi-architecture eligibility patcher#3252
yhan-sun wants to merge 2 commits into
lbjlaq:mainfrom
yhan-sun:main

Conversation

@yhan-sun

Copy link
Copy Markdown

💡 Background

In newer versions of the Google Antigravity CLI binary client (agy / antigravity.exe 1.1.2 and above), a local Eligibility Check is enforced. If the user's Google account is not configured as eligible on the server, the client intercepts inputs in the interactive terminal (TUI) and prompts:
Your current account is not eligible for Antigravity...

This prevents unauthorized accounts from starting local conversations. This Pull Request implements an instruction-level pattern matching patcher that dynamically bypasses this local gate without modifying network configurations.


🛠️ Key Changes

  1. Dedicated CLI Path Settings:

    • Introduced a new antigravity_cli_executable configuration field to the backend configuration schema (AppConfig) and TypeScript types (types/config.ts).
    • Added a dedicated setting input under the "Advanced Settings" UI panel for the CLI path. The application now separates paths for Antigravity Classic, Antigravity IDE, and Antigravity CLI (agy).
    • Moved the eligibility check bypass patching section to reside under the newly added CLI Path configuration since the patching applies only to the agy binary.
  2. Rust Backend (src-tauri):

    • Added the Tauri command patch_agy_binary (patch.rs).
    • Multi-Architecture Support:
      • macOS (ARM64): Scans machine code by 4-byte (32-bit aligned) strides to dynamically locate the userInputLoop instruction pattern (ldrb, tbnz, ldr, and cbz) and overwrites the conditional branch cbz to b (unconditional jump to the send path) to bypass the gate. Also handles macOS ad-hoc code re-signing.
      • Windows/Linux (x86_64 PE/ELF): Scans for the x86_64 verification gate pattern: cmpb $0x0, (%r12), jne label, leaq rip_off, %rax, mov $0x18, %ebx. Dynamically replaces the conditional jump instruction jne with NOP (6 bytes of 0x90) to bypass the gate.
    • Handles backing up the binary to .bak.
    • Added get_antigravity_cli_path for detecting standard installer locations (~/.local/bin/agy or environment PATH).
  3. React Frontend UI (src):

    • Configured the Advanced Settings tab in Settings.tsx to integrate selection, detection, clearing, and triggering of the patching command against the CLI path.
    • Added translation keys for Chinese and English.

🧪 Tested & Verified

  • Platform: macOS (ARM64) & Windows (x64)
  • Target Binary: Antigravity CLI 1.1.2
  • Result: Successfully bypassed the Eligibility Check failed window and restored fully working AI interactions in the terminal for standard Google accounts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants