Skip to main content

stealth_enum_generator 2.2.1 copy "stealth_enum_generator: ^2.2.1" to clipboard
stealth_enum_generator: ^2.2.1 copied to clipboard

Code generator for stealth_enum that transforms private enums into zero-cost obfuscated extension types to eliminate AOT binary metadata.

2.2.1 #

Improvements & Hardening #

  • Added support for project-wide secret keys via build.yaml (options.config['key']) and STEALTH_ENUM_KEY CI environment variable.
  • Added 'fromRawValue' to _reservedNames validation set to prevent constructor collisions when defining enum constants.
  • Hardened empirical AOT verification script (scripts/verify_aot_strings.sh) with -S <symbols> to strip debug symbols on Dart AOT compiles and added real Flutter arm64 APK inspection support.
  • Comprehensive unit tests covering defaultKey options and fromRawValue collision validation.
  • Requires stealth_enum: ">=2.2.1 <3.0.0".
  • Zero hash churn: preserves exact 2.2.0 HMAC-SHA256 derivation for existing constants.

2.2.0 #

Security & Hardening #

  • Hashing upgraded from linear FNV-1a to keyed HMAC-SHA256: eliminates XOR differential attacks (valA ^ valB no longer cancels the key or enum name).
  • Added support for key: String? parameter in @StealthEnum(key: '...').
  • Enforced private enum declarations: generates a descriptive InvalidGenerationSourceError if @StealthEnum is placed on a public enum without a leading underscore (_).
  • Added keyword reservation check: throws a compile-time error if an enum constant collides with a generated extension type member (when, orElse, isValid, etc.).
  • Added strict range validation to @StealthValue: throws a compile-time error on negative integers or values below 0x1000.
  • 15 comprehensive unit tests verifying code emission and non-vacuous validation error logging.

2.1.0 #

New Features & Improvements #

  • Deterministic 32-bit FNV-1a hashing: Replaced Dart runtime hashCode with 32-bit FNV-1a hashing over (seed ?? 0xDEADBEEF) ^ fnv1a(publicName) ^ fnv1a(fieldName). Provides independent per-constant hash values: inserting, reordering, or removing constants leaves other values untouched.
  • Added @StealthValue(int) support: Enum constants annotated with @StealthValue(value) use the exact specified 32-bit hex/int value, allowing frozen values for database and external API stability.
  • Decoupled toJson() and fromJson(int): Integer-based serialization helpers are now generated by default on all extension types with zero string overhead.
  • generateLabel: true now exclusively generates .label and byLabel() string helpers.
  • 10 comprehensive unit tests using build_test testing actual generated code across all options, FNV-1a stability, @StealthValue, and error handling.

2.0.1 #

  • Updated README.md, example code, and package-level llms.txt to accurately reference stealth_enum: ^2.0.0 and stealth_enum_generator: ^2.0.0.
  • Synchronized documentation and examples across the package.

2.0.0 #

  • Added generateLabel code path in StealthEnumGenerator. When @StealthEnum(generateLabel: true), the generator emits .label getter, byLabel(String), toJson(), and fromJson(int) helpers alongside the existing int-backed extension type.
  • Added inline security comment block in generated label section explaining the string-in-binary trade-off.
  • Requires stealth_enum: ^2.0.0.

1.0.5 #

  • Added tryFromRawValue() generation for safe, null-returning integer parsing.
  • Added isValid boolean getter generation for variant validation.
  • 100% test coverage maintained.

1.0.4 #

  • Security hardening: .when() now generates explicit hex conditions for every enum constant.
  • Wildcard branch _ => throw StateError('') fails closed on unknown or corrupted integers without leaking strings.
  • 100% test coverage maintained.

1.0.3 #

  • Added fromRawValue factory constructor to generated extension types for zero-cost runtime deserialization.
  • Added unit test suite for generator and builder.
  • Achieved 100% test coverage.
  • Updated CI/CD workflow actions.

1.0.1 #

  • Improved README formatting and documentation.
  • Updated badges.

1.0.0 #

  • Production ready 1.0.0 release.
  • Updated dependency to support stealth_enum ^1.0.0.

0.1.1 #

  • Added package example in example/example.dart.
  • Added dartdoc comment for StealthEnumGenerator constructor.
  • Fixed unresolved doc reference build.yaml in builder.dart.
  • Refined package description to adhere to pub.dev length guidelines.
  • Broadened analyzer compatibility for EnumElement constants across versions.

0.1.0 #

  • Initial release.
  • StealthEnumGenerator using source_gen 4.x and analyzer 14.x.
  • Deterministic collision-free 32-bit value generation (seeded from enumName ^ fieldName ^ 0xDEADBEEF).
  • SharedPartBuilder integration for .g.dart sharing.
  • Security-first code emission: wildcard final branch, @pragma('vm:prefer-inline').
12
likes
0
points
588
downloads

Publisher

verified publisheraslamambiloly.2bd.net

Weekly Downloads

Code generator for stealth_enum that transforms private enums into zero-cost obfuscated extension types to eliminate AOT binary metadata.

Repository (GitHub)
View/report issues

Topics

#security #obfuscation #reverse-engineering #code-generation #build-runner

License

unknown (license)

Dependencies

analyzer, build, crypto, source_gen, stealth_enum

More

Packages that depend on stealth_enum_generator