@capgo/capacitor-updater 9.0.0 → 9.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 +3 -6
- package/Package.swift +30 -0
- package/README.md +2382 -292
- package/android/build.gradle +37 -15
- package/android/consumer-rules.pro +48 -0
- package/android/proguard-rules.pro +23 -0
- package/android/src/main/AndroidManifest.xml +0 -1
- package/android/src/main/java/ee/forgr/capacitor_updater/AndroidAppExitReporter.java +92 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/AppLifecycleObserver.java +115 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/BundleInfo.java +227 -195
- package/android/src/main/java/ee/forgr/capacitor_updater/BundleStatus.java +24 -23
- package/android/src/main/java/ee/forgr/capacitor_updater/Callback.java +13 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +7435 -1243
- package/android/src/main/java/ee/forgr/capacitor_updater/CapgoUpdater.java +5144 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/CryptoCipher.java +564 -121
- package/android/src/main/java/ee/forgr/capacitor_updater/DataManager.java +44 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/DelayCondition.java +43 -49
- package/android/src/main/java/ee/forgr/capacitor_updater/DelayUntilNext.java +4 -4
- package/android/src/main/java/ee/forgr/capacitor_updater/DelayUpdateUtils.java +427 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/DeviceIdHelper.java +230 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/DownloadService.java +1969 -118
- package/android/src/main/java/ee/forgr/capacitor_updater/DownloadWorkerManager.java +278 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/HeadlessUpdateWorker.java +385 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/Http3.java +356 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/HttpEngineTransport.java +553 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/InternalUtils.java +79 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/Logger.java +419 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/NativeUpdatePrompt.java +303 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/ShakeDetector.java +72 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/ShakeMenu.java +959 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/StatsBatchFailureDiagnostics.java +40 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/ThreeFingerPinchDetector.java +323 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/Version.java +306 -0
- package/dist/docs.json +4431 -840
- package/dist/esm/definitions.d.ts +2607 -225
- package/dist/esm/definitions.js +103 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/history.d.ts +1 -0
- package/dist/esm/history.js +283 -0
- package/dist/esm/history.js.map +1 -0
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.js +5 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +53 -42
- package/dist/esm/web.js +180 -37
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +570 -37
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +570 -37
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CapacitorUpdaterPlugin/AES.swift +262 -0
- package/ios/Sources/CapacitorUpdaterPlugin/AppHealthTracker.swift +82 -0
- package/ios/Sources/CapacitorUpdaterPlugin/BundleInfo.swift +185 -0
- package/ios/Sources/CapacitorUpdaterPlugin/BundleStatus.swift +127 -0
- package/ios/Sources/CapacitorUpdaterPlugin/CapacitorUpdaterPlugin.swift +5642 -0
- package/ios/Sources/CapacitorUpdaterPlugin/CapgoRawRsa.swift +36 -0
- package/ios/Sources/CapacitorUpdaterPlugin/CapgoSemanticVersion.swift +162 -0
- package/ios/Sources/CapacitorUpdaterPlugin/CapgoUpdater.swift +4572 -0
- package/ios/Sources/CapacitorUpdaterPlugin/CryptoCipher.swift +380 -0
- package/ios/Sources/CapacitorUpdaterPlugin/DelayUpdateUtils.swift +343 -0
- package/ios/Sources/CapacitorUpdaterPlugin/DeviceIdHelper.swift +120 -0
- package/ios/Sources/CapacitorUpdaterPlugin/InternalUtils.swift +452 -0
- package/ios/Sources/CapacitorUpdaterPlugin/Logger.swift +380 -0
- package/ios/Sources/CapacitorUpdaterPlugin/NativeUpdatePrompt.swift +183 -0
- package/ios/Sources/CapacitorUpdaterPlugin/RSA.swift +96 -0
- package/ios/Sources/CapacitorUpdaterPlugin/RedirectPolicyDelegate.swift +97 -0
- package/ios/Sources/CapacitorUpdaterPlugin/ShakeMenu.swift +871 -0
- package/ios/{Plugin → Sources/CapacitorUpdaterPlugin}/UserDefaultsExtension.swift +0 -2
- package/ios/Sources/CapacitorUpdaterPlugin/WKWebView+CapgoObjcBridge.swift +20 -0
- package/ios/Sources/CapacitorUpdaterPlugin/WebViewStatsReporter.swift +304 -0
- package/ios/Sources/CapacitorUpdaterPlugin/ZipArchiveReader.swift +247 -0
- package/ios/Sources/CapacitorUpdaterPlugin/ZipCentralDirectory.swift +280 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/BuiltinHashesTests.swift +210 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/BundleHardeningTests.swift +292 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/CapacitorUpdaterPluginTests.swift +3905 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/CapgoSemanticVersionTests.swift +64 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/ChecksumRequiredTests.swift +151 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/CliCryptoFixtureTests.swift +249 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/HttpsOnlyBuiltinMinimumTests.swift +528 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/InstallPerfTests.swift +174 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/ListChannelsTests.swift +74 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/LoggerSecurityTests.swift +149 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/NativeContractTests.swift +160 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/NetworkTransportTests.swift +1095 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/PopulateDeltaCacheTests.swift +573 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/RedirectPolicyTests.swift +63 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/RsaContractTests.swift +281 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/SessionKeyRequiredTests.swift +192 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/TestZipWriter.swift +235 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/UpdateLifecycleTests.swift +454 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/WebKitOverlayGuardTests.swift +32 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/ZipArchiveReaderTests.swift +302 -0
- package/ios/Tests/CapacitorUpdaterPluginTests/ZipBundleExtractionTests.swift +122 -0
- package/package.json +80 -43
- package/scripts/builtin-hashes-lib.mjs +148 -0
- package/scripts/capacitor-builtin-hashes-hook.mjs +65 -0
- package/scripts/resolve-real-path.mjs +25 -0
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdater.java +0 -1130
- package/ios/Plugin/BundleInfo.swift +0 -113
- package/ios/Plugin/BundleStatus.swift +0 -48
- package/ios/Plugin/CapacitorUpdater.swift +0 -858
- package/ios/Plugin/CapacitorUpdaterPlugin.h +0 -10
- package/ios/Plugin/CapacitorUpdaterPlugin.m +0 -27
- package/ios/Plugin/CapacitorUpdaterPlugin.swift +0 -677
- package/ios/Plugin/CryptoCipher.swift +0 -240
- /package/{LICENCE → LICENSE} +0 -0
- /package/ios/{Plugin → Sources/CapacitorUpdaterPlugin}/DelayCondition.swift +0 -0
- /package/ios/{Plugin → Sources/CapacitorUpdaterPlugin}/DelayUntilNext.swift +0 -0
- /package/ios/{Plugin → Sources/CapacitorUpdaterPlugin}/Info.plist +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import XCTest
|
|
2
|
+
|
|
3
|
+
final class WebKitOverlayGuardTests: XCTestCase {
|
|
4
|
+
func testPluginSourcesAvoidSwiftWebKitOverlayCallAsyncJavaScript() throws {
|
|
5
|
+
let testsDir = URL(fileURLWithPath: #filePath).deletingLastPathComponent()
|
|
6
|
+
let pluginSources = testsDir
|
|
7
|
+
.deletingLastPathComponent()
|
|
8
|
+
.deletingLastPathComponent()
|
|
9
|
+
.appendingPathComponent("Sources/CapacitorUpdaterPlugin", isDirectory: true)
|
|
10
|
+
|
|
11
|
+
let files = try FileManager.default.contentsOfDirectory(
|
|
12
|
+
at: pluginSources,
|
|
13
|
+
includingPropertiesForKeys: nil
|
|
14
|
+
).filter { $0.pathExtension == "swift" }
|
|
15
|
+
|
|
16
|
+
var violations: [String] = []
|
|
17
|
+
for file in files {
|
|
18
|
+
let lines = try String(contentsOf: file, encoding: .utf8).split(separator: "\n", omittingEmptySubsequences: false)
|
|
19
|
+
for (index, line) in lines.enumerated() {
|
|
20
|
+
let trimmed = line.trimmingCharacters(in: .whitespaces)
|
|
21
|
+
if trimmed.hasPrefix("//") || trimmed.hasPrefix("*") {
|
|
22
|
+
continue
|
|
23
|
+
}
|
|
24
|
+
if line.contains("callAsyncJavaScript("), !line.contains("__callAsyncJavaScript(") {
|
|
25
|
+
violations.append("\(file.lastPathComponent):\(index + 1)")
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
XCTAssertTrue(violations.isEmpty, "Swift WebKit overlay callAsyncJavaScript found: \(violations.joined(separator: ", "))")
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import XCTest
|
|
3
|
+
@testable import CapacitorUpdaterPlugin
|
|
4
|
+
|
|
5
|
+
final class ZipArchiveReaderTests: XCTestCase {
|
|
6
|
+
private var root = URL(fileURLWithPath: NSTemporaryDirectory())
|
|
7
|
+
|
|
8
|
+
override func setUpWithError() throws {
|
|
9
|
+
root = FileManager.default.temporaryDirectory.appendingPathComponent("capgo-zip-reader-\(UUID().uuidString)")
|
|
10
|
+
try FileManager.default.createDirectory(at: root, withIntermediateDirectories: true)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
override func tearDownWithError() throws {
|
|
14
|
+
try? FileManager.default.removeItem(at: root)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// MARK: - Helpers
|
|
18
|
+
|
|
19
|
+
private func writeZip(_ writer: TestZipWriter, name: String = "test.zip", zip64: Bool = false) throws -> URL {
|
|
20
|
+
let url = root.appendingPathComponent(name)
|
|
21
|
+
try writer.write(to: url, zip64: zip64)
|
|
22
|
+
return url
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private func readAll(_ reader: ZipArchiveReader, _ entry: ZipEntry, bufferSize: Int = 4096) throws -> Data {
|
|
26
|
+
var data = Data()
|
|
27
|
+
try reader.extract(entry, bufferSize: bufferSize) { chunk in
|
|
28
|
+
XCTAssertLessThanOrEqual(chunk.count, bufferSize)
|
|
29
|
+
data.append(chunk)
|
|
30
|
+
}
|
|
31
|
+
return data
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
private func randomData(count: Int) -> Data {
|
|
35
|
+
var generator = SystemRandomNumberGenerator()
|
|
36
|
+
return Data((0..<count).map { _ in UInt8.random(in: 0...255, using: &generator) })
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private func compressibleData(count: Int) -> Data {
|
|
40
|
+
let pattern = Data("capgo-live-update-".utf8)
|
|
41
|
+
var data = Data(capacity: count)
|
|
42
|
+
while data.count < count {
|
|
43
|
+
data.append(pattern)
|
|
44
|
+
}
|
|
45
|
+
return data.prefix(count)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// MARK: - Reader
|
|
49
|
+
|
|
50
|
+
func testReadsStoredAndDeflatedEntries() throws {
|
|
51
|
+
let stored = randomData(count: 10_000)
|
|
52
|
+
let deflated = compressibleData(count: 300_000)
|
|
53
|
+
let empty = Data()
|
|
54
|
+
var writer = TestZipWriter()
|
|
55
|
+
writer.addFile("stored.bin", stored)
|
|
56
|
+
writer.addFile("deflated.txt", deflated, method: .deflate)
|
|
57
|
+
writer.addFile("empty-stored.txt", empty)
|
|
58
|
+
writer.addFile("empty-deflated.txt", empty, method: .deflate)
|
|
59
|
+
let reader = try ZipArchiveReader(url: try writeZip(writer))
|
|
60
|
+
|
|
61
|
+
XCTAssertEqual(reader.entries.map(\.path), ["stored.bin", "deflated.txt", "empty-stored.txt", "empty-deflated.txt"])
|
|
62
|
+
XCTAssertTrue(reader.entries.allSatisfy { $0.type == .file })
|
|
63
|
+
XCTAssertEqual(try readAll(reader, reader.entries[0]), stored)
|
|
64
|
+
XCTAssertEqual(try readAll(reader, reader.entries[1]), deflated)
|
|
65
|
+
XCTAssertEqual(try readAll(reader, reader.entries[1], bufferSize: 7), deflated)
|
|
66
|
+
XCTAssertEqual(try readAll(reader, reader.entries[2]), empty)
|
|
67
|
+
XCTAssertEqual(try readAll(reader, reader.entries[3]), empty)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
func testReadsIncompressibleDeflatedEntryWithSmallBuffer() throws {
|
|
71
|
+
let payload = randomData(count: 200_000)
|
|
72
|
+
var writer = TestZipWriter()
|
|
73
|
+
writer.addFile("random.bin", payload, method: .deflate)
|
|
74
|
+
let reader = try ZipArchiveReader(url: try writeZip(writer))
|
|
75
|
+
XCTAssertEqual(try readAll(reader, reader.entries[0], bufferSize: 1024), payload)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
func testDetectsDirectoriesAndSymlinks() throws {
|
|
79
|
+
var writer = TestZipWriter()
|
|
80
|
+
writer.addDirectory("assets")
|
|
81
|
+
writer.addFile("assets/app.js", Data("js".utf8))
|
|
82
|
+
writer.addSymlink("assets/link.js", target: "app.js")
|
|
83
|
+
// DOS-style entry: directory detected from the trailing slash only.
|
|
84
|
+
writer.add(TestZipWriter.EntrySpec(path: "legacy/", data: Data(), unixMode: nil))
|
|
85
|
+
let reader = try ZipArchiveReader(url: try writeZip(writer))
|
|
86
|
+
|
|
87
|
+
XCTAssertEqual(reader.entries.map(\.type), [.directory, .file, .symlink, .directory])
|
|
88
|
+
XCTAssertEqual(try readAll(reader, reader.entries[0]), Data())
|
|
89
|
+
XCTAssertEqual(try reader.readSmallEntry(reader.entries[2], maxBytes: 1024, bufferSize: 16), Data("app.js".utf8))
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
func testEntryTypeMatchesPreviousZipFoundationRules() {
|
|
93
|
+
let unix: UInt16 = 3 << 8
|
|
94
|
+
let macOS: UInt16 = 19 << 8
|
|
95
|
+
XCTAssertEqual(ZipCentralDirectory.entryType(path: "a", versionMadeBy: unix, externalAttributes: 0o100644 << 16), .file)
|
|
96
|
+
XCTAssertEqual(ZipCentralDirectory.entryType(path: "a", versionMadeBy: unix, externalAttributes: 0o040755 << 16), .directory)
|
|
97
|
+
XCTAssertEqual(ZipCentralDirectory.entryType(path: "a", versionMadeBy: macOS, externalAttributes: 0o120777 << 16), .symlink)
|
|
98
|
+
XCTAssertEqual(ZipCentralDirectory.entryType(path: "a/", versionMadeBy: unix, externalAttributes: 0), .directory)
|
|
99
|
+
XCTAssertEqual(ZipCentralDirectory.entryType(path: "a", versionMadeBy: 0, externalAttributes: 0x10), .directory)
|
|
100
|
+
XCTAssertEqual(ZipCentralDirectory.entryType(path: "a", versionMadeBy: 0, externalAttributes: 0x20), .file)
|
|
101
|
+
// Symlink mode bits from a non-unix host are ignored.
|
|
102
|
+
XCTAssertEqual(ZipCentralDirectory.entryType(path: "a", versionMadeBy: 0, externalAttributes: 0o120777 << 16), .file)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
func testDecodesUtf8AndCp437Names() throws {
|
|
106
|
+
var writer = TestZipWriter()
|
|
107
|
+
writer.addFile("caf\u{E9}.txt", Data("utf8".utf8))
|
|
108
|
+
// Without the UTF-8 flag names are CP437, where 0x82 is "é".
|
|
109
|
+
var cp437 = TestZipWriter.EntrySpec(path: "", data: Data("cp437".utf8))
|
|
110
|
+
cp437.generalPurposeFlags = 0
|
|
111
|
+
cp437.rawName = Data([0x82, 0x2E, 0x74, 0x78, 0x74])
|
|
112
|
+
writer.add(cp437)
|
|
113
|
+
|
|
114
|
+
let reader = try ZipArchiveReader(url: try writeZip(writer))
|
|
115
|
+
XCTAssertEqual(reader.entries.map(\.path), ["caf\u{E9}.txt", "\u{E9}.txt"])
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
func testReadsZip64Archive() throws {
|
|
119
|
+
let payload = compressibleData(count: 50_000)
|
|
120
|
+
var writer = TestZipWriter()
|
|
121
|
+
writer.addFile("index.html", Data("<html></html>".utf8))
|
|
122
|
+
writer.addFile("big.js", payload, method: .deflate)
|
|
123
|
+
let reader = try ZipArchiveReader(url: try writeZip(writer, zip64: true))
|
|
124
|
+
XCTAssertEqual(reader.entries.map(\.path), ["index.html", "big.js"])
|
|
125
|
+
XCTAssertEqual(reader.entries[1].uncompressedSize, UInt64(payload.count))
|
|
126
|
+
XCTAssertEqual(try readAll(reader, reader.entries[1]), payload)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
func testFindsEndOfCentralDirectoryBeforeComment() throws {
|
|
130
|
+
var writer = TestZipWriter()
|
|
131
|
+
writer.addFile("index.html", Data("hi".utf8))
|
|
132
|
+
let url = root.appendingPathComponent("comment.zip")
|
|
133
|
+
try writer.build(comment: "PK\u{05}\u{06} trailing comment").write(to: url)
|
|
134
|
+
let reader = try ZipArchiveReader(url: url)
|
|
135
|
+
XCTAssertEqual(try readAll(reader, reader.entries[0]), Data("hi".utf8))
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
func testRejectsEncryptedEntries() throws {
|
|
139
|
+
var writer = TestZipWriter()
|
|
140
|
+
var spec = TestZipWriter.EntrySpec(path: "secret.txt", data: Data("secret".utf8))
|
|
141
|
+
spec.generalPurposeFlags = 0x0801
|
|
142
|
+
writer.add(spec)
|
|
143
|
+
let reader = try ZipArchiveReader(url: try writeZip(writer))
|
|
144
|
+
XCTAssertThrowsError(try readAll(reader, reader.entries[0])) { error in
|
|
145
|
+
XCTAssertEqual(error as? ZipError, .encryptedEntry)
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
func testRejectsUnsupportedCompressionMethod() throws {
|
|
150
|
+
var writer = TestZipWriter()
|
|
151
|
+
writer.addFile("file.txt", Data("abc".utf8))
|
|
152
|
+
var data = writer.build()
|
|
153
|
+
// Local header method is at offset 8; set it to 12 (bzip2).
|
|
154
|
+
data[8] = 12
|
|
155
|
+
let url = root.appendingPathComponent("bzip2.zip")
|
|
156
|
+
try data.write(to: url)
|
|
157
|
+
let reader = try ZipArchiveReader(url: url)
|
|
158
|
+
XCTAssertThrowsError(try readAll(reader, reader.entries[0])) { error in
|
|
159
|
+
XCTAssertEqual(error as? ZipError, .unsupportedCompressionMethod(12))
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
func testRejectsInvalidBufferSize() throws {
|
|
164
|
+
var writer = TestZipWriter()
|
|
165
|
+
writer.addFile("file.txt", Data("abc".utf8))
|
|
166
|
+
let reader = try ZipArchiveReader(url: try writeZip(writer))
|
|
167
|
+
XCTAssertThrowsError(try reader.extract(reader.entries[0], bufferSize: 0) { _ in
|
|
168
|
+
// No chunk is expected: the buffer size is rejected before reading.
|
|
169
|
+
}) { error in
|
|
170
|
+
XCTAssertEqual(error as? ZipError, .invalidBufferSize)
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
func testCorruptArchivesThrowInsteadOfCrashing() throws {
|
|
175
|
+
var writer = TestZipWriter()
|
|
176
|
+
writer.addFile("index.html", Data("<html></html>".utf8))
|
|
177
|
+
writer.addFile("app.js", compressibleData(count: 20_000), method: .deflate)
|
|
178
|
+
let valid = writer.build()
|
|
179
|
+
|
|
180
|
+
var candidates: [Data] = [
|
|
181
|
+
Data(),
|
|
182
|
+
Data("not a zip".utf8),
|
|
183
|
+
Data(repeating: 0, count: 22),
|
|
184
|
+
valid.prefix(valid.count / 2),
|
|
185
|
+
valid.suffix(40)
|
|
186
|
+
]
|
|
187
|
+
// Truncate at every offset and flip bytes in every header byte range.
|
|
188
|
+
for length in stride(from: 0, to: valid.count, by: 97) {
|
|
189
|
+
candidates.append(valid.prefix(length))
|
|
190
|
+
}
|
|
191
|
+
for index in 0..<valid.count where index < 120 || index >= valid.count - 160 {
|
|
192
|
+
var mutated = valid
|
|
193
|
+
mutated[index] ^= 0xFF
|
|
194
|
+
candidates.append(mutated)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
for (index, candidate) in candidates.enumerated() {
|
|
198
|
+
let url = root.appendingPathComponent("corrupt-\(index).zip")
|
|
199
|
+
try candidate.write(to: url)
|
|
200
|
+
// Either the archive fails to open or every entry either extracts or throws. Nothing may crash or hang.
|
|
201
|
+
guard let reader = try? ZipArchiveReader(url: url) else {
|
|
202
|
+
continue
|
|
203
|
+
}
|
|
204
|
+
for entry in reader.entries {
|
|
205
|
+
_ = try? reader.readSmallEntry(entry, maxBytes: 1_000_000, bufferSize: 512)
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
func testRejectsCentralDirectoryPointingOutsideArchive() throws {
|
|
211
|
+
var writer = TestZipWriter()
|
|
212
|
+
writer.addFile("index.html", Data("<html></html>".utf8))
|
|
213
|
+
var data = writer.build()
|
|
214
|
+
// EOCD central directory offset lives 16 bytes into the 22-byte EOCD record.
|
|
215
|
+
let offsetIndex = data.count - 22 + 16
|
|
216
|
+
data[offsetIndex] = 0xFF
|
|
217
|
+
data[offsetIndex + 1] = 0xFF
|
|
218
|
+
data[offsetIndex + 2] = 0xFF
|
|
219
|
+
data[offsetIndex + 3] = 0x7F
|
|
220
|
+
let url = root.appendingPathComponent("bad-offset.zip")
|
|
221
|
+
try data.write(to: url)
|
|
222
|
+
XCTAssertThrowsError(try ZipArchiveReader(url: url))
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
func testRejectsLocalHeaderOffsetOutsideArchive() throws {
|
|
226
|
+
var writer = TestZipWriter()
|
|
227
|
+
writer.addFile("index.html", Data("<html></html>".utf8))
|
|
228
|
+
var data = writer.build()
|
|
229
|
+
// Central directory entry starts right after the only local entry; its local header offset is at +42.
|
|
230
|
+
let centralStart = 30 + "index.html".utf8.count + "<html></html>".utf8.count
|
|
231
|
+
data[centralStart + 42] = 0xFF
|
|
232
|
+
data[centralStart + 43] = 0xFF
|
|
233
|
+
data[centralStart + 44] = 0xFF
|
|
234
|
+
data[centralStart + 45] = 0x7F
|
|
235
|
+
let url = root.appendingPathComponent("bad-local.zip")
|
|
236
|
+
try data.write(to: url)
|
|
237
|
+
let reader = try ZipArchiveReader(url: url)
|
|
238
|
+
XCTAssertThrowsError(try readAll(reader, reader.entries[0]))
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
func testRejectsStoredEntryWhoseSizesDiffer() throws {
|
|
242
|
+
var writer = TestZipWriter()
|
|
243
|
+
writer.addFile("first.txt", Data("hello".utf8))
|
|
244
|
+
writer.addFile("second.txt", Data("world".utf8))
|
|
245
|
+
var data = writer.build()
|
|
246
|
+
// Grow the first entry's declared uncompressed size (offset 24 in the central header) so a naive
|
|
247
|
+
// stored read would run into the next local header.
|
|
248
|
+
let signature = Data([0x50, 0x4B, 0x01, 0x02])
|
|
249
|
+
guard let range = data.range(of: signature) else {
|
|
250
|
+
return XCTFail("central directory not found")
|
|
251
|
+
}
|
|
252
|
+
var littleEndian = UInt32(40).littleEndian
|
|
253
|
+
data.replaceSubrange((range.lowerBound + 24)..<(range.lowerBound + 28), with: Data(bytes: &littleEndian, count: 4))
|
|
254
|
+
let url = root.appendingPathComponent("stored-size.zip")
|
|
255
|
+
try data.write(to: url)
|
|
256
|
+
|
|
257
|
+
let reader = try ZipArchiveReader(url: url)
|
|
258
|
+
let first = try XCTUnwrap(reader.entries.first { $0.path == "first.txt" })
|
|
259
|
+
XCTAssertThrowsError(try readAll(reader, first)) { error in
|
|
260
|
+
XCTAssertEqual(error as? ZipError, .corruptedEntryData)
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
func testRejectsDeflatedOutputThatDiffersFromDeclaredSize() throws {
|
|
265
|
+
let payload = compressibleData(count: 100_000)
|
|
266
|
+
for declaredSize: UInt32 in [10, 200_000] {
|
|
267
|
+
var writer = TestZipWriter()
|
|
268
|
+
writer.addFile("app.js", payload, method: .deflate)
|
|
269
|
+
var data = writer.build()
|
|
270
|
+
// Patch the central directory's uncompressed size (offset 24 in the central header).
|
|
271
|
+
let signature = Data([0x50, 0x4B, 0x01, 0x02])
|
|
272
|
+
guard let range = data.range(of: signature) else {
|
|
273
|
+
return XCTFail("central directory not found")
|
|
274
|
+
}
|
|
275
|
+
var littleEndian = declaredSize.littleEndian
|
|
276
|
+
let sizeBytes = Data(bytes: &littleEndian, count: 4)
|
|
277
|
+
data.replaceSubrange((range.lowerBound + 24)..<(range.lowerBound + 28), with: sizeBytes)
|
|
278
|
+
let url = root.appendingPathComponent("size-\(declaredSize).zip")
|
|
279
|
+
try data.write(to: url)
|
|
280
|
+
let reader = try ZipArchiveReader(url: url)
|
|
281
|
+
XCTAssertThrowsError(try readAll(reader, reader.entries[0])) { error in
|
|
282
|
+
XCTAssertEqual(error as? ZipError, .corruptedEntryData)
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
func testRejectsTruncatedDeflateStream() throws {
|
|
288
|
+
let payload = compressibleData(count: 100_000)
|
|
289
|
+
var writer = TestZipWriter()
|
|
290
|
+
writer.addFile("app.js", payload, method: .deflate)
|
|
291
|
+
var data = writer.build()
|
|
292
|
+
// Corrupt the deflate payload (starts right after the 30-byte local header and the name).
|
|
293
|
+
let payloadStart = 30 + "app.js".utf8.count
|
|
294
|
+
for index in payloadStart..<(payloadStart + 8) {
|
|
295
|
+
data[index] = 0xFF
|
|
296
|
+
}
|
|
297
|
+
let url = root.appendingPathComponent("bad-deflate.zip")
|
|
298
|
+
try data.write(to: url)
|
|
299
|
+
let reader = try ZipArchiveReader(url: url)
|
|
300
|
+
XCTAssertThrowsError(try readAll(reader, reader.entries[0]))
|
|
301
|
+
}
|
|
302
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import XCTest
|
|
3
|
+
@testable import CapacitorUpdaterPlugin
|
|
4
|
+
|
|
5
|
+
/// End-to-end extraction through `CapgoUpdater.saveDownloaded`, including the path traversal guards.
|
|
6
|
+
final class ZipBundleExtractionTests: XCTestCase {
|
|
7
|
+
private var root = URL(fileURLWithPath: NSTemporaryDirectory())
|
|
8
|
+
|
|
9
|
+
override func setUpWithError() throws {
|
|
10
|
+
root = FileManager.default.temporaryDirectory.appendingPathComponent("capgo-zip-extract-\(UUID().uuidString)")
|
|
11
|
+
try FileManager.default.createDirectory(at: root, withIntermediateDirectories: true)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
override func tearDownWithError() throws {
|
|
15
|
+
try? FileManager.default.removeItem(at: root)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
private func writeZip(_ writer: TestZipWriter, name: String = "test.zip") throws -> URL {
|
|
19
|
+
let url = root.appendingPathComponent(name)
|
|
20
|
+
try writer.write(to: url)
|
|
21
|
+
return url
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private func makeUpdater() -> CapgoUpdater {
|
|
25
|
+
let updater = CapgoUpdater()
|
|
26
|
+
updater.setLogger(Logger(withTag: "zip-extract-tests", options: Logger.Options(level: .silent)))
|
|
27
|
+
return updater
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
private func compressibleData(count: Int) -> Data {
|
|
31
|
+
let pattern = Data("capgo-live-update-".utf8)
|
|
32
|
+
var data = Data(capacity: count)
|
|
33
|
+
while data.count < count {
|
|
34
|
+
data.append(pattern)
|
|
35
|
+
}
|
|
36
|
+
return data.prefix(count)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
func testSaveDownloadedExtractsNestedFilesDirectoriesAndSymlinks() throws {
|
|
40
|
+
let appJs = compressibleData(count: 120_000)
|
|
41
|
+
var writer = TestZipWriter()
|
|
42
|
+
writer.addFile("index.html", Data("<html></html>".utf8), method: .deflate)
|
|
43
|
+
writer.addDirectory("assets")
|
|
44
|
+
writer.addFile("assets/app.js", appJs, method: .deflate)
|
|
45
|
+
writer.addFile("assets/deep/nested/data.bin", Data([1, 2, 3]))
|
|
46
|
+
writer.addSymlink("assets/alias.js", target: "app.js")
|
|
47
|
+
let zipURL = try writeZip(writer)
|
|
48
|
+
|
|
49
|
+
let base = root.appendingPathComponent("bundles")
|
|
50
|
+
try makeUpdater().saveDownloaded(sourceZip: zipURL, id: "bundle1", base: base, notify: false, bufferSize: 4096)
|
|
51
|
+
|
|
52
|
+
let bundle = base.appendingPathComponent("bundle1")
|
|
53
|
+
XCTAssertEqual(try Data(contentsOf: bundle.appendingPathComponent("index.html")), Data("<html></html>".utf8))
|
|
54
|
+
XCTAssertEqual(try Data(contentsOf: bundle.appendingPathComponent("assets/app.js")), appJs)
|
|
55
|
+
XCTAssertEqual(try Data(contentsOf: bundle.appendingPathComponent("assets/deep/nested/data.bin")), Data([1, 2, 3]))
|
|
56
|
+
XCTAssertEqual(
|
|
57
|
+
try FileManager.default.destinationOfSymbolicLink(atPath: bundle.appendingPathComponent("assets/alias.js").path),
|
|
58
|
+
"app.js"
|
|
59
|
+
)
|
|
60
|
+
XCTAssertFalse(FileManager.default.fileExists(atPath: zipURL.path), "source zip is removed after extraction")
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
func testSaveDownloadedUnflattensSingleTopLevelFolder() throws {
|
|
64
|
+
var writer = TestZipWriter()
|
|
65
|
+
writer.addDirectory("dist")
|
|
66
|
+
writer.addFile("dist/index.html", Data("<html></html>".utf8))
|
|
67
|
+
let zipURL = try writeZip(writer)
|
|
68
|
+
let base = root.appendingPathComponent("bundles")
|
|
69
|
+
try makeUpdater().saveDownloaded(sourceZip: zipURL, id: "bundle2", base: base, notify: false)
|
|
70
|
+
XCTAssertTrue(FileManager.default.fileExists(atPath: base.appendingPathComponent("bundle2/index.html").path))
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
func testSaveDownloadedRejectsPathTraversalEntries() throws {
|
|
74
|
+
let maliciousPaths = [
|
|
75
|
+
"../escape.txt",
|
|
76
|
+
"assets/../../escape.txt",
|
|
77
|
+
"/tmp/capgo-absolute-escape.txt",
|
|
78
|
+
"..\\escape.txt",
|
|
79
|
+
"./../escape.txt"
|
|
80
|
+
]
|
|
81
|
+
for (index, path) in maliciousPaths.enumerated() {
|
|
82
|
+
var writer = TestZipWriter()
|
|
83
|
+
writer.addFile("index.html", Data("<html></html>".utf8))
|
|
84
|
+
writer.addFile(path, Data("pwned".utf8))
|
|
85
|
+
let zipURL = try writeZip(writer, name: "traversal-\(index).zip")
|
|
86
|
+
let base = root.appendingPathComponent("bundles-\(index)")
|
|
87
|
+
|
|
88
|
+
XCTAssertThrowsError(
|
|
89
|
+
try makeUpdater().saveDownloaded(sourceZip: zipURL, id: "evil", base: base, notify: false),
|
|
90
|
+
"entry \(path) must be rejected"
|
|
91
|
+
)
|
|
92
|
+
XCTAssertFalse(FileManager.default.fileExists(atPath: base.appendingPathComponent("evil").path))
|
|
93
|
+
XCTAssertFalse(FileManager.default.fileExists(atPath: root.appendingPathComponent("escape.txt").path))
|
|
94
|
+
XCTAssertFalse(FileManager.default.fileExists(atPath: base.appendingPathComponent("escape.txt").path))
|
|
95
|
+
}
|
|
96
|
+
XCTAssertFalse(FileManager.default.fileExists(atPath: "/tmp/capgo-absolute-escape.txt"))
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
func testSaveDownloadedRejectsEscapingSymlinks() throws {
|
|
100
|
+
let targets = ["../../outside", "/etc/passwd", "../../../../../../etc/hosts"]
|
|
101
|
+
for (index, target) in targets.enumerated() {
|
|
102
|
+
var writer = TestZipWriter()
|
|
103
|
+
writer.addFile("index.html", Data("<html></html>".utf8))
|
|
104
|
+
writer.addSymlink("assets/link", target: target)
|
|
105
|
+
let zipURL = try writeZip(writer, name: "symlink-\(index).zip")
|
|
106
|
+
let base = root.appendingPathComponent("symlink-bundles-\(index)")
|
|
107
|
+
XCTAssertThrowsError(
|
|
108
|
+
try makeUpdater().saveDownloaded(sourceZip: zipURL, id: "evil", base: base, notify: false),
|
|
109
|
+
"symlink target \(target) must be rejected"
|
|
110
|
+
)
|
|
111
|
+
XCTAssertFalse(FileManager.default.fileExists(atPath: base.appendingPathComponent("evil").path))
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
func testSaveDownloadedRejectsCorruptZip() throws {
|
|
116
|
+
let zipURL = root.appendingPathComponent("corrupt.zip")
|
|
117
|
+
try Data("definitely not a zip file".utf8).write(to: zipURL)
|
|
118
|
+
let base = root.appendingPathComponent("bundles")
|
|
119
|
+
XCTAssertThrowsError(try makeUpdater().saveDownloaded(sourceZip: zipURL, id: "broken", base: base, notify: false))
|
|
120
|
+
XCTAssertFalse(FileManager.default.fileExists(atPath: base.appendingPathComponent("broken").path))
|
|
121
|
+
}
|
|
122
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-updater",
|
|
3
|
-
"version": "9.0.
|
|
4
|
-
"packageManager": "pnpm@8.5.1",
|
|
3
|
+
"version": "9.0.1",
|
|
5
4
|
"license": "MPL-2.0",
|
|
6
5
|
"description": "Live update for capacitor apps",
|
|
7
6
|
"main": "dist/plugin.cjs.js",
|
|
@@ -10,12 +9,19 @@
|
|
|
10
9
|
"unpkg": "dist/plugin.js",
|
|
11
10
|
"files": [
|
|
12
11
|
"android/src/main/",
|
|
12
|
+
"android/proguard-rules.pro",
|
|
13
|
+
"android/consumer-rules.pro",
|
|
13
14
|
"android/build.gradle",
|
|
14
15
|
"dist/",
|
|
15
|
-
"ios/
|
|
16
|
-
"
|
|
16
|
+
"ios/Sources/",
|
|
17
|
+
"ios/Tests/",
|
|
18
|
+
"CapgoCapacitorUpdater.podspec",
|
|
19
|
+
"Package.swift",
|
|
20
|
+
"scripts/builtin-hashes-lib.mjs",
|
|
21
|
+
"scripts/capacitor-builtin-hashes-hook.mjs",
|
|
22
|
+
"scripts/resolve-real-path.mjs"
|
|
17
23
|
],
|
|
18
|
-
"author": "Martin Donadieu",
|
|
24
|
+
"author": "Martin Donadieu <martin@capgo.app>",
|
|
19
25
|
"repository": {
|
|
20
26
|
"type": "git",
|
|
21
27
|
"url": "git+https://github.com/Cap-go/capacitor-updater.git"
|
|
@@ -23,64 +29,95 @@
|
|
|
23
29
|
"bugs": {
|
|
24
30
|
"url": "https://github.com/Cap-go/capacitor-updater/issues"
|
|
25
31
|
},
|
|
32
|
+
"homepage": "https://capgo.app/docs/plugins/updater/",
|
|
26
33
|
"keywords": [
|
|
27
34
|
"capacitor",
|
|
28
|
-
"
|
|
29
|
-
"OTA",
|
|
30
|
-
"manual update",
|
|
35
|
+
"live updates",
|
|
31
36
|
"live update",
|
|
37
|
+
"updates",
|
|
32
38
|
"auto update",
|
|
39
|
+
"manual update",
|
|
40
|
+
"capgo",
|
|
41
|
+
"plugin",
|
|
42
|
+
"OTA",
|
|
33
43
|
"ionic",
|
|
34
44
|
"appflow alternative",
|
|
35
|
-
"
|
|
45
|
+
"microsoft alternative",
|
|
36
46
|
"native"
|
|
37
47
|
],
|
|
38
48
|
"scripts": {
|
|
39
|
-
"verify": "
|
|
40
|
-
"verify:ios": "
|
|
49
|
+
"verify": "bun run verify:ios && bun run verify:android && bun run verify:web",
|
|
50
|
+
"verify:ios": "xcodebuild -scheme CapgoCapacitorUpdater -destination generic/platform=iOS",
|
|
41
51
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
42
|
-
"verify:web": "
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
52
|
+
"verify:web": "bun run build",
|
|
53
|
+
"native:compile": "./scripts/native-platform.sh compile all",
|
|
54
|
+
"native:compile:ios": "./scripts/native-platform.sh compile ios",
|
|
55
|
+
"native:compile:android": "./scripts/native-platform.sh compile android",
|
|
56
|
+
"native:test": "./scripts/native-platform.sh test all",
|
|
57
|
+
"native:test:ios": "./scripts/native-platform.sh test ios",
|
|
58
|
+
"native:test:android": "./scripts/native-platform.sh test android",
|
|
59
|
+
"native:contract": "bun run native:contract:ios && bun run native:contract:android",
|
|
60
|
+
"native:contract:ios": "./scripts/test-ios.sh -only-testing:CapacitorUpdaterPluginTests/NativeContractTests",
|
|
61
|
+
"native:contract:android": "cd android && ./gradlew testDebugUnitTest --tests ee.forgr.capacitor_updater.NativeContractTest && cd ..",
|
|
62
|
+
"test": "bun run test:ios && bun run test:android",
|
|
63
|
+
"test:ios": "./scripts/test-ios.sh",
|
|
64
|
+
"test:android": "cd android && ./gradlew test && cd ..",
|
|
65
|
+
"test:maestro": "./scripts/maestro/run-android-live-update.sh",
|
|
66
|
+
"test:maestro:android": "./scripts/test-maestro-android.sh",
|
|
67
|
+
"test:maestro:ios": "./scripts/maestro/run-ios-live-update.sh",
|
|
68
|
+
"test:maestro:ios:smoke": "./scripts/test-maestro-ios.sh",
|
|
69
|
+
"lint": "bun run eslint && bun run prettier -- --check && bun run swiftlint -- lint",
|
|
70
|
+
"fmt": "bun run eslint -- --fix && bun run prettier -- --write && bun run swiftlint -- --fix --format",
|
|
71
|
+
"eslint": "eslint .",
|
|
72
|
+
"prettier": "prettier-pretty-check \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
47
73
|
"swiftlint": "node-swiftlint",
|
|
48
|
-
"docgen": "
|
|
49
|
-
"
|
|
50
|
-
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
74
|
+
"docgen": "node scripts/generate-docs.js",
|
|
75
|
+
"build": "bun run clean && bun run docgen && tsc && rollup -c rollup.config.mjs",
|
|
51
76
|
"clean": "rimraf ./dist",
|
|
52
77
|
"watch": "tsc --watch",
|
|
53
|
-
"prepublishOnly": "
|
|
78
|
+
"prepublishOnly": "bun run build",
|
|
79
|
+
"check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs && bun scripts/test-release-workflows.mjs && bun scripts/test-cli-crypto-output-guard.mjs && node scripts/test-builtin-hashes-hook.mjs && node scripts/check-ios-test-shards.mjs && node scripts/maestro/test-helpers.mjs && node scripts/maestro/test-smoke-sequence.mjs && bun scripts/maestro/test-deferred-flow.mjs && bun scripts/maestro/test-startup-update-flow.mjs && bun scripts/maestro/test-local-plugin-manifest.mjs",
|
|
80
|
+
"check:cap9-deprecated": "bun scripts/check-cap9-deprecated.mjs",
|
|
81
|
+
"changelog:ai": "node scripts/generate-ai-changelog.mjs",
|
|
82
|
+
"example:install": "cd example-app && bun install --frozen-lockfile",
|
|
83
|
+
"example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build",
|
|
84
|
+
"native:contract:crypto": "bun run native:contract:crypto:ios && bun run native:contract:crypto:android",
|
|
85
|
+
"native:contract:crypto:ios": "./scripts/test-ios.sh -only-testing:CapacitorUpdaterPluginTests/RsaContractTests",
|
|
86
|
+
"native:contract:crypto:android": "cd android && ./gradlew testDebugUnitTest --tests ee.forgr.capacitor_updater.RsaContractTest && cd ..",
|
|
87
|
+
"native:contract:cli:ios": "./scripts/test-ios.sh -only-testing:CapacitorUpdaterPluginTests/CliCryptoFixtureTests",
|
|
88
|
+
"native:contract:cli:android": "cd android && ./gradlew testDebugUnitTest --tests ee.forgr.capacitor_updater.CliCryptoFixtureTest && cd ..",
|
|
89
|
+
"generate:rsa-contract": "bun scripts/generate-rsa-contract-fixtures.mjs",
|
|
90
|
+
"generate:cli-crypto": "bun scripts/generate-cli-crypto-fixtures.mjs",
|
|
91
|
+
"capacitor:copy:after": "node scripts/capacitor-builtin-hashes-hook.mjs"
|
|
54
92
|
},
|
|
55
93
|
"devDependencies": {
|
|
56
|
-
"@capacitor/android": "^
|
|
57
|
-
"@capacitor/cli": "^
|
|
58
|
-
"@capacitor/core": "^
|
|
59
|
-
"@capacitor/docgen": "^0.
|
|
60
|
-
"@capacitor/ios": "^
|
|
61
|
-
"@
|
|
62
|
-
"@ionic/
|
|
63
|
-
"@
|
|
64
|
-
"@
|
|
65
|
-
"@
|
|
66
|
-
"@
|
|
67
|
-
"
|
|
68
|
-
"eslint
|
|
69
|
-
"
|
|
70
|
-
"prettier
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
94
|
+
"@capacitor/android": "^9.0.0",
|
|
95
|
+
"@capacitor/cli": "^9.0.0",
|
|
96
|
+
"@capacitor/core": "^9.0.0",
|
|
97
|
+
"@capacitor/docgen": "^0.3.1",
|
|
98
|
+
"@capacitor/ios": "^9.0.0",
|
|
99
|
+
"@capgo/cli": "8.120.0",
|
|
100
|
+
"@ionic/eslint-config": "^0.5.0",
|
|
101
|
+
"@typescript-eslint/eslint-plugin": "^8.70.0",
|
|
102
|
+
"@typescript-eslint/parser": "^8.70.0",
|
|
103
|
+
"@ionic/prettier-config": "^4.0.0",
|
|
104
|
+
"@ionic/swiftlint-config": "^2.0.0",
|
|
105
|
+
"@types/node": "^26.0.0",
|
|
106
|
+
"eslint": "^10.0.0",
|
|
107
|
+
"husky": "^9.1.7",
|
|
108
|
+
"prettier": "^3.6.2",
|
|
109
|
+
"prettier-plugin-java": "^2.7.7",
|
|
110
|
+
"rimraf": "^6.1.0",
|
|
111
|
+
"rollup": "^4.53.2",
|
|
112
|
+
"swiftlint": "^2.0.0",
|
|
113
|
+
"typescript": "^5.9.3",
|
|
114
|
+
"prettier-pretty-check": "^0.2.0"
|
|
75
115
|
},
|
|
76
116
|
"peerDependencies": {
|
|
77
|
-
"@capacitor/core": "^
|
|
117
|
+
"@capacitor/core": "^9.0.0"
|
|
78
118
|
},
|
|
79
119
|
"prettier": "@ionic/prettier-config",
|
|
80
120
|
"swiftlint": "@ionic/swiftlint-config",
|
|
81
|
-
"eslintConfig": {
|
|
82
|
-
"extends": "@ionic/eslint-config/recommended"
|
|
83
|
-
},
|
|
84
121
|
"capacitor": {
|
|
85
122
|
"ios": {
|
|
86
123
|
"src": "ios"
|