flutter_ota_system 0.2.0-alpha
flutter_ota_system: ^0.2.0-alpha copied to clipboard
Experimental Flutter client for Flutter OTA System, a self-hosted OTA patch platform: signed patches, staged updates and automatic fallback. Android only.
0.2.0-alpha #
First release on pub.dev. Additive; the 0.1.0-alpha.1 API, wire formats, method channels and storage are unchanged.
Experimental alpha, Android arm64 only, needs the Flutter OTA System toolchain (Flutter 3.47.9).
- New bytecode runtime:
FlutterOta.initialize(),FlutterOta.feature<T>(),OtaFeature, status getters,FlutterOta.lastStartupTimings,FlutterOta.checkForUpdate(). Configuration comes from theFLUTTER_OTA_CONFIGdart-define; without it OTA is disabled (no crash). - Developer-signed
dbc-v1patches (OTAPRT02container): the Phase 3C verification pipeline (canonical manifest, root-certified ES256 keys, approvals, toolchain id, revocation lists) moved into the package, with its 69 tests. - New patches are loaded once in a separate
:flutter_ota_verifyprocess before activation, and activated at the next start. Crash state machine withApplicationExitInfoattribution, previous-patch restore and re-verification of the stored patch at every start. - Android: channel
flutter_ota/runtimeand the serviceFlutterOtaVerifierService. - The bytecode runtime also accepts plain
http://to loopback hosts (127.0.0.1,localhost,[::1]) in release builds, for local tests throughadb reverse.OtaClientis unchanged. - Robustness: malformed but root-signed certificates and revocation lists, and JSON nested more
than 32 levels, are refused cleanly (
PatchRejected) instead of throwing. - The plugin declares the
INTERNETpermission, so release builds can reach the server without editing the app manifest. - If the system kills the verifier process for low memory, the patch is retried at a later check (up to 3 times) instead of being blocklisted at once.
- Tested end to end on one Android 13 arm64 phone: store update over an active patch, feature patches, crash rollback, malformed patches. Compatibility checked on Android 14, 16 and 17 (16 KB pages) x86_64 emulators.
0.1.0-alpha.1 #
Tagged in Git only (v0.1.0-alpha.1; not published on pub.dev). Client SDK package flutter_ota_system;
earlier versions of this code were used from the Git repository as ota_client).
Experimental, not production-ready. Android only. Versioned independently of the Flutter OTA
System server and platform.
OtaClientandOtaConfig: device registration, update checks per channel, staged patches that activate on the next app start, boot protection with automatic fallback to the last good patch or the store build, server-side rollback and revocation, boot telemetry.- Patch verification before use: ES256 signature against compiled-in keys (several keys for rotation), SHA-256, exact size, application, release, CPU ABI, runtime and format, and anti-replay.
- Runtimes:
MockPatchRuntime(mock-v1, inert data such as JSON config) and the experimentalAotPatchRuntime(aot-bidiff-android-v1, Android code patches, release builds only). OtaConfig.applicationId(the server application id) is required; responses for another application are refused.- Security: patch ids must be lowercase UUIDs (checked in Dart and Android before any file
operation); release and profile builds use
https://only, debug builds may also usehttp://localhostandhttp://10.0.2.2; redirects are checked hop by hop, never downgraded to HTTP, and do not forward the device token to another host; connect, request and download timeouts. - Android: Java package and namespace
io.github.punitsoni22.flutter_ota_system(previouslydev.flutterota.ota_client); the plugin registers itself, no app changes needed. - Public API:
OtaClient,OtaConfig,PatchRuntime,MockPatchRuntime,AotPatchRuntime,PatchRecord,UpdateResult,UpdateStatus. Protocol and native-boot details are internal.