Skip to main content

Prerequisites

Refractor requires the Dart SDK version 3.10.0 or later.
1

Check your Dart version

Verify that you have Dart installed:
dart --version
You should see output like:
Dart SDK version: 3.10.0 (stable)
If you don’t have Dart installed or need to upgrade, visit the official Dart installation guide.
2

Install Refractor globally

Install Refractor from the GitHub repository:
dart pub global activate --source git https://github.com/yardexx/refractor.git
This installs the refractor command globally on your system.
The installation may take a few minutes as it compiles the tool and its dependencies.
3

Verify the installation

Confirm that Refractor is installed correctly:
refractor --help
You should see the help output:
Dart kernel (.dill) obfuscation tool — rename, encrypt, and obfuscate.

Usage: refractor <command> [arguments]

Global options:
-h, --help    Print this usage information.

Available commands:
  build      Compile, obfuscate, and build to a target format.
  completion Generate completion script for bash or zsh.
  init       Create a refractor.yaml config template.
  inspect    Print a tree representation of a .dill file.

Shell Completion (Optional)

Refractor supports shell completion for bash and zsh. To enable it:
# Generate completion script
refractor completion bash > ~/.refractor-completion.bash

# Add to your ~/.bashrc or ~/.bash_profile
echo 'source ~/.refractor-completion.bash' >> ~/.bashrc
source ~/.bashrc
After enabling completion, you can use Tab to autocomplete commands and options.

Updating Refractor

To update Refractor to the latest version:
dart pub global activate --source git https://github.com/yardexx/refractor.git
This command reinstalls Refractor from the repository, pulling the latest changes.

Uninstalling Refractor

To remove Refractor from your system:
dart pub global deactivate refractor

Troubleshooting

If you get a “command not found” error, ensure that Dart’s global bin directory is in your PATH:
# Add to ~/.bashrc, ~/.zshrc, or equivalent
export PATH="$PATH:$HOME/.pub-cache/bin"
Then restart your terminal or run source ~/.bashrc (or ~/.zshrc).
If you see an error about SDK constraints:
The current Dart SDK version is X.Y.Z.
Because refractor requires SDK version ^3.10.0, version solving failed.
Update your Dart SDK to version 3.10.0 or later.
The initial installation compiles Refractor from source, which includes:
  • Dart kernel manipulation libraries
  • CLI dependencies
  • Code generation for configuration
This is normal and only happens during installation. Subsequent runs will be fast.

Next Steps

Quickstart

Get started with your first obfuscated build

Commands

Explore all available commands and options

Configuration

Learn how to configure obfuscation passes

Obfuscation Passes

Understand rename, string encryption, and dead code injection

Build docs developers (and LLMs) love