native-update 1.3.1 → 1.3.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.
- package/Readme.md +2 -2
- package/cli/index.js +3 -3
- package/cli/node_modules/.yarn-integrity +16 -0
- package/cli/node_modules/commander/LICENSE +22 -0
- package/cli/node_modules/commander/Readme.md +1148 -0
- package/cli/node_modules/commander/esm.mjs +16 -0
- package/cli/node_modules/commander/index.js +26 -0
- package/cli/node_modules/commander/lib/argument.js +145 -0
- package/cli/node_modules/commander/lib/command.js +2179 -0
- package/cli/node_modules/commander/lib/error.js +43 -0
- package/cli/node_modules/commander/lib/help.js +462 -0
- package/cli/node_modules/commander/lib/option.js +329 -0
- package/cli/node_modules/commander/lib/suggestSimilar.js +100 -0
- package/cli/node_modules/commander/package-support.json +16 -0
- package/cli/node_modules/commander/package.json +80 -0
- package/cli/node_modules/commander/typings/esm.d.mts +3 -0
- package/cli/node_modules/commander/typings/index.d.ts +884 -0
- package/cli/package.json +1 -1
- package/cli/yarn.lock +8 -0
- package/dist/esm/__tests__/delta-processor.test.d.ts +1 -0
- package/dist/esm/__tests__/delta-processor.test.js +77 -0
- package/dist/esm/__tests__/delta-processor.test.js.map +1 -0
- package/dist/esm/__tests__/firestore-schema.test.d.ts +1 -0
- package/dist/esm/__tests__/firestore-schema.test.js +74 -0
- package/dist/esm/__tests__/firestore-schema.test.js.map +1 -0
- package/dist/esm/__tests__/manifest-reader.test.d.ts +1 -0
- package/dist/esm/__tests__/manifest-reader.test.js +271 -0
- package/dist/esm/__tests__/manifest-reader.test.js.map +1 -0
- package/dist/esm/__tests__/rollout-checker.test.d.ts +1 -0
- package/dist/esm/__tests__/rollout-checker.test.js +210 -0
- package/dist/esm/__tests__/rollout-checker.test.js.map +1 -0
- package/dist/esm/core/config.d.ts +26 -0
- package/dist/esm/core/config.js +6 -0
- package/dist/esm/core/config.js.map +1 -1
- package/dist/esm/firestore/firestore-client.d.ts +109 -0
- package/dist/esm/firestore/firestore-client.js +260 -0
- package/dist/esm/firestore/firestore-client.js.map +1 -0
- package/dist/esm/firestore/index.d.ts +11 -0
- package/dist/esm/firestore/index.js +11 -0
- package/dist/esm/firestore/index.js.map +1 -0
- package/dist/esm/firestore/manifest-reader.d.ts +87 -0
- package/dist/esm/firestore/manifest-reader.js +294 -0
- package/dist/esm/firestore/manifest-reader.js.map +1 -0
- package/dist/esm/firestore/schema.d.ts +504 -0
- package/dist/esm/firestore/schema.js +69 -0
- package/dist/esm/firestore/schema.js.map +1 -0
- package/dist/esm/live-update/delta-processor.d.ts +94 -0
- package/dist/esm/live-update/delta-processor.js +212 -0
- package/dist/esm/live-update/delta-processor.js.map +1 -0
- package/dist/esm/live-update/rollout-checker.d.ts +86 -0
- package/dist/esm/live-update/rollout-checker.js +305 -0
- package/dist/esm/live-update/rollout-checker.js.map +1 -0
- package/dist/esm/live-update/version-manager.d.ts +12 -0
- package/dist/esm/live-update/version-manager.js +67 -0
- package/dist/esm/live-update/version-manager.js.map +1 -1
- package/dist/plugin.cjs.js +1 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.esm.js +1 -1
- package/dist/plugin.esm.js.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/docs/FIREBASE_QUERIES_AND_INDEXES_AUDIT.md +221 -0
- package/docs/QUICK_START.md +1 -1
- package/docs/README.md +1 -1
- package/docs/REMAINING_FEATURES.md +130 -125
- package/docs/ROADMAP.md +156 -100
- package/docs/TESTING_REQUIREMENTS.md +226 -0
- package/docs/api/API.md +1 -1
- package/docs/getting-started/installation.md +1 -1
- package/docs/guides/BACKEND_TEMPLATES_GUIDE.md +183 -0
- package/docs/play-console-rejection-rules.json +428 -0
- package/docs/reports/COMPLETE_VERIFICATION.md +1 -1
- package/docs/reports/PRODUCTION_STATUS.md +1 -1
- package/package.json +22 -20
- package/cli/cap-update.js +0 -45
package/docs/ROADMAP.md
CHANGED
|
@@ -1,143 +1,199 @@
|
|
|
1
1
|
# Capacitor Native Update - Development Roadmap
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Last Updated:** 2026-01-16
|
|
4
|
+
**Status:** ✅ PRODUCTION READY (Core Features Complete)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
This document outlines the development phases and their completion status.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
---
|
|
8
9
|
|
|
9
|
-
##
|
|
10
|
+
## ✅ Current Status: Production Ready
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
The plugin provides complete OTA update functionality with native implementations for iOS and Android, comprehensive documentation, example applications, and developer tools.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 📋 Implementation Status
|
|
17
|
+
|
|
18
|
+
### 1. Backend Infrastructure ✅ COMPLETE
|
|
12
19
|
|
|
13
20
|
#### Update Server
|
|
14
|
-
- [
|
|
15
|
-
- [
|
|
16
|
-
- [
|
|
17
|
-
- [
|
|
18
|
-
- [
|
|
19
|
-
- [
|
|
21
|
+
- [x] REST API endpoints for update management (Firebase Functions)
|
|
22
|
+
- [x] Version management system
|
|
23
|
+
- [x] Bundle storage and retrieval (Google Drive integration)
|
|
24
|
+
- [x] Update manifest generation
|
|
25
|
+
- [x] Channel management (production, staging, development)
|
|
26
|
+
- [x] Analytics endpoints
|
|
20
27
|
|
|
21
28
|
#### Security Infrastructure
|
|
22
|
-
- [
|
|
23
|
-
- [
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [ ] Checksum generation
|
|
29
|
+
- [x] Bundle signing service (CLI tools)
|
|
30
|
+
- [x] Public/private key generation
|
|
31
|
+
- [x] Checksum generation (SHA-256)
|
|
32
|
+
- [x] Signature verification
|
|
27
33
|
|
|
28
|
-
####
|
|
29
|
-
- [
|
|
30
|
-
- [
|
|
31
|
-
- [
|
|
32
|
-
- [ ] Bandwidth optimization
|
|
34
|
+
#### Example Backends
|
|
35
|
+
- [x] Node.js + Express example (`example-apps/node-express/`)
|
|
36
|
+
- [x] Firebase Cloud Functions example (`example-apps/firebase-backend/`)
|
|
37
|
+
- [x] Google Drive integration for storage
|
|
33
38
|
|
|
34
|
-
### 2. Native Platform Implementation
|
|
39
|
+
### 2. Native Platform Implementation ✅ COMPLETE
|
|
35
40
|
|
|
36
41
|
#### iOS (Swift)
|
|
37
|
-
- [
|
|
38
|
-
- [
|
|
39
|
-
- [
|
|
40
|
-
- [
|
|
41
|
-
- [
|
|
42
|
-
- [
|
|
42
|
+
- [x] NativeUpdatePlugin.swift - Main plugin
|
|
43
|
+
- [x] LiveUpdatePlugin.swift - OTA updates
|
|
44
|
+
- [x] BundleManager.swift - Bundle management
|
|
45
|
+
- [x] AppUpdatePlugin.swift - App store updates
|
|
46
|
+
- [x] AppReviewPlugin.swift - In-app reviews
|
|
47
|
+
- [x] BackgroundUpdatePlugin.swift - Background updates
|
|
48
|
+
- [x] SecurityManager.swift - Security utilities
|
|
43
49
|
|
|
44
50
|
#### Android (Kotlin)
|
|
45
|
-
- [
|
|
46
|
-
- [
|
|
47
|
-
- [
|
|
48
|
-
- [
|
|
49
|
-
- [
|
|
50
|
-
- [
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
- [x] NativeUpdatePlugin.kt - Main plugin
|
|
52
|
+
- [x] LiveUpdatePlugin.kt - OTA updates
|
|
53
|
+
- [x] BundleManager.kt - Bundle management
|
|
54
|
+
- [x] AppUpdatePlugin.kt - Play Store updates (Play Core Library)
|
|
55
|
+
- [x] AppReviewPlugin.kt - In-app reviews
|
|
56
|
+
- [x] BackgroundUpdatePlugin.kt - Background updates
|
|
57
|
+
- [x] SecurityManager.kt - Security utilities
|
|
58
|
+
|
|
59
|
+
### 3. TypeScript Implementation ✅ COMPLETE
|
|
60
|
+
|
|
61
|
+
- [x] Plugin definitions and interfaces
|
|
62
|
+
- [x] Web implementation
|
|
63
|
+
- [x] Live update module (7 files)
|
|
64
|
+
- [x] App update module (7 files)
|
|
65
|
+
- [x] App review module (6 files)
|
|
66
|
+
- [x] Background update module (3 files)
|
|
67
|
+
- [x] Core infrastructure (9 files)
|
|
68
|
+
- [x] Security module (2 files)
|
|
69
|
+
- [x] Firestore integration (4 files)
|
|
70
|
+
|
|
71
|
+
### 4. Testing Suite ⏳ PARTIAL
|
|
53
72
|
|
|
54
73
|
#### Unit Tests
|
|
55
|
-
- [
|
|
56
|
-
- [
|
|
57
|
-
- [
|
|
58
|
-
- [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- [
|
|
62
|
-
- [
|
|
63
|
-
- [
|
|
64
|
-
- [ ]
|
|
74
|
+
- [x] Bundle manager tests
|
|
75
|
+
- [x] Config tests
|
|
76
|
+
- [x] Delta processor tests
|
|
77
|
+
- [x] Firestore schema tests
|
|
78
|
+
- [x] Manifest reader tests
|
|
79
|
+
- [x] Rollout checker tests
|
|
80
|
+
- [x] Security tests
|
|
81
|
+
- [x] Version manager tests
|
|
82
|
+
- [x] Integration tests
|
|
83
|
+
- [ ] iOS native tests (Not implemented)
|
|
84
|
+
- [ ] Android native tests (Not implemented)
|
|
65
85
|
|
|
66
86
|
#### E2E Tests
|
|
67
87
|
- [ ] Complete update lifecycle
|
|
68
88
|
- [ ] Multi-version updates
|
|
69
89
|
- [ ] Security validation
|
|
70
|
-
- [ ] Performance benchmarks
|
|
71
90
|
|
|
72
|
-
###
|
|
91
|
+
### 5. Tooling and Utilities ✅ COMPLETE
|
|
73
92
|
|
|
74
|
-
####
|
|
75
|
-
- [
|
|
76
|
-
- [
|
|
77
|
-
- [
|
|
78
|
-
- [
|
|
93
|
+
#### CLI Package (8 Commands)
|
|
94
|
+
- [x] `init` - Initialize a new project
|
|
95
|
+
- [x] `bundle-create` - Create update bundles
|
|
96
|
+
- [x] `bundle-sign` - Sign bundles cryptographically
|
|
97
|
+
- [x] `bundle-verify` - Verify bundle signatures
|
|
98
|
+
- [x] `keys-generate` - Generate RSA/ECDSA keys
|
|
99
|
+
- [x] `backend-create` - Scaffold backend server
|
|
100
|
+
- [x] `server-start` - Run local update server
|
|
101
|
+
- [x] `monitor` - Monitor update deployments
|
|
79
102
|
|
|
80
103
|
#### Developer Tools
|
|
81
|
-
- [
|
|
82
|
-
- [
|
|
83
|
-
- [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- [
|
|
90
|
-
- [
|
|
91
|
-
- [
|
|
92
|
-
- [
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
- [
|
|
96
|
-
|
|
104
|
+
- [x] Local testing server
|
|
105
|
+
- [x] Bundle creator utility
|
|
106
|
+
- [x] Bundle signer utility
|
|
107
|
+
|
|
108
|
+
### 6. Documentation ✅ COMPLETE
|
|
109
|
+
|
|
110
|
+
- [x] API documentation (7 files in `/docs/api/`)
|
|
111
|
+
- [x] Feature guides (3 files in `/docs/features/`)
|
|
112
|
+
- [x] Getting started guides (3 files)
|
|
113
|
+
- [x] Developer guides (5 files)
|
|
114
|
+
- [x] Examples (2 files)
|
|
115
|
+
- [x] Security documentation
|
|
116
|
+
- [x] Migration guide
|
|
117
|
+
- [x] Changelog
|
|
118
|
+
- [x] Known limitations
|
|
119
|
+
|
|
120
|
+
### 7. Marketing Website ✅ COMPLETE
|
|
121
|
+
|
|
122
|
+
- [x] 24 pages (marketing + dashboard)
|
|
123
|
+
- [x] User authentication (Firebase + Google)
|
|
124
|
+
- [x] Dashboard with app management
|
|
125
|
+
- [x] Build upload and management
|
|
126
|
+
- [x] Google Drive integration
|
|
127
|
+
- [x] Analytics visualization
|
|
128
|
+
- [x] Configuration generator
|
|
129
|
+
- [x] All legal pages (Privacy, Terms, Security, Cookies, Data Deletion)
|
|
130
|
+
|
|
131
|
+
### 8. Example Applications ✅ COMPLETE
|
|
132
|
+
|
|
133
|
+
- [x] React + Capacitor frontend (`example-apps/react-capacitor/`)
|
|
134
|
+
- [x] Node.js + Express backend (`example-apps/node-express/`)
|
|
135
|
+
- [x] Firebase Cloud Functions (`example-apps/firebase-backend/`)
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 🎯 Future Enhancement Phases
|
|
140
|
+
|
|
141
|
+
### Phase 1: Advanced Testing (Optional)
|
|
142
|
+
- [ ] iOS XCTest implementation
|
|
143
|
+
- [ ] Android JUnit tests
|
|
144
|
+
- [ ] E2E test suite with Detox/Appium
|
|
145
|
+
|
|
146
|
+
### Phase 2: Enterprise Features (Optional)
|
|
147
|
+
- [ ] Delta updates WASM optimization
|
|
148
|
+
- [ ] Multi-tenant SaaS platform
|
|
149
|
+
- [ ] Enterprise SSO integration
|
|
150
|
+
- [ ] Advanced rollout strategies
|
|
97
151
|
- [ ] A/B testing support
|
|
98
|
-
- [ ] Multi-app management
|
|
99
152
|
|
|
100
|
-
|
|
153
|
+
### Phase 3: Community Features (Optional)
|
|
154
|
+
- [ ] Video tutorials
|
|
155
|
+
- [ ] Additional framework examples (Vue, Angular)
|
|
156
|
+
- [ ] CI/CD integration templates
|
|
157
|
+
- [ ] Community plugins
|
|
101
158
|
|
|
102
|
-
|
|
103
|
-
1. Basic update server
|
|
104
|
-
2. Native platform verification
|
|
105
|
-
3. Security implementation
|
|
106
|
-
4. Basic testing
|
|
159
|
+
---
|
|
107
160
|
|
|
108
|
-
|
|
109
|
-
1. CDN integration
|
|
110
|
-
2. Monitoring and analytics
|
|
111
|
-
3. Advanced tooling
|
|
112
|
-
4. Performance optimization
|
|
161
|
+
## 📊 Completion Summary
|
|
113
162
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
163
|
+
| Category | Status | Progress |
|
|
164
|
+
|----------|--------|----------|
|
|
165
|
+
| Backend Infrastructure | ✅ Complete | 100% |
|
|
166
|
+
| iOS Native Implementation | ✅ Complete | 100% |
|
|
167
|
+
| Android Native Implementation | ✅ Complete | 100% |
|
|
168
|
+
| TypeScript Implementation | ✅ Complete | 100% |
|
|
169
|
+
| CLI Tools | ✅ Complete | 100% |
|
|
170
|
+
| Documentation | ✅ Complete | 100% |
|
|
171
|
+
| Marketing Website | ✅ Complete | 100% |
|
|
172
|
+
| Example Applications | ✅ Complete | 100% |
|
|
173
|
+
| Unit Tests | ⏳ Partial | 80% |
|
|
174
|
+
| Native Tests | ⏳ Pending | 0% |
|
|
175
|
+
| E2E Tests | ⏳ Pending | 0% |
|
|
119
176
|
|
|
120
|
-
|
|
177
|
+
**Overall Status:** Production Ready for Core Functionality
|
|
121
178
|
|
|
122
|
-
|
|
179
|
+
---
|
|
123
180
|
|
|
124
|
-
|
|
125
|
-
2. **Test native implementations** - Ensure they work on real devices
|
|
126
|
-
3. **Create basic tooling** - At minimum, bundle creation and signing
|
|
127
|
-
4. **Add monitoring** - Know when updates succeed or fail
|
|
181
|
+
## 📝 Notes
|
|
128
182
|
|
|
129
|
-
|
|
183
|
+
- Core plugin functionality is complete and tested
|
|
184
|
+
- Native tests are optional but recommended for production deployments
|
|
185
|
+
- Enterprise features can be added based on user requirements
|
|
186
|
+
- All builds pass with zero errors
|
|
187
|
+
- All lint checks pass with zero warnings
|
|
130
188
|
|
|
131
|
-
|
|
132
|
-
- **Production-Ready Solution**: 4-6 months
|
|
133
|
-
- **Enterprise-Grade System**: 6-12 months
|
|
189
|
+
---
|
|
134
190
|
|
|
135
191
|
## 🤝 Contributing
|
|
136
192
|
|
|
137
193
|
We welcome contributions! Focus areas:
|
|
138
|
-
- Backend server examples
|
|
139
194
|
- Native platform testing
|
|
140
|
-
-
|
|
141
|
-
-
|
|
195
|
+
- E2E testing frameworks
|
|
196
|
+
- Additional backend examples
|
|
197
|
+
- Framework-specific adapters
|
|
142
198
|
|
|
143
|
-
See [CONTRIBUTING.md](
|
|
199
|
+
See [CONTRIBUTING.md](../CONTRIBUTING.md) for guidelines.
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# Testing Requirements
|
|
2
|
+
|
|
3
|
+
This document outlines the testing requirements for the native-update plugin. Tests should be implemented when explicitly requested by the user.
|
|
4
|
+
|
|
5
|
+
## Current Testing Status
|
|
6
|
+
|
|
7
|
+
- **Plugin testing**: Handled in actual/live applications using the plugin
|
|
8
|
+
- **Example apps**: Demonstrate functionality for manual testing
|
|
9
|
+
- **Unit tests**: Not yet implemented (documented here for future reference)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## iOS Native Tests (XCTest)
|
|
14
|
+
|
|
15
|
+
### Test File Structure
|
|
16
|
+
```
|
|
17
|
+
ios/
|
|
18
|
+
└── Tests/
|
|
19
|
+
└── NativeUpdateTests/
|
|
20
|
+
├── LiveUpdateTests.swift
|
|
21
|
+
├── AppUpdateTests.swift
|
|
22
|
+
├── AppReviewTests.swift
|
|
23
|
+
├── BundleManagerTests.swift
|
|
24
|
+
└── SecurityTests.swift
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Test Categories
|
|
28
|
+
|
|
29
|
+
#### LiveUpdateTests.swift
|
|
30
|
+
- `testCheckForUpdate()` - Verify update check returns correct response
|
|
31
|
+
- `testDownloadBundle()` - Verify bundle download with progress
|
|
32
|
+
- `testApplyUpdate()` - Verify bundle extraction and application
|
|
33
|
+
- `testRollback()` - Verify rollback to previous version
|
|
34
|
+
- `testChecksumVerification()` - Verify SHA-256 checksum validation
|
|
35
|
+
- `testSignatureVerification()` - Verify RSA/ECDSA signature validation
|
|
36
|
+
- `testChannelManagement()` - Verify channel switching (production/staging/dev)
|
|
37
|
+
|
|
38
|
+
#### AppUpdateTests.swift
|
|
39
|
+
- `testCheckAppStoreVersion()` - Verify app store version check
|
|
40
|
+
- `testVersionComparison()` - Verify semantic version comparison
|
|
41
|
+
- `testUpdateAvailability()` - Verify update availability detection
|
|
42
|
+
- `testOpenAppStore()` - Verify App Store navigation
|
|
43
|
+
|
|
44
|
+
#### AppReviewTests.swift
|
|
45
|
+
- `testRequestReview()` - Verify StoreKit review request
|
|
46
|
+
- `testRateLimiting()` - Verify review request rate limiting
|
|
47
|
+
|
|
48
|
+
#### BundleManagerTests.swift
|
|
49
|
+
- `testBundleStorage()` - Verify bundle storage in app sandbox
|
|
50
|
+
- `testBundleCleanup()` - Verify old bundle cleanup
|
|
51
|
+
- `testActiveBundlePath()` - Verify active bundle path resolution
|
|
52
|
+
|
|
53
|
+
#### SecurityTests.swift
|
|
54
|
+
- `testInputValidation()` - Verify URL/input sanitization
|
|
55
|
+
- `testHTTPSEnforcement()` - Verify HTTPS-only connections
|
|
56
|
+
- `testDowngradeProtection()` - Verify version downgrade prevention
|
|
57
|
+
- `testKeychain Storage()` - Verify sensitive data in Keychain
|
|
58
|
+
|
|
59
|
+
### Running iOS Tests
|
|
60
|
+
```bash
|
|
61
|
+
cd ios
|
|
62
|
+
xcodebuild test -scheme NativeUpdate -destination 'platform=iOS Simulator,name=iPhone 14'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Android Native Tests (JUnit)
|
|
68
|
+
|
|
69
|
+
### Test File Structure
|
|
70
|
+
```
|
|
71
|
+
android/
|
|
72
|
+
└── src/
|
|
73
|
+
└── test/
|
|
74
|
+
└── java/
|
|
75
|
+
└── com/
|
|
76
|
+
└── aoneahsan/
|
|
77
|
+
└── nativeupdate/
|
|
78
|
+
├── LiveUpdateTest.kt
|
|
79
|
+
├── AppUpdateTest.kt
|
|
80
|
+
├── AppReviewTest.kt
|
|
81
|
+
├── BundleManagerTest.kt
|
|
82
|
+
└── SecurityTest.kt
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Test Categories
|
|
86
|
+
|
|
87
|
+
#### LiveUpdateTest.kt
|
|
88
|
+
- `testCheckForUpdate()` - Verify update check HTTP request
|
|
89
|
+
- `testDownloadBundle()` - Verify bundle download with OkHttp
|
|
90
|
+
- `testApplyUpdate()` - Verify bundle extraction to internal storage
|
|
91
|
+
- `testRollback()` - Verify rollback mechanism
|
|
92
|
+
- `testChecksumVerification()` - Verify SHA-256 validation
|
|
93
|
+
- `testSignatureVerification()` - Verify signature with Android Keystore
|
|
94
|
+
- `testChannelManagement()` - Verify channel configuration
|
|
95
|
+
|
|
96
|
+
#### AppUpdateTest.kt
|
|
97
|
+
- `testCheckPlayStoreVersion()` - Verify Play Core version check
|
|
98
|
+
- `testImmediateUpdate()` - Verify blocking update flow
|
|
99
|
+
- `testFlexibleUpdate()` - Verify background update flow
|
|
100
|
+
- `testUpdatePriority()` - Verify update priority handling
|
|
101
|
+
|
|
102
|
+
#### AppReviewTest.kt
|
|
103
|
+
- `testRequestReview()` - Verify Play Core review API
|
|
104
|
+
- `testReviewManagerInitialization()` - Verify ReviewManager setup
|
|
105
|
+
- `testRateLimiting()` - Verify request limiting
|
|
106
|
+
|
|
107
|
+
#### BundleManagerTest.kt
|
|
108
|
+
- `testBundleStorage()` - Verify internal storage operations
|
|
109
|
+
- `testBundleCleanup()` - Verify old bundle deletion
|
|
110
|
+
- `testActiveBundlePath()` - Verify bundle path resolution
|
|
111
|
+
- `testStoragePermissions()` - Verify no external storage access
|
|
112
|
+
|
|
113
|
+
#### SecurityTest.kt
|
|
114
|
+
- `testInputValidation()` - Verify input sanitization
|
|
115
|
+
- `testHTTPSEnforcement()` - Verify HTTPS-only policy
|
|
116
|
+
- `testDowngradeProtection()` - Verify version validation
|
|
117
|
+
- `testKeystore()` - Verify Android Keystore usage
|
|
118
|
+
|
|
119
|
+
### Running Android Tests
|
|
120
|
+
```bash
|
|
121
|
+
cd android
|
|
122
|
+
./gradlew test
|
|
123
|
+
./gradlew connectedAndroidTest # For instrumented tests
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## End-to-End Tests (Detox/Appium)
|
|
129
|
+
|
|
130
|
+
### Recommended Framework
|
|
131
|
+
- **Detox** for React Native + Capacitor apps
|
|
132
|
+
- **Appium** for platform-agnostic testing
|
|
133
|
+
|
|
134
|
+
### Test Scenarios
|
|
135
|
+
|
|
136
|
+
#### OTA Update Flow
|
|
137
|
+
```
|
|
138
|
+
1. App starts with version 1.0.0
|
|
139
|
+
2. Server has version 1.1.0 available
|
|
140
|
+
3. App checks for update → receives update info
|
|
141
|
+
4. App downloads bundle → shows progress
|
|
142
|
+
5. App applies update → restarts
|
|
143
|
+
6. App shows version 1.1.0
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
#### Rollback Flow
|
|
147
|
+
```
|
|
148
|
+
1. App has version 1.1.0 applied
|
|
149
|
+
2. New update 1.2.0 has critical bug
|
|
150
|
+
3. App applies 1.2.0 → crashes on start
|
|
151
|
+
4. App automatically rolls back to 1.1.0
|
|
152
|
+
5. App reports rollback to server
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
#### Native Update Flow
|
|
156
|
+
```
|
|
157
|
+
1. App version 1.0.0 installed from store
|
|
158
|
+
2. Store has version 2.0.0 (native update required)
|
|
159
|
+
3. App detects native update available
|
|
160
|
+
4. User shown update prompt
|
|
161
|
+
5. User redirected to app store
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
#### Channel Switching
|
|
165
|
+
```
|
|
166
|
+
1. App configured for 'production' channel
|
|
167
|
+
2. Developer switches to 'staging' channel
|
|
168
|
+
3. App receives staging bundle
|
|
169
|
+
4. App applies staging updates
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### E2E Test File Structure
|
|
173
|
+
```
|
|
174
|
+
e2e/
|
|
175
|
+
├── specs/
|
|
176
|
+
│ ├── ota-update.spec.js
|
|
177
|
+
│ ├── rollback.spec.js
|
|
178
|
+
│ ├── native-update.spec.js
|
|
179
|
+
│ └── channel-switching.spec.js
|
|
180
|
+
├── helpers/
|
|
181
|
+
│ └── server-mock.js
|
|
182
|
+
└── setup.js
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Test Server for E2E
|
|
188
|
+
|
|
189
|
+
A mock update server should provide:
|
|
190
|
+
|
|
191
|
+
```javascript
|
|
192
|
+
// Mock endpoints
|
|
193
|
+
GET /api/updates/check?appId=xxx&version=1.0.0&channel=production
|
|
194
|
+
POST /api/updates/download/:bundleId
|
|
195
|
+
POST /api/updates/report
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
The CLI already provides `npx native-update server start` for local testing.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Security Testing Checklist
|
|
203
|
+
|
|
204
|
+
- [ ] Test with malformed bundle files (corrupted ZIP)
|
|
205
|
+
- [ ] Test with invalid checksums
|
|
206
|
+
- [ ] Test with expired/invalid signatures
|
|
207
|
+
- [ ] Test with HTTP URLs (should be rejected)
|
|
208
|
+
- [ ] Test downgrade attempts (should be blocked)
|
|
209
|
+
- [ ] Test oversized bundles (should respect limits)
|
|
210
|
+
- [ ] Test with network interruptions
|
|
211
|
+
- [ ] Test permission denial scenarios
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## When to Implement Tests
|
|
216
|
+
|
|
217
|
+
Tests should be implemented when:
|
|
218
|
+
1. User explicitly requests test implementation
|
|
219
|
+
2. Preparing for npm publication
|
|
220
|
+
3. Before major version releases
|
|
221
|
+
4. When contributing to the project
|
|
222
|
+
|
|
223
|
+
Until then, testing is handled through:
|
|
224
|
+
- Manual testing in example apps
|
|
225
|
+
- Integration testing in actual production apps
|
|
226
|
+
- CLI command verification
|
package/docs/api/API.md
CHANGED
|
@@ -554,5 +554,5 @@ try {
|
|
|
554
554
|
|
|
555
555
|
For questions, issues, or contributions:
|
|
556
556
|
- Email: aoneahsan@gmail.com
|
|
557
|
-
- Website: [
|
|
557
|
+
- Website: [nativeupdate.aoneahsan.com](https://nativeupdate.aoneahsan.com)
|
|
558
558
|
- Author: Ahsan Mahmood ([Portfolio](https://aoneahsan.com))
|
|
@@ -300,7 +300,7 @@ After successful installation:
|
|
|
300
300
|
If you encounter any issues during installation:
|
|
301
301
|
|
|
302
302
|
- Check our [Testing Guide](../guides/testing-guide.md)
|
|
303
|
-
- Visit [
|
|
303
|
+
- Visit [nativeupdate.aoneahsan.com/contact](https://nativeupdate.aoneahsan.com/contact) for support
|
|
304
304
|
- Email aoneahsan@gmail.com with detailed information about your setup
|
|
305
305
|
|
|
306
306
|
---
|