@capgo/capacitor-updater 8.0.0 → 8.0.1
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/CapgoCapacitorUpdater.podspec +2 -2
- package/Package.swift +35 -0
- package/README.md +667 -206
- package/android/build.gradle +16 -11
- package/android/proguard-rules.pro +28 -0
- package/android/src/main/AndroidManifest.xml +0 -1
- package/android/src/main/java/ee/forgr/capacitor_updater/BundleInfo.java +134 -194
- package/android/src/main/java/ee/forgr/capacitor_updater/BundleStatus.java +23 -23
- package/android/src/main/java/ee/forgr/capacitor_updater/Callback.java +13 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdater.java +967 -1027
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +1283 -1180
- package/android/src/main/java/ee/forgr/capacitor_updater/CryptoCipherV2.java +276 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/DataManager.java +28 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/DelayCondition.java +45 -48
- package/android/src/main/java/ee/forgr/capacitor_updater/DelayUntilNext.java +4 -4
- package/android/src/main/java/ee/forgr/capacitor_updater/DownloadService.java +440 -113
- package/android/src/main/java/ee/forgr/capacitor_updater/DownloadWorkerManager.java +101 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/InternalUtils.java +32 -0
- package/dist/docs.json +1316 -473
- package/dist/esm/definitions.d.ts +518 -248
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +25 -41
- package/dist/esm/web.js +67 -35
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +67 -35
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +67 -35
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CapacitorUpdater.swift +736 -361
- package/ios/Plugin/CapacitorUpdaterPlugin.swift +436 -136
- package/ios/Plugin/CryptoCipherV2.swift +310 -0
- package/ios/Plugin/InternalUtils.swift +258 -0
- package/package.json +33 -29
- package/android/src/main/java/ee/forgr/capacitor_updater/CryptoCipher.java +0 -153
- package/ios/Plugin/CapacitorUpdaterPlugin.h +0 -10
- package/ios/Plugin/CapacitorUpdaterPlugin.m +0 -27
- package/ios/Plugin/CryptoCipher.swift +0 -240
package/dist/plugin.js
CHANGED
|
@@ -6,7 +6,7 @@ var capacitorCapacitorUpdater = (function (exports, core) {
|
|
|
6
6
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
7
7
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
8
8
|
*/
|
|
9
|
-
const CapacitorUpdater = core.registerPlugin(
|
|
9
|
+
const CapacitorUpdater = core.registerPlugin('CapacitorUpdater', {
|
|
10
10
|
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapacitorUpdaterWeb()),
|
|
11
11
|
});
|
|
12
12
|
|
|
@@ -16,96 +16,128 @@ var capacitorCapacitorUpdater = (function (exports, core) {
|
|
|
16
16
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
17
17
|
*/
|
|
18
18
|
const BUNDLE_BUILTIN = {
|
|
19
|
-
status:
|
|
20
|
-
version:
|
|
21
|
-
downloaded:
|
|
22
|
-
id:
|
|
23
|
-
checksum:
|
|
19
|
+
status: 'success',
|
|
20
|
+
version: '',
|
|
21
|
+
downloaded: '1970-01-01T00:00:00.000Z',
|
|
22
|
+
id: 'builtin',
|
|
23
|
+
checksum: '',
|
|
24
24
|
};
|
|
25
25
|
class CapacitorUpdaterWeb extends core.WebPlugin {
|
|
26
|
+
async setStatsUrl(options) {
|
|
27
|
+
console.warn('Cannot setStatsUrl in web', options);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
async setUpdateUrl(options) {
|
|
31
|
+
console.warn('Cannot setUpdateUrl in web', options);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
async setChannelUrl(options) {
|
|
35
|
+
console.warn('Cannot setChannelUrl in web', options);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
26
38
|
async download(options) {
|
|
27
|
-
console.warn(
|
|
39
|
+
console.warn('Cannot download version in web', options);
|
|
28
40
|
return BUNDLE_BUILTIN;
|
|
29
41
|
}
|
|
30
42
|
async next(options) {
|
|
31
|
-
console.warn(
|
|
43
|
+
console.warn('Cannot set next version in web', options);
|
|
32
44
|
return BUNDLE_BUILTIN;
|
|
33
45
|
}
|
|
34
46
|
async isAutoUpdateEnabled() {
|
|
35
|
-
console.warn(
|
|
47
|
+
console.warn('Cannot get isAutoUpdateEnabled in web');
|
|
36
48
|
return { enabled: false };
|
|
37
49
|
}
|
|
38
50
|
async set(options) {
|
|
39
|
-
console.warn(
|
|
51
|
+
console.warn('Cannot set active bundle in web', options);
|
|
40
52
|
return;
|
|
41
53
|
}
|
|
42
54
|
async getDeviceId() {
|
|
43
|
-
console.warn(
|
|
44
|
-
return { deviceId:
|
|
55
|
+
console.warn('Cannot get ID in web');
|
|
56
|
+
return { deviceId: 'default' };
|
|
57
|
+
}
|
|
58
|
+
async getBuiltinVersion() {
|
|
59
|
+
console.warn('Cannot get version in web');
|
|
60
|
+
return { version: 'default' };
|
|
45
61
|
}
|
|
46
62
|
async getPluginVersion() {
|
|
47
|
-
console.warn(
|
|
48
|
-
return { version:
|
|
63
|
+
console.warn('Cannot get plugin version in web');
|
|
64
|
+
return { version: 'default' };
|
|
49
65
|
}
|
|
50
66
|
async delete(options) {
|
|
51
|
-
console.warn(
|
|
67
|
+
console.warn('Cannot delete bundle in web', options);
|
|
52
68
|
}
|
|
53
69
|
async list() {
|
|
54
|
-
console.warn(
|
|
70
|
+
console.warn('Cannot list bundles in web');
|
|
55
71
|
return { bundles: [] };
|
|
56
72
|
}
|
|
57
73
|
async reset(options) {
|
|
58
|
-
console.warn(
|
|
74
|
+
console.warn('Cannot reset version in web', options);
|
|
59
75
|
}
|
|
60
76
|
async current() {
|
|
61
|
-
console.warn(
|
|
62
|
-
return { bundle: BUNDLE_BUILTIN, native:
|
|
77
|
+
console.warn('Cannot get current bundle in web');
|
|
78
|
+
return { bundle: BUNDLE_BUILTIN, native: '0.0.0' };
|
|
63
79
|
}
|
|
64
80
|
async reload() {
|
|
65
|
-
console.warn(
|
|
81
|
+
console.warn('Cannot reload current bundle in web');
|
|
66
82
|
return;
|
|
67
83
|
}
|
|
68
84
|
async getLatest() {
|
|
69
|
-
console.warn(
|
|
85
|
+
console.warn('Cannot getLatest current bundle in web');
|
|
70
86
|
return {
|
|
71
|
-
version:
|
|
72
|
-
message:
|
|
87
|
+
version: '0.0.0',
|
|
88
|
+
message: 'Cannot getLatest current bundle in web',
|
|
73
89
|
};
|
|
74
90
|
}
|
|
75
91
|
async setChannel(options) {
|
|
76
|
-
console.warn(
|
|
92
|
+
console.warn('Cannot setChannel in web', options);
|
|
77
93
|
return {
|
|
78
|
-
status:
|
|
79
|
-
error:
|
|
94
|
+
status: 'error',
|
|
95
|
+
error: 'Cannot setChannel in web',
|
|
80
96
|
};
|
|
81
97
|
}
|
|
98
|
+
async unsetChannel(options) {
|
|
99
|
+
console.warn('Cannot unsetChannel in web', options);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
82
102
|
async setCustomId(options) {
|
|
83
|
-
console.warn(
|
|
103
|
+
console.warn('Cannot setCustomId in web', options);
|
|
84
104
|
return;
|
|
85
105
|
}
|
|
86
106
|
async getChannel() {
|
|
87
|
-
console.warn(
|
|
107
|
+
console.warn('Cannot getChannel in web');
|
|
88
108
|
return {
|
|
89
|
-
status:
|
|
90
|
-
error:
|
|
109
|
+
status: 'error',
|
|
110
|
+
error: 'Cannot getChannel in web',
|
|
91
111
|
};
|
|
92
112
|
}
|
|
93
113
|
async notifyAppReady() {
|
|
94
|
-
console.warn(
|
|
95
|
-
return BUNDLE_BUILTIN;
|
|
114
|
+
console.warn('Cannot notify App Ready in web');
|
|
115
|
+
return { bundle: BUNDLE_BUILTIN };
|
|
96
116
|
}
|
|
97
117
|
async setMultiDelay(options) {
|
|
98
|
-
console.warn(
|
|
118
|
+
console.warn('Cannot setMultiDelay in web', options === null || options === void 0 ? void 0 : options.delayConditions);
|
|
99
119
|
return;
|
|
100
120
|
}
|
|
101
121
|
async setDelay(option) {
|
|
102
|
-
console.warn(
|
|
122
|
+
console.warn('Cannot setDelay in web', option);
|
|
103
123
|
return;
|
|
104
124
|
}
|
|
105
125
|
async cancelDelay() {
|
|
106
|
-
console.warn(
|
|
126
|
+
console.warn('Cannot cancelDelay in web');
|
|
107
127
|
return;
|
|
108
128
|
}
|
|
129
|
+
async isAutoUpdateAvailable() {
|
|
130
|
+
console.warn('Cannot isAutoUpdateAvailable in web');
|
|
131
|
+
return { available: false };
|
|
132
|
+
}
|
|
133
|
+
async getCurrentBundle() {
|
|
134
|
+
console.warn('Cannot get current bundle in web');
|
|
135
|
+
return BUNDLE_BUILTIN;
|
|
136
|
+
}
|
|
137
|
+
async getNextBundle() {
|
|
138
|
+
console.warn('Cannot get next bundle in web');
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
109
141
|
}
|
|
110
142
|
|
|
111
143
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { registerPlugin } from
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { registerPlugin } from '@capacitor/core';\nconst CapacitorUpdater = registerPlugin('CapacitorUpdater', {\n web: () => import('./web').then((m) => new m.CapacitorUpdaterWeb()),\n});\nexport * from './definitions';\nexport { CapacitorUpdater };\n//# sourceMappingURL=index.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { WebPlugin } from '@capacitor/core';\nconst BUNDLE_BUILTIN = {\n status: 'success',\n version: '',\n downloaded: '1970-01-01T00:00:00.000Z',\n id: 'builtin',\n checksum: '',\n};\nexport class CapacitorUpdaterWeb extends WebPlugin {\n async setStatsUrl(options) {\n console.warn('Cannot setStatsUrl in web', options);\n return;\n }\n async setUpdateUrl(options) {\n console.warn('Cannot setUpdateUrl in web', options);\n return;\n }\n async setChannelUrl(options) {\n console.warn('Cannot setChannelUrl in web', options);\n return;\n }\n async download(options) {\n console.warn('Cannot download version in web', options);\n return BUNDLE_BUILTIN;\n }\n async next(options) {\n console.warn('Cannot set next version in web', options);\n return BUNDLE_BUILTIN;\n }\n async isAutoUpdateEnabled() {\n console.warn('Cannot get isAutoUpdateEnabled in web');\n return { enabled: false };\n }\n async set(options) {\n console.warn('Cannot set active bundle in web', options);\n return;\n }\n async getDeviceId() {\n console.warn('Cannot get ID in web');\n return { deviceId: 'default' };\n }\n async getBuiltinVersion() {\n console.warn('Cannot get version in web');\n return { version: 'default' };\n }\n async getPluginVersion() {\n console.warn('Cannot get plugin version in web');\n return { version: 'default' };\n }\n async delete(options) {\n console.warn('Cannot delete bundle in web', options);\n }\n async list() {\n console.warn('Cannot list bundles in web');\n return { bundles: [] };\n }\n async reset(options) {\n console.warn('Cannot reset version in web', options);\n }\n async current() {\n console.warn('Cannot get current bundle in web');\n return { bundle: BUNDLE_BUILTIN, native: '0.0.0' };\n }\n async reload() {\n console.warn('Cannot reload current bundle in web');\n return;\n }\n async getLatest() {\n console.warn('Cannot getLatest current bundle in web');\n return {\n version: '0.0.0',\n message: 'Cannot getLatest current bundle in web',\n };\n }\n async setChannel(options) {\n console.warn('Cannot setChannel in web', options);\n return {\n status: 'error',\n error: 'Cannot setChannel in web',\n };\n }\n async unsetChannel(options) {\n console.warn('Cannot unsetChannel in web', options);\n return;\n }\n async setCustomId(options) {\n console.warn('Cannot setCustomId in web', options);\n return;\n }\n async getChannel() {\n console.warn('Cannot getChannel in web');\n return {\n status: 'error',\n error: 'Cannot getChannel in web',\n };\n }\n async notifyAppReady() {\n console.warn('Cannot notify App Ready in web');\n return { bundle: BUNDLE_BUILTIN };\n }\n async setMultiDelay(options) {\n console.warn('Cannot setMultiDelay in web', options === null || options === void 0 ? void 0 : options.delayConditions);\n return;\n }\n async setDelay(option) {\n console.warn('Cannot setDelay in web', option);\n return;\n }\n async cancelDelay() {\n console.warn('Cannot cancelDelay in web');\n return;\n }\n async isAutoUpdateAvailable() {\n console.warn('Cannot isAutoUpdateAvailable in web');\n return { available: false };\n }\n async getCurrentBundle() {\n console.warn('Cannot get current bundle in web');\n return BUNDLE_BUILTIN;\n }\n async getNextBundle() {\n console.warn('Cannot get next bundle in web');\n return null;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;AAEK,UAAC,gBAAgB,GAAGA,mBAAc,CAAC,kBAAkB,EAAE;IAC5D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;IACvE,CAAC;;ICRD;IACA;IACA;IACA;IACA;IAEA,MAAM,cAAc,GAAG;IACvB,IAAI,MAAM,EAAE,SAAS;IACrB,IAAI,OAAO,EAAE,EAAE;IACf,IAAI,UAAU,EAAE,0BAA0B;IAC1C,IAAI,EAAE,EAAE,SAAS;IACjB,IAAI,QAAQ,EAAE,EAAE;IAChB,CAAC;IACM,MAAM,mBAAmB,SAASC,cAAS,CAAC;IACnD,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAC/B,QAAQ,OAAO,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