native-update 1.4.8 → 2.0.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 (77) hide show
  1. package/Readme.md +13 -1
  2. package/android/src/main/java/com/aoneahsan/nativeupdate/BackgroundUpdatePlugin.kt +15 -0
  3. package/android/src/main/java/com/aoneahsan/nativeupdate/BackgroundUpdateWorker.kt +23 -7
  4. package/android/src/main/java/com/aoneahsan/nativeupdate/LiveUpdatePlugin.kt +152 -4
  5. package/android/src/main/java/com/aoneahsan/nativeupdate/NativeUpdatePlugin.kt +14 -1
  6. package/android/src/main/java/com/aoneahsan/nativeupdate/NotificationActionReceiver.kt +10 -1
  7. package/android/src/main/java/com/aoneahsan/nativeupdate/SecurityManager.kt +18 -18
  8. package/cli/AGENTS.md +29 -0
  9. package/cli/CLAUDE.md +51 -0
  10. package/dist/esm/__tests__/security-enforcement.test.d.ts +1 -0
  11. package/dist/esm/__tests__/security-enforcement.test.js +95 -0
  12. package/dist/esm/__tests__/security-enforcement.test.js.map +1 -0
  13. package/dist/esm/core/config.d.ts +6 -15
  14. package/dist/esm/core/config.js +1 -4
  15. package/dist/esm/core/config.js.map +1 -1
  16. package/dist/esm/core/security.d.ts +11 -3
  17. package/dist/esm/core/security.js +19 -6
  18. package/dist/esm/core/security.js.map +1 -1
  19. package/dist/esm/definitions.d.ts +38 -24
  20. package/dist/esm/definitions.js.map +1 -1
  21. package/dist/esm/firestore/firestore-client.js +4 -0
  22. package/dist/esm/firestore/firestore-client.js.map +1 -1
  23. package/dist/esm/firestore/schema.d.ts +2 -0
  24. package/dist/esm/firestore/schema.js.map +1 -1
  25. package/dist/esm/index.d.ts +1 -2
  26. package/dist/esm/index.js +0 -2
  27. package/dist/esm/index.js.map +1 -1
  28. package/dist/esm/live-update/download-manager.d.ts +36 -5
  29. package/dist/esm/live-update/download-manager.js +61 -22
  30. package/dist/esm/live-update/download-manager.js.map +1 -1
  31. package/dist/esm/live-update/update-manager.d.ts +12 -1
  32. package/dist/esm/live-update/update-manager.js +38 -10
  33. package/dist/esm/live-update/update-manager.js.map +1 -1
  34. package/dist/esm/live-update/version-manager.d.ts +9 -0
  35. package/dist/esm/live-update/version-manager.js +40 -0
  36. package/dist/esm/live-update/version-manager.js.map +1 -1
  37. package/dist/esm/plugin.js +95 -175
  38. package/dist/esm/plugin.js.map +1 -1
  39. package/dist/esm/web.d.ts +18 -1
  40. package/dist/esm/web.js +69 -24
  41. package/dist/esm/web.js.map +1 -1
  42. package/dist/plugin.cjs.js +1 -1
  43. package/dist/plugin.cjs.js.map +1 -1
  44. package/dist/plugin.esm.js +1 -1
  45. package/dist/plugin.esm.js.map +1 -1
  46. package/dist/plugin.js +2 -2
  47. package/dist/plugin.js.map +1 -1
  48. package/docs/AGENTS.md +38 -0
  49. package/docs/CHANGELOG.md +167 -0
  50. package/docs/CLAUDE.md +101 -0
  51. package/docs/MIGRATION.md +87 -0
  52. package/docs/README.md +13 -2
  53. package/docs/deployment/HOSTINGER_DEPLOY.md +329 -0
  54. package/docs/features/laravel-nova-backend/ASSESSMENT-SUMMARY.md +96 -0
  55. package/docs/features/laravel-nova-backend/IMPLEMENTATION-PLAN.md +504 -0
  56. package/docs/features/laravel-nova-backend/credentials.ignore.md +34 -0
  57. package/docs/features/laravel-nova-backend/progress-tracker.json +184 -0
  58. package/docs/guides/no-cost-backend-implementation-plan.md +77 -0
  59. package/docs/guides/no-cost-firestore-google-drive-backend.md +60 -0
  60. package/docs/project-knowledge-base/01-system-overview.md +218 -0
  61. package/docs/project-knowledge-base/02-routes-pages-forms-users.md +346 -0
  62. package/docs/project-knowledge-base/03-tech-stack-modules-services.md +347 -0
  63. package/docs/project-knowledge-base/04-data-models-integrations.md +307 -0
  64. package/docs/project-knowledge-base/05-docs-corpus-inventory.md +193 -0
  65. package/docs/project-knowledge-base/06-operations-testing-legal-content.md +170 -0
  66. package/docs/project-knowledge-base/README.md +90 -0
  67. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-16.md +454 -0
  68. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-24.md +66 -0
  69. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-25.md +67 -0
  70. package/docs/seo-aeo-rules.json +3043 -0
  71. package/docs/tracking/seo-checklist-tracker.json +333 -0
  72. package/ios/Plugin/BackgroundUpdate/BackgroundUpdatePlugin.swift +50 -6
  73. package/ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift +238 -8
  74. package/ios/Plugin/NativeUpdatePlugin.swift +8 -0
  75. package/ios/Plugin/Security/SecurityManager.swift +13 -14
  76. package/package.json +31 -32
  77. package/docs/play-console-rejection-rules.json +0 -428
