native-update-capacitor 0.0.0-stage → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/AI-INTEGRATION-GUIDE.md +578 -0
  2. package/LICENSE +25 -0
  3. package/NativeUpdate.podspec +19 -0
  4. package/README.md +574 -2
  5. package/android/build.gradle +125 -0
  6. package/android/consumer-rules.pro +9 -0
  7. package/android/gradle/wrapper/gradle-wrapper.properties +8 -0
  8. package/android/gradle.properties +17 -0
  9. package/android/manifest-additions.xml +28 -0
  10. package/android/proguard-rules.pro +26 -0
  11. package/android/settings.gradle +2 -0
  12. package/android/src/main/AndroidManifest.xml +13 -0
  13. package/android/src/main/java/com/aoneahsan/nativeupdate/AppReviewPlugin.kt +159 -0
  14. package/android/src/main/java/com/aoneahsan/nativeupdate/AppUpdatePlugin.kt +314 -0
  15. package/android/src/main/java/com/aoneahsan/nativeupdate/BackgroundNotificationManager.kt +406 -0
  16. package/android/src/main/java/com/aoneahsan/nativeupdate/BackgroundUpdateManager.kt +48 -0
  17. package/android/src/main/java/com/aoneahsan/nativeupdate/BackgroundUpdatePlugin.kt +343 -0
  18. package/android/src/main/java/com/aoneahsan/nativeupdate/BackgroundUpdateWorker.kt +236 -0
  19. package/android/src/main/java/com/aoneahsan/nativeupdate/JsonOptional.kt +26 -0
  20. package/android/src/main/java/com/aoneahsan/nativeupdate/LiveUpdatePlugin.kt +1249 -0
  21. package/android/src/main/java/com/aoneahsan/nativeupdate/NativeUpdatePlugin.kt +404 -0
  22. package/android/src/main/java/com/aoneahsan/nativeupdate/NotificationActionReceiver.kt +107 -0
  23. package/android/src/main/java/com/aoneahsan/nativeupdate/SecurityManager.kt +240 -0
  24. package/android/variables.gradle +5 -0
  25. package/cli/commands/backend-create.js +623 -0
  26. package/cli/commands/bundle-create.js +145 -0
  27. package/cli/commands/bundle-sign.js +64 -0
  28. package/cli/commands/bundle-verify.js +58 -0
  29. package/cli/commands/flutter-patch.js +107 -0
  30. package/cli/commands/init.js +146 -0
  31. package/cli/commands/keys-generate.js +58 -0
  32. package/cli/commands/monitor.js +89 -0
  33. package/cli/commands/remote-shared.js +264 -0
  34. package/cli/commands/remote.js +634 -0
  35. package/cli/commands/server-start.js +96 -0
  36. package/cli/index.js +625 -0
  37. package/cli/package.json +21 -0
  38. package/dist/esm/app-review/app-review-manager.d.ts +24 -0
  39. package/dist/esm/app-review/app-review-manager.js +194 -0
  40. package/dist/esm/app-review/index.d.ts +5 -0
  41. package/dist/esm/app-review/index.js +5 -0
  42. package/dist/esm/app-review/platform-review-handler.d.ts +20 -0
  43. package/dist/esm/app-review/platform-review-handler.js +137 -0
  44. package/dist/esm/app-review/review-conditions-checker.d.ts +22 -0
  45. package/dist/esm/app-review/review-conditions-checker.js +154 -0
  46. package/dist/esm/app-review/review-rate-limiter.d.ts +23 -0
  47. package/dist/esm/app-review/review-rate-limiter.js +163 -0
  48. package/dist/esm/app-review/types.d.ts +41 -0
  49. package/dist/esm/app-review/types.js +1 -0
  50. package/dist/esm/app-update/app-update-checker.d.ts +58 -0
  51. package/dist/esm/app-update/app-update-checker.js +227 -0
  52. package/dist/esm/app-update/app-update-installer.d.ts +20 -0
  53. package/dist/esm/app-update/app-update-installer.js +134 -0
  54. package/dist/esm/app-update/app-update-manager.d.ts +28 -0
  55. package/dist/esm/app-update/app-update-manager.js +198 -0
  56. package/dist/esm/app-update/app-update-notifier.d.ts +14 -0
  57. package/dist/esm/app-update/app-update-notifier.js +99 -0
  58. package/dist/esm/app-update/index.d.ts +6 -0
  59. package/dist/esm/app-update/index.js +6 -0
  60. package/dist/esm/app-update/platform-app-update.d.ts +19 -0
  61. package/dist/esm/app-update/platform-app-update.js +138 -0
  62. package/dist/esm/app-update/types.d.ts +58 -0
  63. package/dist/esm/app-update/types.js +11 -0
  64. package/dist/esm/background-update/background-scheduler.d.ts +63 -0
  65. package/dist/esm/background-update/background-scheduler.js +332 -0
  66. package/dist/esm/background-update/index.d.ts +3 -0
  67. package/dist/esm/background-update/index.js +2 -0
  68. package/dist/esm/background-update/notification-manager.d.ts +29 -0
  69. package/dist/esm/background-update/notification-manager.js +88 -0
  70. package/dist/esm/config/support.d.ts +9 -0
  71. package/dist/esm/config/support.js +9 -0
  72. package/dist/esm/core/analytics.d.ts +83 -0
  73. package/dist/esm/core/analytics.js +151 -0
  74. package/dist/esm/core/cache-manager.d.ts +72 -0
  75. package/dist/esm/core/cache-manager.js +274 -0
  76. package/dist/esm/core/config.d.ts +69 -0
  77. package/dist/esm/core/config.js +107 -0
  78. package/dist/esm/core/errors.d.ts +56 -0
  79. package/dist/esm/core/errors.js +85 -0
  80. package/dist/esm/core/event-emitter.d.ts +30 -0
  81. package/dist/esm/core/event-emitter.js +80 -0
  82. package/dist/esm/core/logger.d.ts +21 -0
  83. package/dist/esm/core/logger.js +108 -0
  84. package/dist/esm/core/performance.d.ts +53 -0
  85. package/dist/esm/core/performance.js +153 -0
  86. package/dist/esm/core/plugin-manager.d.ts +88 -0
  87. package/dist/esm/core/plugin-manager.js +224 -0
  88. package/dist/esm/core/security.d.ts +123 -0
  89. package/dist/esm/core/security.js +361 -0
  90. package/dist/esm/core/update-check.d.ts +121 -0
  91. package/dist/esm/core/update-check.js +127 -0
  92. package/dist/esm/definitions.d.ts +872 -0
  93. package/dist/esm/definitions.js +104 -0
  94. package/dist/esm/index.d.ts +14 -0
  95. package/dist/esm/index.js +18 -0
  96. package/dist/esm/live-update/bundle-manager.d.ts +102 -0
  97. package/dist/esm/live-update/bundle-manager.js +344 -0
  98. package/dist/esm/live-update/certificate-pinning.d.ts +38 -0
  99. package/dist/esm/live-update/certificate-pinning.js +77 -0
  100. package/dist/esm/live-update/delta-processor.d.ts +84 -0
  101. package/dist/esm/live-update/delta-processor.js +257 -0
  102. package/dist/esm/live-update/download-manager.d.ts +106 -0
  103. package/dist/esm/live-update/download-manager.js +412 -0
  104. package/dist/esm/live-update/rollout-checker.d.ts +86 -0
  105. package/dist/esm/live-update/rollout-checker.js +304 -0
  106. package/dist/esm/live-update/update-manager.d.ts +63 -0
  107. package/dist/esm/live-update/update-manager.js +321 -0
  108. package/dist/esm/live-update/version-manager.d.ts +93 -0
  109. package/dist/esm/live-update/version-manager.js +390 -0
  110. package/dist/esm/plugin.d.ts +3 -0
  111. package/dist/esm/plugin.js +848 -0
  112. package/dist/esm/security/crypto.d.ts +88 -0
  113. package/dist/esm/security/crypto.js +228 -0
  114. package/dist/esm/security/validator.d.ts +60 -0
  115. package/dist/esm/security/validator.js +142 -0
  116. package/dist/esm/types/app-identity.d.ts +36 -0
  117. package/dist/esm/types/app-identity.js +1 -0
  118. package/dist/esm/types/rollout.d.ts +91 -0
  119. package/dist/esm/types/rollout.js +25 -0
  120. package/dist/esm/web.d.ts +130 -0
  121. package/dist/esm/web.js +981 -0
  122. package/dist/plugin.cjs +1 -0
  123. package/dist/plugin.esm.js +1 -0
  124. package/dist/plugin.js +2 -0
  125. package/docs/CHANGELOG.md +1016 -0
  126. package/docs/KNOWN_LIMITATIONS.md +240 -0
  127. package/docs/MIGRATION.md +391 -0
  128. package/docs/protocol/CLIENT-PROTOCOL.md +199 -0
  129. package/docs/server-requirements.md +211 -0
  130. package/ios/Plugin/AppReview/AppReviewPlugin.swift +158 -0
  131. package/ios/Plugin/AppUpdate/AppUpdatePlugin.swift +249 -0
  132. package/ios/Plugin/BackgroundUpdate/BackgroundNotificationManager.swift +333 -0
  133. package/ios/Plugin/BackgroundUpdate/BackgroundUpdatePlugin.swift +464 -0
  134. package/ios/Plugin/Info.plist +43 -0
  135. package/ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift +1286 -0
  136. package/ios/Plugin/LiveUpdate/WebViewConfiguration.swift +45 -0
  137. package/ios/Plugin/NativeUpdatePlugin.m +53 -0
  138. package/ios/Plugin/NativeUpdatePlugin.swift +315 -0
  139. package/ios/Plugin/Security/SecurityManager.swift +289 -0
  140. package/package.json +133 -4
