trusted_time 1.2.1
trusted_time: ^1.2.1 copied to clipboard
Tamper-proof, high-precision network time for Flutter. Anchored to hardware monotonic clocks to prevent system-time manipulation.
1.2.1 #
Critical enhancements
- iOS/macOS: Enhanced channel initialization avoiding naming mismatch
- Android: Optimized
BroadcastReceiverlifecycle to efficiently detach - Android: Upgraded
BackgroundSyncWorkerto perform HTTPS connectivity check SyncClock.elapsedSinceAnchorMs()upgraded to use DartStopwatch(monotonic) instead of wall-clock delta- Linux: Implemented proper
get_platform_version()parsing to resolve implicit logic - Example integration test upgraded to effectively await
TrustedTime.initialize()
High-priority enhancements
- iOS BGTask handler upgraded to perform HTTPS HEAD check (parity with Android worker)
- iOS BGTask closure stabilized to capture dynamic interval value
- Windows native test enhanced building with explicit constructor
- Example widget test stabilized to match actual app UI
Engine improvements
- Serialized sync via
Completerintroduced to prevent concurrent_performSync()calls - Integrity events (
systemClockJumped,deviceRebooted) configured to invalidate trust and optimally trigger resync - Automatic retry engine introduced with configurable delay on sync failure
- Background sync optimally enabled on both warm-restore and cold-start paths
dispose()architecture enhanced to clearSyncClockstatic state, preventing cross-test leakageinitialize()short-circuits engine init immediately when test mock is activetimezoneChangedstreamlined as an intentional non-resync event (UTC is timezone-independent)- All
debugPrintcalls optimized and guarded bykDebugModefor release builds
Algorithm & sources optimizations
- Marzullo tie-breaking upgraded: lower endpoints prioritize over upper at equal times
bestEndintelligently resets when finding new maximum overlap depthHttpsSource: Implemented robust HEAD→GET fallback architecture on 405 or missing Date header- Comprehensive HTTP date parser expanded (RFC 7231 + RFC 850 formats)
- NTP source optimized via conditional imports (
dart:ioguard) for deep web compatibility TrustedTimeConfig.operator==andhashCodestabilized to comprehensively includeadditionalSources
Platform native architecture
- Android: Migrated
RECEIVER_NOT_EXPORTEDflags properly for API 33+ implicit-intent receivers - Android: Deprecated and removed unused
SharedPreferenceswrites from background worker - Android: Standardized
build.gradlestructure alongsideAndroidManifest.xml - iOS:
BGTaskScheduler.registerinitialization restricted optimally to run once viabgRegisteredflag - iOS:
Info.plistproperly documentsBGTaskSchedulerPermittedIdentifiersrequirement tracking - Windows: Deprecated legacy
"trusted_time"method channel registration safely - Linux: Deprecated legacy
"trusted_time"method channel registration safely - Web: Registered
MethodChannelhandlers gracefully for monotonic and background channels
Cleanup & Standardization
- Deprecated 7 dead platform abstraction files
- Streamlined bundle, removing
plugin_platform_interfacedependency - Reverted misleading
Package.swiftSPM target for CocoaPods plugin standard - Stripped committed
test_results.txtandlogcat_full.txtlogs fully prioritizing Git cleanliness - Renamed
sync_engine_test.dart→models_test.dartto logically match content - Broadened SDK constraints scaling accessibility:
sdk: >=3.4.0,flutter: >=3.19.0
Validation Pipeline Enhancement
- Scaled 54 total tests across 9 test files (up from 8 tests originally)
- Instated
TrustedTimeEstimatetests (isReasonable, toString) - Instated
IntegrityMonitortests (reboot detection, multiple attach, double dispose) - Instated
TrustedTimeConfigequality tests coveringadditionalSources - Instated
SyncClock.reset()verification structure - Adjusted timing bounds dynamically in SyncClock tests for CI reliability scaling
CI & Documentation
- CI workflow modernized to deeply analyze example app alongside plugin
SECURITY.mdvalidation tables strictly updatedCHANGELOG.mdproperly reflects comprehensive audit validations
1.2.0 #
Major stability and accuracy update with desktop support.
- Added integrity monitoring (
Stream<IntegrityEvent>) - Added offline time via
nowEstimated() - Added testing override support
- Improved timezone reliability (IANA-based)
- Added Windows & Linux observers
Fixes & improvements
- Safer storage behavior
- Correct config usage (NTP/HTTPS)
- Windows & Linux stability fixes
- SDK updates
Breaking
UnknownTimezoneExceptionreplaces generic errors
1.0.5 #
- iOS/macOS: Implemented proper Swift Package Manager (SPM) support following Flutter 3.24+ standards.
- Chore: Removed obsolete lint rules from
analysis_options.yamlfor Dart 3.x compatibility.
1.0.4 #
- Web: Full WASM compatibility by removing
dart:iodependencies and implementing conditional imports.
1.0.3 #
- Fix workflows: formatting and release check (fa4e61a)
- Format env block in release workflow (35168a2)
- Add automated release workflows and iOS packaging (68949cd)
1.0.1 #
- Chore: Implemented a fully automated release and publishing workflow using GitHub Actions.
- Fix: Added full platform support for Web, Windows, macOS, and Linux.
1.0.0 #
- Initial High-Integrity Release: Production-ready engine for tamper-proof UTC time.
- Marzullo Consensus: Multi-source quorum resolution from Tier-1 NTP and HTTPS providers.
- Temporal Baseline: Hardware-anchored monotonic timeline ensuring zero-drift consistency.
- Full Jitter Backoff: Industry-standard retry strategy for high-resiliency cloud connectivity.
- Zero-Alloc Performance: Memory-optimized internal stack with <1μs synchronous retrieval.