Skip to content

Keep reai.json in Ghidra's user settings directory - #212

Open
felipe-dos-santos81 wants to merge 1 commit into
RevEngAI:mainfrom
felipe-dos-santos81:portable-settings
Open

felipe-dos-santos81 wants to merge 1 commit into
RevEngAI:mainfrom
felipe-dos-santos81:portable-settings

Conversation

@felipe-dos-santos81

Copy link
Copy Markdown

Problem

ReaiPluginPackage.DEFAULT_CONFIG_PATH is ~/.reai/reai.json. The setup wizard writes the API key and hostnames there, outside Ghidra's settings directory.

Portable Ghidra installs (-Dapplication.settingsdir=... in launch.properties) expect every per-user file under that directory. With the current default, separate installs share one key file in the home directory.

Change

DEFAULT_CONFIG_PATH is now Application.getUserSettingsDirectory()/reai/reai.json. SetupWizardManager already creates the parent directory, and a config file override passed to the wizard still works.

Notes for review

  • An existing ~/.reai/reai.json is neither read nor migrated, so users enter their API key once more in the setup wizard. A fallback that reads the old file would be easy to add if you prefer that.
  • Tests that rely on the old path were left unchanged.

Testing

  • Built with gradle buildExtension against Ghidra 12.1.4, on Linux arm64.
  • A headless check confirmed that DEFAULT_CONFIG_PATH resolves under Application.getUserSettingsDirectory(), which was set to a portable directory.

🤖 Generated with Claude Code

The API key config went to ~/.reai/reai.json. It now defaults to
<Ghidra user settings>/reai/reai.json, so portable Ghidra installs
(application.settingsdir) keep it with the rest of their settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@felipe-dos-santos81
felipe-dos-santos81 requested a review from a team as a code owner October 8, 2026 19:50
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