@hot-updater/react-native 0.19.7 → 0.19.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/react-native",
3
- "version": "0.19.7",
3
+ "version": "0.19.9",
4
4
  "description": "React Native OTA solution for self-hosted",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -119,12 +119,13 @@
119
119
  "react-native": "0.79.1",
120
120
  "react-native-builder-bob": "^0.40.10",
121
121
  "typescript": "^5.8.3",
122
- "hot-updater": "0.19.7"
122
+ "hot-updater": "0.19.9"
123
123
  },
124
124
  "dependencies": {
125
125
  "use-sync-external-store": "1.5.0",
126
- "@hot-updater/core": "0.19.7",
127
- "@hot-updater/js": "0.19.7"
126
+ "@hot-updater/js": "0.19.9",
127
+ "@hot-updater/plugin-core": "0.19.9",
128
+ "@hot-updater/core": "0.19.9"
128
129
  },
129
130
  "scripts": {
130
131
  "build": "bob build && tsc -p plugin/tsconfig.json",
@@ -39,6 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
+ var plugin_core_1 = require("@hot-updater/plugin-core");
42
43
  var config_plugins_1 = require("expo/config-plugins");
43
44
  var hot_updater_1 = require("hot-updater");
44
45
  var package_json_1 = __importDefault(require("../../package.json"));
@@ -207,26 +208,46 @@ var withHotUpdaterConfigAsync = function (props) { return function (config) {
207
208
  var modifiedConfig = config;
208
209
  // === iOS: Add channel and fingerprint to Info.plist ===
209
210
  modifiedConfig = (0, config_plugins_1.withInfoPlist)(modifiedConfig, function (cfg) { return __awaiter(void 0, void 0, void 0, function () {
210
- var ios;
211
+ var fingerprintHash, config, ios;
211
212
  return __generator(this, function (_a) {
212
213
  switch (_a.label) {
213
- case 0: return [4 /*yield*/, getFingerprint()];
214
+ case 0:
215
+ fingerprintHash = null;
216
+ return [4 /*yield*/, (0, plugin_core_1.loadConfig)(null)];
214
217
  case 1:
218
+ config = _a.sent();
219
+ if (!(config.updateStrategy !== "appVersion")) return [3 /*break*/, 3];
220
+ return [4 /*yield*/, getFingerprint()];
221
+ case 2:
215
222
  ios = (_a.sent()).ios;
223
+ fingerprintHash = ios.hash;
224
+ _a.label = 3;
225
+ case 3:
216
226
  cfg.modResults.HOT_UPDATER_CHANNEL = channel;
217
- cfg.modResults.HOT_UPDATER_FINGERPRINT_HASH = ios.hash;
227
+ if (fingerprintHash) {
228
+ cfg.modResults.HOT_UPDATER_FINGERPRINT_HASH = fingerprintHash;
229
+ }
218
230
  return [2 /*return*/, cfg];
219
231
  }
220
232
  });
221
233
  }); });
222
234
  // === Android: Add channel and fingerprint to strings.xml ===
223
235
  modifiedConfig = (0, config_plugins_1.withStringsXml)(modifiedConfig, function (cfg) { return __awaiter(void 0, void 0, void 0, function () {
224
- var android;
236
+ var fingerprintHash, config, android;
225
237
  return __generator(this, function (_a) {
226
238
  switch (_a.label) {
227
- case 0: return [4 /*yield*/, getFingerprint()];
239
+ case 0:
240
+ fingerprintHash = null;
241
+ return [4 /*yield*/, (0, plugin_core_1.loadConfig)(null)];
228
242
  case 1:
243
+ config = _a.sent();
244
+ if (!(config.updateStrategy !== "appVersion")) return [3 /*break*/, 3];
245
+ return [4 /*yield*/, getFingerprint()];
246
+ case 2:
229
247
  android = (_a.sent()).android;
248
+ fingerprintHash = android.hash;
249
+ _a.label = 3;
250
+ case 3:
230
251
  // Ensure resources object exists
231
252
  if (!cfg.modResults.resources) {
232
253
  cfg.modResults.resources = {};
@@ -244,16 +265,21 @@ var withHotUpdaterConfigAsync = function (props) { return function (config) {
244
265
  },
245
266
  _: channel,
246
267
  });
247
- // Remove existing hot_updater_fingerprint_hash entry if it exists
248
- cfg.modResults.resources.string = cfg.modResults.resources.string.filter(function (item) { return !(item.$ && item.$.name === "hot_updater_fingerprint_hash"); });
249
- // Add the new hot_updater_fingerprint_hash entry
250
- cfg.modResults.resources.string.push({
251
- $: {
252
- name: "hot_updater_fingerprint_hash",
253
- moduleConfig: "true",
254
- },
255
- _: android.hash,
256
- });
268
+ if (fingerprintHash) {
269
+ // Remove existing hot_updater_fingerprint_hash entry if it exists
270
+ cfg.modResults.resources.string =
271
+ cfg.modResults.resources.string.filter(function (item) {
272
+ return !(item.$ && item.$.name === "hot_updater_fingerprint_hash");
273
+ });
274
+ // Add the new hot_updater_fingerprint_hash entry
275
+ cfg.modResults.resources.string.push({
276
+ $: {
277
+ name: "hot_updater_fingerprint_hash",
278
+ moduleConfig: "true",
279
+ },
280
+ _: fingerprintHash,
281
+ });
282
+ }
257
283
  return [2 /*return*/, cfg];
258
284
  }
259
285
  });