package/docs/AGENTS.md ADDED
@@ -0,0 +1,38 @@
1
+ # AGENTS.md - Documentation
2
+
3
+ Agent instructions for maintaining native-update documentation.
4
+
5
+ ## 🔴 3-Day Freshness Rule
6
+ Check and update this file at least every 3 days. See root AGENTS.md.
7
+
8
+ ## Scope
9
+
10
+ All markdown documentation, guides, API reference, project profiles, knowledge base, and tracker files.
11
+
12
+ ## Key Rules
13
+
14
+ 1. **Documentation-first**: Update docs BEFORE or WITH code changes, never after
15
+ 2. **Knowledge base**: Update `/docs/project-knowledge-base/` every 2 weeks minimum
16
+ 3. **Project profile**: Update `/docs/project-profiles/` weekly when project is active
17
+ 4. **Inventory sync**: When docs are added/removed, update `05-docs-corpus-inventory.md`
18
+ 5. **No stale docs**: Every doc must reflect current reality, not historical plans
19
+
20
+ ## When API Changes
21
+ 1. Update relevant guides in `docs/features/` or `docs/guides/`
22
+ 2. Update `docs/api/` reference
23
+ 3. Update `AI-INTEGRATION-GUIDE.md`
24
+ 4. Update `CHANGELOG.md`
25
+ 5. If breaking: update `MIGRATION.md`
26
+
27
+ ## When Adding New Docs
28
+ 1. Place in appropriate subfolder by topic
29
+ 2. Update `docs/project-knowledge-base/05-docs-corpus-inventory.md`
30
+ 3. Link from relevant parent docs
31
+ 4. Include `Last Updated` date at bottom
32
+
33
+ ## Tracker Files
34
+ Located in `docs/tracking/`. Update relevant trackers when completing cross-project work.
35
+
36
+ ---
37
+
38
+ **Last Updated**: 2026-04-02
package/docs/CHANGELOG.md CHANGED
@@ -5,6 +5,173 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.0.0] - 2026-04-18
9
+
10
+ ### Native (Android + iOS)
11
+ - **Boot-time bundle re-verification.** On every cold start the plugin
12
+ re-hashes the active OTA bundle and compares against the checksum
13
+ stored at install time. If the host app configured a public key and the
14
+ bundle carries a signature, the signature is re-verified too. Mismatch
15
+ triggers an immediate rollback to the previous known-good bundle and
16
+ emits `updateStateChanged` with `status: 'ROLLBACK'`. Closes an
17
+ on-disk-tampering gap on rooted/jailbroken devices.
18
+ - **Automatic rollback on crash loop.** Activating a bundle marks it as
19
+ pending-verify. Each cold start before `notifyAppReady()` fires
20
+ increments a counter; after 2 failed boots the plugin rolls back to
21
+ the previous bundle automatically. Catches a bundle that crashes the
22
+ app before it can tell the plugin it booted cleanly.
23
+ - Bundle metadata now persists the signature alongside checksum so the
24
+ boot re-verify can run without needing the manifest or a re-download.
25
+ - **iOS zip-slip + zip-bomb protection.** Bundle extraction now inspects
26
+ every archive entry before writing to disk: rejects symlinks, absolute
27
+ paths, and any path that resolves outside the destination directory,
28
+ and caps total uncompressed size at 500 MB. A malicious bundle can no
29
+ longer overwrite files outside the sandbox or exhaust device storage.
30
+ (Android does not currently extract bundles in-plugin; when that is
31
+ added, the same validation must be applied.)
32
+ - **Secure storage is now always on.** Android persists secrets only
33
+ through `EncryptedSharedPreferences` (Keystore-backed); iOS persists
34
+ only through the Keychain. The `secureStorage: false` opt-out is
35
+ removed — passing it is ignored. On web, `initialize()` config is
36
+ sanitised before write-through to `localStorage`: `apiKey`, top-level
37
+ and `liveUpdate.publicKey`, and `security.publicKey` are stripped, so
38
+ a compromised script or stale cache cannot surface the credential.
39
+ Host apps must pass the apiKey/publicKey on every `initialize()`.
40
+ - **Android background retries are bounded + backoff-aware.** All three
41
+ enqueue sites (periodic, one-shot, notification-action) now pass
42
+ `setBackoffCriteria(EXPONENTIAL, 30s)`. The worker itself caps at
43
+ 5 retry attempts per run, so a persistently-failing server can no
44
+ longer burn battery in a tight retry loop — total wall-clock budget
45
+ for a failing run is ~15 minutes before falling through to the next
46
+ scheduled tick.
47
+ - **iOS background-task diagnostics.** `BGTaskScheduler.submit` errors
48
+ are now classified (`.notPermitted`, `.tooManyPendingTaskRequests`,
49
+ `.unavailable`) and logged with actionable messages. `.notPermitted`
50
+ almost always means the host app's `Info.plist` is missing the
51
+ scheduler identifier — previously a silent failure. We also cancel
52
+ any prior pending request before resubmitting to dodge the
53
+ "already-scheduled" edge case observed on a few iOS versions. Host
54
+ apps must declare `BGTaskSchedulerPermittedIdentifiers` with
55
+ `com.aoneahsan.nativeupdate.background` in their own Info.plist —
56
+ the framework's plist does not propagate to the app bundle.
57
+
58
+ ### Security (BREAKING)
59
+ - **Signature verification fails closed.** If the host app configures
60
+ `publicKey`, `requireSignature`, or `enableSignatureValidation`, a missing
61
+ signature now throws instead of silently passing. Previously, a manifest
62
+ with the signature field stripped out would bypass all integrity checks.
63
+ - **Checksum verification fails closed.** `verifyChecksum(data, '')` now
64
+ throws. Every OTA bundle manifest must ship a SHA-256 checksum; a missing
65
+ one is treated as tampering.
66
+ - **Monotonic version enforcement persists across reinstalls.** The plugin
67
+ now records the highest version ever applied per channel in Preferences
68
+ and refuses to apply any older bundle — even if the active-bundle state
69
+ was wiped. Closes a downgrade-attack path.
70
+ - **`setUpdateUrl()` is deprecated and ignored at runtime.** The update
71
+ server URL is fixed at `initialize()` time. Runtime mutation was an XSS
72
+ attack path (compromised WebView could repoint updates to a hostile
73
+ host). Re-call `initialize()` to switch servers.
74
+ - **Removed `allowDowngrade` from `UpdateOptions`.** Downgrades are a
75
+ debug/recovery operation and do not belong in a production option flag.
76
+ - **Removed `enableEncryption`, `encryptionKey`, `encryptionSalt` from
77
+ the public API.** Bundle encryption was only wired on the web path and
78
+ never implemented on Android or iOS — the option shipped a false
79
+ guarantee. Sign bundles (RSA-PSS/ECDSA) and serve them over HTTPS; the
80
+ plugin's existing verification is the correct integrity primitive.
81
+
82
+ ### Backend (native-update/backend)
83
+ - API key checksum comparison uses `hash_equals` (timing-safe) — closes a
84
+ byte-by-byte response-time leak on brute-force against short suffixes.
85
+ - Bundle download asserts `build->app_id === authenticated app->id` as
86
+ defense-in-depth beyond the signed URL.
87
+ - Device identifiers are HMAC-SHA256 hashed (keyed by `APP_KEY`) via an
88
+ Eloquent mutator before landing in `analytics_events` and
89
+ `device_activities`. Casual DB access can no longer correlate a row back
90
+ to a specific device.
91
+ - Build upload rejects versions ≤ current channel head unless an explicit
92
+ rollback flow is used. Prevents accidental and malicious downgrades on
93
+ live channels.
94
+ - `GET /api/health` unauth'd endpoint added for Hostinger uptime pings.
95
+ - `/api/v1/*` now carries a route-level `throttle:600,15` as
96
+ defense-in-depth on top of per-key rate limiting in middleware.
97
+ - `.env.example` tightened for production defaults: `APP_ENV=production`,
98
+ `APP_DEBUG=false`, `LOG_LEVEL=warning`, `LOG_CHANNEL=daily`,
99
+ `DB_CONNECTION=mysql`.
100
+ - **Signed bundle URLs include checksum + app_id in their signed payload**
101
+ and `BundleController::download` re-asserts both against the `Build`
102
+ row before streaming. A replayed URL whose Build was flipped to
103
+ archived now returns 403 instead of serving the old bundle.
104
+ - **Signed URL TTL moved from 5 minutes → 30 minutes and made
105
+ configurable** via `NATIVE_UPDATE_DOWNLOAD_TTL_MIN`. Five minutes
106
+ frequently expired mid-download on a slow mobile link.
107
+ - **Bundle downloads stream through Laravel**, never redirect to the
108
+ underlying storage URL — comment enforces the invariant. Keeps auth,
109
+ rate-limit, and audit in one chokepoint.
110
+ - **Signing-key decryption is now per-request memoised** in
111
+ `SigningKey::getPrivateKey()`. `rotate()` and `revoke()` clear the
112
+ cache so stale keys can't leak across a long-running worker.
113
+
114
+ ### Optimization
115
+ - **Resume-download correctness.** `resumeDownload()` now records whether
116
+ the server actually returned HTTP 206 (Partial Content) and decides
117
+ whether to concatenate the partial prefix or discard it accordingly.
118
+ Previously a server that fell back to HTTP 200 (full response)
119
+ silently produced a corrupted bundle by double-writing the prefix —
120
+ a latent corruption bug on CDNs that don't honour Range.
121
+ - **Jittered exponential backoff on download retry.** `downloadWithRetry`
122
+ now adds ±25% random jitter to each retry interval. Avoids the
123
+ thundering-herd scenario where many clients retry in lockstep after a
124
+ common failure (CDN blip, server restart) and hammer a recovering
125
+ server simultaneously.
126
+ - **Auto-cleanup is now the default.** After a successful bundle apply
127
+ the plugin keeps the last 3 bundles (active + 2 recent) and deletes
128
+ the rest. Host apps that want the old every-bundle-forever behavior
129
+ can pass `cleanupOldBundles: false` explicitly.
130
+
131
+ ### Payments (BREAKING)
132
+ - **Stripe + Cashier removed; PayPal (`srmklive/paypal`) takes over.**
133
+ New `SubscriptionController` exposes `subscribe → activate → cancel /
134
+ resume / changePlan` with PayPal's approval-URL flow. Webhook endpoint
135
+ moved from `/api/webhooks/stripe` → `/api/webhooks/paypal`, with a new
136
+ `PayPalWebhookController` that verifies transmissions via PayPal's
137
+ own `verifyWebHook` API.
138
+ - New migration `2026_04_18_000001_add_paypal_provider_to_subscriptions`
139
+ introduces provider-agnostic columns (`provider`,
140
+ `provider_subscription_id`, `provider_status`, `provider_plan_id`) on
141
+ `subscriptions`, `subscription_items`, and `users`. Legacy `stripe_*`
142
+ columns are kept nullable for one release to ease rollback.
143
+ - `.env.example` replaces `STRIPE_*` with `PAYPAL_MODE`,
144
+ `PAYPAL_LIVE_CLIENT_ID / SECRET / APP_ID`, `PAYPAL_PLAN_PRO`,
145
+ `PAYPAL_PLAN_ENTERPRISE`, `PAYPAL_WEBHOOK_ID`.
146
+ - `User` model drops the Cashier `Billable` trait and grows an
147
+ `activeSubscription()` helper against the new schema.
148
+
149
+ ### Migration
150
+ - Apps relying on `allowDowngrade: true` in `UpdateOptions` will fail to
151
+ apply older bundles. Remove the flag and treat rollback as a separate
152
+ flow.
153
+ - Apps passing `enableEncryption`, `encryptionKey`, or `encryptionSalt`
154
+ to `initialize()` or `configure()` will see them silently dropped.
155
+ Rely on signature + checksum verification for integrity.
156
+ - Apps calling `setUpdateUrl()` at runtime will receive a deprecation
157
+ warning and the call is a no-op. Pass `serverUrl` to `initialize()`.
158
+
159
+ ## [1.4.9] - 2026-03-11
160
+
161
+ ### Added
162
+ - Firestore-backed manifest reads through `backendType: 'firestore'`
163
+ - Secure manifest lookup support via `apiKeys/{apiKey}/manifests/{channel}`
164
+ - Concrete no-cost backend implementation guide for `website + Firestore + Google Drive`
165
+
166
+ ### Changed
167
+ - Website dashboard publish flow aligned to Google Drive asset uploads plus Firestore manifest publishing
168
+ - Website dashboard configuration/docs now recommend Firestore instead of the old `/api/updates` path
169
+ - Package config types now expose Firestore configuration for production app integration
170
+
171
+ ### Fixed
172
+ - Manifest publishing now writes the full manifest shape to both secure and compatibility Firestore paths
173
+ - Google Drive asset uploads now preserve correct filenames for ZIP bundles and generated manifest files
174
+
8
175
  ## [1.4.5] - 2026-02-25
