flutter_neo_shield 0.5.0
flutter_neo_shield: ^0.5.0 copied to clipboard
Client-side PII protection toolkit for Flutter. Secures sensitive data from logs and clipboard, protects memory, and obfuscates strings in binaries.
0.5.0 #
Security Hardening (47 issues fixed across all modules) #
Breaking Changes
- LogShield:
sanitizeInDebugnow defaults totrue(PII hidden in all modes). SetsanitizeInDebug: falseto see raw values during development. - StringShield:
enableCachenow defaults tofalse(opt-in). Cached plaintext secrets in memory were a security risk. SetenableCache: trueif you need the performance. - LogShieldConfig:
timestampFormatreplaced withshowTimestamp(bool). ISO 8601 is always used when enabled. - PIIDetector: Minimum name length for
registerName()increased from 2 to 3 characters to reduce false positives. - ClipboardShield:
cancelAutoClear()is now@visibleForTesting. UseclearNow()instead. - MemoryShield:
register()/unregister()now acceptSecureDisposableinstead ofdynamic. - Pubspec:
source_gen,build, andanalyzermoved fromdependenciestodev_dependencies. Consumers no longer pull in the analyzer toolchain.
RASP Shield
- Fail-closed by default: Platform errors now report threats as detected instead of silently passing. Controlled via
RaspChannel.failClosed. - Parallel checks:
fullSecurityScan()runs all 6 checks in parallel to reduce TOCTOU window. - SecurityMode enforcement:
fullSecurityScan()now acceptsmodeparameter (strictthrowsSecurityException,warnlogs,custominvokes callback). - Android fail-closed:
checkHooksandcheckIntegrityreturntrue(detected) whenapplicationContextis null.
Log Shield
- Stack traces sanitized:
shieldLogError()now runs PII detection on stack traces in release mode. - Dead code removed:
timestampFormatconfig replaced with workingshowTimestampboolean.
Memory Shield
- Type-safe containers: New
SecureDisposableinterface replacesdynamicinMemoryShield. - Wipe comparison bytes:
SecureString.matches()now zero-fills the comparison byte array after use. - Centralised channel:
SecureStringandSecureBytesnow useMemoryShield.channelinstead of inlineMethodChannelconstruction. - Security documentation: Added Dart VM memory limitation warnings to
SecureStringandSecureBytesclass docs.
Clipboard Shield
- Improved paste detection: Threshold raised from 2 to 3 chars; smarter divergence detection to reduce autocorrect false positives.
- Overlay safety:
SecureCopyButtonoverlay removal now checksmountedbefore removing entries. - Reduced info disclosure: Copy event logs no longer include the specific PII type.
- Timer limitations documented:
ClipboardShieldConfig.defaultExpirynow documents clipboard history and app-kill limitations.
PII Detection Core
- Expanded JSON sensitive keys: 50+ keys now covered including
username,pwd,pin,session,cookie,iban,account_number,apiSecret, and more. - International PII patterns: Added IBAN, UK National Insurance Number, Canadian SIN, and passport number detection.
- IPv6 detection: IPv6 addresses are now detected alongside IPv4.
- European date format: Added DD/MM/YYYY pattern.
- Tightened regexes:
- Bearer token requires 8+ token-like chars (reduces false positives on prose).
- Phone number requires separators/prefix (reduces false positives on plain numbers).
- SSN without dashes validates area/group/serial per SSA rules.
- Email disallows consecutive dots per RFC 5322.
- API key supports underscore prefix and 8+ char minimum.
- Password field crash fix: No longer throws
RangeErrorwhen separator char is missing. - Duplicate pattern prevention:
addPattern()silently ignores duplicate type+regex combinations. - Efficient event queue:
ShieldReportusesQueueinstead ofList.removeAt(0).
String Shield
- Security documentation:
ObfuscationStrategydocs now clearly state all strategies are obfuscation, not encryption, with key/order stored in the binary.
Other
- Init warning: Debug assertion warns when modules are used before
FlutterNeoShield.init(). - SecureValue safety:
dispose()wiper exceptions no longer preventunregister().
0.4.2 #
- Fixed missing
diodependency which caused issues withDioShieldInterceptorduring downgrade analysis. - Broadened dependency constraints to support the latest stable Dart SDK (
analyzerandbuild). - Documentation updates for perfect pub.dev score.
0.4.0 #
- New Module: RASP Shield (Runtime App Self Protection)
- Added Android & iOS native runtime security detections.
- Features include:
checkDebugger(),checkRoot(),checkEmulator(),checkFrida(),checkHooks(), andcheckIntegrity(). - Call
RaspShield.fullSecurityScan()to retrieve a fullSecurityReport. - Reorganized imports for modular access.
0.3.0 #
- Added full platform support for Web, macOS, Windows, and Linux.
- All features (Log Shield, Clipboard Shield, Memory Shield, String Shield) now work on all six Flutter platforms.
- Memory Shield uses native wipe on Android/iOS and Dart-side byte overwriting on other platforms.
- Added
flutter_web_pluginsSDK dependency for web plugin registration. - No breaking changes — existing Android/iOS code is fully unaffected.
0.2.1 #
- Fixed pub.dev static analysis warnings.
- Broadened dependency constraints to support the latest analyzer and build versions.
- Shortened package description to meet pub.dev requirements.
0.2.0 #
- String Shield: compile-time string obfuscation with @Obfuscate() annotation
- Three obfuscation strategies: XOR, Enhanced XOR, Split-and-reassemble
- build_runner integration with code generation
- Runtime deobfuscation with optional caching and stats tracking
- Removed shieldPrint() (use shieldLog() instead)
0.1.0 #
- Initial release
- Core PII Detection Engine with 11 built-in patterns
- Log Shield: shieldLog(), JSON sanitizer, Dio interceptor
- Clipboard Shield: secureCopy() with auto-clear, SecureCopyButton, SecurePasteField
- Memory Shield: SecureString, SecureBytes, SecureValue with wipe-on-dispose
- Platform channels for native memory wipe (Android/iOS)
- Full example app with demos for all features
- 90%+ test coverage