@@ -0,0 +1,1016 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [4.4.0] - 2026-11-20
9
+
10
+ Dart code updates for Flutter apps. The Capacitor plugin itself is unchanged; this release carries the CLI and the
11
+ protocol for the Flutter SDK 1.1.0 (`native_update` on pub.dev).
12
+
13
+ ### Added
14
+
15
+ - **CLI `bundle flutter-patch <release.apk>`** turns a release APK into a Dart code patch (`lib/<abi>/libapp.so`) and
16
+ writes the engine it fits beside it (`.runtime-keys`: the SHA-256 of that APK's `libflutter.so`).
17
+ - **CLI `deploy --payload-type dart_aot`** uploads that patch. `--runtime-keys` overrides the engine list; by default
18
+ the sibling `.runtime-keys` file is read.
19
+
20
+ ### Server (marker `2026.11.20.1`)
21
+
22
+ - Builds can be `dart_aot`. One is offered only to a Flutter app that asks for code updates and runs one of the
23
+ build's engines; a different engine gets `RUNTIME_MISMATCH`, and no other SDK is ever offered one.
24
+
25
+ ### Proven on a phone (live server)
26
+
27
+ - A patch loads on the next cold start; a patch that never confirms its start rolls back after two starts and is
28
+ not offered again (`ROLLED_BACK`); a wrong engine key and a forged signature are both refused; installing a new
29
+ APK, even one that keeps its version fields, sets the patch aside.
30
+
31
+ ## [4.3.0] - 2026-11-19
32
+
33
+ The update protocol learns which SDK is asking. Groundwork for the native Android, Flutter and React Native SDKs that
34
+ share this licence and backend (`docs/protocol/CLIENT-PROTOCOL.md`).
35
+
36
+ ### Added
37
+
38
+ - **Every update check sends `X-Client-Sdk: capacitor` and `X-Sdk-Version`** (web, Android and iOS). The server uses
39
+ them to offer only builds this plugin can run.
40
+ - **`payloadType` on the update-check response** (server field; a Capacitor app is only ever offered `web_bundle`).
41
+ - **CLI `deploy --payload-type <web_bundle|assets>`** (default `web_bundle`) and the matching `payload_type` field on the
42
+ Management API upload (OpenAPI 1.2.0).
43
+
44
+ ### Server
45
+
46
+ - Builds carry a `payload_type`. An `assets` build is never offered to a Capacitor or React Native client, and a web
47
+ bundle is never offered to a native Android, Flutter or iOS SDK (`PAYLOAD_NOT_SUPPORTED`). A client older than the
48
+ header is treated as Capacitor, so every existing app keeps receiving its web bundles.
49
+ - The device record keeps the reporting SDK and its version.
50
+
51
+ ## [4.2.4] - 2026-11-19
52
+
53
+ Android native fixes, found and proven on a physical phone. They are in native code, so consumers need a new app build
54
+ (store or sideload); an OTA bundle cannot carry them.
55
+
56
+ ### Fixed
57
+
58
+ - **Android OTA never started for a flat `configure({ config })` without `maxBundleSize`.** Optional fields were read with
59
+ org.json getters that throw on a missing key, so configuration failed and OTA stayed off. Every optional field is now
60
+ read null-safely (ISSUE-14).
61
+ - **A failed update check read as "no update".** The native check now logs why it failed and `checkForUpdate()` rejects
62
+ `NETWORK_ERROR`, as on the web.
63
+ - **`applyUpdate()` could not find a downloaded bundle on Android.** `list()` returned its bundles as a string; it is an
64
+ array again, so a bundle is applied and is not downloaded twice (ISSUE-15).
65
+ - **The applied bundle's own `configure()` was refused as locked.** A repeated, identical configuration now resolves; a
66
+ changed one is still refused until `reset()` (ISSUE-16).
67
+ - **An applied bundle was lost on every cold start.** The bundle path is now stored where Capacitor restores it, and a
68
+ bundle recorded against an older native binary is retired after a store update (ISSUE-17).
69
+ - **Old bundles stayed on the device forever.** After a healthy boot only the active bundle, its rollback target and a
70
+ newer staged download are kept; `delete({ keepVersions })` never removes the active or rollback bundle (ISSUE-18).
71
+ - **In-app review results now carry the typed names** `displayed` and `canRequest` on Android and iOS; `shown` and
72
+ `allowed` remain for one minor release (ISSUE-11).
73
+
74
+ ## [4.2.3] - 2026-11-16
75
+
76
+ ### Changed
77
+
78
+ - The release CLI uses `commander` 15. Commands and options are unchanged.
79
+ - The bundles are rebuilt with Rollup 4.68 on Node 26.13.1 LTS, and dependencies are at latest stable. No API change; the
80
+ package and its CLI still need Node 24.16 or newer.
81
+
82
+ ## [4.2.2] - 2026-11-04
83
+
84
+ ### Fixed
85
+
86
+ - **"Capacitor plugin "App" already registered" in every app.** The bundled builds inlined `@capacitor/app` (and
87
+ `@capacitor/device`), so the plugin registered a second time beside the app's own copy. Every `@capacitor/*` package
88
+ is now external, and `@capacitor/app` and `@capacitor/device` are declared as optional peers. No API change.
89
+
90
+ ### Changed
91
+
92
+ - `ora` 10 in the CLI (Node 22 floor, already below this package's own). Dependencies at latest stable.
93
+
94
+ ## [4.2.1] - 2026-10-30
95
+
96
+ ### Fixed
97
+
98
+ - **Android release builds with R8.** The plugin now ships its R8 rules to every app that uses it
99
+ (`consumerProguardFiles`), so an app's release build with `minifyEnabled true` needs no rules of its own.
100
+ Before, an app without Google Play services on its classpath stopped with `Missing class
101
+ com.google.android.gms.common.annotation.NoNullnessRewrite` (referenced by Play Core's review library).
102
+ Remove any `-dontwarn` your app added for it. No API change.
103
+
104
+ ## [4.2.0] - 2026-10-26
105
+
106
+ ### Added
107
+
108
+ - **Billing hold on the update check.** `checkForUpdate()` and `getLatest()` now return `held: true`, the
109
+ held `version`/`latestVersion` and a `heldMessage` when the hosted service has a newer release for the app
110
+ but has paused delivery because the developer account has been over its plan limits for longer than the
111
+ grace period. `available` stays `false`, so nothing is downloaded; an app may show `heldMessage` to its
112
+ users. Web, Android and iOS. Servers that do not send the field are unaffected.
113
+
114
+ ## [4.1.2] - 2026-10-26
115
+
116
+ ### Changed
117
+
118
+ - **License.** From this version the package is published under the Native Update License (see `LICENSE`):
119
+ free to install and use in the apps you build, with a Native Update account or your own server that
120
+ implements the documented update contract, and not to be redistributed on its own. Versions before 4.1.2
121
+ remain under the MIT license they were published with. Native Update is a hosted service, not an open-source
122
+ project.
123
+ - The README and the AI integration guide no longer describe a self-hostable Laravel backend; the hosted
124
+ service or your own contract server are the two supported backends. No code or API change.
125
+
126
+ ## [4.1.1] - 2026-10-21
127
+
128
+ ### Changed
129
+
130
+ - Refreshed the supported Capacitor 8, CLI, build, lint and test dependencies without changing the public
131
+ plugin API. TypeScript remains on the fleet-safe 6.0 line.
132
+ - Refreshed the bundled CLI's Chalk and Express dependencies and verified both ESM and CommonJS package
133
+ entry points plus the installed CLI help path from the candidate tarball.
134
+
135
+ ## [4.1.0] - 2026-09-05
136
+
137
+ ### Fixed
138
+
139
+ - **A locally-signed bundle can now actually be uploaded (ISSUE-08).** `builds.signature` existed, the model
140
+ exposed it and `/v1/updates/check` already served it — but no upload validation accepted a signature and
141
+ neither store path set one from input. So `native-update bundle sign` produced a detached `.sig` that
142
+ nothing could carry to the server, every build landed `signature: null`, and an app configured
143
+ `requireSignature: true` rejected the download **on device**, indistinguishable from "no update arrived".
144
+ `POST /apps/{app}/builds` now accepts an optional `signature` on both the dashboard and public planes,
145
+ stores it, and serves it on the update-check.
146
+
147
+ ### Added
148
+
149
+ - `native-update deploy --signature <file>`, and **automatic pick-up of the sibling `.sig`** that
150
+ `bundle sign` writes — the documented local-signing flow now works end to end without a new flag to learn.
151
+ - `bundle sign` records `bundleSha256` in its `.sig`, and `deploy` **refuses** to upload a signature whose
152
+ checksum does not cover the bundle being sent. The server cannot detect that mismatch (it holds no public
153
+ key to check against), so without this guard a stale `.sig` would publish a release every device rejects.
154
+
155
+ ### Notes
156
+
157
+ - A caller-supplied signature **wins over server-side signing** and is never silently replaced — signing a
158
+ consumer's bundle with the server key would produce a release that fails on device while every server-side
159
+ check looked healthy.
160
+ - The server deliberately does **not** verify a caller-supplied signature: it never holds that public key.
161
+ Verification happens on the device, against the key compiled into the binary, where it fails closed.
162
+
163
+ ## [4.0.2] - 2026-08-06
164
+
165
+ ### Fixed
166
+
167
+ - Prevent update checks from offering an active bundle whose semantic version is equal to or older
168
+ than the device's current bundle, with the public TypeScript helper enforcing the same rule as a
169
+ defense-in-depth check.
170
+ - Report the Android binary `versionName` from `current()` while the default bundled web assets are
171
+ active, so a newly installed store build cannot be mistaken for version `1.0.0` and downgraded.
172
+
173
+ ### Backend deploy required
174
+
175
+ - Deploy the update-check downgrade guard and verify `/api/version` returns `2026.08.06.2`.
176
+
177
+ ## [4.0.1] - 2026-08-05
178
+
179
+ ### Fixed
180
+
181
+ - Excluded nested Yarn install state from the published tarball and made the normalized `bin` and
182
+ repository metadata explicit. Runtime code is unchanged from 4.0.0.
183
+
184
+ ## [4.0.0] - 2026-08-05
185
+
186
+ ### Added
187
+
188
+ - **Real delta delivery.** The canonical backend generates deterministic `NUDELTA/1` copy/literal
189
+ patches from the last three compatible active builds, stores only patches smaller than 85% of the
190
+ full target archive, and advertises them on the existing update-check response. Web, Android, and
191
+ iOS validate the patch checksum, source checksum, operation bounds, target size, and final target
192
+ checksum; every failure falls back to the signed full bundle.
193
+ - Active GitHub Actions gates for the plugin, website, Laravel backend, Android, iOS, CLI, examples,
194
+ dependency audits, publish-artifact inspection, and the no-source-map policy.
195
+ - Focused TypeScript delta tests and Laravel reconstruction/signed-download tests; the backend suite
196
+ now contains 426 passing tests (1,253 assertions), alongside 83 Android plugin tests.
197
+
198
+ ### Changed
199
+
200
+ - Requires Capacitor 8, Node.js 24.16+, Java 21, Android API 26+, Android compile/target SDK 36,
201
+ Gradle 8.14.5, and current supported dependencies across every monorepo unit.
202
+ - Standardizes the wire and all verifiers on `RSA-SHA256` (RSASSA-PKCS1-v1_5 with SHA-256), matching
203
+ the backend signer. Removed false RSA-PSS/ECDSA fallback claims.
204
+ - Configuration is immutable after initialization. `setUpdateUrl()` remains a deprecated no-op;
205
+ changing locked settings requires `reset()` followed by a new `initialize()`/`configure()` call.
206
+ - Android sensitive configuration now uses a non-exportable Android Keystore AES-256-GCM key rather
207
+ than deprecated EncryptedSharedPreferences. iOS Keychain entries are device-only.
208
+ - Reveal endpoints for retrievable API/access-token secrets are POST-only, rate-limited, audited,
209
+ and return no-store headers. Keystore replacement validates ZIP structure and uploads the new
210
+ private object before deleting the old one.
211
+
212
+ ### Fixed
213
+
214
+ - Native bridge return/argument shape drift, omitted iOS bridge methods, double-resolved
215
+ initialization calls, nonfunctional background helper instances, fake worker responses, download
216
+ cancellation tracking, boot-time signed-ZIP deletion, and inconsistent HTTPS/host/path checks.
217
+ - PayPal subscription plan changes now call the vendor-supported revise operation.
218
+ - The published examples and marketing snippets now use the real package name, v4 configuration
219
+ shape, signed manifest fields, delta-aware download helper, and Capacitor 8 APIs.
220
+
221
+ ### Backend deploy required
222
+
223
+ - Apply `2026_08_05_000001_create_delta_patches_table.php`, rebuild Laravel caches, restart PHP-FPM
224
+ when needed for OPcache, and verify `/api/version` returns `2026.08.05.1`.
225
+
226
+ ## [3.4.2] - 2026-07-25
227
+
228
+ ### Fixed
229
+
230
+ - 🔴 **Android release builds failed for every consumer.** `android/build.gradle` called
231
+ `getDefaultProguardFile('proguard-android.txt')`, which the current Android Gradle Plugin hard-rejects
232
+ because that file bundles `-dontoptimize`. The call is evaluated at **configuration** time, so a
233
+ consuming app's `./gradlew :app:processReleaseManifest` and `bundleRelease` failed during evaluation of
234
+ `:native-update` — **even with `minifyEnabled false`**. Now uses `proguard-android-optimize.txt`, which
235
+ is what every other Capacitor plugin already uses. Consumers carrying a local yarn `patch:` for this can
236
+ drop it.
237
+
238
+ ### Changed
239
+
240
+ - **README rewritten to the canonical package pattern** and renamed `Readme.md` → `README.md`. The
241
+ previous file shipped with no heading anchors across 24 sections, no table of contents, an internal
242
+ `## Current State` audit block, and relative links (`./LICENSE`, `./CONTRIBUTING.md`,
243
+ `./docs/deployment/…`) that are dead wherever npm renders the README outside the repository. Limitations,
244
+ Changelog and Keywords sections added; every link is now absolute and probed.
245
+ - `funding` added; `description` shortened to match the README's one-line promise.
246
+ - **`.npmignore` deleted.** It coexisted with the `files` allowlist, which silently wins — and it listed
247
+ `CHANGELOG.md`, which `files` explicitly ships. Proven inert before removal: packing with and without it
248
+ produced identical 136-file lists.
249
+
250
+ ## [3.4.1] - 2026-07-25
251
+
252
+ ### Fixed
253
+
254
+ - 🔴 **`require('native-update')` returned an empty object.** Every CommonJS consumer got `{}` — no
255
+ error, just nothing — while ESM consumers got all 28 exports. `package.json` declares
256
+ `"type": "module"`, which makes Node treat **every `.js` file as ESM**, and the CommonJS artifact was
257
+ emitted as `dist/plugin.cjs.js`. That `.js` ending meant genuinely-CommonJS output (`exports.X = …`)
258
+ was loaded as an ES module, exposing no named exports. The artifact is now `dist/plugin.cjs`, whose
259
+ extension forces CommonJS regardless of `type`; `main` and `exports["."].require` updated to match.
260
+ Proven with identical bytes under two extensions in one directory: `.cjs` → 28 exports,
261
+ `.cjs.js` → 0. `dist/plugin.esm.js` is unaffected and stays ESM.
262
+ - **`repository` pointed at the documentation site**, not a git remote, so `npm repo` and the registry's
263
+ Repository link did not lead to source. Now `git+https://github.com/aoneahsan/native-update.git` with
264
+ an explicit `"type": "git"`.
265
+ - **`cli/CLAUDE.md` and `cli/AGENTS.md` were shipping inside the tarball.** Those are internal
266
+ agent-instruction files and have no business in a published package; the `files` entry `"cli/"` swept
267
+ them in. Excluded with `!**/CLAUDE.md` and `!**/AGENTS.md`. Tarball goes 138 → 136 files, with every
268
+ real artifact retained.
269
+
270
+ No runtime behaviour changed for ESM consumers.
271
+
272
+ ## [3.4.0] - 2026-07-23
273
+
274
+ ### Added
275
+ - **Full app lifecycle on the Public Management API.** Beyond builds, the
276
+ `/api/public/v1` plane now creates, edits, and deletes **apps**; manages an
277
+ app's **API keys** (list, create, rotate, reveal, restrict, revoke, deprecate,
278
+ delete — the secret is only ever shown on create/rotate/reveal); manages its
279
+ **signing key** (show public key + fingerprint, create, rotate — the private
280
+ key never leaves the server); and stores a private **keystore backup** (upload
281
+ and download a `.zip` up to 10 MB, held with private visibility and only ever
282
+ streamed back through the API, never a public URL). CI or an agent can now
283
+ provision and run an app end to end without the dashboard. Machine-readable
284
+ spec: <https://nativeupdate-docs.aoneahsan.com/openapi/public-api.json>
285
+ (now v1.1.0), with a front-matter-stripped Markdown mirror at `/raw/*.md`
286
+ indexed by `/raw/manifest.json`.
287
+ - **`all_apps` token scope.** An access token can now cover **every app you own**
288
+ — the ones you have and any created later — instead of a fixed ticked list.
289
+ Creating an app with a specifically-scoped token auto-attaches the new app to
290
+ it. `GET /token` reports `all_apps`.
291
+ - **Two more opt-in delete permissions.** Alongside `builds.delete`, a token can
292
+ be granted `apps.delete` and `keys.delete` (both off by default). Deleting an
293
+ app or a key without the matching permission answers
294
+ `403 TOKEN_PERMISSION_DENIED`. Access tokens themselves stay **dashboard-only**
295
+ — nothing on the API can create, rotate, or delete one.
296
+ - **Build controls:** a `mandatory` flag on upload and edit; a `BUILD_NOT_READY`
297
+ guard so a build cannot be forced `active` before its upload job completes; and
298
+ rollout pause/resume via `enabled`, alongside the percentage (`0` halts).
299
+ - **New CLI commands** for the whole surface: `apps create|show|update|delete`,
300
+ `apps keys list|create|show|rotate|reveal|revoke|deprecate|restrict|delete`,
301
+ `apps signing show|create|rotate`, and
302
+ `apps keystore upload|info|download|delete`. Auth via `NATIVE_UPDATE_TOKEN`, as
303
+ with `deploy`.
304
+
305
+ ### Backend
306
+ - Requires a deploy: new public-plane controllers and routes for app CRUD,
307
+ API-key management, signing keys, and the keystore backup; migrations for the
308
+ keystore backup and the `all_apps` token flag; and a permissions seeder re-run
309
+ for the new `apps.delete` and `keys.delete` permissions. 423 PHPUnit tests pass.
310
+
311
+ ## [3.3.1] - 2026-07-16
312
+
313
+ ### Changed
314
+ - README now documents the public management API and the `deploy` / release-control
315
+ CLI commands added in 3.3.0. npm is where CI and agent users land, so the
316
+ package's own front page needed to say the feature exists.
317
+
318
+ ### Fixed
319
+ - Dashboard: the access-token form rendered a `<Badge>` (a block element) inside a
320
+ `<p>`, so browsers auto-closed the paragraph and produced malformed DOM. Caught by
321
+ running the page — type-check, lint, and build all passed it.
322
+
323
+ ## [3.3.0] - 2026-07-16
324
+
325
+ ### Added
326
+ - **Public Management API — manage your apps and releases over HTTP.** Everything
327
+ the dashboard does (list apps, upload a bundle, publish, promote between
328
+ channels, adjust a rollout, delete) is now an API at
329
+ `https://nativeupdatebe.aoneahsan.com/api/public/v1`, for CI, scripts, and
330
+ agents. Machine-readable spec:
331
+ <https://nativeupdate-docs.aoneahsan.com/openapi/public-api.json>
332
+ - **Access tokens** — a new user-level credential (`nu_pat_…`), created in the
333
+ dashboard under **Access Tokens**:
334
+ - **App-scoped.** Tick the apps a token may manage; it reaches nothing else.
335
+ Anything out of scope answers 404, never 403, so the API cannot be used to
336
+ discover other people's apps.
337
+ - **Permission split.** Every token has an implied `manage` (read, upload,
338
+ publish, promote, rollout). **`builds.delete` is opt-in and off by default**,
339
+ so a leaked CI token can ship a release but never erase your history.
340
+ - **Retrievable.** Copy a token from the dashboard anytime, or rotate it — the
341
+ old secret stops working immediately. Same posture as app API keys.
342
+ - Distinct from app API keys (`nu_app_…`), which authenticate the plugin inside
343
+ your app. The two are not interchangeable, and the public plane deliberately
344
+ sends no CORS headers: an access token has no origin restrictions and belongs
345
+ in a CI secret, never a browser.
346
+ - **Queued uploads with a job to poll.** `POST /apps/{app}/builds` answers **202**
347
+ with `{job_id, status_url}` — a 202 means accepted, not live. Devices only ever
348
+ receive `active` builds, so a release is invisible until `GET /jobs/{jobId}`
349
+ reports `completed`. On failure the job reports `error`, the build never goes
350
+ live, and the owner is emailed.
351
+ - **New CLI commands** (no new dependencies):
352
+ - `native-update deploy <webDirOrZip> --app <app> [--wait]` — zips a directory
353
+ if needed, uploads it, and with `--wait` blocks until the release is live,
354
+ exiting non-zero if it fails, so a broken release fails your pipeline.
355
+ - `native-update token info` · `apps list` · `builds list|promote|rollout|status|delete`
356
+ · `jobs status`.
357
+ - Auth via `NATIVE_UPDATE_TOKEN` (preferred — a `--token` flag leaks into shell
358
+ history and CI logs); `NATIVE_UPDATE_SERVER` for self-hosted backends.
359
+
360
+ ### Changed
361
+ - Bundle-upload logic (duplicate-version and monotonic-version guards, sync and
362
+ queued storage paths, zero-copy promotion) moved into a shared
363
+ `BuildUploadService`, so the dashboard and the public API cannot drift apart.
364
+ No behaviour change to the dashboard.
365
+
366
+ ### Backend
367
+ - Requires a deploy: two migrations (`access_tokens` + `access_token_app`,
368
+ `api_jobs`) and a `RolesPermissionsSeeder` re-run for the new
369
+ `access-tokens.manage` permission.
370
+
371
+ ## [3.2.0] - 2026-07-14
372
+
373
+ ### Added
374
+ - **API-key client restrictions — ship `nu_app_…` keys directly in your app,
375
+ no self-hosted proxy needed.** In the dashboard (Apps → API Keys →
376
+ Restrictions) you can now lock each key to its clients:
377
+ - **Web** — allowed origins (exact `https://app.example.com` or a
378
+ `https://*.example.com` wildcard), enforced against the browser's `Origin`
379
+ header. The public update API (`/v1/updates/check`, analytics, signed
380
+ download) is now callable straight from the browser (permissive CORS on
381
+ that plane; the real gating is the per-key check, not CORS).
382
+ - **Android** — allowed apps by package name + signing-cert SHA-256/SHA-1.
383
+ - **iOS** — allowed apps by bundle identifier.
384
+
385
+ A key with **no** restrictions keeps working from anywhere (unchanged,
386
+ back-compatible). A restricted key that a client does not satisfy gets a
387
+ `403 API_KEY_RESTRICTED` (the response never leaks the allowlist).
388
+ - **`LiveUpdate.getAppIdentity()`** returns this app's client identity
389
+ (Android: applicationId + signing-cert SHA-256/SHA-1; iOS: bundle id; web:
390
+ `{ platform: 'web' }`). Use it when you perform your OWN update-check fetch,
391
+ then attach the `X-Android-*` / `X-Ios-*` headers. The plugin's native
392
+ update-check attaches them automatically.
393
+
394
+ ### Notes
395
+ - Android/iOS restrictions require the app to be built with **native-update
396
+ ≥ 3.2.0** (older builds send no identity headers and will be blocked by an
397
+ Android/iOS restriction). Web restrictions work with any version.
398
+ - The native identity headers are **client-attested** (parity with Google
399
+ API-key app restrictions): they stop cross-site/casual key reuse and quota
400
+ abuse, not a determined attacker replaying headers by hand. Only the web
401
+ Origin check is browser-enforced.
402
+
403
+ ## [3.1.5] - 2026-07-14
404
+
405
+ ### Changed
406
+ - **npm `repository` link now points to the public documentation site**
407
+ (`https://nativeupdate-docs.aoneahsan.com`) instead of the private source
408
+ repository (which returned 404 for the public on the npm package page).
409
+ Metadata-only release — no plugin code, API, or runtime changes.
410
+
411
+ ## [3.1.4] - 2026-07-14
412
+
413
+ ### Fixed
414
+ - **CLI `bundle create --version <v>` now works.** The long-form `--version`
415
+ flag was swallowed by the root `-V, --version` option (commander's default
416
+ parsing matches program options anywhere on the line), so
417
+ `native-update bundle create ./dist --version 1.2.0` printed the CLI version
418
+ and exited instead of building the bundle. The program and every parent
419
+ command now use `enablePositionalOptions()`, so flags after a subcommand
420
+ reach the leaf command. Short `-v` and the root `native-update --version`
421
+ are unchanged.
422
+ - **CLI `bundle create` no longer crashes on `archiver` import.** `archiver`
423
+ v8 is ESM with named-only exports (no default export), so the previous
424
+ `import archiver from 'archiver'` threw at load. Migrated to the v8 API
425
+ (`import { ZipArchive }` + `new ZipArchive({ zlib: { level: 9 } })`); the
426
+ `.pipe()`/`.directory()`/`.finalize()` flow is unchanged.
427
+
428
+ ## [3.1.3] - 2026-07-14
429
+
430
+ ### Fixed
431
+ - **[CRITICAL] Native Android/iOS update checks now speak the real wire
432
+ contract.** Both native layers previously called the dead
433
+ `{serverUrl}/check` path with NO auth headers, so on-device `sync()` /
434
+ `getLatest()` / background checks silently reported "up to date" forever
435
+ against the hosted backend. They now issue
436
+ `GET {serverUrl}/v1/updates/check?channel=…` with `X-API-Key`,
437
+ `X-Device-ID` (stable per-install UUID, newly minted/persisted),
438
+ `X-Current-Version` (active bundle version — Android previously
439
+ hardcoded "1.0.0"), `X-Platform`, and `X-App-Version` (binary version),
440
+ and parse the v3 response fields
441
+ (`version`/`downloadUrl`/`checksum`/`signature`/`size`/`mandatory`/`releaseNotes`).
442
+ - **Flat `initialize(PluginInitConfig)` now configures the NATIVE layers
443
+ too.** Native `configure`/`initialize` only accepted the wrapped
444
+ `{ config: {...} }` shape and rejected the flat form outright, so
445
+ serverUrl/apiKey never reached Android/iOS. Both shapes (plus nested
446
+ `UpdateConfig`) are now accepted and normalized.
447
+ - **`configure({ liveUpdate })` can finally carry the API key** — new
448
+ `LiveUpdateConfig.apiKey` field, mapped through to the config manager
449
+ and the native layers.
450
+ - **Web `getLatest()` implemented** (was a hardcoded `{available:false}`
451
+ stub) — now delegates to the shared `/v1/updates/check` implementation.
452
+ - **`@capacitor/filesystem` + `@capacitor/preferences` declared as
453
+ peerDependencies** — the web path statically imports them, but they were
454
+ only devDependencies, so consumers got runtime module-resolution failures
455
+ with no install-time warning.
456
+ - **Legacy-key error is actionable:** `INVALID_API_KEY_FORMAT` now tells
457
+ you to mint an `nu_app_…` key in the dashboard.
458
+
459
+ ### Added
460
+ - **Dashboard API-key management** (backend + app detail page): create
461
+ (max 3 active keys per app), rotate (replaces the secret in place; old
462
+ value dies immediately), delete, and copy-anytime reveal (keys now stored
463
+ encrypted at rest alongside the lookup hash — keys minted before this
464
+ release can't be revealed, only rotated). Lifecycle actions are
465
+ rate-limited per app from a DB-backed audit trail: create 1/hour,
466
+ rotate 1/hour per key, and 10/30-days + 20/180-days caps per action —
467
+ friendly 429s with retry timing. The ConfigPage now emits copy-paste
468
+ snippets with the app's REAL bundle id, API key, and the canonical
469
+ backend URL.
470
+
471
+ ### Changed
472
+ - **Canonical `serverUrl` rule documented everywhere:**
473
+ `https://nativeupdatebe.aoneahsan.com/api` — the plugin appends
474
+ `/v1/updates/check`. Fixed the wrong `…/api/updates` examples in the
475
+ website's AI docs dump and the stale `api.nativeupdate.aoneahsan.com`
476
+ host in MIGRATION.md.
477
+ - **node-express example implements the real contract** (X-API-Key auth,
478
+ contract field names, SHA-256 checksums at upload, semver comparison) —
479
+ it previously served the legacy fictional shape.
480
+ - **Canonical documentation moved to
481
+ [nativeupdate-docs.aoneahsan.com](https://nativeupdate-docs.aoneahsan.com)**
482
+ (Docusaurus on GitHub Pages, CI-deployed on every push). README and all
483
+ package links now point there; `nativeupdate.aoneahsan.com/docs/*` URLs
484
+ 301-redirect to the matching page, so previously published links keep
485
+ working.
486
+ - **npm tarball slimmed.** `files[]` now ships a curated doc set
487
+ (`docs/CHANGELOG.md`, `docs/MIGRATION.md`, `docs/server-requirements.md`,
488
+ `docs/KNOWN_LIMITATIONS.md`) instead of the whole `docs/` tree — 134 files
489
+ instead of 321, and internal planning material no longer ships to npm.
490
+ - **Docs corpus consolidated + corrected.** The duplicated in-repo consumer
491
+ guides (quick start, feature guides, api/, getting-started/, guides/,
492
+ examples set) were deleted in favor of the docs site; the retained docs
493
+ were corrected to the real API (nested `configure` config, `SyncResult.status`,
494
+ `canRequestReview().canRequest`, real event names, real
495
+ `/v1/updates/check` wire contract, correct backend host).
496
+
497
+ - **react-capacitor example** `capacitor.config.ts` dropped inert config keys
498
+ and the stale `analytics: { provider: 'firebase' }` block (Firebase was
499
+ removed from the SDK in v3.0.0).
500
+
501
+ ## [3.1.2] - 2026-07-14
502
+
503
+ ### Fixed
504
+ - **npm README fully refreshed and de-contradicted.** Removed the false
505
+ "yarn workspace / workspace:*" and "3 examples incl. Firebase backend"
506
+ claims (two example apps; the example uses yarn's `portal:` protocol),
507
+ replaced the legacy "What You Need to Build" scaffold section with an
508
+ accurate "What Ships in This Package", corrected `startImmediateUpdate`
509
+ → `performImmediateUpdate`, fixed the live-update example to the real
510
+ `SyncResult.status` + `getLatest()` flow, corrected the requirement to
511
+ Capacitor 8.x and the backend host to `nativeupdatebe.aoneahsan.com`.
512
+ - **AI-INTEGRATION-GUIDE.md now matches the real API.** Nested
513
+ `UpdateConfig` for `configure()`, `SyncResult.status` enum,
514
+ `download({url, version, checksum})`, `canRequestReview().canRequest`,
515
+ the real event names, the `/v1/updates/check` wire contract (was a
516
+ fictional `GET /api/check`), no nonexistent `bundle upload` command, and
517
+ no legacy `play:core` Gradle instruction (the plugin bundles Play App
518
+ Update + Play Review already).
519
+ - **Website docs viewer no longer renders the SPA shell as markdown.**
520
+ Hosting rewrites answer `200 text/html` for missing files; the viewer now
521
+ rejects HTML responses and falls through to the real file, so
522
+ `/docs/AI-INTEGRATION-GUIDE` renders correctly and "View Raw Markdown"
523
+ always points at an existing `.md` URL.
524
+
525
+ ### Changed
526
+ - **Single source of truth for the version: root `package.json`.** The CLI
527
+ already reads it; the website now bakes it into `__APP_VERSION__`,
528
+ JSON-LD `softwareVersion`, `humans.txt`, and `llms-full.txt` at build
529
+ time ({{PKG_VERSION}} placeholders), and `cli/package.json` no longer
530
+ carries its own version field. No file hardcodes the version anymore.
531
+ - **Website `package-docs` copies are synced from the repo root on every
532
+ build** (`yarn sync:package-docs`, refresh-only — internal docs are never
533
+ newly published), ending the stale-copy drift (the public copy was stuck
534
+ at the v2.0.0-era content).
535
+
536
+ ## [3.1.1] - 2026-07-13
537
+
538
+ ### Fixed
539
+ - **Update checks now share ONE wire-contract implementation.** New
540
+ `src/core/update-check.ts` implements the `/v1/updates/check` contract;
541
+ `plugin.ts`, the version manager, and the background scheduler's live
542
+ fallback all route through it. The latter two previously called paths
543
+ the backend never served (`/check`, `/updates/latest`), so their remote
544
+ checks could never succeed against the hosted backend.
545
+
546
+ ### Changed
547
+ - **Native app-store version paths documented as extension points.** The
548
+ `/app-version` endpoints used by the native app-store update module are
549
+ now explicitly documented (JSDoc + docs) as custom-backend extension
550
+ points rather than hosted-backend routes. No public API changes.
551
+
552
+ ## [3.1.0] - 2026-07-02
553
+
554
+ ### Added
555
+ - **`exports` map in package.json.** Modern conditional exports
556
+ (`types`/`import`/`require`) with `./dist/*` and `./cli/*` wildcard
557
+ passthrough so existing deep imports keep resolving. Legacy
558
+ `main`/`module`/`types`/`unpkg` fields retained.
559
+ - **`website/.env.production`.** Production builds now always bake the
560
+ production backend URL; the dev `.env` can safely point at localhost.
561
+ - **Composite index `builds(app_id, channel, status, created_at)`.**
562
+ Covers the update-check lookup's sort; removes a filesort from the
563
+ hottest query.
564
+
565
+ ### Changed
566
+ - **Update-check hot path (backend).** The two per-request DB writes
567
+ (device activity + analytics event) now run after the response is
568
+ sent (`dispatch(...)->afterResponse()`), and the latest-build lookup
569
+ is cached for 45s with model-event invalidation. Rollout bucketing
570
+ stays per-device and uncached.
571
+ - **`analytics:cleanup` now also prunes `analytics_events`** in 5000-row
572
+ chunks (previously only device-activity rows; the events table grew
573
+ unboundedly).
574
+ - **Web validateUpdate() reuses downloaded bundle bytes.** Validating a
575
+ bundle right after `download()` no longer re-downloads it to hash.
576
+ - **Landing page animation engine loads lazily** (LazyMotion): ~44 KB
577
+ of framer-motion moves off the first-paint critical path.
578
+ - **Firebase Hosting config consolidated** to the repo root with
579
+ long-lived immutable caching for hashed assets and revalidation for
580
+ HTML.
581
+ - CORS `supports_credentials` disabled (bearer-token auth needs no
582
+ credentialed CORS).
583
+
584
+ ### Removed
585
+ - 9 dead env keys from `website/.env` (Firebase-era), 10 commented-out
586
+ debug lines in `src/web.ts`, 2 framework scaffold test files.
587
+
588
+ ### Fixed
589
+ - Doc drift: backend is Laravel 13 (not 11); the test suite is PHPUnit
590
+ (not Pest); canonical backend host is `nativeupdatebe.aoneahsan.com`.
591
+
592
+ ## [3.0.1] - 2026-05-11
593
+
594
+ ### Added
595
+ - **Documentation site.** A new public Docusaurus documentation site
596
+ ships alongside the marketing site. 58 pages total: SDK reference
597
+ (23), CLI reference (9), Backend setup (5), Platform guides (3),
598
+ Tutorials (2), How-to guides (6), Concepts (6), Getting Started (2),
599
+ About + intro pages. Full Diátaxis coverage. Lives in the sibling
600
+ `native-update-docs/` repository; deployed to Firebase Hosting at
601
+ `docs.nativeupdate.aoneahsan.com`. Discovery files (`robots.txt`
602
+ with 30+ AI-bot allowlist, `llms.txt`, `llms-full.txt`, `humans.txt`,
603
+ `.well-known/security.txt`, `sitemap-index.json`, `sitemap.xml`)
604
+ and 3 JSON-LD blocks per page (WebSite, SoftwareApplication,
605
+ Organization) for AI-search citability.
606
+ - **`docs/security/PRE-LAUNCH-PENTEST-CHECKLIST.md`.** 10-section
607
+ DIY security checklist covering dep hygiene, authentication,
608
+ authorization, CORS/CSRF, bundle integrity, file safety, data
609
+ handling, operational safety, mobile platform integration,
610
+ 9 specific attack paths, and a final sanity sweep.
611
+ - **`docs/PERFORMANCE.md` + `tools/bench/`.** Vitest microbench
612
+ scaffold for the SHA-256 checksum and RSA-SHA256 signature hot
613
+ paths, with calibration targets and a regression-investigation
614
+ workflow.
615
+ - **CI: example-bundle workflow.** `.github/workflows/example-bundle.yml`
616
+ builds, signs, and attaches an OTA bundle from `example-apps/react-capacitor`
617
+ to each GitHub Release. Also runs weekly as a drift-detection canary.
618
+ - **Example-app capability cards.** `example-apps/react-capacitor/src/App.tsx`
619
+ now demonstrates App Update (`getAppUpdateInfo` + `openAppStore`),
620
+ App Review (`canRequestReview` + `requestReview`), and Background
621
+ Update (toggle with `allowMeteredConnection` + `nextCheckTime`)
622
+ alongside the existing Live Update flow. One section per feature
623
+ area.
624
+
625
+ ### Fixed
626
+ - **`website/src/pages/ExamplesPage.tsx`.** Removed the stale third
627
+ example card advertising the `example-apps/firebase-backend`
628
+ directory, which was deleted in v3.0.0. The GitHub source link
629
+ 404'd and the description ("Firestore manifests") contradicted the
630
+ website's own v3 architecture rule.
631
+
632
+ ### Documentation
633
+ - **`docs/project-audit/MARKETING-WEBSITE-FINDINGS-2026-05-11.md`**
634
+ produced by the production-readiness audit Batch 9 sweep. Documents
635
+ 3 deferred follow-ups (stale MDX docs mirror, HomePage missing
636
+ Screenshots/Demo section, DocsPage size violation) and 7 surfaces
637
+ confirmed healthy.
638
+ - **`docs/MARKETING_WEBSITE_TRACKER.md`** annotated as SUPERSEDED with
639
+ a redirect block to the new findings doc.
640
+ - **`example-apps/react-capacitor/README.md`** documents the React 18
641
+ vs 19 version-choice reasoning (the plugin is React-version-agnostic;
642
+ the example pins React 18 to maximise readable audience).
643
+
644
+ ### Closed
645
+ - **Production-readiness audit (10 batches)** initiated 2026-05-08 is
646
+ complete as of 2026-05-11. Authoritative tracker:
647
+ `docs/tracking/production-readiness-audit-tracker.json`. The flow
648
+ enters a 7-day cooldown; next allowed re-run 2026-05-18.
649
+
650
+ ## [3.0.0] - 2026-05-04
651
+
652
+ ### Removed (BREAKING)
653
+ - **Firestore backend.** `backendType: 'firestore'` and the
654
+ `firestore: { … }` config field are gone. The plugin now speaks HTTP
655
+ to a single backend (the hosted Native Update SaaS / Laravel
656
+ reference implementation in `backend/`). Apps using the Firestore
657
+ branch must switch to `serverUrl` + `apiKey` — see
658
+ [MIGRATION.md](./MIGRATION.md#upgrading-v2--v300).
659
+ - **`src/firestore/` module.** `FirestoreClient`, `ManifestReader`,
660
+ `firestore.rules`, `firestore.indexes.json`, the schema types, and
661
+ the `FirestoreConfig` public export are removed.
662
+ - **`example-apps/firebase-backend/`.** The standalone Firebase Cloud
663
+ Functions example is removed; `example-apps/node-express/` is the
664
+ reference HTTP implementation of the `/v1/updates/check` contract.
665
+
666
+ ### Changed
667
+ - Rollout / device-info / update-check types moved to
668
+ `src/types/rollout.ts` and are re-exported from the package root.
669
+ `FirestoreTimestamp` is replaced by `RolloutTimestamp` (`number |
670
+ string | Date`) with a `toEpochMs()` helper.
671
+ - Website auth-service drops the Firestore user-profile mirror. The
672
+ Laravel `ValidateFirebaseToken` middleware already upserts the user
673
+ record from verified token claims on every authenticated request, so
674
+ the client mirror was redundant.
675
+
676
+ ## [2.0.0] - 2026-04-18
677
+
678
+ ### Native (Android + iOS)
679
+ - **Boot-time bundle re-verification.** On every cold start the plugin
680
+ re-hashes the active OTA bundle and compares against the checksum
681
+ stored at install time. If the host app configured a public key and the
682
+ bundle carries a signature, the signature is re-verified too. Mismatch
683
+ triggers an immediate rollback to the previous known-good bundle and
684
+ emits `updateStateChanged` with `status: 'ROLLBACK'`. Closes an
685
+ on-disk-tampering gap on rooted/jailbroken devices.
686
+ - **Automatic rollback on crash loop.** Activating a bundle marks it as
687
+ pending-verify. Each cold start before `notifyAppReady()` fires
688
+ increments a counter; after 2 failed boots the plugin rolls back to
689
+ the previous bundle automatically. Catches a bundle that crashes the
690
+ app before it can tell the plugin it booted cleanly.
691
+ - Bundle metadata now persists the signature alongside checksum so the
692
+ boot re-verify can run without needing the manifest or a re-download.
693
+ - **iOS zip-slip + zip-bomb protection.** Bundle extraction now inspects
694
+ every archive entry before writing to disk: rejects symlinks, absolute
695
+ paths, and any path that resolves outside the destination directory,
696
+ and caps total uncompressed size at 500 MB. A malicious bundle can no
697
+ longer overwrite files outside the sandbox or exhaust device storage.
698
+ (Android does not currently extract bundles in-plugin; when that is
699
+ added, the same validation must be applied.)
700
+ - **Secure storage is now always on.** Android persists secrets only
701
+ through `EncryptedSharedPreferences` (Keystore-backed); iOS persists
702
+ only through the Keychain. The `secureStorage: false` opt-out is
703
+ removed — passing it is ignored. On web, `initialize()` config is
704
+ sanitised before write-through to `localStorage`: `apiKey`, top-level
705
+ and `liveUpdate.publicKey`, and `security.publicKey` are stripped, so
706
+ a compromised script or stale cache cannot surface the credential.
707
+ Host apps must pass the apiKey/publicKey on every `initialize()`.
708
+ - **Android background retries are bounded + backoff-aware.** All three
709
+ enqueue sites (periodic, one-shot, notification-action) now pass
710
+ `setBackoffCriteria(EXPONENTIAL, 30s)`. The worker itself caps at
711
+ 5 retry attempts per run, so a persistently-failing server can no
712
+ longer burn battery in a tight retry loop — total wall-clock budget
713
+ for a failing run is ~15 minutes before falling through to the next
714
+ scheduled tick.
715
+ - **iOS background-task diagnostics.** `BGTaskScheduler.submit` errors
716
+ are now classified (`.notPermitted`, `.tooManyPendingTaskRequests`,
717
+ `.unavailable`) and logged with actionable messages. `.notPermitted`
718
+ almost always means the host app's `Info.plist` is missing the
719
+ scheduler identifier — previously a silent failure. We also cancel
720
+ any prior pending request before resubmitting to dodge the
721
+ "already-scheduled" edge case observed on a few iOS versions. Host
722
+ apps must declare `BGTaskSchedulerPermittedIdentifiers` with
723
+ `com.aoneahsan.nativeupdate.background` in their own Info.plist —
724
+ the framework's plist does not propagate to the app bundle.
725
+
726
+ ### Security (BREAKING)
727
+ - **Signature verification fails closed.** If the host app configures
728
+ `publicKey`, `requireSignature`, or `enableSignatureValidation`, a missing
729
+ signature now throws instead of silently passing. Previously, a manifest
730
+ with the signature field stripped out would bypass all integrity checks.
731
+ - **Checksum verification fails closed.** `verifyChecksum(data, '')` now
732
+ throws. Every OTA bundle manifest must ship a SHA-256 checksum; a missing
733
+ one is treated as tampering.
734
+ - **Monotonic version enforcement persists across reinstalls.** The plugin
735
+ now records the highest version ever applied per channel in Preferences
736
+ and refuses to apply any older bundle — even if the active-bundle state
737
+ was wiped. Closes a downgrade-attack path.
738
+ - **`setUpdateUrl()` is deprecated and ignored at runtime.** The update
739
+ server URL is fixed at `initialize()` time. Runtime mutation was an XSS
740
+ attack path (compromised WebView could repoint updates to a hostile
741
+ host). Re-call `initialize()` to switch servers.
742
+ - **Removed `allowDowngrade` from `UpdateOptions`.** Downgrades are a
743
+ debug/recovery operation and do not belong in a production option flag.
744
+ - **Removed `enableEncryption`, `encryptionKey`, `encryptionSalt` from
745
+ the public API.** Bundle encryption was only wired on the web path and
746
+ never implemented on Android or iOS — the option shipped a false
747
+ guarantee. Sign bundles (RSA-PSS/ECDSA) and serve them over HTTPS; the
748
+ plugin's existing verification is the correct integrity primitive.
749
+
750
+ ### Backend (native-update/backend)
751
+ - API key checksum comparison uses `hash_equals` (timing-safe) — closes a
752
+ byte-by-byte response-time leak on brute-force against short suffixes.
753
+ - Bundle download asserts `build->app_id === authenticated app->id` as
754
+ defense-in-depth beyond the signed URL.
755
+ - Device identifiers are HMAC-SHA256 hashed (keyed by `APP_KEY`) via an
756
+ Eloquent mutator before landing in `analytics_events` and
757
+ `device_activities`. Casual DB access can no longer correlate a row back
758
+ to a specific device.
759
+ - Build upload rejects versions ≤ current channel head unless an explicit
760
+ rollback flow is used. Prevents accidental and malicious downgrades on
761
+ live channels.
762
+ - `GET /api/health` unauth'd endpoint added for Hostinger uptime pings.
763
+ - `/api/v1/*` now carries a route-level `throttle:600,15` as
764
+ defense-in-depth on top of per-key rate limiting in middleware.
765
+ - `.env.example` tightened for production defaults: `APP_ENV=production`,
766
+ `APP_DEBUG=false`, `LOG_LEVEL=warning`, `LOG_CHANNEL=daily`,
767
+ `DB_CONNECTION=mysql`.
768
+ - **Signed bundle URLs include checksum + app_id in their signed payload**
769
+ and `BundleController::download` re-asserts both against the `Build`
770
+ row before streaming. A replayed URL whose Build was flipped to
771
+ archived now returns 403 instead of serving the old bundle.
772
+ - **Signed URL TTL moved from 5 minutes → 30 minutes and made
773
+ configurable** via `NATIVE_UPDATE_DOWNLOAD_TTL_MIN`. Five minutes
774
+ frequently expired mid-download on a slow mobile link.
775
+ - **Bundle downloads stream through Laravel**, never redirect to the
776
+ underlying storage URL — comment enforces the invariant. Keeps auth,
777
+ rate-limit, and audit in one chokepoint.
778
+ - **Signing-key decryption is now per-request memoised** in
779
+ `SigningKey::getPrivateKey()`. `rotate()` and `revoke()` clear the
780
+ cache so stale keys can't leak across a long-running worker.
781
+
782
+ ### Optimization
783
+ - **Resume-download correctness.** `resumeDownload()` now records whether
784
+ the server actually returned HTTP 206 (Partial Content) and decides
785
+ whether to concatenate the partial prefix or discard it accordingly.
786
+ Previously a server that fell back to HTTP 200 (full response)
787
+ silently produced a corrupted bundle by double-writing the prefix —
788
+ a latent corruption bug on CDNs that don't honour Range.
789
+ - **Jittered exponential backoff on download retry.** `downloadWithRetry`
790
+ now adds ±25% random jitter to each retry interval. Avoids the
791
+ thundering-herd scenario where many clients retry in lockstep after a
792
+ common failure (CDN blip, server restart) and hammer a recovering
793
+ server simultaneously.
794
+ - **Auto-cleanup is now the default.** After a successful bundle apply
795
+ the plugin keeps the last 3 bundles (active + 2 recent) and deletes
796
+ the rest. Host apps that want the old every-bundle-forever behavior
797
+ can pass `cleanupOldBundles: false` explicitly.
798
+
799
+ ### Payments (BREAKING)
800
+ - **Stripe + Cashier removed; PayPal (`srmklive/paypal`) takes over.**
801
+ New `SubscriptionController` exposes `subscribe → activate → cancel /
802
+ resume / changePlan` with PayPal's approval-URL flow. Webhook endpoint
803
+ moved from `/api/webhooks/stripe` → `/api/webhooks/paypal`, with a new
804
+ `PayPalWebhookController` that verifies transmissions via PayPal's
805
+ own `verifyWebHook` API.
806
+ - New migration `2026_04_18_000001_add_paypal_provider_to_subscriptions`
807
+ introduces provider-agnostic columns (`provider`,
808
+ `provider_subscription_id`, `provider_status`, `provider_plan_id`) on
809
+ `subscriptions`, `subscription_items`, and `users`. Legacy `stripe_*`
810
+ columns are kept nullable for one release to ease rollback.
811
+ - `.env.example` replaces `STRIPE_*` with `PAYPAL_MODE`,
812
+ `PAYPAL_LIVE_CLIENT_ID / SECRET / APP_ID`, `PAYPAL_PLAN_PRO`,
813
+ `PAYPAL_PLAN_ENTERPRISE`, `PAYPAL_WEBHOOK_ID`.
814
+ - `User` model drops the Cashier `Billable` trait and grows an
815
+ `activeSubscription()` helper against the new schema.
816
+
817
+ ### Migration
818
+ - Apps relying on `allowDowngrade: true` in `UpdateOptions` will fail to
819
+ apply older bundles. Remove the flag and treat rollback as a separate
820
+ flow.
821
+ - Apps passing `enableEncryption`, `encryptionKey`, or `encryptionSalt`
822
+ to `initialize()` or `configure()` will see them silently dropped.
823
+ Rely on signature + checksum verification for integrity.
824
+ - Apps calling `setUpdateUrl()` at runtime will receive a deprecation
825
+ warning and the call is a no-op. Pass `serverUrl` to `initialize()`.
826
+
827
+ ## [1.4.9] - 2026-03-11
828
+
829
+ ### Added
830
+ - Firestore-backed manifest reads through `backendType: 'firestore'`
831
+ - Secure manifest lookup support via `apiKeys/{apiKey}/manifests/{channel}`
832
+ - Concrete no-cost backend implementation guide for `website + Firestore + Google Drive`
833
+
834
+ ### Changed
835
+ - Website dashboard publish flow aligned to Google Drive asset uploads plus Firestore manifest publishing
836
+ - Website dashboard configuration/docs now recommend Firestore instead of the old `/api/updates` path
837
+ - Package config types now expose Firestore configuration for production app integration
838
+
839
+ ### Fixed
840
+ - Manifest publishing now writes the full manifest shape to both secure and compatibility Firestore paths
841
+ - Google Drive asset uploads now preserve correct filenames for ZIP bundles and generated manifest files
842
+
843
+ ## [1.4.5] - 2026-02-25
844
+
845
+ ### Changed
846
+ - Updated all dependencies to latest versions
847
+ - Full verification suite passing (81 tests, 0 lint warnings)
848
+ - Android Gradle build verified (assembleDebug successful)
849
+ - Website and Firebase Functions builds verified
850
+ - Release-ready state confirmed
851
+
852
+ ### Maintenance
853
+ - Package updates: Capacitor 8.x, TypeScript 5.9.3, Vitest 4.0.18, ESLint 9.39.2
854
+ - Node.js engine requirement: >=24.13.0
855
+
856
+ ## [1.0.7] - 2025-01-15
857
+
858
+ ### Fixed
859
+ - **Critical Android Build Issues**:
860
+ - Fixed Google Play app-update library dependencies by using explicit version 2.1.0 instead of variable
861
+ - Resolved kotlinVersion resolution issues by hardcoding version in gradle plugin
862
+ - Made all Google Play Services dependencies use explicit versions to prevent resolution errors
863
+ - Added variables.gradle file for better variable management
864
+ - Ensured no manual intervention is required by users
865
+
866
+ ### Changed
867
+ - Updated package version to 1.0.7
868
+ - Hardcoded critical dependency versions in Android build.gradle to prevent resolution issues
869
+
870
+ ## [1.0.6] - 2025-01-15
871
+
872
+ ### Fixed
873
+ - **Android Build Issues**:
874
+ - Fixed Google Play app-update library version error (changed from non-existent 18.2.0 to correct 2.1.0)
875
+ - Fixed `kotlinVersion` MissingPropertyException by properly defining it in buildscript ext block
876
+ - Added missing Kotlin stdlib dependency
877
+ - Reorganized build.gradle structure to ensure proper variable scope
878
+
879
+ ### Documentation Fixes
880
+ - Corrected all API method references to match TypeScript definitions
881
+ - Fixed method signatures and parameters across all documentation
882
+ - Updated event names to match the 4 defined events (downloadProgress, updateStateChanged, backgroundUpdateProgress, backgroundUpdateNotification)
883
+ - Removed references to non-existent methods
884
+ - Fixed broken documentation links
885
+
886
+ ### Android Configuration
887
+ - kotlinVersion: 1.9.22 (stable version)
888
+ - playAppUpdateVersion: 2.1.0 (correct Google Play version)
889
+ - playReviewVersion: 2.0.1
890
+ - All dependencies now use proper version variables
891
+
892
+ ## [1.4.0] - 2025-01-02
893
+
894
+ ### Added
895
+
896
+ - Complete TypeScript implementation with strict typing
897
+ - Core plugin architecture with modular design
898
+ - Comprehensive error handling system
899
+ - Security validation framework
900
+ - Bundle management system
901
+ - Download manager with retry logic
902
+ - Version management capabilities
903
+ - Configuration manager
904
+ - Logging system with multiple log levels
905
+ - Cache management
906
+ - Background update support
907
+ - Plugin initialization system
908
+
909
+ ### Changed
910
+
911
+ - Migrated from class-based to functional architecture
912
+ - Improved type definitions and interfaces
913
+ - Enhanced security with input validation
914
+ - Better error messages and error codes
915
+
916
+ ### Fixed
917
+
918
+ - Removed circular dependencies
919
+ - Fixed TypeScript compilation issues
920
+ - Proper exclusion of test files in tsconfig
921
+ - Removed console.log statements in favor of Logger
922
+
923
+ ## [0.0.2] - 2024-12-01
924
+
925
+ ### Added
926
+
927
+ - Comprehensive documentation for all features
928
+ - Bundle signing and security utilities
929
+ - CI/CD pipeline with GitHub Actions
930
+ - Example update server implementation
931
+ - TypeScript strict mode
932
+ - ESLint v9 flat config support
933
+
934
+ ### Fixed
935
+
936
+ - Security vulnerabilities in update process
937
+ - TypeScript compilation errors
938
+ - Path traversal prevention
939
+
940
+ ### Security
941
+
942
+ - Enforced HTTPS for all update downloads
943
+ - Added RSA signature verification
944
+ - Implemented checksum validation
945
+ - Added certificate pinning support
946
+
947
+ ## [0.0.1] - 2024-01-08
948
+
949
+ ### Added
950
+
951
+ - Initial release of Capacitor Native Update plugin
952
+ - Live/OTA update functionality
953
+ - Bundle download and management
954
+ - Multiple update strategies (immediate, background, manual)
955
+ - Delta update support
956
+ - Automatic rollback on failed updates
957
+ - Update channels (production, staging, development)
958
+ - End-to-end encryption and signature verification
959
+ - Bundle integrity checks with SHA-256/512 checksums
960
+ - Native app update functionality
961
+ - App store version checking
962
+ - Immediate and flexible update flows (Android)
963
+ - Direct app store navigation
964
+ - Version comparison and update priority
965
+ - App review functionality
966
+ - In-app review prompts using native APIs
967
+ - Smart triggering with configurable conditions
968
+ - Rate limiting to respect platform quotas
969
+ - Security features
970
+ - HTTPS enforcement by default
971
+ - Certificate pinning support
972
+ - Public key signature verification
973
+ - Input validation and sanitization
974
+ - Secure storage using platform keystores
975
+ - Platform support
976
+ - iOS implementation using Swift
977
+ - Android implementation using Kotlin
978
+ - Web fallback implementation
979
+ - Comprehensive TypeScript definitions
980
+ - Example application demonstrating all features
981
+ - Extensive documentation
982
+ - API reference
983
+ - Security guidelines
984
+ - Migration guide
985
+ - Feature overview
986
+
987
+ ### Security
988
+
989
+ - Enforced HTTPS for all update operations by default
990
+ - Required checksum validation for all bundle downloads
991
+ - Implemented path traversal prevention
992
+ - Added secure storage for sensitive configuration
993
+
994
+ ### Known Issues
995
+
996
+ - ESLint configuration needs update for v9 compatibility
997
+ - Certificate pinning requires manual certificate configuration
998
+ - Delta updates require server-side implementation
999
+
1000
+ ## Future Releases
1001
+
1002
+ ### [0.1.0] - Planned
1003
+
1004
+ - Add delta update server reference implementation
1005
+ - Improve offline update handling
1006
+ - Add update scheduling APIs
1007
+ - Enhanced progress reporting with ETA
1008
+ - Batch update support
1009
+
1010
+ ### [0.2.0] - Planned
1011
+
1012
+ - Machine learning for optimal update timing
1013
+ - Peer-to-peer update distribution
1014
+ - Advanced A/B testing framework
1015
+ - Custom update UI components
1016
+ - Differential compression algorithms