@capgo/capacitor-updater 7.38.0 → 7.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapgoCapacitorUpdater.podspec +1 -1
- package/Package.swift +2 -2
- package/README.md +311 -140
- package/android/build.gradle +3 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +348 -25
- package/android/src/main/java/ee/forgr/capacitor_updater/DeviceIdHelper.java +0 -6
- package/dist/docs.json +517 -467
- package/dist/esm/definitions.d.ts +426 -319
- package/dist/esm/definitions.js +103 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/history.js +2 -2
- package/dist/esm/history.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +6 -1
- package/dist/esm/web.js +24 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +135 -2
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +136 -4
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CapacitorUpdaterPlugin/CapacitorUpdaterPlugin.swift +212 -2
- package/ios/Sources/CapacitorUpdaterPlugin/CapgoUpdater.swift +53 -57
- package/ios/Sources/CapacitorUpdaterPlugin/CryptoCipher.swift +1 -5
- package/package.json +6 -5
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/history.js","esm/index.js","esm/web.js"],"sourcesContent":["/*\n * Maintains navigation history across Capgo-controlled reloads when keepUrlPathAfterReload is enabled.\n */\nconst KEEP_FLAG_KEY = '__capgo_keep_url_path_after_reload';\nconst HISTORY_STORAGE_KEY = '__capgo_history_stack__';\nconst MAX_STACK_ENTRIES = 100;\nconst isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof history !== 'undefined';\nif (isBrowser) {\n const win = window;\n if (!win.__capgoHistoryPatched) {\n win.__capgoHistoryPatched = true;\n const isFeatureConfigured = () => {\n try {\n if (win.__capgoKeepUrlPathAfterReload) {\n return true;\n }\n }\n catch (err) {\n // ignore access issues\n }\n try {\n return window.localStorage.getItem(KEEP_FLAG_KEY) === '1';\n }\n catch (err) {\n return false;\n }\n };\n const readStored = () => {\n try {\n const raw = window.sessionStorage.getItem(HISTORY_STORAGE_KEY);\n if (!raw) {\n return { stack: [], index: -1 };\n }\n const parsed = JSON.parse(raw);\n if (!parsed || !Array.isArray(parsed.stack) || typeof parsed.index !== 'number') {\n return { stack: [], index: -1 };\n }\n return parsed;\n }\n catch (err) {\n return { stack: [], index: -1 };\n }\n };\n const writeStored = (stack, index) => {\n try {\n window.sessionStorage.setItem(HISTORY_STORAGE_KEY, JSON.stringify({ stack, index }));\n }\n catch (err) {\n // Storage might be unavailable; fail silently.\n }\n };\n const clearStored = () => {\n try {\n window.sessionStorage.removeItem(HISTORY_STORAGE_KEY);\n }\n catch (err) {\n // ignore\n }\n };\n const normalize = (url) => {\n try {\n const base = url !== null && url !== void 0 ? url : window.location.href;\n const parsed = new URL(base instanceof URL ? base.toString() : base, window.location.href);\n return `${parsed.pathname}${parsed.search}${parsed.hash}`;\n }\n catch (err) {\n return null;\n }\n };\n const trimStack = (stack, index) => {\n if (stack.length <= MAX_STACK_ENTRIES) {\n return { stack, index };\n }\n const start = stack.length - MAX_STACK_ENTRIES;\n const trimmed = stack.slice(start);\n const adjustedIndex = Math.max(0, index - start);\n return { stack: trimmed, index: adjustedIndex };\n };\n const runWhenReady = (fn) => {\n if (document.readyState === 'complete' || document.readyState === 'interactive') {\n fn();\n }\n else {\n window.addEventListener('DOMContentLoaded', fn, { once: true });\n }\n };\n let featureActive = false;\n let isRestoring = false;\n let restoreScheduled = false;\n const ensureCurrentTracked = () => {\n if (!featureActive) {\n return;\n }\n const stored = readStored();\n const current = normalize();\n if (!current) {\n return;\n }\n if (stored.stack.length === 0) {\n stored.stack.push(current);\n stored.index = 0;\n writeStored(stored.stack, stored.index);\n return;\n }\n if (stored.index < 0 || stored.index >= stored.stack.length) {\n stored.index = stored.stack.length - 1;\n }\n if (stored.stack[stored.index] !== current) {\n stored.stack[stored.index] = current;\n writeStored(stored.stack, stored.index);\n }\n };\n const record = (url, replace) => {\n if (!featureActive || isRestoring) {\n return;\n }\n const normalized = normalize(url);\n if (!normalized) {\n return;\n }\n let { stack, index } = readStored();\n if (stack.length === 0) {\n stack.push(normalized);\n index = stack.length - 1;\n }\n else if (replace) {\n if (index < 0 || index >= stack.length) {\n index = stack.length - 1;\n }\n stack[index] = normalized;\n }\n else {\n if (index >= stack.length - 1) {\n stack.push(normalized);\n index = stack.length - 1;\n }\n else {\n stack = stack.slice(0, index + 1);\n stack.push(normalized);\n index = stack.length - 1;\n }\n }\n ({ stack, index } = trimStack(stack, index));\n writeStored(stack, index);\n };\n const restoreHistory = () => {\n if (!featureActive || isRestoring) {\n return;\n }\n const stored = readStored();\n if (stored.stack.length === 0) {\n ensureCurrentTracked();\n return;\n }\n const targetIndex = stored.index >= 0 && stored.index < stored.stack.length ? stored.index : stored.stack.length - 1;\n const normalizedCurrent = normalize();\n if (stored.stack.length === 1 && normalizedCurrent === stored.stack[0]) {\n return;\n }\n const firstEntry = stored.stack[0];\n if (!firstEntry) {\n return;\n }\n isRestoring = true;\n try {\n history.replaceState(history.state, document.title, firstEntry);\n for (let i = 1; i < stored.stack.length; i += 1) {\n history.pushState(history.state, document.title, stored.stack[i]);\n }\n }\n catch (err) {\n isRestoring = false;\n return;\n }\n isRestoring = false;\n const currentIndex = stored.stack.length - 1;\n const offset = targetIndex - currentIndex;\n if (offset !== 0) {\n history.go(offset);\n }\n else {\n history.replaceState(history.state, document.title, stored.stack[targetIndex]);\n window.dispatchEvent(new PopStateEvent('popstate'));\n }\n };\n const scheduleRestore = () => {\n if (!featureActive || restoreScheduled) {\n return;\n }\n restoreScheduled = true;\n runWhenReady(() => {\n restoreScheduled = false;\n restoreHistory();\n });\n };\n let originalPushState = null;\n let originalReplaceState = null;\n const popstateHandler = () => {\n if (!featureActive || isRestoring) {\n return;\n }\n const normalized = normalize();\n if (!normalized) {\n return;\n }\n const stored = readStored();\n const idx = stored.stack.lastIndexOf(normalized);\n if (idx >= 0) {\n stored.index = idx;\n }\n else {\n stored.stack.push(normalized);\n stored.index = stored.stack.length - 1;\n }\n const trimmed = trimStack(stored.stack, stored.index);\n writeStored(trimmed.stack, trimmed.index);\n };\n const patchHistory = () => {\n if (originalPushState && originalReplaceState) {\n return;\n }\n originalPushState = history.pushState;\n originalReplaceState = history.replaceState;\n history.pushState = function pushStatePatched(state, title, url) {\n const result = originalPushState.call(history, state, title, url);\n record(url, false);\n return result;\n };\n history.replaceState = function replaceStatePatched(state, title, url) {\n const result = originalReplaceState.call(history, state, title, url);\n record(url, true);\n return result;\n };\n window.addEventListener('popstate', popstateHandler);\n };\n const unpatchHistory = () => {\n if (originalPushState) {\n history.pushState = originalPushState;\n originalPushState = null;\n }\n if (originalReplaceState) {\n history.replaceState = originalReplaceState;\n originalReplaceState = null;\n }\n window.removeEventListener('popstate', popstateHandler);\n };\n const setFeatureActive = (enabled) => {\n if (featureActive === enabled) {\n if (featureActive) {\n ensureCurrentTracked();\n scheduleRestore();\n }\n return;\n }\n featureActive = enabled;\n if (featureActive) {\n patchHistory();\n ensureCurrentTracked();\n scheduleRestore();\n }\n else {\n unpatchHistory();\n clearStored();\n }\n };\n window.addEventListener('CapacitorUpdaterKeepUrlPathAfterReload', (event) => {\n var _a;\n const evt = event;\n const enabled = (_a = evt === null || evt === void 0 ? void 0 : evt.detail) === null || _a === void 0 ? void 0 : _a.enabled;\n if (typeof enabled === 'boolean') {\n win.__capgoKeepUrlPathAfterReload = enabled;\n setFeatureActive(enabled);\n }\n else {\n win.__capgoKeepUrlPathAfterReload = true;\n setFeatureActive(true);\n }\n });\n setFeatureActive(isFeatureConfigured());\n }\n}\nexport {};\n//# sourceMappingURL=history.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 { registerPlugin } from '@capacitor/core';\nimport './history';\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 setBundleError(options) {\n console.warn('Cannot setBundleError in web', options);\n return BUNDLE_BUILTIN;\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 listChannels() {\n console.warn('Cannot listChannels in web');\n throw {\n message: 'Cannot listChannels in web',\n error: 'platform_not_supported',\n };\n }\n async notifyAppReady() {\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 return Promise.resolve(null);\n }\n async getFailedUpdate() {\n console.warn('Cannot getFailedUpdate in web');\n return null;\n }\n async setShakeMenu(_options) {\n throw this.unimplemented('Shake menu not available on web platform');\n }\n async isShakeMenuEnabled() {\n return Promise.resolve({ enabled: false });\n }\n async getAppId() {\n console.warn('Cannot getAppId in web');\n return { appId: 'default' };\n }\n async setAppId(options) {\n console.warn('Cannot setAppId in web', options);\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IA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I;IACJ,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;IACjC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,0CAA0C,CAAC;IAC5E,IAAI;IACJ,IAAI,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAClD,IAAI;IACJ,IAAI,MAAM,QAAQ,GAAG;IACrB,QAAQ,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC;IAC9C,QAAQ,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE;IACnC,IAAI;IACJ,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;IAC5B,QAAQ,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,OAAO,CAAC;IACvD,QAAQ;IACR,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/history.js","esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/*\n * Maintains navigation history across Capgo-controlled reloads when keepUrlPathAfterReload is enabled.\n */\nconst KEEP_FLAG_KEY = '__capgo_keep_url_path_after_reload';\nconst HISTORY_STORAGE_KEY = '__capgo_history_stack__';\nconst MAX_STACK_ENTRIES = 100;\nconst isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof history !== 'undefined';\nif (isBrowser) {\n const win = window;\n if (!win.__capgoHistoryPatched) {\n win.__capgoHistoryPatched = true;\n const isFeatureConfigured = () => {\n try {\n if (win.__capgoKeepUrlPathAfterReload) {\n return true;\n }\n }\n catch (err) {\n // ignore access issues\n }\n try {\n return window.localStorage.getItem(KEEP_FLAG_KEY) === '1';\n }\n catch (err) {\n return false;\n }\n };\n const readStored = () => {\n try {\n const raw = window.sessionStorage.getItem(HISTORY_STORAGE_KEY);\n if (!raw) {\n return { stack: [], index: -1 };\n }\n const parsed = JSON.parse(raw);\n if (!parsed || !Array.isArray(parsed.stack) || typeof parsed.index !== 'number') {\n return { stack: [], index: -1 };\n }\n return parsed;\n }\n catch (err) {\n return { stack: [], index: -1 };\n }\n };\n const writeStored = (stack, index) => {\n try {\n window.sessionStorage.setItem(HISTORY_STORAGE_KEY, JSON.stringify({ stack, index }));\n }\n catch (err) {\n // Storage might be unavailable; fail silently.\n }\n };\n const clearStored = () => {\n try {\n window.sessionStorage.removeItem(HISTORY_STORAGE_KEY);\n }\n catch (err) {\n // ignore\n }\n };\n const normalize = (url) => {\n try {\n const base = url !== null && url !== void 0 ? url : window.location.href;\n const parsed = new URL(base instanceof URL ? base.toString() : base, window.location.href);\n return `${parsed.pathname}${parsed.search}${parsed.hash}`;\n }\n catch (err) {\n return null;\n }\n };\n const trimStack = (stack, index) => {\n if (stack.length <= MAX_STACK_ENTRIES) {\n return { stack, index };\n }\n const start = stack.length - MAX_STACK_ENTRIES;\n const trimmed = stack.slice(start);\n const adjustedIndex = Math.max(0, index - start);\n return { stack: trimmed, index: adjustedIndex };\n };\n const runWhenReady = (fn) => {\n if (document.readyState === 'complete' || document.readyState === 'interactive') {\n fn();\n }\n else {\n window.addEventListener('DOMContentLoaded', fn, { once: true });\n }\n };\n let featureActive = false;\n let isRestoring = false;\n let restoreScheduled = false;\n const ensureCurrentTracked = () => {\n if (!featureActive) {\n return;\n }\n const stored = readStored();\n const current = normalize();\n if (!current) {\n return;\n }\n if (stored.stack.length === 0) {\n stored.stack.push(current);\n stored.index = 0;\n writeStored(stored.stack, stored.index);\n return;\n }\n if (stored.index < 0 || stored.index >= stored.stack.length) {\n stored.index = stored.stack.length - 1;\n }\n if (stored.stack[stored.index] !== current) {\n stored.stack[stored.index] = current;\n writeStored(stored.stack, stored.index);\n }\n };\n const record = (url, replace) => {\n if (!featureActive || isRestoring) {\n return;\n }\n const normalized = normalize(url);\n if (!normalized) {\n return;\n }\n let { stack, index } = readStored();\n if (stack.length === 0) {\n stack.push(normalized);\n index = stack.length - 1;\n }\n else if (replace) {\n if (index < 0 || index >= stack.length) {\n index = stack.length - 1;\n }\n stack[index] = normalized;\n }\n else {\n if (index >= stack.length - 1) {\n stack.push(normalized);\n index = stack.length - 1;\n }\n else {\n stack = stack.slice(0, index + 1);\n stack.push(normalized);\n index = stack.length - 1;\n }\n }\n ({ stack, index } = trimStack(stack, index));\n writeStored(stack, index);\n };\n const restoreHistory = () => {\n if (!featureActive || isRestoring) {\n return;\n }\n const stored = readStored();\n if (stored.stack.length === 0) {\n ensureCurrentTracked();\n return;\n }\n const targetIndex = stored.index >= 0 && stored.index < stored.stack.length ? stored.index : stored.stack.length - 1;\n const normalizedCurrent = normalize();\n if (stored.stack.length === 1 && normalizedCurrent === stored.stack[0]) {\n return;\n }\n const firstEntry = stored.stack[0];\n if (!firstEntry) {\n return;\n }\n isRestoring = true;\n try {\n history.replaceState(history.state, document.title, firstEntry);\n for (let i = 1; i < stored.stack.length; i += 1) {\n history.pushState(history.state, document.title, stored.stack[i]);\n }\n }\n catch (err) {\n isRestoring = false;\n return;\n }\n isRestoring = false;\n const currentIndex = stored.stack.length - 1;\n const offset = targetIndex - currentIndex;\n if (offset !== 0) {\n history.go(offset);\n }\n else {\n history.replaceState(history.state, document.title, stored.stack[targetIndex]);\n window.dispatchEvent(new PopStateEvent('popstate'));\n }\n };\n const scheduleRestore = () => {\n if (!featureActive || restoreScheduled) {\n return;\n }\n restoreScheduled = true;\n runWhenReady(() => {\n restoreScheduled = false;\n restoreHistory();\n });\n };\n let originalPushState = null;\n let originalReplaceState = null;\n const popstateHandler = () => {\n if (!featureActive || isRestoring) {\n return;\n }\n const normalized = normalize();\n if (!normalized) {\n return;\n }\n const stored = readStored();\n const idx = stored.stack.lastIndexOf(normalized);\n if (idx >= 0) {\n stored.index = idx;\n }\n else {\n stored.stack.push(normalized);\n stored.index = stored.stack.length - 1;\n }\n const trimmed = trimStack(stored.stack, stored.index);\n writeStored(trimmed.stack, trimmed.index);\n };\n const patchHistory = () => {\n if (originalPushState && originalReplaceState) {\n return;\n }\n originalPushState = history.pushState;\n originalReplaceState = history.replaceState;\n history.pushState = function pushStatePatched(state, title, url) {\n const result = originalPushState === null || originalPushState === void 0 ? void 0 : originalPushState.call(history, state, title, url);\n record(url, false);\n return result;\n };\n history.replaceState = function replaceStatePatched(state, title, url) {\n const result = originalReplaceState === null || originalReplaceState === void 0 ? void 0 : originalReplaceState.call(history, state, title, url);\n record(url, true);\n return result;\n };\n window.addEventListener('popstate', popstateHandler);\n };\n const unpatchHistory = () => {\n if (originalPushState) {\n history.pushState = originalPushState;\n originalPushState = null;\n }\n if (originalReplaceState) {\n history.replaceState = originalReplaceState;\n originalReplaceState = null;\n }\n window.removeEventListener('popstate', popstateHandler);\n };\n const setFeatureActive = (enabled) => {\n if (featureActive === enabled) {\n if (featureActive) {\n ensureCurrentTracked();\n scheduleRestore();\n }\n return;\n }\n featureActive = enabled;\n if (featureActive) {\n patchHistory();\n ensureCurrentTracked();\n scheduleRestore();\n }\n else {\n unpatchHistory();\n clearStored();\n }\n };\n window.addEventListener('CapacitorUpdaterKeepUrlPathAfterReload', (event) => {\n var _a;\n const evt = event;\n const enabled = (_a = evt === null || evt === void 0 ? void 0 : evt.detail) === null || _a === void 0 ? void 0 : _a.enabled;\n if (typeof enabled === 'boolean') {\n win.__capgoKeepUrlPathAfterReload = enabled;\n setFeatureActive(enabled);\n }\n else {\n win.__capgoKeepUrlPathAfterReload = true;\n setFeatureActive(true);\n }\n });\n setFeatureActive(isFeatureConfigured());\n }\n}\nexport {};\n//# sourceMappingURL=history.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 */\n/**\n * Update availability status.\n *\n * @since 8.0.0\n */\nexport var AppUpdateAvailability;\n(function (AppUpdateAvailability) {\n /**\n * Update availability is unknown.\n * This typically means the check hasn't completed or failed.\n */\n AppUpdateAvailability[AppUpdateAvailability[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n /**\n * No update is available.\n * The installed version is the latest.\n */\n AppUpdateAvailability[AppUpdateAvailability[\"UPDATE_NOT_AVAILABLE\"] = 1] = \"UPDATE_NOT_AVAILABLE\";\n /**\n * An update is available for download.\n */\n AppUpdateAvailability[AppUpdateAvailability[\"UPDATE_AVAILABLE\"] = 2] = \"UPDATE_AVAILABLE\";\n /**\n * An update is currently being downloaded or installed.\n */\n AppUpdateAvailability[AppUpdateAvailability[\"UPDATE_IN_PROGRESS\"] = 3] = \"UPDATE_IN_PROGRESS\";\n})(AppUpdateAvailability || (AppUpdateAvailability = {}));\n/**\n * Installation status for flexible updates (Android only).\n *\n * @since 8.0.0\n */\nexport var FlexibleUpdateInstallStatus;\n(function (FlexibleUpdateInstallStatus) {\n /**\n * Unknown install status.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n /**\n * Download is pending and will start soon.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"PENDING\"] = 1] = \"PENDING\";\n /**\n * Download is in progress.\n * Check `bytesDownloaded` and `totalBytesToDownload` for progress.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"DOWNLOADING\"] = 2] = \"DOWNLOADING\";\n /**\n * The update is being installed.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"INSTALLING\"] = 3] = \"INSTALLING\";\n /**\n * The update has been installed.\n * The app needs to be restarted to use the new version.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"INSTALLED\"] = 4] = \"INSTALLED\";\n /**\n * The update failed to download or install.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"FAILED\"] = 5] = \"FAILED\";\n /**\n * The update was canceled by the user.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"CANCELED\"] = 6] = \"CANCELED\";\n /**\n * The update has been downloaded and is ready to install.\n * Call {@link CapacitorUpdaterPlugin.completeFlexibleUpdate} to install.\n */\n FlexibleUpdateInstallStatus[FlexibleUpdateInstallStatus[\"DOWNLOADED\"] = 11] = \"DOWNLOADED\";\n})(FlexibleUpdateInstallStatus || (FlexibleUpdateInstallStatus = {}));\n/**\n * Result codes for app update operations.\n *\n * @since 8.0.0\n */\nexport var AppUpdateResultCode;\n(function (AppUpdateResultCode) {\n /**\n * The update completed successfully.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"OK\"] = 0] = \"OK\";\n /**\n * The user canceled the update.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"CANCELED\"] = 1] = \"CANCELED\";\n /**\n * The update failed.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"FAILED\"] = 2] = \"FAILED\";\n /**\n * No update is available.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"NOT_AVAILABLE\"] = 3] = \"NOT_AVAILABLE\";\n /**\n * The requested update type is not allowed.\n * For example, trying to perform an immediate update when only flexible is allowed.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"NOT_ALLOWED\"] = 4] = \"NOT_ALLOWED\";\n /**\n * Required information is missing.\n * This can happen if {@link CapacitorUpdaterPlugin.getAppUpdateInfo} wasn't called first.\n */\n AppUpdateResultCode[AppUpdateResultCode[\"INFO_MISSING\"] = 5] = \"INFO_MISSING\";\n})(AppUpdateResultCode || (AppUpdateResultCode = {}));\n//# sourceMappingURL=definitions.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 'capacitor-cli.d.ts';\nimport { registerPlugin } from '@capacitor/core';\nimport './history';\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';\nimport { AppUpdateAvailability } from './definitions';\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 setBundleError(options) {\n console.warn('Cannot setBundleError in web', options);\n return BUNDLE_BUILTIN;\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 listChannels() {\n console.warn('Cannot listChannels in web');\n throw {\n message: 'Cannot listChannels in web',\n error: 'platform_not_supported',\n };\n }\n async notifyAppReady() {\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 return Promise.resolve(null);\n }\n async getFailedUpdate() {\n console.warn('Cannot getFailedUpdate in web');\n return null;\n }\n async setShakeMenu(_options) {\n throw this.unimplemented('Shake menu not available on web platform');\n }\n async isShakeMenuEnabled() {\n return Promise.resolve({ enabled: false });\n }\n async getAppId() {\n console.warn('Cannot getAppId in web');\n return { appId: 'default' };\n }\n async setAppId(options) {\n console.warn('Cannot setAppId in web', options);\n return;\n }\n // ============================================================================\n // App Store / Play Store Update Methods (Web stubs)\n // ============================================================================\n async getAppUpdateInfo(_options) {\n console.warn('getAppUpdateInfo is not available on web platform');\n return {\n currentVersionName: '0.0.0',\n currentVersionCode: '0',\n updateAvailability: AppUpdateAvailability.UNKNOWN,\n };\n }\n async openAppStore(_options) {\n throw this.unimplemented('openAppStore is not available on web platform');\n }\n async performImmediateUpdate() {\n throw this.unimplemented('performImmediateUpdate is only available on Android');\n }\n async startFlexibleUpdate() {\n throw this.unimplemented('startFlexibleUpdate is only available on Android');\n }\n async completeFlexibleUpdate() {\n throw this.unimplemented('completeFlexibleUpdate is only available on Android');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["AppUpdateAvailability","FlexibleUpdateInstallStatus","AppUpdateResultCode","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA,MAAM,aAAa,GAAG,oCAAoC;IAC1D,MAAM,mBAAmB,GAAG,yBAAyB;IACrD,MAAM,iBAAiB,GAAG,GAAG;IAC7B,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW;IACpH,IAAI,SAAS,EAAE;IACf,IAAI,MAAM,GAAG,GAAG,MAAM;IACtB,IAAI,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE;IACpC,QAAQ,GAAG,CAAC,qBAAqB,GAAG,IAAI;IACxC,QAAQ,MAAM,mBAAmB,GAAG,MAAM;IAC1C,YAAY,IAAI;IAChB,gBAAgB,IAAI,GAAG,CAAC,6BAA6B,EAAE;IACvD,oBAAoB,OAAO,IAAI;IAC/B,gBAAgB;IAChB,YAAY;IACZ,YAAY,OAAO,GAAG,EAAE;IACxB;IACA,YAAY;IACZ,YAAY,IAAI;IAChB,gBAAgB,OAAO,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,GAAG;IACzE,YAAY;IACZ,YAAY,OAAO,GAAG,EAAE;IACxB,gBAAgB,OAAO,KAAK;IAC5B,YAAY;IACZ,QAAQ,CAAC;IACT,QAAQ,MAAM,UAAU,GAAG,MAAM;IACjC,YAAY,IAAI;IAChB,gBAAgB,MAAM,GAAG,GAAG,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC;IAC9E,gBAAgB,IAAI,CAAC,GAAG,EAAE;IAC1B,oBAAoB,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE;IACnD,gBAAgB;IAChB,gBAAgB,MAAM,MAAM,GAAG,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CAAC;IACvF,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -51,10 +51,16 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
51
51
|
CAPPluginMethod(name: "getNextBundle", returnType: CAPPluginReturnPromise),
|
|
52
52
|
CAPPluginMethod(name: "getFailedUpdate", returnType: CAPPluginReturnPromise),
|
|
53
53
|
CAPPluginMethod(name: "setShakeMenu", returnType: CAPPluginReturnPromise),
|
|
54
|
-
CAPPluginMethod(name: "isShakeMenuEnabled", returnType: CAPPluginReturnPromise)
|
|
54
|
+
CAPPluginMethod(name: "isShakeMenuEnabled", returnType: CAPPluginReturnPromise),
|
|
55
|
+
// App Store update methods
|
|
56
|
+
CAPPluginMethod(name: "getAppUpdateInfo", returnType: CAPPluginReturnPromise),
|
|
57
|
+
CAPPluginMethod(name: "openAppStore", returnType: CAPPluginReturnPromise),
|
|
58
|
+
CAPPluginMethod(name: "performImmediateUpdate", returnType: CAPPluginReturnPromise),
|
|
59
|
+
CAPPluginMethod(name: "startFlexibleUpdate", returnType: CAPPluginReturnPromise),
|
|
60
|
+
CAPPluginMethod(name: "completeFlexibleUpdate", returnType: CAPPluginReturnPromise)
|
|
55
61
|
]
|
|
56
62
|
public var implementation = CapgoUpdater()
|
|
57
|
-
private let pluginVersion: String = "7.
|
|
63
|
+
private let pluginVersion: String = "7.40.0"
|
|
58
64
|
static let updateUrlDefault = "https://plugin.capgo.app/updates"
|
|
59
65
|
static let statsUrlDefault = "https://plugin.capgo.app/stats"
|
|
60
66
|
static let channelUrlDefault = "https://plugin.capgo.app/channel_self"
|
|
@@ -1660,4 +1666,208 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
1660
1666
|
implementation.appId = appId
|
|
1661
1667
|
call.resolve()
|
|
1662
1668
|
}
|
|
1669
|
+
|
|
1670
|
+
// MARK: - App Store Update Methods
|
|
1671
|
+
|
|
1672
|
+
/// AppUpdateAvailability enum values matching TypeScript definitions
|
|
1673
|
+
private enum AppUpdateAvailability: Int {
|
|
1674
|
+
case unknown = 0
|
|
1675
|
+
case updateNotAvailable = 1
|
|
1676
|
+
case updateAvailable = 2
|
|
1677
|
+
case updateInProgress = 3
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
@objc func getAppUpdateInfo(_ call: CAPPluginCall) {
|
|
1681
|
+
let country = call.getString("country", "US")
|
|
1682
|
+
let bundleId = implementation.appId
|
|
1683
|
+
|
|
1684
|
+
logger.info("Getting App Store update info for \(bundleId) in country \(country)")
|
|
1685
|
+
|
|
1686
|
+
DispatchQueue.global(qos: .background).async {
|
|
1687
|
+
let urlString = "https://itunes.apple.com/lookup?bundleId=\(bundleId)&country=\(country)"
|
|
1688
|
+
guard let url = URL(string: urlString) else {
|
|
1689
|
+
call.reject("Invalid URL for App Store lookup")
|
|
1690
|
+
return
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
let task = URLSession.shared.dataTask(with: url) { data, _, error in
|
|
1694
|
+
if let error = error {
|
|
1695
|
+
self.logger.error("App Store lookup failed: \(error.localizedDescription)")
|
|
1696
|
+
call.reject("App Store lookup failed: \(error.localizedDescription)")
|
|
1697
|
+
return
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
guard let data = data else {
|
|
1701
|
+
call.reject("No data received from App Store")
|
|
1702
|
+
return
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
do {
|
|
1706
|
+
guard let json = try JSONSerialization.jsonObject(with: data) as? [String: Any],
|
|
1707
|
+
let resultCount = json["resultCount"] as? Int else {
|
|
1708
|
+
call.reject("Invalid response from App Store")
|
|
1709
|
+
return
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
let currentVersionName = Bundle.main.versionName ?? "0.0.0"
|
|
1713
|
+
let currentVersionCode = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "0"
|
|
1714
|
+
|
|
1715
|
+
var result: [String: Any] = [
|
|
1716
|
+
"currentVersionName": currentVersionName,
|
|
1717
|
+
"currentVersionCode": currentVersionCode,
|
|
1718
|
+
"updateAvailability": AppUpdateAvailability.unknown.rawValue
|
|
1719
|
+
]
|
|
1720
|
+
|
|
1721
|
+
if resultCount > 0,
|
|
1722
|
+
let results = json["results"] as? [[String: Any]],
|
|
1723
|
+
let appInfo = results.first {
|
|
1724
|
+
|
|
1725
|
+
let availableVersion = appInfo["version"] as? String
|
|
1726
|
+
let releaseDate = appInfo["currentVersionReleaseDate"] as? String
|
|
1727
|
+
let minimumOsVersion = appInfo["minimumOsVersion"] as? String
|
|
1728
|
+
|
|
1729
|
+
result["availableVersionName"] = availableVersion
|
|
1730
|
+
result["availableVersionCode"] = availableVersion // iOS doesn't have separate version code
|
|
1731
|
+
result["availableVersionReleaseDate"] = releaseDate
|
|
1732
|
+
result["minimumOsVersion"] = minimumOsVersion
|
|
1733
|
+
|
|
1734
|
+
// Determine update availability by comparing versions
|
|
1735
|
+
if let availableVersion = availableVersion {
|
|
1736
|
+
do {
|
|
1737
|
+
let currentVer = try Version(currentVersionName)
|
|
1738
|
+
let availableVer = try Version(availableVersion)
|
|
1739
|
+
if availableVer > currentVer {
|
|
1740
|
+
result["updateAvailability"] = AppUpdateAvailability.updateAvailable.rawValue
|
|
1741
|
+
} else {
|
|
1742
|
+
result["updateAvailability"] = AppUpdateAvailability.updateNotAvailable.rawValue
|
|
1743
|
+
}
|
|
1744
|
+
} catch {
|
|
1745
|
+
// If version parsing fails, do string comparison
|
|
1746
|
+
if availableVersion != currentVersionName {
|
|
1747
|
+
result["updateAvailability"] = AppUpdateAvailability.updateAvailable.rawValue
|
|
1748
|
+
} else {
|
|
1749
|
+
result["updateAvailability"] = AppUpdateAvailability.updateNotAvailable.rawValue
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
} else {
|
|
1753
|
+
result["updateAvailability"] = AppUpdateAvailability.updateNotAvailable.rawValue
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
// iOS doesn't support in-app updates like Android
|
|
1757
|
+
result["immediateUpdateAllowed"] = false
|
|
1758
|
+
result["flexibleUpdateAllowed"] = false
|
|
1759
|
+
} else {
|
|
1760
|
+
// App not found in App Store (maybe not published yet)
|
|
1761
|
+
result["updateAvailability"] = AppUpdateAvailability.updateNotAvailable.rawValue
|
|
1762
|
+
self.logger.info("App not found in App Store for bundleId: \(bundleId)")
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
call.resolve(result)
|
|
1766
|
+
} catch {
|
|
1767
|
+
self.logger.error("Failed to parse App Store response: \(error.localizedDescription)")
|
|
1768
|
+
call.reject("Failed to parse App Store response: \(error.localizedDescription)")
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
task.resume()
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
@objc func openAppStore(_ call: CAPPluginCall) {
|
|
1776
|
+
let appId = call.getString("appId")
|
|
1777
|
+
|
|
1778
|
+
if let appId = appId {
|
|
1779
|
+
// Open App Store with provided app ID
|
|
1780
|
+
let urlString = "https://apps.apple.com/app/id\(appId)"
|
|
1781
|
+
guard let url = URL(string: urlString) else {
|
|
1782
|
+
call.reject("Invalid App Store URL")
|
|
1783
|
+
return
|
|
1784
|
+
}
|
|
1785
|
+
DispatchQueue.main.async {
|
|
1786
|
+
UIApplication.shared.open(url) { success in
|
|
1787
|
+
if success {
|
|
1788
|
+
call.resolve()
|
|
1789
|
+
} else {
|
|
1790
|
+
call.reject("Failed to open App Store")
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
} else {
|
|
1795
|
+
// Look up app ID using bundle identifier
|
|
1796
|
+
let bundleId = implementation.appId
|
|
1797
|
+
let lookupUrl = "https://itunes.apple.com/lookup?bundleId=\(bundleId)"
|
|
1798
|
+
|
|
1799
|
+
DispatchQueue.global(qos: .background).async {
|
|
1800
|
+
guard let url = URL(string: lookupUrl) else {
|
|
1801
|
+
call.reject("Invalid lookup URL")
|
|
1802
|
+
return
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
let task = URLSession.shared.dataTask(with: url) { data, _, error in
|
|
1806
|
+
if let error = error {
|
|
1807
|
+
call.reject("Failed to lookup app: \(error.localizedDescription)")
|
|
1808
|
+
return
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
guard let data = data,
|
|
1812
|
+
let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any],
|
|
1813
|
+
let results = json["results"] as? [[String: Any]],
|
|
1814
|
+
let appInfo = results.first,
|
|
1815
|
+
let trackId = appInfo["trackId"] as? Int else {
|
|
1816
|
+
// If lookup fails, try opening the generic App Store app page using bundle ID
|
|
1817
|
+
let fallbackUrlString = "https://apps.apple.com/app/\(bundleId)"
|
|
1818
|
+
guard let fallbackUrl = URL(string: fallbackUrlString) else {
|
|
1819
|
+
call.reject("Failed to find app in App Store and fallback URL is invalid")
|
|
1820
|
+
return
|
|
1821
|
+
}
|
|
1822
|
+
DispatchQueue.main.async {
|
|
1823
|
+
UIApplication.shared.open(fallbackUrl) { success in
|
|
1824
|
+
if success {
|
|
1825
|
+
call.resolve()
|
|
1826
|
+
} else {
|
|
1827
|
+
call.reject("Failed to open App Store")
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
return
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
let appStoreUrl = "https://apps.apple.com/app/id\(trackId)"
|
|
1835
|
+
guard let url = URL(string: appStoreUrl) else {
|
|
1836
|
+
call.reject("Invalid App Store URL")
|
|
1837
|
+
return
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
DispatchQueue.main.async {
|
|
1841
|
+
UIApplication.shared.open(url) { success in
|
|
1842
|
+
if success {
|
|
1843
|
+
call.resolve()
|
|
1844
|
+
} else {
|
|
1845
|
+
call.reject("Failed to open App Store")
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
task.resume()
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
@objc func performImmediateUpdate(_ call: CAPPluginCall) {
|
|
1856
|
+
// iOS doesn't support in-app updates like Android's Play Store
|
|
1857
|
+
// Redirect users to the App Store instead
|
|
1858
|
+
logger.warn("performImmediateUpdate is not supported on iOS. Use openAppStore() instead.")
|
|
1859
|
+
call.reject("In-app updates are not supported on iOS. Use openAppStore() to direct users to the App Store.", "NOT_SUPPORTED")
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
@objc func startFlexibleUpdate(_ call: CAPPluginCall) {
|
|
1863
|
+
// iOS doesn't support flexible in-app updates
|
|
1864
|
+
logger.warn("startFlexibleUpdate is not supported on iOS. Use openAppStore() instead.")
|
|
1865
|
+
call.reject("Flexible updates are not supported on iOS. Use openAppStore() to direct users to the App Store.", "NOT_SUPPORTED")
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
@objc func completeFlexibleUpdate(_ call: CAPPluginCall) {
|
|
1869
|
+
// iOS doesn't support flexible in-app updates
|
|
1870
|
+
logger.warn("completeFlexibleUpdate is not supported on iOS.")
|
|
1871
|
+
call.reject("Flexible updates are not supported on iOS.", "NOT_SUPPORTED")
|
|
1872
|
+
}
|
|
1663
1873
|
}
|
|
@@ -5,11 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import Foundation
|
|
8
|
-
|
|
9
|
-
import ZipArchive
|
|
10
|
-
#else
|
|
11
|
-
import SSZipArchive
|
|
12
|
-
#endif
|
|
8
|
+
import ZIPFoundation
|
|
13
9
|
import Alamofire
|
|
14
10
|
import Compression
|
|
15
11
|
import UIKit
|
|
@@ -237,38 +233,22 @@ import UIKit
|
|
|
237
233
|
}
|
|
238
234
|
}
|
|
239
235
|
|
|
240
|
-
private func
|
|
241
|
-
|
|
242
|
-
|
|
236
|
+
private func validateZipEntry(path: String, destUnZip: URL) throws {
|
|
237
|
+
// Check for Windows paths
|
|
238
|
+
if path.contains("\\") {
|
|
239
|
+
logger.error("unzip: Windows path is not supported, please use unix path as required by zip RFC: \(path)")
|
|
243
240
|
self.sendStats(action: "windows_path_fail")
|
|
241
|
+
throw CustomError.cannotUnzip
|
|
244
242
|
}
|
|
245
243
|
|
|
246
|
-
|
|
247
|
-
let
|
|
248
|
-
let
|
|
244
|
+
// Check for path traversal
|
|
245
|
+
let fileURL = destUnZip.appendingPathComponent(path)
|
|
246
|
+
let canonicalPath = fileURL.standardizedFileURL.path
|
|
247
|
+
let canonicalDir = destUnZip.standardizedFileURL.path
|
|
249
248
|
|
|
250
249
|
if !canonicalPath.hasPrefix(canonicalDir) {
|
|
251
250
|
self.sendStats(action: "canonical_path_fail")
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
let isDirectory = entry.hasSuffix("/")
|
|
256
|
-
if !isDirectory {
|
|
257
|
-
let folderURL = fileURL.deletingLastPathComponent()
|
|
258
|
-
if !FileManager.default.fileExists(atPath: folderURL.path) {
|
|
259
|
-
do {
|
|
260
|
-
try FileManager.default.createDirectory(at: folderURL, withIntermediateDirectories: true, attributes: nil)
|
|
261
|
-
} catch {
|
|
262
|
-
self.sendStats(action: "directory_path_fail")
|
|
263
|
-
unzipError = error as NSError
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
let newPercent = self.calcTotalPercent(percent: Int(Double(entryNumber) / Double(total) * 100), min: 75, max: 81)
|
|
269
|
-
if newPercent != self.unzipPercent {
|
|
270
|
-
self.unzipPercent = newPercent
|
|
271
|
-
self.notifyDownload(id: id, percent: newPercent)
|
|
251
|
+
throw CustomError.cannotUnzip
|
|
272
252
|
}
|
|
273
253
|
}
|
|
274
254
|
|
|
@@ -280,36 +260,52 @@ import UIKit
|
|
|
280
260
|
self.unzipPercent = 0
|
|
281
261
|
self.notifyDownload(id: id, percent: 75)
|
|
282
262
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
password: nil,
|
|
292
|
-
error: &unzipError,
|
|
293
|
-
delegate: nil,
|
|
294
|
-
progressHandler: { [weak self] (entry, zipInfo, entryNumber, total) in
|
|
295
|
-
DispatchQueue.global(qos: .background).async {
|
|
296
|
-
guard let self = self else { return }
|
|
297
|
-
if !notify {
|
|
298
|
-
return
|
|
299
|
-
}
|
|
300
|
-
self.unzipProgressHandler(entry: entry, zipInfo: zipInfo, entryNumber: entryNumber, total: total, destUnZip: destUnZip, id: id, unzipError: &unzipError)
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
completionHandler: { _, _, _ in
|
|
304
|
-
semaphore.signal()
|
|
305
|
-
})
|
|
263
|
+
// Open the archive
|
|
264
|
+
let archive: Archive
|
|
265
|
+
do {
|
|
266
|
+
archive = try Archive(url: sourceZip, accessMode: .read)
|
|
267
|
+
} catch {
|
|
268
|
+
self.sendStats(action: "unzip_fail")
|
|
269
|
+
throw CustomError.cannotUnzip
|
|
270
|
+
}
|
|
306
271
|
|
|
307
|
-
|
|
272
|
+
// Create destination directory
|
|
273
|
+
try FileManager.default.createDirectory(at: destUnZip, withIntermediateDirectories: true, attributes: nil)
|
|
274
|
+
|
|
275
|
+
// Count total entries for progress
|
|
276
|
+
let totalEntries = archive.reduce(0) { count, _ in count + 1 }
|
|
277
|
+
var processedEntries = 0
|
|
278
|
+
|
|
279
|
+
do {
|
|
280
|
+
for entry in archive {
|
|
281
|
+
// Validate entry path for security
|
|
282
|
+
try validateZipEntry(path: entry.path, destUnZip: destUnZip)
|
|
283
|
+
|
|
284
|
+
let destPath = destUnZip.appendingPathComponent(entry.path)
|
|
285
|
+
|
|
286
|
+
// Create parent directories if needed
|
|
287
|
+
let parentDir = destPath.deletingLastPathComponent()
|
|
288
|
+
if !FileManager.default.fileExists(atPath: parentDir.path) {
|
|
289
|
+
try FileManager.default.createDirectory(at: parentDir, withIntermediateDirectories: true, attributes: nil)
|
|
290
|
+
}
|
|
308
291
|
|
|
309
|
-
|
|
292
|
+
// Extract the entry
|
|
293
|
+
_ = try archive.extract(entry, to: destPath, skipCRC32: true)
|
|
294
|
+
|
|
295
|
+
// Update progress
|
|
296
|
+
processedEntries += 1
|
|
297
|
+
if notify && totalEntries > 0 {
|
|
298
|
+
let newPercent = self.calcTotalPercent(percent: Int(Double(processedEntries) / Double(totalEntries) * 100), min: 75, max: 81)
|
|
299
|
+
if newPercent != self.unzipPercent {
|
|
300
|
+
self.unzipPercent = newPercent
|
|
301
|
+
self.notifyDownload(id: id, percent: newPercent)
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
} catch {
|
|
310
306
|
self.sendStats(action: "unzip_fail")
|
|
311
307
|
try? FileManager.default.removeItem(at: destUnZip)
|
|
312
|
-
throw
|
|
308
|
+
throw error
|
|
313
309
|
}
|
|
314
310
|
|
|
315
311
|
if try unflatFolder(source: destUnZip, dest: destPersist) {
|
|
@@ -151,11 +151,7 @@ public struct CryptoCipher {
|
|
|
151
151
|
while autoreleasepool(invoking: {
|
|
152
152
|
let fileData: Data
|
|
153
153
|
do {
|
|
154
|
-
|
|
155
|
-
fileData = try fileHandle.read(upToCount: bufferSize) ?? Data()
|
|
156
|
-
} else {
|
|
157
|
-
fileData = fileHandle.readData(ofLength: bufferSize)
|
|
158
|
-
}
|
|
154
|
+
fileData = try fileHandle.read(upToCount: bufferSize) ?? Data()
|
|
159
155
|
} catch {
|
|
160
156
|
logger.error("Error reading file: \(error)")
|
|
161
157
|
return false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-updater",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.40.0",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "Live update for capacitor apps",
|
|
6
6
|
"main": "dist/plugin.cjs.js",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"bugs": {
|
|
25
25
|
"url": "https://github.com/Cap-go/capacitor-updater/issues"
|
|
26
26
|
},
|
|
27
|
+
"homepage": "https://capgo.app/docs/plugins/updater/",
|
|
27
28
|
"keywords": [
|
|
28
29
|
"capacitor",
|
|
29
30
|
"live updates",
|
|
@@ -36,8 +37,7 @@
|
|
|
36
37
|
"OTA",
|
|
37
38
|
"ionic",
|
|
38
39
|
"appflow alternative",
|
|
39
|
-
"
|
|
40
|
-
"@capawesome/capacitor-live-update",
|
|
40
|
+
"microsoft alternative",
|
|
41
41
|
"native"
|
|
42
42
|
],
|
|
43
43
|
"scripts": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
52
52
|
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
53
53
|
"eslint": "eslint . --ext .ts",
|
|
54
|
-
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
54
|
+
"prettier": "prettier-pretty-check \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
55
55
|
"swiftlint": "node-swiftlint",
|
|
56
56
|
"docgen": "node scripts/generate-docs.js",
|
|
57
57
|
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
@@ -77,7 +77,8 @@
|
|
|
77
77
|
"rimraf": "^6.0.1",
|
|
78
78
|
"rollup": "^4.50.0",
|
|
79
79
|
"swiftlint": "^2.0.0",
|
|
80
|
-
"typescript": "^5.9.2"
|
|
80
|
+
"typescript": "^5.9.2",
|
|
81
|
+
"prettier-pretty-check": "^0.2.0"
|
|
81
82
|
},
|
|
82
83
|
"peerDependencies": {
|
|
83
84
|
"@capacitor/core": ">=7.0.0"
|