@hot-updater/react-native 1.0.8 → 1.1.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/HotUpdater.podspec +14 -2
- package/Package.swift +24 -3
- package/android/build.gradle +2 -6
- package/android/hot-updater-fingerprint.gradle +135 -0
- package/android/src/main/cpp/HotUpdaterRecovery.cpp +291 -21
- package/android/src/main/java/com/hotupdater/ActivityStartGate.kt +176 -15
- package/android/src/main/java/com/hotupdater/ArtifactFileResolver.kt +20 -8
- package/android/src/main/java/com/hotupdater/BundleFileStorageService.kt +145 -31
- package/android/src/main/java/com/hotupdater/CohortService.kt +10 -2
- package/android/src/main/java/com/hotupdater/FileManagerService.kt +3 -1
- package/android/src/main/java/com/hotupdater/HotUpdaterConfig.kt +249 -21
- package/android/src/main/java/com/hotupdater/HotUpdaterException.kt +8 -4
- package/android/src/main/java/com/hotupdater/HotUpdaterHeldContent.kt +92 -0
- package/android/src/main/java/com/hotupdater/HotUpdaterImpl.kt +319 -113
- package/android/src/main/java/com/hotupdater/HotUpdaterInstance.kt +87 -0
- package/android/src/main/java/com/hotupdater/HotUpdaterInstanceEnvironment.kt +323 -0
- package/android/src/main/java/com/hotupdater/HotUpdaterMainThread.kt +46 -0
- package/android/src/main/java/com/hotupdater/HotUpdaterProcess.kt +30 -0
- package/android/src/main/java/com/hotupdater/HotUpdaterRecoveryAttribution.kt +492 -0
- package/android/src/main/java/com/hotupdater/HotUpdaterRecoveryManager.kt +1541 -159
- package/android/src/main/java/com/hotupdater/HotUpdaterRecoverySlots.kt +137 -0
- package/android/src/main/java/com/hotupdater/HotUpdaterRecoveryState.kt +4 -0
- package/android/src/main/java/com/hotupdater/HotUpdaterRuntimeInstance.kt +53 -0
- package/android/src/main/java/com/hotupdater/HotUpdaterUpdateCheck.kt +149 -0
- package/android/src/main/java/com/hotupdater/InstallIdentityService.kt +12 -2
- package/android/src/main/java/com/hotupdater/NativeConfigUtils.kt +5 -6
- package/android/src/main/java/com/hotupdater/NativeUpdateCheck.kt +172 -0
- package/android/src/main/java/com/hotupdater/NativeUpdateChecker.kt +1007 -0
- package/android/src/main/java/com/hotupdater/NativeUpdateEventQueue.kt +111 -0
- package/android/src/main/java/com/hotupdater/OkHttpUpdateCheckTransport.kt +88 -0
- package/android/src/main/java/com/hotupdater/ReleaseCatalog.kt +491 -0
- package/android/src/main/java/com/hotupdater/ReleaseCatalogClient.kt +405 -0
- package/android/src/main/java/com/hotupdater/ReleaseSelection.kt +474 -0
- package/android/src/main/java/com/hotupdater/SignatureVerifier.kt +32 -10
- package/android/src/main/java/com/hotupdater/StrictJson.kt +392 -0
- package/android/src/main/java/com/hotupdater/VersionedPreferencesService.kt +24 -9
- package/android/src/main/java/com/hotupdater/WeakIdentitySet.kt +76 -0
- package/android/src/main/java/com/hotupdater/vendor/brotli/dec/BitReader.java +314 -0
- package/android/src/main/java/com/hotupdater/vendor/brotli/dec/BrotliError.java +47 -0
- package/android/src/main/java/com/hotupdater/vendor/brotli/dec/BrotliInputStream.java +174 -0
- package/android/src/main/java/com/hotupdater/vendor/brotli/dec/BrotliRuntimeException.java +21 -0
- package/android/src/main/java/com/hotupdater/vendor/brotli/dec/Context.java +58 -0
- package/android/src/main/java/com/hotupdater/vendor/brotli/dec/Decode.java +1574 -0
- package/android/src/main/java/com/hotupdater/vendor/brotli/dec/Decoder.java +72 -0
- package/android/src/main/java/com/hotupdater/vendor/brotli/dec/Dictionary.java +103 -0
- package/android/src/main/java/com/hotupdater/vendor/brotli/dec/DictionaryData.java +82 -0
- package/android/src/main/java/com/hotupdater/vendor/brotli/dec/Huffman.java +143 -0
- package/{LICENSE → android/src/main/java/com/hotupdater/vendor/brotli/dec/LICENSE} +6 -20
- package/android/src/main/java/com/hotupdater/vendor/brotli/dec/README.md +39 -0
- package/android/src/main/java/com/hotupdater/vendor/brotli/dec/State.java +100 -0
- package/android/src/main/java/com/hotupdater/vendor/brotli/dec/Transform.java +240 -0
- package/android/src/main/java/com/hotupdater/vendor/brotli/dec/Utils.java +163 -0
- package/android/src/main/resources/META-INF/LICENSE-brotli +19 -0
- package/android/src/newarch/HotUpdater.kt +53 -15
- package/android/src/newarch/HotUpdaterModule.kt +42 -17
- package/android/src/newarch/JavaScriptExceptionHooks.kt +45 -8
- package/android/src/oldarch/HotUpdater.kt +51 -12
- package/android/src/oldarch/HotUpdaterModule.kt +43 -17
- package/android/src/oldarch/HotUpdaterSpec.kt +2 -0
- package/android/src/oldarch/JavaScriptExceptionHooks.kt +25 -16
- package/ios/HotUpdater/Interface/HotUpdaterInterface.h +13 -0
- package/ios/HotUpdater/Internal/ArtifactFileResolver.swift +38 -7
- package/ios/HotUpdater/Internal/BuiltInAssetResolver.swift +10 -4
- package/ios/HotUpdater/Internal/BundleFileStorageService.swift +186 -48
- package/ios/HotUpdater/Internal/CohortService.swift +8 -0
- package/ios/HotUpdater/Internal/HotUpdater.mm +821 -71
- package/ios/HotUpdater/Internal/HotUpdaterAsync.swift +7 -0
- package/ios/HotUpdater/Internal/HotUpdaterConfig.swift +208 -25
- package/ios/HotUpdater/Internal/HotUpdaterFingerprintHash.m +10 -0
- package/ios/HotUpdater/Internal/HotUpdaterImpl.swift +940 -261
- package/ios/HotUpdater/Internal/HotUpdaterInstanceEnvironment.swift +492 -0
- package/ios/HotUpdater/Internal/HotUpdaterInstanceRouter.swift +83 -0
- package/ios/HotUpdater/Internal/HotUpdaterInterface.swift +28 -1
- package/ios/HotUpdater/Internal/HotUpdaterLaunchRecovery.swift +1553 -0
- package/ios/HotUpdater/Internal/HotUpdaterNativeUpdates.swift +353 -0
- package/ios/HotUpdater/Internal/LaunchPreparationLock.swift +54 -0
- package/ios/HotUpdater/Internal/NativeUpdateCheck.swift +2051 -0
- package/ios/HotUpdater/Internal/ReleaseCatalog.swift +634 -0
- package/ios/HotUpdater/Internal/ReleaseCatalogCacheService.swift +1 -1
- package/ios/HotUpdater/Internal/ReleaseSelection.swift +482 -0
- package/ios/HotUpdater/Internal/SignatureVerifier.swift +27 -10
- package/ios/HotUpdater/Internal/StrictJson.swift +363 -0
- package/ios/HotUpdater/Internal/URLSessionDownloadService.swift +4 -2
- package/ios/HotUpdater/Internal/UpdateFailure.swift +2 -0
- package/ios/HotUpdater/Package.swift +11 -0
- package/ios/HotUpdater/Public/HotUpdater/HotUpdater.h +4 -0
- package/ios/HotUpdater/Public/HotUpdater.h +21 -2
- package/ios/HotUpdater/Recovery/HotUpdaterRecoveryHooks.mm +66 -0
- package/ios/Plugins/HotUpdaterFingerprintPlugin/HotUpdaterFingerprintPlugin.swift +45 -0
- package/ios/scripts/generate-fingerprint-hash.zsh +85 -0
- package/lib/commonjs/checkForUpdate.js +3 -1
- package/lib/commonjs/checkForUpdate.js.map +1 -1
- package/lib/commonjs/index.js +9 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native.js +24 -79
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/nativeUpdateEvents.js +66 -0
- package/lib/commonjs/nativeUpdateEvents.js.map +1 -0
- package/lib/commonjs/sdkVersion.js +1 -1
- package/lib/commonjs/specs/NativeHotUpdater.js.map +1 -1
- package/lib/module/checkForUpdate.js +3 -1
- package/lib/module/checkForUpdate.js.map +1 -1
- package/lib/module/index.js +10 -13
- package/lib/module/index.js.map +1 -1
- package/lib/module/native.js +19 -73
- package/lib/module/native.js.map +1 -1
- package/lib/module/nativeUpdateEvents.js +61 -0
- package/lib/module/nativeUpdateEvents.js.map +1 -0
- package/lib/module/sdkVersion.js +1 -1
- package/lib/module/specs/NativeHotUpdater.js.map +1 -1
- package/lib/typescript/commonjs/checkForUpdate.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +4 -14
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/native.d.ts +9 -46
- package/lib/typescript/commonjs/native.d.ts.map +1 -1
- package/lib/typescript/commonjs/nativeUpdateEvents.d.ts +12 -0
- package/lib/typescript/commonjs/nativeUpdateEvents.d.ts.map +1 -0
- package/lib/typescript/commonjs/sdkVersion.d.ts +1 -1
- package/lib/typescript/commonjs/specs/NativeHotUpdater.d.ts +19 -3
- package/lib/typescript/commonjs/specs/NativeHotUpdater.d.ts.map +1 -1
- package/lib/typescript/module/checkForUpdate.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +4 -14
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/native.d.ts +9 -46
- package/lib/typescript/module/native.d.ts.map +1 -1
- package/lib/typescript/module/nativeUpdateEvents.d.ts +12 -0
- package/lib/typescript/module/nativeUpdateEvents.d.ts.map +1 -0
- package/lib/typescript/module/sdkVersion.d.ts +1 -1
- package/lib/typescript/module/specs/NativeHotUpdater.d.ts +19 -3
- package/lib/typescript/module/specs/NativeHotUpdater.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/checkForUpdate.ts +7 -1
- package/src/index.ts +9 -17
- package/src/native.ts +19 -91
- package/src/nativeUpdateEvents.ts +77 -0
- package/src/sdkVersion.ts +1 -1
- package/src/specs/NativeHotUpdater.ts +20 -3
- package/android/libs/README.md +0 -50
- package/android/libs/hot-updater-brotli-dec-1.2.0.jar +0 -0
- package/android/src/bridge/BridgeReactInstance.kt +0 -38
- package/android/src/bridgeless/BridgeReactInstance.kt +0 -24
- package/android/src/main/java/com/hotupdater/ContentAppearedLog.kt +0 -31
- package/android/src/main/java/com/hotupdater/ReactIntegrationManagerBase.kt +0 -34
- package/android/src/newarch/ReactIntegrationManager.kt +0 -212
- package/android/src/oldarch/ReactIntegrationManager.kt +0 -120
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#if SWIFT_PACKAGE
|
|
2
|
+
// Swift Package Manager: this file is the `HotUpdater` module apps import. It
|
|
3
|
+
// re-exports the Objective-C++ module and the Swift implementation, such as
|
|
4
|
+
// `HotUpdaterInstance`, so `import HotUpdater` reaches both.
|
|
5
|
+
@_exported import HotUpdaterObjC
|
|
6
|
+
@_exported import HotUpdaterSwift
|
|
7
|
+
#endif
|
|
@@ -1,54 +1,237 @@
|
|
|
1
1
|
import Foundation
|
|
2
2
|
|
|
3
|
-
///
|
|
3
|
+
/// Main's programmatic configuration and recorded bundle.
|
|
4
4
|
///
|
|
5
|
-
///
|
|
6
|
-
///
|
|
7
|
-
///
|
|
8
|
-
/// `
|
|
5
|
+
/// `HotUpdaterOptions` of the `main` instance record their `channel`,
|
|
6
|
+
/// `fingerprintHash`, and `publicKey` here before main's impl exists; they
|
|
7
|
+
/// take priority over the `HOT_UPDATER_*` Info.plist keys. The deprecated
|
|
8
|
+
/// `HotUpdater.configure` writes the same values. Named instances never read
|
|
9
|
+
/// it.
|
|
9
10
|
@objcMembers
|
|
10
11
|
public class HotUpdaterConfig: NSObject {
|
|
11
12
|
public static let shared = HotUpdaterConfig()
|
|
12
13
|
|
|
14
|
+
/// Main's values over its Info.plist keys. Nil means none; an empty
|
|
15
|
+
/// fingerprint hash, which only `configure` can set, means none for the
|
|
16
|
+
/// isolation key without falling back to Info.plist.
|
|
17
|
+
struct Overrides: Equatable {
|
|
18
|
+
var fingerprintHash: String?
|
|
19
|
+
var publicKey: String?
|
|
20
|
+
var channel: String?
|
|
21
|
+
var isolationKey: String?
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/// Which of main's values a main `HotUpdaterOptions` set, until a
|
|
25
|
+
/// deprecated `configure` call takes them over.
|
|
26
|
+
private struct OptionFields {
|
|
27
|
+
var fingerprintHash = false
|
|
28
|
+
var publicKey = false
|
|
29
|
+
var channel = false
|
|
30
|
+
|
|
31
|
+
static let all = OptionFields(fingerprintHash: true, publicKey: true, channel: true)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/// Guards the values. Lock order: `HotUpdaterMainBundle`'s lock, then
|
|
35
|
+
/// this one. Code holding this lock never takes the other, and `log` runs
|
|
36
|
+
/// after it is released.
|
|
13
37
|
private let lock = NSLock()
|
|
38
|
+
private let log: (String) -> Void
|
|
39
|
+
/// Runs in `claimOptions` between its check and its record, with the
|
|
40
|
+
/// lock held.
|
|
41
|
+
private let onOptionsChecked: (() -> Void)?
|
|
42
|
+
|
|
43
|
+
private var _overrides = Overrides()
|
|
44
|
+
private var _optionFields = OptionFields()
|
|
45
|
+
private var _bundle: Bundle = .main
|
|
46
|
+
private var _buildFingerprintHash: String?
|
|
47
|
+
|
|
48
|
+
public override convenience init() {
|
|
49
|
+
self.init(log: { NSLog("%@", $0) })
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/// `log` receives the warning a `configure` call over main's options
|
|
53
|
+
/// logs. `onOptionsChecked` runs inside `claimOptions` between its check
|
|
54
|
+
/// and its record, to show no legacy write lands there.
|
|
55
|
+
init(log: @escaping (String) -> Void, onOptionsChecked: (() -> Void)? = nil) {
|
|
56
|
+
self.log = log
|
|
57
|
+
self.onOptionsChecked = onOptionsChecked
|
|
58
|
+
super.init()
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/// The bundle that holds the embedded `main.jsbundle`, which
|
|
62
|
+
/// `HotUpdater.bundleURL(bundle:)` records. A brownfield XCFramework passes
|
|
63
|
+
/// its own bundle, so reloads find its embedded bundle and assets, and the
|
|
64
|
+
/// `HOT_UPDATER_*` keys the CLI writes into its Info.plist apply.
|
|
65
|
+
public var bundle: Bundle {
|
|
66
|
+
get { lock.lock(); defer { lock.unlock() }; return _bundle }
|
|
67
|
+
set { lock.lock(); defer { lock.unlock() }; _bundle = newValue }
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/// The fingerprint this build embedded, or nil for an app without one.
|
|
71
|
+
/// The core package compiles without the generated source, so
|
|
72
|
+
/// `HotUpdaterImpl` sets it on `shared` before anything resolves an
|
|
73
|
+
/// instance's values.
|
|
74
|
+
var buildFingerprintHash: String? {
|
|
75
|
+
get { lock.lock(); defer { lock.unlock() }; return _buildFingerprintHash }
|
|
76
|
+
set { lock.lock(); defer { lock.unlock() }; _buildFingerprintHash = newValue }
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/// Reads a `HOT_UPDATER_*` Info.plist value from `bundle`, then from the
|
|
80
|
+
/// host app's main bundle.
|
|
81
|
+
@objc(infoValueForKey:)
|
|
82
|
+
public func infoValue(forKey key: String) -> String? {
|
|
83
|
+
Self.infoValue(forKey: key, bundle: bundle)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/// A `HOT_UPDATER_*` Info.plist value from `bundle`, then from the host
|
|
87
|
+
/// app's main bundle.
|
|
88
|
+
static func infoValue(forKey key: String, bundle: Bundle) -> String? {
|
|
89
|
+
for source in [bundle, Bundle.main] {
|
|
90
|
+
if let value = source.object(forInfoDictionaryKey: key) as? String, !value.isEmpty {
|
|
91
|
+
return value
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return nil
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/// The values main reads; Hot Updater's own code uses this, never the
|
|
98
|
+
/// deprecated properties below.
|
|
99
|
+
var overrides: Overrides {
|
|
100
|
+
get { lock.lock(); defer { lock.unlock() }; return _overrides }
|
|
101
|
+
set { lock.lock(); defer { lock.unlock() }; _overrides = newValue }
|
|
102
|
+
}
|
|
14
103
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
104
|
+
/// Checks the values a main `HotUpdaterOptions` set against the ones
|
|
105
|
+
/// main holds, then records them, in one step under the lock the
|
|
106
|
+
/// deprecated `configure` and setters write under: a legacy write lands
|
|
107
|
+
/// before it, and conflicts, or after it, and warns. nil keeps a value,
|
|
108
|
+
/// and an empty held value is none, as main resolves it.
|
|
109
|
+
/// - Throws: the conflict `conflict(field)` returns, recording nothing.
|
|
110
|
+
func claimOptions(
|
|
111
|
+
channel: String?,
|
|
112
|
+
fingerprintHash: String?,
|
|
113
|
+
publicKey: String?,
|
|
114
|
+
conflict: (String) -> Error
|
|
115
|
+
) throws {
|
|
116
|
+
lock.lock()
|
|
117
|
+
defer { lock.unlock() }
|
|
118
|
+
let fields: [(name: String, requested: String?, held: String?)] = [
|
|
119
|
+
("channel", channel, _overrides.channel),
|
|
120
|
+
("fingerprintHash", fingerprintHash, _overrides.fingerprintHash),
|
|
121
|
+
("publicKey", publicKey, _overrides.publicKey),
|
|
122
|
+
]
|
|
123
|
+
for field in fields {
|
|
124
|
+
guard let requested = field.requested,
|
|
125
|
+
let held = field.held, !held.isEmpty,
|
|
126
|
+
held != requested else {
|
|
127
|
+
continue
|
|
128
|
+
}
|
|
129
|
+
throw conflict(field.name)
|
|
130
|
+
}
|
|
131
|
+
onOptionsChecked?()
|
|
132
|
+
if let channel {
|
|
133
|
+
_overrides.channel = channel
|
|
134
|
+
_optionFields.channel = true
|
|
135
|
+
}
|
|
136
|
+
if let fingerprintHash {
|
|
137
|
+
_overrides.fingerprintHash = fingerprintHash
|
|
138
|
+
_optionFields.fingerprintHash = true
|
|
139
|
+
}
|
|
140
|
+
if let publicKey {
|
|
141
|
+
_overrides.publicKey = publicKey
|
|
142
|
+
_optionFields.publicKey = true
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/// The deprecated `configure` and setters: `update` writes the values,
|
|
147
|
+
/// as it always has. When it changes a value main's options set, it logs
|
|
148
|
+
/// one warning naming them; the `touched` values then belong to the
|
|
149
|
+
/// legacy API, so a later call warns only after options set them again.
|
|
150
|
+
private func replace(touching touched: OptionFields, _ update: (inout Overrides) -> Void) {
|
|
151
|
+
lock.lock()
|
|
152
|
+
let previous = _overrides
|
|
153
|
+
update(&_overrides)
|
|
154
|
+
let overrides = _overrides
|
|
155
|
+
let fields = OptionFields(
|
|
156
|
+
fingerprintHash: _optionFields.fingerprintHash && touched.fingerprintHash,
|
|
157
|
+
publicKey: _optionFields.publicKey && touched.publicKey,
|
|
158
|
+
channel: _optionFields.channel && touched.channel
|
|
159
|
+
)
|
|
160
|
+
_optionFields.fingerprintHash = _optionFields.fingerprintHash && !touched.fingerprintHash
|
|
161
|
+
_optionFields.publicKey = _optionFields.publicKey && !touched.publicKey
|
|
162
|
+
_optionFields.channel = _optionFields.channel && !touched.channel
|
|
163
|
+
lock.unlock()
|
|
164
|
+
|
|
165
|
+
var changes: [String] = []
|
|
166
|
+
if fields.channel, previous.channel != overrides.channel {
|
|
167
|
+
changes.append("channel \(Self.describe(previous.channel)) -> \(Self.describe(overrides.channel))")
|
|
168
|
+
}
|
|
169
|
+
if fields.fingerprintHash, previous.fingerprintHash != overrides.fingerprintHash {
|
|
170
|
+
changes.append(
|
|
171
|
+
"fingerprintHash \(Self.describe(previous.fingerprintHash)) -> \(Self.describe(overrides.fingerprintHash))"
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
// Never the key itself.
|
|
175
|
+
if fields.publicKey, previous.publicKey != overrides.publicKey {
|
|
176
|
+
changes.append("publicKey")
|
|
177
|
+
}
|
|
178
|
+
guard !changes.isEmpty else {
|
|
179
|
+
return
|
|
180
|
+
}
|
|
181
|
+
log(
|
|
182
|
+
"[HotUpdater] HotUpdater.configure replaced values HotUpdaterOptions set: "
|
|
183
|
+
+ changes.joined(separator: ", ")
|
|
184
|
+
+ ". configure is deprecated: pass channel, fingerprintHash, and publicKey to HotUpdaterOptions."
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
private static func describe(_ value: String?) -> String {
|
|
189
|
+
value.map { "\"\($0)\"" } ?? "nil"
|
|
190
|
+
}
|
|
19
191
|
|
|
192
|
+
@available(*, deprecated, message: "Pass fingerprintHash to HotUpdaterOptions.")
|
|
20
193
|
public var fingerprintHash: String? {
|
|
21
|
-
get {
|
|
22
|
-
set {
|
|
194
|
+
get { overrides.fingerprintHash }
|
|
195
|
+
set { replace(touching: OptionFields(fingerprintHash: true)) { $0.fingerprintHash = newValue } }
|
|
23
196
|
}
|
|
24
197
|
|
|
198
|
+
@available(*, deprecated, message: "Pass publicKey to HotUpdaterOptions.")
|
|
25
199
|
public var publicKey: String? {
|
|
26
|
-
get {
|
|
27
|
-
set {
|
|
200
|
+
get { overrides.publicKey }
|
|
201
|
+
set { replace(touching: OptionFields(publicKey: true)) { $0.publicKey = newValue } }
|
|
28
202
|
}
|
|
29
203
|
|
|
204
|
+
@available(*, deprecated, message: "Pass channel to HotUpdaterOptions.")
|
|
30
205
|
public var channel: String? {
|
|
31
|
-
get {
|
|
32
|
-
set {
|
|
206
|
+
get { overrides.channel }
|
|
207
|
+
set { replace(touching: OptionFields(channel: true)) { $0.channel = newValue } }
|
|
33
208
|
}
|
|
34
209
|
|
|
35
|
-
/// When set, used verbatim as the storage isolation key, bypassing the
|
|
36
|
-
/// `hotupdater_{fingerprint}_{
|
|
37
|
-
///
|
|
210
|
+
/// When set, used verbatim as the storage isolation key, bypassing the
|
|
211
|
+
/// default `hotupdater_{fingerprint}_{minBundleId}_{channel}_` (fingerprint
|
|
212
|
+
/// strategy) or `hotupdater_{appVersion}_{channel}_` composition.
|
|
213
|
+
@available(*, deprecated, message: "Fingerprint downloads now survive native releases that ship the same artifact, so no isolation key is needed.")
|
|
38
214
|
public var isolationKey: String? {
|
|
39
|
-
get {
|
|
40
|
-
set {
|
|
215
|
+
get { overrides.isolationKey }
|
|
216
|
+
set { replace(touching: OptionFields()) { $0.isolationKey = newValue } }
|
|
41
217
|
}
|
|
42
218
|
|
|
219
|
+
/// Replaces all four values. Deprecated with `HotUpdater.configure`.
|
|
220
|
+
@available(*, deprecated, message: "Pass channel, fingerprintHash, and publicKey to HotUpdaterOptions. Fingerprint downloads now survive native releases that ship the same artifact.")
|
|
43
221
|
@objc(configureWithFingerprintHash:publicKey:channel:isolationKey:)
|
|
44
222
|
public func configureWithFingerprintHash(_ fingerprintHash: String?, publicKey: String?, channel: String?, isolationKey: String?) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
223
|
+
replace(touching: .all) {
|
|
224
|
+
$0 = Overrides(
|
|
225
|
+
fingerprintHash: fingerprintHash,
|
|
226
|
+
publicKey: publicKey,
|
|
227
|
+
channel: channel,
|
|
228
|
+
isolationKey: isolationKey
|
|
229
|
+
)
|
|
230
|
+
}
|
|
49
231
|
}
|
|
50
232
|
|
|
233
|
+
@available(*, deprecated, message: "Pass channel, fingerprintHash, and publicKey to HotUpdaterOptions.")
|
|
51
234
|
public func clear() {
|
|
52
|
-
|
|
235
|
+
replace(touching: .all) { $0 = Overrides() }
|
|
53
236
|
}
|
|
54
237
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
|
|
3
|
+
// Generated before every compile by ios/scripts/generate-fingerprint-hash.zsh,
|
|
4
|
+
// so this file is the only one rebuilt when the value changes.
|
|
5
|
+
#import "HotUpdaterBuildFingerprintHash.h"
|
|
6
|
+
|
|
7
|
+
NSString *HotUpdaterBuildFingerprintHash(void)
|
|
8
|
+
{
|
|
9
|
+
return @HOT_UPDATER_BUILD_FINGERPRINT_HASH;
|
|
10
|
+
}
|