Available Targets
TheTarget enum defines four compilation targets:
lib/src/engine/compiler/compiler.dart:6-11
Target Details
exe
Native executable with the Dart VM embedded. Self-contained and ready to run.
aot
AOT snapshot for pre-compiled native code. Fastest startup and execution.
jit
JIT snapshot with optimized bytecode. Requires Dart runtime to execute.
kernel
Raw kernel bytecode (.dill). Intermediate format for further processing.
Executable (exe)
File Extension: None (platform-specific executable) Use Cases:- Standalone CLI tools
- Desktop applications
- Production deployments where no Dart SDK is available
- Self-contained binary with embedded Dart VM
- Largest file size (includes runtime)
- No external dependencies
- Platform-specific (Windows .exe, macOS/Linux binary)
AOT Snapshot (aot)
File Extension:.aot
Use Cases:
- Performance-critical applications
- Server-side deployments
- Mobile apps (Flutter)
- Minimal startup time requirements
- Pre-compiled to native machine code
- Fastest execution and startup
- Requires
dartaotruntimeto execute - Smaller than exe, larger than JIT
- Best runtime performance
JIT Snapshot (jit)
File Extension:.jit
Use Cases:
- Development and testing
- Applications with dynamic code patterns
- Scenarios where AOT restrictions apply
- Optimized bytecode with type feedback
- Requires full Dart VM to execute
- Smaller file size than AOT
- Slower startup than AOT
- Supports dynamic features better than AOT
Kernel (kernel)
File Extension:.dill
Use Cases:
- Inspecting obfuscated bytecode
- Further processing or analysis
- Integration with custom tooling
- Debugging obfuscation passes
- Raw Dart kernel intermediate representation
- Can be inspected with
refractor inspect - Smallest file size
- Not directly executable
- Platform-independent
Build Pipeline
All targets follow the same obfuscation pipeline:
Source:
lib/src/engine/engine.dart:39-85
Performance Comparison
| Target | File Size | Startup Time | Runtime Performance | Deployment |
|---|---|---|---|---|
| exe | Largest | Fast | Very Fast | Easiest |
| aot | Large | Fastest | Fastest | Requires runtime |
| jit | Medium | Medium | Fast | Requires VM |
| kernel | Smallest | N/A | N/A | Not executable |
Choosing the Right Target
When to use exe
When to use exe
Choose
exe when:- You need a single file with no dependencies
- Distributing to users without Dart SDK
- Building CLI tools or standalone apps
- File size is not a critical constraint
When to use aot
When to use aot
Choose
aot when:- Performance is the top priority
- You’re deploying to servers with
dartaotruntime - Building Flutter mobile apps
- You need the fastest possible startup
When to use jit
When to use jit
Choose
jit when:- You need dynamic code features
- File size matters more than startup time
- Deploying to environments with Dart VM
- AOT compilation limitations are blocking
When to use kernel
When to use kernel
Choose
kernel when:- Inspecting obfuscation results
- Building custom tooling
- Debugging pass behavior
- You need platform-independent bytecode
Inspecting Kernel Output
You can inspect any.dill file (including intermediate and final kernel targets) using:
Target Selection Examples
Next Steps
Configuration
Configure obfuscation passes and settings
Debugging
Learn to debug obfuscated builds with symbol maps