Skip to content

hyunnnchoi/CodexBar-android

Repository files navigation

CodexBar for Android

Android port of CodexBar by @steipete — the macOS menu bar app for monitoring AI service quotas.

Monitor your AI service quotas from your Android device. Track remaining usage for Claude, Codex (ChatGPT), and Gemini in one place.

Dashboard    Settings

Features

  • Real-time quota monitoring for Claude, Codex, and Gemini (more services coming soon)
  • Animated gauge bars showing remaining usage percentage
  • Quick Settings tile for at-a-glance status
  • Background refresh with configurable intervals
  • Persistent notification with per-service breakdown
  • Push alert when quota resets (fully replenished)
  • Encrypted credential storage
  • Material 3 with Dynamic Color

Download

Pre-built APKs are available on the Releases page.

I do system software for a living — I'm not smart enough to sneak viruses into an Android app.

No backend server — all tokens are processed and stored strictly on-device.

Setup

  1. Install OpenJDK 17 (or any JDK 17+)
  2. Clone and open in Android Studio
  3. Build and install the debug APK
  4. Open the app and go to Settings to enter your API tokens

Getting Your Tokens

Claude (Anthropic)

Claude uses OAuth tokens from Claude Code CLI. Extract from macOS Keychain:

security find-generic-password -s "Claude Code-credentials" -w \
  | python3 -c "import sys,json; print(json.loads(sys.stdin.read())['accessToken'])"

Paste the resulting token into the Claude access token field in Settings.

Codex (OpenAI / ChatGPT)

If you have the Codex CLI installed and logged in, extract tokens from ~/.codex/auth.json:

# Access token
cat ~/.codex/auth.json | python3 -c "import sys,json; print(json.loads(sys.stdin.read())['tokens']['access_token'])"

# Refresh token
cat ~/.codex/auth.json | python3 -c "import sys,json; print(json.loads(sys.stdin.read())['tokens']['refresh_token'])"

Paste both into the Codex fields in Settings.

Alternative: Extract from browser (if CLI is not installed)
  1. Open chatgpt.com in your browser
  2. Open DevTools (F12) > Network tab
  3. Look for requests to https://chatgpt.com/backend-api/
  4. Copy the Authorization: Bearer ... token from request headers

Gemini (Google)

Gemini requires 4 values: access token, refresh token, OAuth client ID, and OAuth client secret. The client ID/secret are needed because Gemini uses Google OAuth for token refresh.

If you have the Gemini CLI installed and logged in:

# 1. Access token
python3 -c "import json; print(json.load(open('$HOME/.gemini/oauth_creds.json'))['access_token'])"

# 2. Refresh token
python3 -c "import json; print(json.load(open('$HOME/.gemini/oauth_creds.json'))['refresh_token'])"

# 3. OAuth Client ID & Secret (from Gemini CLI source)
oauth_js="$(dirname "$(which gemini)")/../lib/node_modules/@google/gemini-cli/node_modules/@google/gemini-cli-core/dist/src/code_assist/oauth2.js"
python3 -c "
import re, sys
text = open('$oauth_js').read()
cid = re.search(r\"OAUTH_CLIENT_ID\s*=\s*'([^']+)'\", text)
sec = re.search(r\"OAUTH_CLIENT_SECRET\s*=\s*'([^']+)'\", text)
print('Client ID:', cid.group(1) if cid else 'not found')
print('Client Secret:', sec.group(1) if sec else 'not found')
"

Paste all four values into the Gemini fields in Settings.

Build

./gradlew assembleDebug

APK output: app/build/outputs/apk/debug/app-debug.apk

Tech Stack

  • Kotlin 2.1.0, Jetpack Compose, Material 3
  • Hilt (DI), Retrofit2 + OkHttp (networking)
  • WorkManager (background sync), EncryptedSharedPreferences (security)
  • KSP, kotlinx.serialization

Acknowledgments

Based on CodexBar by Peter Steinberger.

License

MIT