9
176
 
10
177
  ### Changed
package/docs/CLAUDE.md ADDED
@@ -0,0 +1,101 @@
1
+ # Native Update - Documentation
2
+
3
+ Comprehensive documentation for the native-update Capacitor plugin and platform.
4
+
5
+ ## 🔴 3-Day Freshness Rule
6
+ Check and update this file at least every 3 days. See root CLAUDE.md.
7
+
8
+ ## Structure
9
+
10
+ | Folder | Purpose |
11
+ |--------|---------|
12
+ | `api/` | API reference documentation |
13
+ | `architecture/` | System architecture docs |
14
+ | `examples/` | Code examples |
15
+ | `features/` | Feature documentation |
16
+ | `getting-started/` | Quick start guides |
17
+ | `guides/` | How-to guides |
18
+ | `plans/` | Development plans and roadmap |
19
+ | `project-knowledge-base/` | AI-readable domain knowledge |
20
+ | `project-profiles/` | Project profile for portfolio/resume |
21
+ | `reports/` | Status and analysis reports |
22
+ | `security/` | Security documentation |
23
+ | `tracking/` | Progress tracker JSON files |
24
+
25
+ ## Key Reference Files
26
+
27
+ | File | Purpose |
28
+ |------|---------|
29
+ | `QUICK_START.md` | Getting started guide |
30
+ | `CHANGELOG.md` | Version history |
31
+ | `ROADMAP.md` | Future plans |
32
+ | `MIGRATION.md` | v1 to v2 migration guide |
33
+ | `SECURITY.md` | Security overview |
34
+ | `KNOWN_LIMITATIONS.md` | Current limitations |
35
+ | `TESTING_REQUIREMENTS.md` | Test guidelines |
36
+ | `SERVER_REQUIREMENTS.md` | Backend requirements |
37
+ | `CLI_REFERENCE.md` | CLI command reference |
38
+
39
+ ## Feature Guides
40
+
41
+ | File | Topic |
42
+ |------|-------|
43
+ | `APP_REVIEW_GUIDE.md` | App review integration |
44
+ | `LIVE_UPDATES_GUIDE.md` | OTA live updates |
45
+ | `NATIVE_UPDATES_GUIDE.md` | App store updates |
46
+ | `BUNDLE_SIGNING.md` | Bundle security signing |
47
+ | `BACKGROUND_UPDATES.md` | Background update processing |
48
+
49
+ ## Project Profile Maintenance Rule
50
+
51
+ **CRITICAL: Keep the dated project profile file current**
52
+
53
+ - Canonical location: `/docs/project-profiles/`
54
+ - Filename pattern: `native-update-capacitor-update-platform-project-profile-last-updated-YYYY-MM-DD.md`
55
+ - Update weekly when project is active, or whenever major features, positioning, roadmap, SEO metadata, resume bullets, or portfolio messaging changes
56
+ - Always update inside: `Reference Date`, `Last Updated`, `Update History`
57
+ - Keep only the most recent 10 update-history records
58
+ - All sub-projects with their own `CLAUDE.md` must follow this same rule
59
+
60
+ ## Root Portfolio File Maintenance Rule
61
+
62
+ - Maintain exactly one root portfolio info file: `NATIVE-UPDATE_portfolio-info_YYYY-MM-DD.md`
63
+ - Refresh only after 7+ days unless a major release or material change happens sooner
64
+ - Keep at most 10 update-history records
65
+ - When portfolio file changes, also update: `README.md`, root `CLAUDE.md`, and the dated project-profile file
66
+
67
+ ## AI Knowledge Base Maintenance Rule
68
+
69
+ **CRITICAL: Keep `/docs/project-knowledge-base/` current**
70
+
71
+ - Update every 2 weeks while project is active
72
+ - Also update when: routes, forms, user roles, docs, legal pages, modules, tech stack, integrations, or backend assumptions change
73
+
74
+ ### Required Files (minimum)
75
+ 1. `README.md` — Knowledge base index
76
+ 2. `01-system-overview.md` — System overview
77
+ 3. `02-routes-pages-forms-users.md` — Routes, pages, forms, user roles
78
+ 4. `03-tech-stack-modules-services.md` — Tech stack, modules, services
79
+ 5. `04-data-models-integrations.md` — Data models, integrations
80
+ 6. `05-docs-corpus-inventory.md` — Documentation inventory
81
+ 7. `06-operations-testing-legal-content.md` — Operations, testing, legal
82
+
83
+ ### Sync Triggers
84
+ - When `/docs` gains or loses files → update `05-docs-corpus-inventory.md`
85
+ - When website routes/pages/forms change → update `02-routes-pages-forms-users.md`
86
+ - When modules/services/schema/integrations change → update `03-tech-stack-modules-services.md` and `04-data-models-integrations.md`
87
+ - Every file must keep `Reference Date` and `Last Updated` current
88
+
89
+ ## Package Update History
90
+
91
+ | Date | Updated By | Notes |
92
+ |------|------------|-------|
93
+ | 2026-03-24 | Codex | Refreshed docs, verified package state |
94
+ | 2026-02-02 | Claude | Full update to latest versions |
95
+
96
+ ## FilesHub Rule (inherited)
97
+ All file storage uses FilesHub API. See root CLAUDE.md.
98
+
99
+ ---
100
+
101
+ **Last Updated**: 2026-04-02
package/docs/MIGRATION.md CHANGED
@@ -1,5 +1,92 @@
1
1
  # Migration Guide
