StringShield class
Singleton manager for runtime string deobfuscation.
Provides optional caching of deobfuscated values and tracks deobfuscation statistics.
StringShield().init(StringShieldConfig(
enableCache: true,
enableStats: true,
));
// Access stats:
print(StringShield().deobfuscationCount);
Constructors
- StringShield()
-
Returns the singleton StringShield instance.
factory
Properties
- cacheSize → int
-
The number of entries currently in the cache.
no setter
- config → StringShieldConfig
-
The current configuration.
no setter
- deobfuscationCount → int
-
The total number of deobfuscation operations performed.
no setter
-
fieldAccessCounts
→ Map<
String, int> -
Per-field access counts.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCacheEnabled → bool
-
Whether caching is enabled.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearCache(
) → void - Clears the deobfuscation cache.
-
getCached(
String fieldKey) → String? -
Returns a cached value for
fieldKey, or null if not cached. -
init(
StringShieldConfig config) → void -
Initializes the StringShield with the given
config. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recordAccess(
String fieldKey) → void - Records a deobfuscation event for statistics.
-
reset(
) → void - Resets the StringShield to its default state.
-
setCached(
String fieldKey, String value) → void -
Stores a deobfuscated
valuein the cache underfieldKey. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited