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