Skip to main content

What is Refractor?

Refractor is a powerful Dart kernel (.dill) obfuscation tool that protects your compiled Dart applications from reverse engineering and static analysis. It compiles your Dart code to kernel bytecode, applies configurable obfuscation transformations, and outputs production-ready executables, AOT snapshots, JIT snapshots, or kernel files.
Refractor is in early stages of development. Real impact at the generated binary may differ from expectations.

Key Features

Identifier Renaming

Rewrites class, method, and field names to short meaningless identifiers

String Encryption

Replaces string literals with XOR-encoded byte arrays and runtime decoder

Dead Code Injection

Inserts unreachable branches to hinder static analysis and decompilers

Multiple Build Targets

Output as executable, AOT snapshot, JIT snapshot, or kernel file

Symbol Map

JSON mapping of obfuscated names back to originals for debugging

Configurable Exclusions

Glob-based patterns to exclude generated files and specific libraries

How It Works

Refractor operates in four stages:
1

Compile to Kernel

Your Dart entrypoint is compiled to kernel bytecode (.dill format)
2

Apply Obfuscation Passes

Configured passes transform the kernel AST: renaming identifiers, encrypting strings, and injecting dead code
3

Write Obfuscated Kernel

The transformed kernel is written to an intermediate .dill file
4

Compile to Target

The obfuscated kernel is compiled to your target format (exe, AOT, JIT, or kernel)

Use Cases

  • Mobile app protection — Obfuscate Flutter apps before release to app stores
  • CLI tool distribution — Protect proprietary business logic in command-line tools
  • Server-side code — Harden Dart backend services against reverse engineering
  • Library distribution — Protect algorithms and IP in published packages

Quick Example

# Install Refractor
dart pub global activate --source git https://github.com/yardexx/refractor.git

# Initialize configuration
refractor init

# Build with obfuscation
refractor build --target exe --output build

Next Steps

Installation

Install Refractor and set up your environment

Quickstart

Build your first obfuscated application in minutes

Commands

Explore the command-line interface

Configuration

Configure obfuscation passes and options

Build docs developers (and LLMs) love