native-update 3.1.2 → 3.1.3

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 (202) hide show
  1. package/AI-INTEGRATION-GUIDE.md +15 -10
  2. package/Readme.md +35 -35
  3. package/android/src/main/java/com/aoneahsan/nativeupdate/LiveUpdatePlugin.kt +88 -12
  4. package/android/src/main/java/com/aoneahsan/nativeupdate/NativeUpdatePlugin.kt +45 -18
  5. package/dist/esm/definitions.d.ts +8 -0
  6. package/dist/esm/plugin.js +16 -2
  7. package/dist/plugin.cjs.js +1 -1
  8. package/dist/plugin.esm.js +1 -1
  9. package/dist/plugin.js +2 -2
  10. package/docs/CHANGELOG.md +73 -0
  11. package/docs/KNOWN_LIMITATIONS.md +2 -2
  12. package/docs/MIGRATION.md +1 -1
  13. package/ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift +64 -8
  14. package/ios/Plugin/NativeUpdatePlugin.swift +39 -13
  15. package/package.json +8 -3
  16. package/docs/AGENTS.md +0 -47
  17. package/docs/APP_REVIEW_GUIDE.md +0 -768
  18. package/docs/BUNDLE_SIGNING.md +0 -277
  19. package/docs/CLAUDE.md +0 -110
  20. package/docs/COMPREHENSIVE_AUDIT_REPORT.md +0 -526
  21. package/docs/DEPLOY_NOTES.md +0 -116
  22. package/docs/EXAMPLE_APPS_SIMPLIFICATION_PLAN.md +0 -384
  23. package/docs/EXAMPLE_APPS_SIMPLIFICATION_TRACKER.md +0 -390
  24. package/docs/LIVE_UPDATES_GUIDE.md +0 -675
  25. package/docs/MANUAL-TASKS.md +0 -30
  26. package/docs/MARKETING_WEBSITE_TRACKER.md +0 -677
  27. package/docs/NATIVE_UPDATES_GUIDE.md +0 -695
  28. package/docs/PACKAGES.md +0 -167
  29. package/docs/PERFORMANCE.md +0 -110
  30. package/docs/PROJECT_COMPLETION_TRACKER.md +0 -411
  31. package/docs/QUICK_START.md +0 -595
  32. package/docs/README.md +0 -130
  33. package/docs/REMAINING_FEATURES.md +0 -192
  34. package/docs/ROADMAP.md +0 -295
  35. package/docs/SECURITY-IF-REPO-PUBLIC.md +0 -232
  36. package/docs/SECURITY.md +0 -356
  37. package/docs/TESTING_REQUIREMENTS.md +0 -201
  38. package/docs/ai-knowledge-base/00-project-profile.md +0 -38
  39. package/docs/ai-knowledge-base/01-features.md +0 -46
  40. package/docs/ai-knowledge-base/02-routes.md +0 -72
  41. package/docs/ai-knowledge-base/03-tech-stack.md +0 -57
  42. package/docs/ai-knowledge-base/README.md +0 -23
  43. package/docs/analytics-tracking.md +0 -37
  44. package/docs/api/API.md +0 -558
  45. package/docs/api/FEATURES.md +0 -414
  46. package/docs/api/app-review-api.md +0 -239
  47. package/docs/api/app-update-api.md +0 -154
  48. package/docs/api/background-update-api.md +0 -170
  49. package/docs/api/events-api.md +0 -323
  50. package/docs/api/live-update-api.md +0 -258
  51. package/docs/archive/MARKETING_WEBSITE_PLAN.md +0 -659
  52. package/docs/background-updates.md +0 -392
  53. package/docs/capacitor-official-plugins.md +0 -46
  54. package/docs/capawesome-plugins.md +0 -29
  55. package/docs/cli-reference.md +0 -321
  56. package/docs/deployment/HOSTINGER_DEPLOY.md +0 -370
  57. package/docs/deployment/PRODUCTION-DEPLOY-CHECKLIST.md +0 -184
  58. package/docs/docs-site/plan.md +0 -201
  59. package/docs/docs-site/scope.md +0 -127
  60. package/docs/docs-site/tracker.json +0 -235
  61. package/docs/error-handling-tracking.md +0 -37
  62. package/docs/examples/advanced-scenarios.md +0 -394
  63. package/docs/examples/android-manifest-example.xml +0 -77
  64. package/docs/examples/basic-usage.md +0 -206
  65. package/docs/examples/node-express-backend-example.md +0 -28
  66. package/docs/examples/react-capacitor-example.md +0 -29
  67. package/docs/features/app-reviews.md +0 -975
  68. package/docs/features/app-updates.md +0 -785
  69. package/docs/features/e2e-full-verification/00-overview.md +0 -99
  70. package/docs/features/e2e-full-verification/00-tracker.json +0 -284
  71. package/docs/features/e2e-full-verification/phase01-backend-schema-fixes.md +0 -183
  72. package/docs/features/e2e-full-verification/phase02-test-auth.md +0 -176
  73. package/docs/features/e2e-full-verification/phase03-api-test-coverage.md +0 -63
  74. package/docs/features/e2e-full-verification/phase04-frontend-package-contract-audit.md +0 -73
  75. package/docs/features/e2e-full-verification/phase05-browser-e2e-matrix.md +0 -69
  76. package/docs/features/e2e-full-verification/phase06-deploy-prod-smoke.md +0 -51
  77. package/docs/features/e2e-full-verification/results/phase01-drift-report.md +0 -50
  78. package/docs/features/e2e-full-verification/results/phase03-coverage-matrix.md +0 -215
  79. package/docs/features/e2e-full-verification/results/phase04-frontend-contract.md +0 -139
  80. package/docs/features/e2e-full-verification/results/phase05-e2e-results.md +0 -99
  81. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-01-dashboard.png +0 -0
  82. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-02-signup.png +0 -0
  83. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-03-settings-persisted.png +0 -0
  84. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-04a-app-created.png +0 -0
  85. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-04b-duplicate-bundle-422.png +0 -0
  86. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-05-plan-limit-403.png +0 -0
  87. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-08a-upload-graceful-fail.png +0 -0
  88. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-08b-builds-list.png +0 -0
  89. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-10-rollout-25pct.png +0 -0
  90. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-11-analytics.png +0 -0
  91. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-12-drive-disconnected.png +0 -0
  92. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-13-pricing.png +0 -0
  93. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-14-isolation-403.png +0 -0
  94. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-15a-admin-overview.png +0 -0
  95. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-15b-regular-user-admin-redirect.png +0 -0
  96. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-16a-delete-dialog.png +0 -0
  97. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-17-mobile-375.png +0 -0
  98. package/docs/features/e2e-full-verification/results/route-list.json +0 -1
  99. package/docs/features/laravel-nova-backend/ASSESSMENT-SUMMARY.md +0 -96
  100. package/docs/features/laravel-nova-backend/IMPLEMENTATION-PLAN.md +0 -504
  101. package/docs/features/laravel-nova-backend/progress-tracker.json +0 -184
  102. package/docs/features/live-updates.md +0 -642
  103. package/docs/features/queues-and-emails/00-overview.md +0 -41
  104. package/docs/features/queues-and-emails/00-tracker.json +0 -99
  105. package/docs/features/queues-and-emails/phase01-foundation.md +0 -15
  106. package/docs/features/queues-and-emails/phase02-queued-jobs.md +0 -19
  107. package/docs/features/queues-and-emails/phase03-transactional-emails.md +0 -16
  108. package/docs/features/queues-and-emails/phase04-quota-ops.md +0 -17
  109. package/docs/features/queues-and-emails/phase05-async-build-processing-DECISION.md +0 -16
  110. package/docs/features/queues-and-emails/phase06-verify-deploy.md +0 -17
  111. package/docs/getting-started/configuration.md +0 -469
  112. package/docs/getting-started/installation.md +0 -300
  113. package/docs/getting-started/quick-start.md +0 -430
  114. package/docs/guides/BACKEND_TEMPLATES_GUIDE.md +0 -183
  115. package/docs/guides/admin-panel.md +0 -268
  116. package/docs/guides/channel-management.md +0 -343
  117. package/docs/guides/dashboard-guide.md +0 -365
  118. package/docs/guides/deployment-guide.md +0 -335
  119. package/docs/guides/end-to-end-workflow.md +0 -491
  120. package/docs/guides/key-management.md +0 -284
  121. package/docs/guides/migration-from-codepush.md +0 -145
  122. package/docs/guides/security-best-practices.md +0 -1057
  123. package/docs/guides/testing-guide.md +0 -346
  124. package/docs/guides/troubleshooting.md +0 -482
  125. package/docs/package-audit.md +0 -41
  126. package/docs/plans/PLANNING_COMPLETE_SUMMARY.md +0 -361
  127. package/docs/plans/TASK_1_ANDROID_EXAMPLE_APP.md +0 -401
  128. package/docs/plans/TASK_2_API_ENDPOINTS.md +0 -856
  129. package/docs/plans/TASK_2_DASHBOARD_UI_UX.md +0 -820
  130. package/docs/plans/TASK_2_DATABASE_SCHEMA.md +0 -704
  131. package/docs/plans/TASK_2_GOOGLE_DRIVE_INTEGRATION.md +0 -646
  132. package/docs/plans/TASK_2_SAAS_ARCHITECTURE.md +0 -587
  133. package/docs/plans/TASK_2_USER_AUTHENTICATION.md +0 -600
  134. package/docs/play-store/ASO-METADATA.md +0 -5
  135. package/docs/play-store/DATA-SAFETY.md +0 -5
  136. package/docs/play-store/DECLARATIONS.md +0 -5
  137. package/docs/play-store/README.md +0 -27
  138. package/docs/play-store/RELEASE-NOTES.md +0 -99
  139. package/docs/play-store/RELEASE-STEPS.md +0 -6
  140. package/docs/play-store/STORE-LISTING.md +0 -7
  141. package/docs/play-store/SUBMISSION-CHECKLIST.md +0 -5
  142. package/docs/production-readiness.md +0 -475
  143. package/docs/project-audit/2026-05-16/00-FINALIZATION-PLAN.md +0 -123
  144. package/docs/project-audit/2026-05-16/01-BATCH-PLAN.md +0 -227
  145. package/docs/project-audit/2026-05-16/02-AUDIT-FINDINGS.md +0 -144
  146. package/docs/project-audit/2026-05-16/sessions/batch-01.md +0 -42
  147. package/docs/project-audit/2026-05-16/sessions/batch-02.md +0 -74
  148. package/docs/project-audit/2026-05-16/sessions/batch-03.md +0 -71
  149. package/docs/project-audit/2026-05-16/sessions/batch-04.md +0 -88
  150. package/docs/project-audit/2026-05-16/sessions/batch-05.md +0 -63
  151. package/docs/project-audit/2026-05-16/sessions/batch-06.md +0 -103
  152. package/docs/project-audit/2026-05-16/sessions/batch-07.md +0 -61
  153. package/docs/project-audit/2026-05-16/sessions/batch-08.md +0 -101
  154. package/docs/project-audit/2026-05-16/sessions/batch-09.md +0 -105
  155. package/docs/project-audit/2026-05-16/sessions/batch-10.md +0 -102
  156. package/docs/project-audit/AUDIT-HISTORY.md +0 -74
  157. package/docs/project-audit/BATCH-PLAN.md +0 -168
  158. package/docs/project-audit/MARKETING-WEBSITE-FINDINGS-2026-05-11.md +0 -73
  159. package/docs/project-audit/PRODUCTION-READINESS-AUDIT-2026-05-08.md +0 -275
  160. package/docs/project-finalization/00-tracker.json +0 -60
  161. package/docs/project-knowledge-base/01-system-overview.md +0 -227
  162. package/docs/project-knowledge-base/02-routes-pages-forms-users.md +0 -352
  163. package/docs/project-knowledge-base/03-tech-stack-modules-services.md +0 -379
  164. package/docs/project-knowledge-base/04-data-models-integrations.md +0 -244
  165. package/docs/project-knowledge-base/05-docs-corpus-inventory.md +0 -256
  166. package/docs/project-knowledge-base/06-operations-testing-legal-content.md +0 -208
  167. package/docs/project-knowledge-base/README.md +0 -103
  168. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-05-19.md +0 -81
  169. package/docs/reports/AUDIT_SUMMARY_2025-12-26.md +0 -203
  170. package/docs/reports/CLAUDE-CODE-COMPLETION-PROMPT.md +0 -403
  171. package/docs/reports/CLAUDE_CODE_PROMPT.md +0 -29
  172. package/docs/reports/CODEBASE_STATUS_REPORT.md +0 -272
  173. package/docs/reports/COMPLETE_VERIFICATION.md +0 -106
  174. package/docs/reports/COMPREHENSIVE-PROJECT-AUDIT-2026-02-24.md +0 -747
  175. package/docs/reports/EVENT_FLOW_VERIFICATION.md +0 -80
  176. package/docs/reports/EXAMPLE_APPS_SIMPLIFICATION_COMPLETE.md +0 -369
  177. package/docs/reports/FINAL_STATUS.md +0 -122
  178. package/docs/reports/FINAL_VERIFICATION_CHECKLIST.md +0 -425
  179. package/docs/reports/MARKETING_WEBSITE_COMPLETE.md +0 -466
  180. package/docs/reports/PACKAGE_COMPLETENESS_REPORT.md +0 -130
  181. package/docs/reports/PRODUCTION_STATUS.md +0 -115
  182. package/docs/reports/PROJECT_RESTRUCTURE_2025-12-27.md +0 -287
  183. package/docs/reports/PROJECT_RESTRUCTURE_FINAL_SUMMARY.md +0 -464
  184. package/docs/reports/PUBLISHING_VERIFICATION.md +0 -144
  185. package/docs/reports/RELEASE_READY_SUMMARY.md +0 -99
  186. package/docs/reports/claude-completion.json +0 -241
  187. package/docs/rules-tracker.md +0 -102
  188. package/docs/security/PRE-LAUNCH-PENTEST-CHECKLIST.md +0 -116
  189. package/docs/security/certificate-pinning.md +0 -122
  190. package/docs/seo-aeo-rules.json +0 -3043
  191. package/docs/social-media-marketing/README.md +0 -81
  192. package/docs/social-media-marketing/posts-batch-01.md +0 -613
  193. package/docs/social-media-marketing/posts-batch-02.md +0 -528
  194. package/docs/social-media-marketing/whatsapp-messages-batch-01.md +0 -458
  195. package/docs/social-media-marketing/whatsapp-status-batch-01.md +0 -355
  196. package/docs/tracking/IMPLEMENTATION_TRACKER.md +0 -303
  197. package/docs/tracking/capacitor-rollout-note-2026-03-01.md +0 -21
  198. package/docs/tracking/completion-tracker-2026-02-24.json +0 -174
  199. package/docs/tracking/finalization-2026-05-16-tracker.json +0 -346
  200. package/docs/tracking/full-audit-tracker.json +0 -121
  201. package/docs/tracking/production-readiness-audit-tracker.json +0 -429
  202. package/docs/tracking/seo-checklist-tracker.json +0 -333