2
2
 
3
+ ## Upgrading v1 → v2.0.0
4
+
5
+ v2 is a security-focused hardening release with a handful of breaking
6
+ changes. Every change is either (a) a credential-hardening tightening
7
+ that removes a silent-pass path, or (b) a feature removal for an option
8
+ that was documented but never actually implemented. Typical integrations
9
+ need only 2–3 config edits.
10
+
11
+ ### Required action
12
+
13
+ #### 1. Re-pass `apiKey` / `publicKey` on every `initialize()`
14
+
15
+ v1 persisted config (including `apiKey` and `publicKey`) to
16
+ `localStorage` / `SharedPreferences` / `UserDefaults`. v2 strips these
17
+ fields before persistence on every platform. Your app must provide them
18
+ on every `initialize()` call instead of relying on the cached copy.
19
+
20
+ ```ts
21
+ await NativeUpdate.initialize({
22
+ serverUrl: import.meta.env.VITE_NATIVE_UPDATE_API_URL,
23
+ apiKey: import.meta.env.VITE_NATIVE_UPDATE_API_KEY,
24
+ publicKey: import.meta.env.VITE_NATIVE_UPDATE_PUBLIC_KEY,
25
+ appId: 'com.your.app',
26
+ channel: 'production',
27
+ });
28
+ ```
29
+
30
+ If you relied on a "call initialize once, then continue" pattern without
31
+ re-passing the key, sync + download calls will fail with
32
+ "API key not configured" after the first cold start.
33
+
34
+ #### 2. Remove `enableEncryption`, `encryptionKey`, `encryptionSalt`
35
+
36
+ These options claimed AES-256-GCM bundle encryption but were only wired
37
+ on the web platform and never on Android/iOS — they shipped a false
38
+ guarantee. v2 removes them from the public API.
39
+
40
+ #### 3. Remove `allowDowngrade` from `UpdateOptions`
41
+
42
+ Downgrades are a debug / recovery operation, not a production flag.
43
+ v2 removes the option and always blocks downgrades against the
44
+ persisted high-water mark per channel.
45
+
46
+ #### 4. Stop calling `setUpdateUrl()` at runtime
47
+
48
+ `setUpdateUrl()` is deprecated and now a no-op. Server URL is fixed at
49
+ `initialize()` to close an XSS-repoint attack path. Re-call
50
+ `initialize()` with the new config if you legitimately need to switch
51
+ servers.
52
+
53
+ #### 5. iOS host-app Info.plist for background updates
54
+
55
+ If you use `enableBackgroundUpdates` on iOS, add to your app's own
56
+ `Info.plist`:
57
+
58
+ ```xml
59
+ <key>UIBackgroundModes</key>
60
+ <array><string>background-app-refresh</string></array>
61
+ <key>BGTaskSchedulerPermittedIdentifiers</key>
62
+ <array><string>com.aoneahsan.nativeupdate.background</string></array>
63
+ ```
64
+
65
+ Without these, iOS silently refuses to register the background task.
66
+ v2 surfaces an actionable error in `backgroundUpdateStatus.lastError`.
67
+
68
+ ### Behaviour that changed (no action needed)
69
+
70
+ - Signature verification fails closed when a `publicKey` is configured.
71
+ - Active bundle is re-hashed + re-signature-verified on every cold start.
72
+ - 2 failed cold starts without `notifyAppReady()` trigger auto-rollback.
73
+ - 3 most recent bundles kept by default (pass `cleanupOldBundles: false`
74
+ to opt out).
75
+ - Jittered exponential backoff on retries.
76
+ - Android WorkManager background jobs cap at 5 retries.
77
+
78
+ ### Backend changes (if self-hosting)
79
+
80
+ - Stripe → PayPal swap via `srmklive/paypal`. Run `composer update`,
81
+ apply the new migration, set `PAYPAL_*` env vars. See
82
+ `/docs/deployment/HOSTINGER_DEPLOY.md`.
83
+ - Signed URL TTL moved 5min → 30min, configurable via
84
+ `NATIVE_UPDATE_DOWNLOAD_TTL_MIN`.
85
+ - Device IDs HMAC-SHA256 hashed at DB write. New rows only — existing
86
+ rows are not backfilled.
87
+
88
+ ---
89
+
3
90
  ## Migrating from Other Update Solutions
