Skip to content

fix: use the embedded CurseForge API key in local debug builds - #455

Merged
futrime merged 1 commit into
mainfrom
claude/curseforge-403-levilauncher-windows-bcca15
Nov 10, 2026
Merged

futrime merged 1 commit into
mainfrom
claude/curseforge-403-levilauncher-windows-bcca15

Conversation

@futrime

@futrime futrime commented Nov 10, 2026

Copy link
Copy Markdown
Member

Problem

Local builds have an empty curseforge.api_key in local.properties. Every CurseForge request then sends an empty x-api-key header, and CurseForge returns 403. LeviLauncher for Windows does not hit this because it embeds an obfuscated key (internal/curseforge/apikey.bin).

Changes

  • Add app/curseforge-debug-apikey.bin, the same obfuscated key the Windows launcher embeds (base64, then XOR 0xAF).
  • app/build.gradle falls back to that key only when all of these hold:
    • it is a debug build
    • curseforge.api_key is empty
    • the CI environment variable is not set
  • Release, beta and CI builds still use only local.properties.
  • CurseForgeClient now says, on 401/403, whether the key is missing from the build or was rejected.

Testing

  • Checked the generated BuildConfig key length:
    • local debug: 60
    • release and beta: 0
    • debug with CI=true: 0
  • :app:compileDebugJavaWithJavac passes. The native build was skipped.
  • Not tested on a device.

Local builds had an empty curseforge.api_key, so every CurseForge request
returned 403. Local debug builds now fall back to the same obfuscated key
that LeviLauncher for Windows embeds. Release, beta and CI builds still
use only local.properties.

CurseForge 401/403 responses now say whether the key is missing or was
rejected.
@futrime
futrime merged commit e1fe07d into main Nov 10, 2026
4 checks passed
@futrime
futrime deleted the claude/curseforge-403-levilauncher-windows-bcca15 branch November 10, 2026 14:37
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.

1 participant