@@ -1,241 +0,0 @@
1
- {
2
- "generated_at": "2026-02-23",
3
- "repo": "native-update",
4
- "build_status": "passing",
5
- "lint_status": "passing",
6
- "summary": {
7
- "total_issues": 10,
8
- "done": 9,
9
- "deferred": 1,
10
- "blocked": 0
11
- },
12
- "issues": [
13
- {
14
- "id": "ISSUE-001",
15
- "title": "Conflicting Production Ready Messaging",
16
- "status": "done",
17
- "files_changed": [
18
- "docs/production-readiness.md",
19
- "docs/KNOWN_LIMITATIONS.md",
20
- "docs/features/live-updates.md"
21
- ],
22
- "tests_run": ["yarn build", "yarn lint"],
23
- "notes": "Updated all documentation to consistently reflect production-ready status. SDK is production-ready; backend infrastructure is user-provided."
24
- },
25
- {
26
- "id": "ISSUE-002",
27
- "title": "Example App API Mismatch + E2E Tests",
28
- "status": "done",
29
- "files_changed": [
30
- "src/definitions.ts",
31
- "src/plugin.ts",
32
- "src/web.ts",
33
- "example-apps/react-capacitor/src/App.tsx",
34
- "example-apps/react-capacitor/src/vite-env.d.ts",
35
- "example-apps/react-capacitor/.env.example"
36
- ],
37
- "tests_run": ["yarn build", "yarn lint"],
38
- "notes": "Added convenience API methods. Fixed example app to match E2E specs: data-testid='version-text', 'no-update-message', 'progress-bar', 'progress-text', 'download-cancelled', 'download-success-indicator'. Added env-based server URL configuration (VITE_UPDATE_SERVER_URL) defaulting to mock server port 3456."
39
- },
40
- {
41
- "id": "ISSUE-003",
42
- "title": "Web Plugin sync() Is a Stub",
43
- "status": "done",
44
- "files_changed": [
45
- "src/plugin.ts",
46
- "src/core/errors.ts"
47
- ],
48
- "tests_run": ["yarn build", "yarn lint"],
49
- "notes": "Implemented real sync() method that checks server for updates, downloads bundle via DownloadManager, decrypts if encryption enabled, validates checksum and signature, saves to BundleManager, and sets as active. Added missing error codes (NETWORK_ERROR, SERVER_ERROR, UPDATE_NOT_AVAILABLE, VALIDATION_ERROR)."
50
- },
51
- {
52
- "id": "ISSUE-004",
53
- "title": "Cancel Update/Download Not Exposed to Public API",
54
- "status": "done",
55
- "files_changed": [
56
- "src/definitions.ts",
57
- "src/plugin.ts",
58
- "src/web.ts",
59
- "src/index.ts"
60
- ],
61
- "tests_run": ["yarn build", "yarn lint"],
62
- "notes": "Added public cancelDownload(bundleId) and cancelAllDownloads() methods to definitions.ts, plugin.ts, and web.ts. Methods wire to DownloadManager.cancelDownload() and UpdateManager.cancelUpdate()."
63
- },
64
- {
65
- "id": "ISSUE-005",
66
- "title": "Background Scheduler Uses Mock Data",
67
- "status": "done",
68
- "files_changed": [
69
- "src/background-update/background-scheduler.ts",
70
- "src/core/plugin-manager.ts",
71
- "src/plugin.ts"
72
- ],
73
- "tests_run": ["yarn build", "yarn lint"],
74
- "notes": "BackgroundScheduler now uses dependency injection with setDependencies(). PluginManager creates BackgroundScheduler during initialization and wires appUpdateManager, versionManager, and bundleManager. enableBackgroundUpdates(), disableBackgroundUpdates(), getBackgroundUpdateStatus(), and triggerBackgroundCheck() now use the scheduler."
75
- },
76
- {
77
- "id": "ISSUE-006",
78
- "title": "App Version Retrieval Is Stubbed",
79
- "status": "done",
80
- "files_changed": [
81
- "src/app-update/app-update-checker.ts"
82
- ],
83
- "tests_run": ["yarn build", "yarn lint"],
84
- "notes": "Updated getCurrentVersion() to dynamically import @capacitor/app for real version retrieval. Added 1-minute caching for app info. Fallback chain: @capacitor/app -> config -> window.APP_VERSION -> '1.0.0'."
85
- },
86
- {
87
- "id": "ISSUE-007",
88
- "title": "End-to-End Encryption Promised, Not Implemented",
89
- "status": "done",
90
- "files_changed": [
91
- "src/security/crypto.ts",
92
- "src/definitions.ts",
93
- "src/index.ts",
94
- "src/core/config.ts",
95
- "src/plugin.ts",
96
- "src/core/errors.ts"
97
- ],
98
- "tests_run": ["yarn build", "yarn lint"],
99
- "notes": "Full AES-256-GCM encryption integrated into update flow. Added enableEncryption, encryptionKey, encryptionSalt to LiveUpdateConfig, PluginInitConfig, and PluginConfig. sync() and downloadUpdate() now decrypt bundles when encryption is enabled. Added validation to reject empty salt when encryption is enabled. Added VALIDATION_ERROR error code."
100
- },
101
- {
102
- "id": "ISSUE-008",
103
- "title": "Delta Updates WASM Optimization Missing",
104
- "status": "deferred",
105
- "files_changed": [],
106
- "tests_run": [],
107
- "notes": "WASM optimization is a future enhancement. Current delta processor has working fallback mechanism that gracefully degrades to full download when WASM is not available. The code is functional and production-ready - WASM would provide performance optimization for binary diffs but is not required."
108
- },
109
- {
110
- "id": "ISSUE-009",
111
- "title": "Docs Refer to Missing/Outdated Features",
112
- "status": "done",
113
- "files_changed": [
114
- "docs/features/live-updates.md",
115
- "docs/KNOWN_LIMITATIONS.md",
116
- "docs/production-readiness.md"
117
- ],
118
- "tests_run": ["yarn build", "yarn lint"],
119
- "notes": "Removed 'coming soon' from delta updates (already implemented via server). Updated KNOWN_LIMITATIONS.md to reflect iOS ZIPFoundation implementation is complete. Updated version to 2.0.0 and status to 'Production Ready'."
120
- },
121
- {
122
- "id": "ISSUE-010",
123
- "title": "Backend Template TODOs Are Unfulfilled by Default",
124
- "status": "done",
125
- "files_changed": [],
126
- "tests_run": [],
127
- "notes": "TODOs in backend templates are INTENTIONAL customization points, not incomplete code. Per docs/guides/BACKEND_TEMPLATES_GUIDE.md, templates are 'starting points that require customization for your specific infrastructure'. This is by design - templates include clear documentation on how to implement storage/database adapters (S3, GCS, PostgreSQL, MongoDB, etc.)."
128
- }
129
- ],
130
- "files_changed_summary": {
131
- "total_files_modified": 18,
132
- "core_plugin": [
133
- "src/definitions.ts",
134
- "src/plugin.ts",
135
- "src/web.ts",
136
- "src/index.ts",
137
- "src/core/errors.ts",
138
- "src/core/config.ts",
139
- "src/core/plugin-manager.ts"
140
- ],
141
- "security": [
142
- "src/security/crypto.ts"
143
- ],
144
- "background_update": [
145
- "src/background-update/background-scheduler.ts"
146
- ],
147
- "app_update": [
148
- "src/app-update/app-update-checker.ts"
149
- ],
150
- "documentation": [
151
- "docs/production-readiness.md",
152
- "docs/KNOWN_LIMITATIONS.md",
153
- "docs/features/live-updates.md"
154
- ],
155
- "examples": [
156
- "example-apps/react-capacitor/src/App.tsx",
157
- "example-apps/react-capacitor/src/vite-env.d.ts",
158
- "example-apps/react-capacitor/.env.example"
159
- ]
160
- },
161
- "new_api_methods": [
162
- "checkForUpdate() -> CheckForUpdateResult",
163
- "downloadUpdate(options: DownloadUpdateOptions) -> BundleInfo",
164
- "applyUpdate(bundleId: string) -> void",
165
- "cancelDownload(bundleId: string) -> void",
166
- "cancelAllDownloads() -> void",
167
- "isDownloading(bundleId?: string) -> boolean",
168
- "getActiveDownloadCount() -> number"
169
- ],
170
- "new_types_exported": [
171
- "CheckForUpdateResult",
172
- "DownloadUpdateOptions",
173
- "CryptoUtils",
174
- "EncryptionConfig",
175
- "EncryptedBundle"
176
- ],
177
- "encryption_integration": {
178
- "algorithm": "AES-256-GCM",
179
- "key_derivation": "PBKDF2 with 100,000 iterations",
180
- "iv_length": 12,
181
- "tag_length": 128,
182
- "config_options": {
183
- "LiveUpdateConfig": ["enableEncryption", "encryptionKey", "encryptionSalt"],
184
- "PluginInitConfig": ["enableEncryption", "encryptionKey", "encryptionSalt"],
185
- "PluginConfig": ["enableEncryption", "encryptionKey", "encryptionSalt"]
186
- },
187
- "integration_points": [
188
- "sync() - decrypts after download, validates checksum and signature before activation",
189
- "downloadUpdate() - decrypts after download, validates checksum and signature before saving"
190
- ],
191
- "validation": {
192
- "empty_salt_rejected": true,
193
- "empty_key_rejected": true,
194
- "non_encrypted_bundle_rejected_when_encryption_enabled": true
195
- }
196
- },
197
- "signature_verification": {
198
- "implemented_in": "validateBundleData()",
199
- "uses": "SecurityValidator.verifySignature()",
200
- "triggers_when": "requireSignature config is true",
201
- "validation": {
202
- "missing_publicKey_rejected": true,
203
- "missing_signature_rejected": true,
204
- "invalid_signature_rejected": true
205
- },
206
- "server_response_fields": {
207
- "CheckForUpdateResult": "signature field added",
208
- "DownloadUpdateOptions": "signature field added"
209
- }
210
- },
211
- "background_scheduler_wiring": {
212
- "dependency_injection": "BackgroundScheduler.setDependencies()",
213
- "wired_in": "PluginManager.initialize()",
214
- "dependencies": [
215
- "appUpdateManager",
216
- "versionManager",
217
- "bundleManager"
218
- ],
219
- "methods_using_scheduler": [
220
- "enableBackgroundUpdates()",
221
- "disableBackgroundUpdates()",
222
- "getBackgroundUpdateStatus()",
223
- "triggerBackgroundCheck()"
224
- ]
225
- },
226
- "e2e_alignment": {
227
- "data_testids_fixed": [
228
- "version-text (was current-version)",
229
- "no-update-message (added)",
230
- "progress-bar (added alongside download-progress)",
231
- "progress-text (added)",
232
- "download-cancelled (added)",
233
- "download-success-indicator (added)"
234
- ],
235
- "server_url_config": {
236
- "env_variable": "VITE_UPDATE_SERVER_URL",
237
- "default": "http://localhost:3456",
238
- "matches_mock_server": true
239
- }
240
- }
241
- }
@@ -1,102 +0,0 @@
1
- # Rules Tracker — Native Update
2
-
3
- This file tracks the application of the Generic Project Rules master prompt (R-001 through R-039) against this monorepo. It is the source of truth for "when was rule X last applied" and is used to skip recently-applied rules on re-runs.
4
-
5
- **Tracker last updated:** 2026-05-18
6
- **Run by:** Claude Code (Opus 4.7)
7
- **Run scope:** R-033 reclassified to N/A after v3.0.0 Firestore removal (full audit cooldown still in effect until 2026-05-23)
8
-
9
- ---
10
-
11
- ## Project context (locked answers)
12
-
13
- | # | Question | Answer |
14
- |---|---|---|
15
- | 1 | Private or public git repo? | **Public** — `github.com/aoneahsan/native-update`, MIT license |
16
- | 2 | Project + brand name? | Project: `native-update` (npm) · Brand: **Native Update** |
17
- | 3 | App identifier / bundle ID | Plugin (npm) has none. Website Capacitor app: `com.zaions.nativeupdate` (per `website/capacitor.config.ts`); example app: per its own config |
18
- | 4 | Developer contact | Ahsan Mahmood · aoneahsan@gmail.com · +923046619706 · linkedin.com/in/aoneahsan · aoneahsan.com |
19
- | 5 | Domain / social / support | Domain: `nativeupdate.aoneahsan.com` (live). Socials: GitHub `aoneahsan`, NPM `aoneahsan`, LinkedIn `aoneahsan`, Twitter `aoneahsan`. Support email: `aoneahsan@gmail.com`. Privacy URL: `https://nativeupdate.aoneahsan.com/privacy` |
20
- | 6 | Radix UI / ShadCN used? | **Yes (Radix UI)** — Radix primitives across `website/`. Tailwind v4 + Radix is the stack. ShadCN is not used |
21
- | 7 | Capacitor used? | Root IS a Capacitor **plugin** (not an app). The `website/` is a Capacitor app for hybrid mobile distribution of the dashboard. `example-apps/react-capacitor/` is a Capacitor demo. Root plugin rules differ from app-level Capacitor rules |
22
-
23
- ---
24
-
25
- ## Sub-project map and applicable rule set
26
-
27
- | Sub-project | Path | Type | Frontend rules (R-007/R-008/R-012/R-013/R-018/R-021–R-024/R-026/R-031/R-032/R-034) | Capacitor rules (R-019/R-027/R-028/R-035/R-036) | Notes |
28
- |---|---|---|---|---|---|
29
- | Root plugin | `/` | npm + Capacitor plugin | N/A (no UI) | N/A (the plugin is consumed; not itself an app) | Apply structural, build, docs rules only |
30
- | Website + dashboard | `website/` | React + Vite + Capacitor app | YES | YES | Primary UI target |
31
- | Example app | `example-apps/react-capacitor/` | Capacitor demo | Light (demo only) | Light (demo only) | Demos plugin usage; not a published product |
32
- | Example backend | `example-apps/node-express/` | Node demo | N/A | N/A | Reference server for plugin docs (the `firebase-backend/` example was removed in v3.0.0) |
33
- | Backend | `backend/` | Laravel 11 + Nova SaaS | N/A (server-rendered, separate flow) | N/A | Canonical backend — the only backend after v3.0.0 |
34
- | CLI | `cli/` | Node CLI | N/A | N/A | Plugin user CLI — structural rules only |
35
-
36
- ---
37
-
38
- ## Rules table
39
-
40
- Rules marked **N/A** include a justification in the Notes column. **Done** means the rule was applied in this run (or a prior run, and verified still in place). **Pending** means it's a follow-up.
41
-
42
- | Rule ID | Cadence | Status | Last Applied | Next Review | Notes |
43
- |---|---|---|---|---|---|
44
- | R-001-CLAUDE-AGENTS-FILES | Every 3 days | Done | 2026-04-25 | 2026-04-28 | Root + sub-project CLAUDE.md/AGENTS.md verified. AGENTS.md re-synced from CLAUDE.md at root. |
45
- | R-002-CONTEXT-MANAGEMENT | Behavioral | Done | 2026-04-25 | — | Already enshrined in root + global CLAUDE.md (`/compact` at <20%, progress logs). |
46
- | R-003-PACKAGE-MANAGER | One-time | Done | 2026-04-25 | — | yarn-only confirmed across root, website, cli, example-apps. No `package-lock.json` or `pnpm-lock.yaml` at any level (one stray `package-lock.json` exists at `backend/` for npm-published Tailwind/PostCSS — left because `backend/` is Laravel + intentionally uses npm for Vite plugins; documented in tracker). |
47
- | R-004-DOCS-SCRIPTS-FOLDERS | Recurring | Done | 2026-04-25 | 2026-05-09 | Docs in `docs/` (41 entries). Scripts intentionally absent at root per R-006. `website/scripts/` retained — only `generate-sitemap.mjs` (necessary for SEO build pipeline). |
48
- | R-005-NO-USELESS-FILES | Recurring | Done | 2026-04-25 | 2026-05-09 | Reviewed root + website docs; no useless record/summary files added. Older "_TRACKER.md" / "_PLAN.md" files left in place because they're in active use. |
49
- | R-006-NO-SCRIPTS | One-time | Done | 2026-04-25 | — | No `.sh` files anywhere. Root has no `scripts/`. `website/scripts/generate-sitemap.mjs` is the only script — required by SEO build, documented at top of file. |
50
- | R-007-NO-NATIVE-HTML | One-time + recurring | Partial | 2026-04-25 | 2026-05-09 | Website uses Radix primitives extensively, but some `<button>` / `<input>` usage remains in legacy components. Documented for incremental migration; no regressions allowed in new code. See R-007 audit notes below. |
51
- | R-008-SITEMAP-FEED-BLOG | ≥3 days, ≤7 days | Done (sitemap+feed) / N/A (blog) | 2026-04-24 | 2026-05-01 | Sitemap + feed fully implemented per `website/CLAUDE.md` SEO record. Blog is **not** required for this project (technical plugin docs site, not a content site) — recorded as deliberate N/A. |
52
- | R-009-GITIGNORE | Recurring | Done | 2026-04-25 | 2026-05-09 | Root + website + example-apps `.gitignore` re-audited. `website/.firebase/hosting.*` cache was leaking into git — already fixed in commit `c687dd5`. No further changes needed. |
53
- | R-010-CLEAN-PACKAGE-JSON | Recurring | Done | 2026-04-25 | 2026-05-09 | Audited root + website + cli `package.json`. All listed deps are imported. Notes recorded in `docs/package-audit.md`. |
54
- | R-011-APP-VERSION-FOOTER | One-time | Done | 2026-04-25 | — | Website footer now displays plugin version + build year. Sourced from `package.json` via Vite `define`. |
55
- | R-012-404-ERROR-PAGES | One-time + recurring | Done | 2026-04-25 | 2026-05-09 | `NotFoundPage.tsx` exists. Verified it matches current branding. 401/403/500 fall back to NotFoundPage with appropriate copy via router. |
56
- | R-013-SCROLL-TO-TOP | One-time | Done | 2026-04-25 | — | `<ScrollToTop>` component added to `MarketingLayout` and `DashboardLayout`. Honours hash for deep links. |
57
- | R-014-README-SYNC | Every 14 days | Done | 2026-04-25 | 2026-05-09 | Root `Readme.md` + `website/README.md` last updated; rules-tracker date noted. |
58
- | R-015-DEV-SERVER-PORT | One-time, confirm | Done | 2026-04-25 | — | Website: 5942 (registered). Example-apps/react-capacitor: 5944 (registered). Both unique, NOT defaults. Path in registry updated to current `projects/native-update/...` location. |
59
- | R-016-AI-KNOWLEDGE-BASE | Every 14 days | Done | 2026-04-25 | 2026-05-09 | `docs/ai-knowledge-base/` populated with project profile, features, routes, tech-stack, modules. Existing `AI-INTEGRATION-GUIDE.md` referenced. |
60
- | R-017-ENV-EXAMPLE | Recurring | Done | 2026-04-25 | 2026-05-09 | Root `env-example` and `env.sentry-example` unchanged (no new env vars). Website `.env.example` unchanged (still 4 keys). Required-env error wiring verified. |
61
- | R-018-PROJECT-META-INFO | Recurring | Done | 2026-04-25 | 2026-05-09 | All info pages exist and were verified: privacy, terms, security, cookies, data-deletion, about, contact, permissions. Links from footer confirmed. |
62
- | R-019-PUBLISH-ASSETS | One-time + refresh | Done (website) | 2026-04-25 | — | `website/app-publish-assets/` already exists. Refreshed `Last Updated` date. |
63
- | R-020-UPDATE-CLAUDE-MD | Every 14 days | Done | 2026-04-25 | 2026-05-09 | Root + website + cli + example-apps + backend CLAUDE.md/AGENTS.md updated with `Last Updated: 2026-04-25`. Version drift fixed. |
64
- | R-021-THEME-COLOR-CONTROLS | One-time, confirm | N/A (deliberate) | 2026-04-25 | — | Per `~/.claude/rules/radix-theme.md`: rule applies if Radix is used **app-wide**. Native Update website uses some Radix primitives but the visual system is Tailwind-driven, not `@radix-ui/themes`. Recorded as "Radix not used app-wide" → no theme customizer required. Re-verify on adoption of `@radix-ui/themes`. |
65
- | R-022-GO-BACK-BUTTON | One-time + recurring | Done | 2026-04-25 | 2026-05-09 | Dashboard pages have absolute back routes. Marketing pages don't need back (root + footer nav). DocsMarkdownPage uses absolute back to `/docs`. |
66
- | R-023-ERROR-HANDLING | One-time + audit | Partial | 2026-05-18 | 2026-05-25 | `errorTracker` service at `website/src/lib/errorTracking.ts`. Firebase Analytics path removed during the auth swap (2026-05-11). Sentry / Clarity / Amplitude shims silently skip when their env keys are missing. `docs/error-handling-tracking.md` registry kept up to date. |
67
- | R-024-ANALYTICS | One-time + audit | Partial | 2026-05-18 | 2026-05-25 | `website/src/lib/analytics.ts` no longer routes to Firebase Analytics — that path was removed when the app moved off Firebase Auth. Clarity + Amplitude shims silently skip when env keys missing; analytics-event registry kept at `docs/analytics-tracking.md`. |
68
- | R-025-FILES-STORAGE | One-time + audit | Done | 2026-04-25 | 2026-05-09 | Project intentionally uses **Google Drive only** (no FilesHub) — see `website/CLAUDE.md` "No-Cost Backend Rule". Documented as deliberate choice. FilesHub admin path is not needed because admins also use their Drive. |
69
- | R-026-D3-CHARTS | One-time + audit | Done | 2026-04-25 | 2026-05-09 | `d3@^7.9.0` and `@types/d3` confirmed in website deps. No competing chart libs (`Recharts`/`Chart.js`) in `package.json`. |
70
- | R-027-TRAPEZE-CONFIGURE | One-time | Done | 2026-04-25 | — | Root has `apps-config.yaml`. Website has `apps-config.yaml` with `sync:apps-config` script. Confirmed. |
71
- | R-028-CAPACITOR-ASSETS | One-time | Done | 2026-04-25 | — | Website has `assets/` source directory. `@capacitor/assets` is invoked via `cap:sync`. Verified. |
72
- | R-029-VITE-LOGGER | One-time | Done | 2026-04-25 | — | `website/src/lib/logger.ts` created — wraps `console.warn`/`console.error` with a single toggle for verbose mode. Existing `console.log` calls left in dev paths but documented for incremental migration. |
73
- | R-030-GOOGLE-AUTH-ONLY | One-time | Done | 2026-05-18 | — | Website uses Google sign-in only — implemented as a full-page redirect to the Laravel Socialite endpoint (`${VITE_API_URL}/auth/google/redirect`); the backend issues a Sanctum personal access token on callback. No Firebase, no popups, no client-side credentials. Confirmed in `website/src/services/auth-service.ts`. |
74
- | R-031-FORM-MANAGEMENT | One-time + audit | Done | 2026-04-25 | 2026-05-09 | `react-hook-form@^7.72`, `zod@^4.3.6`, `@hookform/resolvers@^5.2.2` — all confirmed. Used in UploadPage, SettingsPage, AppsPage. New forms in this run will reuse the pattern. |
75
- | R-032-UI-STATE-IN-URL | One-time + audit | Partial | 2026-04-25 | 2026-05-09 | Some pages already use search params (`?tab=...`, `?view=...`). `useUrlState` hook added at `website/src/lib/hooks/useUrlState.ts`. Audit notes record outstanding pages for incremental migration. |
76
- | R-033-FIRESTORE-RULES-INDEXES | Every 3 days | N/A (permanent) | 2026-05-18 | — | Firestore was removed from the plugin SDK + website in v3.0.0 (2026-05-04). The project's only persistence layer is now MySQL behind Laravel. `firestore.rules` / `firestore.indexes.json` / `docs/firestore-queries.json` were all deleted in commit `336f647` (post-closure cleanup). This rule is permanently N/A for this project; do not re-introduce Firestore. |
77
- | R-034-ADMIN-PANEL | One-time + audit | Done | 2026-04-25 | 2026-05-09 | Admin layout exists at `website/src/components/admin/` and pages at `website/src/pages/admin/` (Overview, Users, Apps, Builds). Super admin email: `aoneahsan@gmail.com` per `VITE_ADMIN_EMAILS`. |
78
- | R-035-CAPACITOR-OFFICIAL-PLUGINS | One-time | Done | 2026-04-25 | — | Website has `@capacitor/{android,ios,core,cli,motion,preferences,privacy-screen}` installed. Other plugins are deliberately not installed because the website doesn't need them (no camera, geolocation, etc.). Plugin status registry created at `docs/capacitor-official-plugins.md`. |
79
- | R-036-CAPAWESOME-PLUGINS | One-time | Done | 2026-04-25 | — | Website has `@capawesome/capacitor-app-shortcuts`. Other Capawesome plugins (app-update, app-review, edge-to-edge, badge) documented as "to add when website ships to Play Store" — registry at `docs/capawesome-plugins.md`. |
80
- | R-037-PROJECT-AS-PRODUCT | One-time, confirm | Done | 2026-04-25 | — | Footer copyright updated to `© Native Update team. Built with care.`. Footer credit to "Ahsan Mahmood" replaced with neutral attribution. Contact info on info pages still uses dev contact. |
81
- | R-038-REFERENCE-PROJECTS | One-time | Done | 2026-04-25 | — | Reference projects `ZTools`, `ClearHire`, `Video Controls Plus` exist at `~/Documents/01-code/projects/`. Patterns from those projects already informed prior native-update SEO/AEO work; no new patterns to copy in this pass. |
82
- | R-039-PROJECT-COMPLIANCE-AUDIT | Every run | Done | 2026-04-25 | next run | Final-step audit completed: build status confirmed, tracker entries finalized, version drift resolved. |
83
-
84
- ---
85
-
86
- ## Pending follow-ups (incremental work)
87
-
88
- These items are documented but not rolled into this run because they would require multi-day refactors and the user wants this run shipped. Each is dated; a future re-run picks them up.
89
-
90
- 1. **R-007 — Native HTML migration to Radix:** `<button>` and `<input>` still appear in some marketing/legacy components. New code MUST use Radix or `@/components/ui/*` wrappers. Existing usage to be migrated component-by-component.
91
- 2. **R-023 / R-024 — Sentry / Clarity / Amplitude env wiring:** services exist and silently skip when keys are absent. Add real env keys when those tools are provisioned.
92
- 3. **R-032 — URL state migration:** `useUrlState` hook is now available at `src/lib/hooks/useUrlState.ts`. Migrate the remaining pages incrementally as they're touched.
93
- 4. **R-036 — Capawesome plugins:** `app-update`, `app-review`, `edge-to-edge`, `badge` to be added before any Play Store / App Store submission of the website-as-app.
94
-
95
- ---
96
-
97
- ## Run history
98
-
99
- | Date | Scope | Outcome | Operator |
100
- |---|---|---|---|
101
- | 2026-04-25 | Full pass R-001 → R-039 | All rules either Done, Done-Partial (with documented follow-up), or N/A-with-justification | Claude Code Opus 4.7 |
102
- | 2026-05-18 | R-033 reclassification only — marked permanently N/A after v3.0.0 Firestore removal | Targeted update; full audit cooldown still in effect until 2026-05-23 | Claude Code Opus 4.7 |
@@ -1,116 +0,0 @@
1
- # Pre-Launch Pentest Checklist
2
-
3
- A focused, do-it-yourself security checklist for self-hosted `native-update` deployments before going to production. Walk through every section. Each item is a yes/no gate; if you can't say yes, fix it before launch.
4
-
5
- This is not a substitute for a professional penetration test. It is the floor — the issues a serious external test would catch in the first hour. Apps that fail this checklist are not ready for production traffic regardless of how nice the dashboard looks.
6
-
7
- The checklist assumes you have a self-hosted Laravel + Nova backend (the reference implementation). Adapt to your own backend if you wrote one. Hosted SaaS users skip everything in the backend sections — those defenses are operated by the SaaS provider — and focus on the device-side and operational sections.
8
-
9
- Maintained by Ahsan Mahmood. Last review: 2026-05-11.
10
-
11
- ## 1 — Dependency hygiene (root + backend + website + example-app)
12
-
13
- The single highest-yield pre-launch security activity. Most production incidents trace back to an unpatched transitive dep, not a clever bug in your own code.
14
-
15
- - [ ] **Root plugin**: `yarn npm audit --severity high --recursive` exits 0 from `/` (the project root). If it reports a high or critical, evaluate each — false positives are common in the npm advisory feed, but a real one blocks launch.
16
- - [ ] **Backend (Laravel)**: `cd backend && composer audit` exits 0. If a CVE shows up, bump the package or pin the patched version explicitly.
17
- - [ ] **Website (React dashboard)**: `cd website && yarn npm audit --severity high --recursive` exits 0.
18
- - [ ] **Example app**: `cd example-apps/react-capacitor && yarn npm audit` clean (advisory severity HIGH or above only — the example app has a shallower attack surface).
19
- - [ ] **Direct dependency review**: scan `package.json` files for any deps that haven't been updated in >12 months. Stale deps are not a vulnerability by themselves but correlate strongly with abandoned maintenance.
20
- - [ ] **Yarn / Composer lockfile is committed**: `yarn.lock` (root, website, example-app) and `composer.lock` (backend) all in git. Without locked versions, every CI run can install different transitive versions and your audit is meaningless.
21
- - [ ] **No deprecated crypto libraries**: grep for `crypto-js`, `node-forge`, `jsrsasign`. None should appear in production paths — use Node's built-in `crypto` (server side) or `SubtleCrypto` (browser side).
22
-
23
- ## 2 — Authentication and authorization
24
-
25
- - [ ] **API keys are hashed at rest.** The Laravel reference stores `key_hash` (bcrypt) plus `key_prefix` (first 12 chars, for lookup). The full key is shown ONCE at creation. Confirm with `mysql -e "SELECT key_prefix, LENGTH(key_hash), key_hash LIKE '%\$2y\$%' FROM native_update_dev.api_keys LIMIT 5"` — `key_hash` should look like a bcrypt string.
26
- - [ ] **API keys are scoped to one app.** The `ValidateApiKey` middleware joins `api_keys` to `apps` by `app_id`. Try authenticating a request with App A's key against App B's bundle download URL — it should 403, not 200.
27
- - [ ] **API keys have a rate limit.** Default is 600 req / 15 min per key. Verify: send 700 requests in 5 minutes and confirm requests 601+ return 429 with `Retry-After`.
28
- - [ ] **Revoked keys are immediately rejected.** Flip a key's `revoked_at`, then make a request with it. Should 401 within 1 second (no caching that extends past revocation).
29
- - [ ] **Firebase ID tokens are verified server-side.** The dashboard `/api/dashboard/*` endpoints use `ValidateFirebaseToken`. Send an unsigned / expired / wrong-audience token; backend should reject with 401. Watch `storage/logs/laravel.log` for the verification trace.
30
- - [ ] **Admin claims are checked.** `/api/admin/*` requires both a Firebase token AND the user being on the `ADMIN_EMAILS` allowlist. Authenticate as a non-admin and call `/api/admin/users` — should 403.
31
- - [ ] **Nova policies fail closed.** Verify by logging into Nova as a non-admin tenant and trying to view another tenant's app via direct URL (`/admin/resources/apps/<other-tenant-app-id>`). Should redirect or 404, not show the resource.
32
- - [ ] **Suspended-user flow works.** Flip `is_suspended=true` on a test user via Nova. Their API keys should immediately return 403; their dashboard logins should redirect to the suspension screen.
33
-
34
- ## 3 — Cross-origin and CSRF
35
-
36
- - [ ] **CORS allowlist is finite.** Open `backend/config/cors.php` (or your equivalent). `allowed_origins` must be a comma-separated list of full origins (`https://...`), NOT `*`. The default `CORS_ALLOWED_ORIGINS` env var should be set.
37
- - [ ] **Wildcard origin only allowed for the public SDK endpoints.** `/api/v1/*` may permit `*` because it's API-key-gated; `/api/dashboard/*` must NOT.
38
- - [ ] **`supports_credentials=true` is paired with explicit origin allowlist.** Browsers reject `Access-Control-Allow-Origin: *` when credentials are sent.
39
- - [ ] **CSRF protection on dashboard endpoints.** Laravel's `web` middleware group includes `VerifyCsrfToken`. The dashboard's React client must send the CSRF token in the `X-CSRF-Token` header on mutating requests.
40
- - [ ] **PayPal webhook is CSRF-exempt but signature-verified.** `/api/webhooks/paypal` skips Laravel's CSRF check (it has no session) but runs PayPal's signature verification. Confirm with a request lacking the signature header — should 401.
41
-
42
- ## 4 — Bundle integrity and signing
43
-
44
- - [ ] **HTTPS enforced for the bundle download.** `npm run dev`-style HTTP allowlists must not appear in `app.production.env`. Confirm: `curl http://your-backend/api/v1/updates/check` should redirect to HTTPS or refuse.
45
- - [ ] **Signed download URLs expire.** Default TTL is 30 minutes (`NATIVE_UPDATE_DOWNLOAD_URL_TTL_MINUTES`). Get a signed URL, wait 31 minutes, try it — should 403.
46
- - [ ] **Bundle ZIP hash is verified server-side at upload.** When uploading a build via the dashboard or `/api/v1/bundles/upload`, the backend should re-compute SHA-256 over the bytes and reject if mismatched against the client-supplied checksum. Confirm by uploading with a deliberately wrong checksum — should 400.
47
- - [ ] **Signature is verified server-side at upload.** Backend should also re-verify the RSA-SHA256 signature against the app's registered public key. Confirm by uploading a bundle signed with the wrong key — should 400.
48
- - [ ] **Device-side signature verify is unconditional.** Edit `native-update.config.js` to point at the backend, deliberately corrupt the bundle bytes mid-transit (e.g. via a proxy), and confirm the SDK refuses to apply with `SIGNATURE_VERIFICATION_FAILED`. There must be no debug flag to bypass.
49
- - [ ] **Private signing keys are never persisted to logs.** Grep `storage/logs/laravel.log` for `BEGIN PRIVATE KEY`, `pkcs8`, `RSA PRIVATE`. Zero hits required.
50
-
51
- ## 5 — Bundle file safety
52
-
53
- - [ ] **No reverse-engineered or unsafe ZIP extraction.** The plugin uses platform-standard libraries (`java.util.zip.ZipFile` on Android, `Foundation`'s `NSFileManager` on iOS). Zip-slip is mitigated by validating entry names don't contain `..` or absolute paths. Verify with a crafted bundle whose entry name is `../../etc/passwd` — install should fail with `INVALID_BUNDLE`.
54
- - [ ] **Bundle size limits enforced.** Set `NATIVE_UPDATE_MAX_BUNDLE_SIZE_MB=50` (or your real limit). Upload a 60 MB bundle — should 413.
55
- - [ ] **No symlinks in extracted bundles.** Bundle extraction refuses symlink entries. Verify with a ZIP containing a symlink entry — install should fail.
56
- - [ ] **Temp files are scoped to the app sandbox.** The SDK extracts to `<sandbox>/native-update/bundles/<version>/`. Verify by inspecting filesystem after a download — no files outside the sandbox.
57
-
58
- ## 6 — Data handling and privacy
59
-
60
- - [ ] **Device hashes are not raw identifiers.** Confirm the SDK sends `X-Device-ID: <sha256_hex>`, never the raw IMEI / ADID / IDFA. Inspect `src/web.ts` for the hashing call.
61
- - [ ] **MAU + analytics writes do not include PII.** Inspect the analytics_events table — should contain `device_hash` (opaque), platform, app_version, bundle_version, event_type. Should NOT contain email, name, exact location, or full IP.
62
- - [ ] **Account deletion is honored.** The `/api/dashboard/me` DELETE endpoint cascades to apps + builds + signing_keys + api_keys + analytics_events for that user. Verify by creating a test user, uploading data, calling DELETE /api/dashboard/me, then confirming all related rows are gone.
63
- - [ ] **PII fields in user table are listed.** `users.name`, `users.email`, `users.firebase_uid` — known. Document any others. GDPR DSAR responses depend on knowing what to dump.
64
- - [ ] **Privacy policy URL is publicly accessible AND covers OTA.** Open the URL in an incognito tab. Body must mention bundle downloads, device IDs, and the retention policy for analytics events.
65
-
66
- ## 7 — Operational safety
67
-
68
- - [ ] **`.env` is in `.gitignore`.** Verify: `git check-ignore backend/.env` exits 0.
69
- - [ ] **`firebase-credentials.json` is in `.gitignore`.** Same check for `backend/storage/firebase-credentials.json`.
70
- - [ ] **`auth.json` (Nova license) is in `.gitignore`.** Same check.
71
- - [ ] **No secrets in committed history.** Run `git log --all -p -G "BEGIN RSA PRIVATE\|password\s*=\|api[_-]key\s*=" -- backend/ | head -50`. Should return nothing meaningful. If something appears, rotate the secret AND filter the history with `git filter-repo`.
72
- - [ ] **Production database backups exist.** Run a backup, restore it to a test instance, verify the restore is bit-for-bit identical via `mysqldump | sha256sum` comparison.
73
- - [ ] **Queue worker is supervised.** systemctl status native-update-queue should show "active (running)" with auto-restart on failure.
74
- - [ ] **Logs do not contain API keys, JWTs, or signed URLs in plaintext.** Grep `storage/logs/laravel.log` for `Bearer eyJ`, `X-API-Key:`, `signature=`. Zero hits required.
75
- - [ ] **Web server hides version info.** `curl -sI https://your-backend/api/health | grep -i server` should NOT show `Server: nginx/1.18.0 (Ubuntu)`. Set `server_tokens off;` in nginx config.
76
-
77
- ## 8 — Mobile platform integration
78
-
79
- - [ ] **Android merged manifest has no unexpected permissions.** Inspect `android/app/build/intermediates/merged_manifests/release/AndroidManifest.xml`. Sensitive permissions (CAMERA, RECORD_AUDIO, ACCESS_FINE_LOCATION, ACCESS_BACKGROUND_LOCATION, READ_CONTACTS, READ_SMS, READ_CALL_LOG, BODY_SENSORS, ACTIVITY_RECOGNITION) must each map to a privacy-policy disclosure + Data Safety entry + runtime-prompt UX.
80
- - [ ] **iOS Privacy Manifest is complete.** Open `ios/App/App/PrivacyInfo.xcprivacy`. Required-reason API entries must cover all the APIs your app uses (the plugin's two: NSPrivacyAccessedAPICategoryUserDefaults CA92.1, NSPrivacyAccessedAPICategoryFileTimestamp C617.1).
81
- - [ ] **ATS exceptions removed from production builds.** Inspect `ios/App/App/Info.plist`. `NSAllowsArbitraryLoads`, `NSAllowsLocalNetworking`, and per-domain exception entries should all be false / absent in the production xcconfig.
82
- - [ ] **Network security config restricts cleartext to dev IPs only.** `android/app/src/main/res/xml/network_security_config.xml` should permit cleartext only for `10.0.2.2` / `192.168.x.x` LAN ranges, not `*`.
83
- - [ ] **Production AAB is signed with Play App Signing.** Confirm in Play Console → Setup → App integrity. Without this, the In-App Update API does not work.
84
-
85
- ## 9 — Specific attack paths to try
86
-
87
- Run each of these against staging. Document the result.
88
-
89
- - [ ] **Login-as-other-user via Firebase token swap.** Mint a Firebase ID token for user A, call `/api/dashboard/me` with it. Mint one for user B, call `/api/dashboard/me`. Confirm the response identifies the correct user in each case. Try sending user A's token with `Authorization: Bearer <token>` AND a header `X-User-Id: <user-b-id>` — should ignore the header and identify user A.
90
- - [ ] **Cross-tenant bundle download.** As tenant A, upload bundle. Grab the signed download URL from the check response. As tenant B (different API key), try to download from that URL. Should 403 even though the URL is signed — the BundleController re-asserts `app_id` ownership.
91
- - [ ] **Signed-URL tampering.** Take a valid signed URL, change one byte of the `signature=` parameter, request. Should 403.
92
- - [ ] **Replay of expired signed URL.** Take a signed URL, wait past its TTL, request. Should 403.
93
- - [ ] **Bundle ID confusion.** Generate two builds with overlapping `bundle_id` values (force via DB if needed). Check that bundle_id is unique-constrained — INSERT should fail at DB level.
94
- - [ ] **API key prefix collision.** API keys are looked up by 12-char prefix. Brute-force the prefix space — at 16^12 you're not at meaningful collision risk, but verify with `EXPLAIN SELECT * FROM api_keys WHERE key_prefix = '<prefix>'` that the prefix column has an index (you don't want a full-table scan on every request).
95
- - [ ] **Subscription cancellation race.** Create a subscription, cancel via dashboard, immediately try to upload a build. Should the subscription state propagate fast enough to block the upload? Define the policy and test it.
96
- - [ ] **License-key bypass.** A user with no license tries to access a license-gated feature. Should 403. A user with an expired license_expires_at tries the same. Should 403.
97
- - [ ] **MAU limit bypass.** A user on the free tier (100 MAU) tries to exceed it. Define the policy (soft limit with warning? hard limit?) and test it.
98
-
99
- ## 10 — Final pre-launch sanity sweep
100
-
101
- - [ ] **Run the test suite.** `php artisan test` (backend) — all pass.
102
- - [ ] **Run lint.** `yarn lint` (root + website) — exit 0.
103
- - [ ] **Run typecheck.** `yarn typecheck` (website) — exit 0.
104
- - [ ] **Run build.** `yarn build` (root + website) — exit 0.
105
- - [ ] **Smoke-test the full happy path.** Sign up → create app → upload bundle → device fetches → device verifies → device applies → notifyAppReady → bundle marked verified. End-to-end, on a real device, not just an emulator.
106
- - [ ] **External healthcheck.** Use UptimeRobot / Pingdom / a similar service to monitor `/api/health` from outside your network for ~24 hours before launch. Should be 100% green.
107
-
108
- ## What this checklist does NOT replace
109
-
110
- A professional pentest. A SOC 2 audit. A formal threat model. Bug-bounty engagement. Independent code review of the plugin native layer (Kotlin + Swift) by someone fluent in those languages. Quarterly review and update of this checklist itself.
111
-
112
- This is the first 80% — the fast-cheap-routine part. The remaining 20% (sophisticated attacker classes, supply-chain via deps, side-channel attacks, advanced persistent threats) needs specialist attention.
113
-
114
- ## Authored by
115
-
116
- [Ahsan Mahmood](https://aoneahsan.com) — author and maintainer of `native-update`.
@@ -1,122 +0,0 @@
1
- # Certificate Pinning
2
-
3
- Certificate pinning provides an additional layer of security by ensuring that your app only communicates with servers that have specific SSL certificates. This prevents man-in-the-middle attacks even if a certificate authority is compromised.
4
-
5
- ## Configuration
6
-
7
- Certificate pinning is configured through the security configuration:
8
-
9
- ```typescript
10
- import { NativeUpdate } from 'native-update';
11
-
12
- await NativeUpdate.configure({
13
- config: {
14
- security: {
15
- certificatePinning: {
16
- enabled: true,
17
- pins: [
18
- {
19
- hostname: 'api.example.com',
20
- sha256: [
21
- 'sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=',
22
- 'sha256/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB=' // Backup pin
23
- ]
24
- },
25
- {
26
- hostname: 'cdn.example.com',
27
- sha256: [
28
- 'sha256/CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC='
29
- ]
30
- }
31
- ]
32
- }
33
- }
34
- }
35
- });
36
- ```
37
-
38
- ## Generating Certificate Pins
39
-
40
- To generate SHA-256 pins for your certificates:
41
-
42
- ### Using OpenSSL (Recommended)
43
-
44
- ```bash
45
- # For a live server
46
- openssl s_client -servername example.com -connect example.com:443 | \
47
- openssl x509 -pubkey -noout | \
48
- openssl pkey -pubin -outform der | \
49
- openssl dgst -sha256 -binary | \
50
- openssl enc -base64
51
-
52
- # For a certificate file
53
- openssl x509 -in certificate.crt -pubkey -noout | \
54
- openssl pkey -pubin -outform der | \
55
- openssl dgst -sha256 -binary | \
56
- openssl enc -base64
57
- ```
58
-
59
- ### Using the Plugin Utility
60
-
61
- ```typescript
62
- import { CertificatePinning } from 'native-update/certificate-pinning';
63
-
64
- // Generate pin from PEM certificate
65
- const pin = await CertificatePinning.generateFingerprint(certificatePem);
66
- console.log(pin); // sha256/base64hash...
67
- ```
68
-
69
- ## Best Practices
70
-
71
- 1. **Always Include Backup Pins**: Include at least one backup pin for certificate rotation
72
- 2. **Pin to Intermediate CA**: Consider pinning to intermediate CA certificates for flexibility
73
- 3. **Test Thoroughly**: Test certificate rotation scenarios before production
74
- 4. **Monitor Failures**: Implement logging for pin validation failures
75
- 5. **Plan for Updates**: Have a strategy for updating pins when certificates change
76
-
77
- ## Platform Differences
78
-
79
- - **iOS**: Uses URLSession delegate for certificate validation
80
- - **Android**: Uses OkHttp's CertificatePinner
81
- - **Web**: Certificate pinning is not available in web browsers
82
-
83
- ## Error Handling
84
-
85
- Certificate pinning failures will result in network errors:
86
-
87
- ```typescript
88
- try {
89
- await NativeUpdate.sync();
90
- } catch (error) {
91
- if (error.code === 'CERTIFICATE_PIN_FAILURE') {
92
- // Handle certificate pinning failure
93
- console.error('Certificate validation failed:', error.message);
94
- }
95
- }
96
- ```
97
-
98
- ## Disabling for Development
99
-
100
- For development environments, you may want to disable certificate pinning:
101
-
102
- ```typescript
103
- const isDevelopment = process.env.NODE_ENV === 'development';
104
-
105
- await NativeUpdate.configure({
106
- config: {
107
- security: {
108
- certificatePinning: {
109
- enabled: !isDevelopment,
110
- pins: [...]
111
- }
112
- }
113
- }
114
- });
115
- ```
116
-
117
- ## Security Considerations
118
-
119
- - Certificate pins are included in your app bundle and can be extracted
120
- - Use certificate pinning as one layer of defense, not the only security measure
121
- - Regularly review and update pins as certificates are renewed
122
- - Consider implementing a pin update mechanism through your update system