4
91
 
5
92
  ### From Capacitor Live Updates (Official)
package/docs/README.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  Welcome to the comprehensive documentation for **Capacitor Native Update**, a complete update lifecycle management solution for Capacitor applications.
4
4
 
5
+ ## Verified Status
6
+
7
+ - Last reviewed: `2026-03-25`
8
+ - Current package version: `1.4.9`
9
+ - Test status: `yarn test:run` passed with 81 tests
10
+ - Build status: `yarn build` passed
11
+ - Root package manager: `yarn@4.10.3`
12
+ - Root package workflow is Yarn-only and no longer shells out to npm or pnpm
13
+ - Root portfolio info file: `../NATIVE-UPDATE_portfolio-info_2026-03-25.md`
14
+ - Current dated project profile: `./project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-25.md`
15
+
5
16
  > **Dashboard & Management Platform**: [nativeupdate.aoneahsan.com](https://nativeupdate.aoneahsan.com)
6
17
  >
7
18
  > The platform provides a complete SaaS solution for managing your updates including:
@@ -97,7 +108,7 @@ Consistent API across iOS, Android, and Web platforms with platform-specific opt
97
108
  - Capacitor 7.0.0 or higher
98
109
  - iOS 13.0+ for iOS apps
99
110
  - Android 5.0+ (API level 21) for Android apps
100
- - Node.js 18+ for development
111
+ - Node.js `>=24.13.0` for development
101
112
 
102
113
  ## 🤝 Contributing
103
114
 
@@ -117,4 +128,4 @@ This project is licensed under the MIT License. See the [LICENSE](../LICENSE) fi
117
128
 
118
129
  ---
119
130
 
120
- Made with ❤️ by Ahsan Mahmood for the developer community
131
+ Created by Ahsan Mahmood for the developer community.