@hot-updater/react-native 0.35.0 → 0.35.2

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.
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.HOT_UPDATER_SDK_VERSION = void 0;
7
- const HOT_UPDATER_SDK_VERSION = exports.HOT_UPDATER_SDK_VERSION = "0.35.0";
7
+ const HOT_UPDATER_SDK_VERSION = exports.HOT_UPDATER_SDK_VERSION = "0.35.2";
8
8
  //# sourceMappingURL=sdkVersion.js.map
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
 
3
- export const HOT_UPDATER_SDK_VERSION = "0.35.0";
3
+ export const HOT_UPDATER_SDK_VERSION = "0.35.2";
4
4
  //# sourceMappingURL=sdkVersion.js.map
@@ -1,2 +1,2 @@
1
- export declare const HOT_UPDATER_SDK_VERSION = "0.35.0";
1
+ export declare const HOT_UPDATER_SDK_VERSION = "0.35.2";
2
2
  //# sourceMappingURL=sdkVersion.d.ts.map
@@ -1,2 +1,2 @@
1
- export declare const HOT_UPDATER_SDK_VERSION = "0.35.0";
1
+ export declare const HOT_UPDATER_SDK_VERSION = "0.35.2";
2
2
  //# sourceMappingURL=sdkVersion.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/react-native",
3
- "version": "0.35.0",
3
+ "version": "0.35.2",
4
4
  "description": "React Native OTA solution for self-hosted",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/commonjs/index.js",
@@ -125,14 +125,14 @@
125
125
  "react-native": "0.79.1",
126
126
  "react-native-builder-bob": "0.41.0",
127
127
  "typescript": "^6.0.2",
128
- "hot-updater": "0.35.0"
128
+ "hot-updater": "0.35.2"
129
129
  },
130
130
  "dependencies": {
131
131
  "use-sync-external-store": "1.5.0",
132
- "@hot-updater/core": "0.35.0",
133
- "@hot-updater/cli-tools": "0.35.0",
134
- "@hot-updater/js": "0.35.0",
135
- "@hot-updater/plugin-core": "0.35.0"
132
+ "@hot-updater/cli-tools": "0.35.2",
133
+ "@hot-updater/core": "0.35.2",
134
+ "@hot-updater/js": "0.35.2",
135
+ "@hot-updater/plugin-core": "0.35.2"
136
136
  },
137
137
  "scripts": {
138
138
  "build": "node ./scripts/sync-sdk-version.mjs run -- bob build && tsc -p plugin/tsconfig.build.json",
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getPublicKeyFromConfig = void 0;
6
7
  const promises_1 = require("node:fs/promises");
7
8
  const path_1 = __importDefault(require("path"));
8
9
  const config_plugins_1 = require("expo/config-plugins");
@@ -66,12 +67,14 @@ const getPublicKeyFromConfig = async (signingConfig) => {
66
67
  if (!signingConfig?.enabled) {
67
68
  return null;
68
69
  }
69
- // Priority 1: Environment variable with private key PEM (EAS builds)
70
70
  const envPrivateKey = process.env.HOT_UPDATER_PRIVATE_KEY;
71
71
  if (envPrivateKey) {
72
72
  try {
73
- const { getPublicKeyFromPrivate } = await loadHotUpdater();
74
- const publicKeyPEM = getPublicKeyFromPrivate(envPrivateKey);
73
+ const { getPublicKeyFromPrivate, loadPrivateKey } = await loadHotUpdater();
74
+ const envPrivateKeyPEM = envPrivateKey.includes("-----BEGIN")
75
+ ? envPrivateKey
76
+ : await loadPrivateKey(envPrivateKey);
77
+ const publicKeyPEM = getPublicKeyFromPrivate(envPrivateKeyPEM);
75
78
  console.log("[hot-updater] Using public key extracted from HOT_UPDATER_PRIVATE_KEY environment variable");
76
79
  return publicKeyPEM.trim();
77
80
  }
@@ -124,6 +127,7 @@ const getPublicKeyFromConfig = async (signingConfig) => {
124
127
  }
125
128
  }
126
129
  };
130
+ exports.getPublicKeyFromConfig = getPublicKeyFromConfig;
127
131
  /**
128
132
  * Native code modifications - should only run once
129
133
  */
@@ -161,7 +165,7 @@ const withHotUpdaterConfigAsync = (props) => (config) => {
161
165
  fingerprintHash = fingerprint.ios.hash;
162
166
  }
163
167
  // Load public key if signing is enabled
164
- const publicKey = await getPublicKeyFromConfig(config.signing);
168
+ const publicKey = await (0, exports.getPublicKeyFromConfig)(config.signing);
165
169
  cfg.modResults.HOT_UPDATER_CHANNEL = channel;
166
170
  if (fingerprintHash) {
167
171
  cfg.modResults.HOT_UPDATER_FINGERPRINT_HASH = fingerprintHash;
@@ -181,7 +185,7 @@ const withHotUpdaterConfigAsync = (props) => (config) => {
181
185
  fingerprintHash = fingerprint.android.hash;
182
186
  }
183
187
  // Load public key if signing is enabled
184
- const publicKey = await getPublicKeyFromConfig(config.signing);
188
+ const publicKey = await (0, exports.getPublicKeyFromConfig)(config.signing);
185
189
  const application = cfg.modResults.manifest.application?.[0];
186
190
  if (!application) {
187
191
  return cfg;
package/src/sdkVersion.ts CHANGED
@@ -1 +1 @@
1
- export const HOT_UPDATER_SDK_VERSION = "0.35.0";
1
+ export const HOT_UPDATER_SDK_VERSION = "0.35.2";