mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-11-22 15:36:10 +08:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84b71e33a8 | ||
|
|
6cd99dece0 | ||
|
|
d726f3602b | ||
|
|
da21c99bcc | ||
|
|
1f8748375c | ||
|
|
fa731cd583 | ||
|
|
d077dcb6d3 | ||
|
|
59b60fdc6d | ||
|
|
c768705221 | ||
|
|
57206dd2f1 | ||
|
|
4e27d906c3 | ||
|
|
c24f469475 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -52,3 +52,8 @@ Example/testHotUpdate/harmony
|
||||
Example/testHotUpdate/android/app/.cxx
|
||||
Example/harmony_use_pushy/libs
|
||||
**/mcp.json
|
||||
|
||||
|
||||
harmony/package
|
||||
**/oh_modules
|
||||
harmony/pushy/.preview
|
||||
|
||||
8
.gitmodules
vendored
8
.gitmodules
vendored
@@ -4,9 +4,9 @@
|
||||
[submodule "android/jni/HDiffPatch"]
|
||||
path = android/jni/HDiffPatch
|
||||
url = https://github.com/sisong/HDiffPatch.git
|
||||
[submodule "harmony/src/main/cpp/HDiffPatch"]
|
||||
path = harmony/src/main/cpp/HDiffPatch
|
||||
[submodule "harmony/pushy/src/main/cpp/HDiffPatch"]
|
||||
path = harmony/pushy/src/main/cpp/HDiffPatch
|
||||
url = https://github.com/sisong/HDiffPatch.git
|
||||
[submodule "harmony/src/main/cpp/lzma"]
|
||||
path = harmony/src/main/cpp/lzma
|
||||
[submodule "harmony/pushy/src/main/cpp/lzma"]
|
||||
path = harmony/pushy/src/main/cpp/lzma
|
||||
url = https://github.com/sisong/lzma.git
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
"adaptiveIcon": {
|
||||
"foregroundImage": "./assets/adaptive-icon.png",
|
||||
"backgroundColor": "#ffffff"
|
||||
}
|
||||
},
|
||||
"package": "com.anonymous.expoUsePushy"
|
||||
},
|
||||
"web": {
|
||||
"favicon": "./assets/favicon.png"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1 @@
|
||||
import { registerRootComponent } from 'expo';
|
||||
|
||||
import App from './App';
|
||||
|
||||
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
|
||||
// It also ensures that whether you load the app in Expo Go or in a native build,
|
||||
// the environment is set up appropriately
|
||||
registerRootComponent(App);
|
||||
import 'expo-router/entry';
|
||||
|
||||
@@ -1,27 +1,50 @@
|
||||
{
|
||||
"name": "expousepushy",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"start": "expo start",
|
||||
"reset-project": "node ./scripts/reset-project.js",
|
||||
"android": "expo run:android",
|
||||
"ios": "expo run:ios",
|
||||
"web": "expo start --web"
|
||||
"web": "expo start --web",
|
||||
"lint": "expo lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@expo/metro-runtime": "~4.0.1",
|
||||
"expo": "~52.0.46",
|
||||
"expo-status-bar": "~2.0.1",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1",
|
||||
"react-native": "0.76.9",
|
||||
"react-native-update": "^10.30.3",
|
||||
"react-native-web": "~0.19.13"
|
||||
"@expo/vector-icons": "^14.1.0",
|
||||
"@react-navigation/bottom-tabs": "^7.3.10",
|
||||
"@react-navigation/elements": "^2.3.8",
|
||||
"@react-navigation/native": "^7.1.6",
|
||||
"expo": "~53.0.22",
|
||||
"expo-blur": "~14.1.5",
|
||||
"expo-constants": "~17.1.7",
|
||||
"expo-font": "~13.3.2",
|
||||
"expo-haptics": "~14.1.4",
|
||||
"expo-image": "~2.4.0",
|
||||
"expo-linking": "~7.1.7",
|
||||
"expo-router": "~5.1.5",
|
||||
"expo-splash-screen": "~0.30.10",
|
||||
"expo-status-bar": "~2.2.3",
|
||||
"expo-symbols": "~0.4.5",
|
||||
"expo-system-ui": "~5.0.11",
|
||||
"expo-web-browser": "~14.2.0",
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0",
|
||||
"react-native": "0.79.6",
|
||||
"react-native-gesture-handler": "~2.24.0",
|
||||
"react-native-reanimated": "~3.17.4",
|
||||
"react-native-safe-area-context": "5.4.0",
|
||||
"react-native-screens": "~4.11.1",
|
||||
"react-native-update": "^10.34.4",
|
||||
"react-native-web": "~0.20.0",
|
||||
"react-native-webview": "13.13.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@types/react": "~18.3.12",
|
||||
"typescript": "^5.3.3"
|
||||
"@types/react": "~19.0.10",
|
||||
"typescript": "~5.8.3",
|
||||
"eslint": "^9.25.0",
|
||||
"eslint-config-expo": "~9.2.0"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
|
||||
@@ -1,41 +1,49 @@
|
||||
{
|
||||
"app": {
|
||||
"signingConfigs": [],
|
||||
"products": [
|
||||
app: {
|
||||
signingConfigs: [],
|
||||
products: [
|
||||
{
|
||||
"name": "default",
|
||||
"signingConfig": "default",
|
||||
"compatibleSdkVersion": "5.0.0(12)",
|
||||
"runtimeOS": "HarmonyOS",
|
||||
"buildOption": {
|
||||
"strictMode": {
|
||||
"caseSensitiveCheck": true,
|
||||
"useNormalizedOHMUrl": true
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'default',
|
||||
signingConfig: 'default',
|
||||
compatibleSdkVersion: '5.0.0(12)',
|
||||
runtimeOS: 'HarmonyOS',
|
||||
buildOption: {
|
||||
strictMode: {
|
||||
caseSensitiveCheck: true,
|
||||
useNormalizedOHMUrl: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
"buildModeSet": [
|
||||
buildModeSet: [
|
||||
{
|
||||
"name": "debug",
|
||||
name: 'debug',
|
||||
},
|
||||
{
|
||||
"name": "release"
|
||||
}
|
||||
]
|
||||
name: 'release',
|
||||
},
|
||||
],
|
||||
},
|
||||
"modules": [
|
||||
modules: [
|
||||
{
|
||||
"name": "entry",
|
||||
"srcPath": "./entry",
|
||||
"targets": [
|
||||
name: 'entry',
|
||||
srcPath: './entry',
|
||||
targets: [
|
||||
{
|
||||
"name": "default",
|
||||
"applyToProducts": [
|
||||
"default"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
name: 'default',
|
||||
applyToProducts: ['default'],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'pushy',
|
||||
srcPath: '../../../harmony/pushy',
|
||||
targets: [
|
||||
{
|
||||
name: 'default',
|
||||
applyToProducts: ['default'],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
@@ -1,25 +1,26 @@
|
||||
{
|
||||
"meta": {
|
||||
"stableOrder": true
|
||||
"stableOrder": true,
|
||||
"enableUnifiedLockfile": false
|
||||
},
|
||||
"lockfileVersion": 3,
|
||||
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
|
||||
"specifiers": {
|
||||
"@rnoh/react-native-openharmony@0.72.38": "@rnoh/react-native-openharmony@0.72.38",
|
||||
"pushy@../../node_modules/react-native-update/harmony": "pushy@../../node_modules/react-native-update/harmony"
|
||||
"pushy@../../node_modules/react-native-update/harmony/pushy": "pushy@../../node_modules/react-native-update/harmony/pushy"
|
||||
},
|
||||
"packages": {
|
||||
"@rnoh/react-native-openharmony@0.72.38": {
|
||||
"name": "@rnoh/react-native-openharmony",
|
||||
"name": "",
|
||||
"version": "0.72.38",
|
||||
"integrity": "sha512-br5SIrbB0OarSLirenleE7eTOX1lNccMJ7nb/G7qWTyJ7kW4DalmTXVKYpoT2qaOLls1uEE7McD1OjbZZM9jug==",
|
||||
"resolved": "https://ohpm.openharmony.cn/ohpm/@rnoh/react-native-openharmony/-/react-native-openharmony-0.72.38.har",
|
||||
"registryType": "ohpm"
|
||||
},
|
||||
"pushy@../../node_modules/react-native-update/harmony": {
|
||||
"pushy@../../node_modules/react-native-update/harmony/pushy": {
|
||||
"name": "pushy",
|
||||
"version": "3.1.0-0.0.7",
|
||||
"resolved": "../../node_modules/react-native-update/harmony",
|
||||
"resolved": "",
|
||||
"registryType": "local",
|
||||
"dependencies": {
|
||||
"@rnoh/react-native-openharmony": "^0.72.38"
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
{
|
||||
"name": "entry",
|
||||
"version": "1.0.0",
|
||||
"description": "Please describe the basic information.",
|
||||
"main": "",
|
||||
"author": "",
|
||||
"license": "",
|
||||
"dependencies": {
|
||||
"@rnoh/react-native-openharmony": "0.72.38",
|
||||
"pushy": "file:../../node_modules/react-native-update/harmony/pushy.har",
|
||||
}
|
||||
name: 'entry',
|
||||
version: '1.0.0',
|
||||
description: 'Please describe the basic information.',
|
||||
main: '',
|
||||
author: '',
|
||||
license: '',
|
||||
dependencies: {
|
||||
'@rnoh/react-native-openharmony': '0.72.38',
|
||||
pushy: 'file:../../node_modules/react-native-update/harmony/pushy',
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { appTasks } from '@ohos/hvigor-ohos-plugin';
|
||||
import {appTasks} from '@ohos/hvigor-ohos-plugin';
|
||||
|
||||
export default {
|
||||
system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
|
||||
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
|
||||
}
|
||||
system: appTasks /* Built-in plugin of Hvigor. It cannot be modified. */,
|
||||
plugins: [] /* Custom plugin to extend the functionality of Hvigor. */,
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"react-native-paper": "^5.14.5",
|
||||
"react-native-safe-area-context": "^5.6.1",
|
||||
"react-native-svg": "^15.13.0",
|
||||
"react-native-update": "^10.31.2",
|
||||
"react-native-update": "^10.34.4",
|
||||
"react-native-vector-icons": "^10.3.0",
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -1430,7 +1430,7 @@
|
||||
|
||||
"react-native-svg": ["react-native-svg@15.13.0", "", { "dependencies": { "css-select": "^5.1.0", "css-tree": "^1.1.3", "warn-once": "0.1.1" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-/YPK+PAAXg4T0x2d2vYPvqqAhOYid2bRKxUVT7STIyd1p2JxWmsGQkfZxXCkEFN7TwLfIyVlT5RimT91Pj/qXw=="],
|
||||
|
||||
"react-native-update": ["react-native-update@10.31.2", "", { "dependencies": { "nanoid": "^3.3.3", "react-native-url-polyfill": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-native": ">=0.59.0" } }, "sha512-doKTDyU/+6eN1jDswSh1HxnM9/XuxYFM65dLadsYVR+JvdLJ0PtbceSauthv4HYI3QXoeGaStkrRCaQAVKvp+w=="],
|
||||
"react-native-update": ["react-native-update@10.34.4", "", { "dependencies": { "nanoid": "^3.3.3", "react-native-url-polyfill": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-native": ">=0.59.0" } }, "sha512-yuXlff7EMUDyp1js2NylOw9jT0sVXoc5rpaRhzoYYcwfQTQq1Qp53qpyupDuUj43MEv5ikfJ6xBd/iRpXuanNg=="],
|
||||
|
||||
"react-native-url-polyfill": ["react-native-url-polyfill@2.0.0", "", { "dependencies": { "whatwg-url-without-unicode": "8.0.0-3" }, "peerDependencies": { "react-native": "*" } }, "sha512-My330Do7/DvKnEvwQc0WdcBnFPploYKp9CYlefDXzIdEaA+PAhDYllkvGeEroEzvc4Kzzj2O4yVdz8v6fjRvhA=="],
|
||||
|
||||
|
||||
@@ -403,6 +403,8 @@
|
||||
"-DFOLLY_NO_CONFIG",
|
||||
"-DFOLLY_MOBILE=1",
|
||||
"-DFOLLY_USE_LIBCPP=1",
|
||||
"-DFOLLY_CFG_NO_COROUTINES=1",
|
||||
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
|
||||
);
|
||||
OTHER_LDFLAGS = "$(inherited)";
|
||||
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
||||
@@ -475,6 +477,8 @@
|
||||
"-DFOLLY_NO_CONFIG",
|
||||
"-DFOLLY_MOBILE=1",
|
||||
"-DFOLLY_USE_LIBCPP=1",
|
||||
"-DFOLLY_CFG_NO_COROUTINES=1",
|
||||
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
|
||||
);
|
||||
OTHER_LDFLAGS = "$(inherited)";
|
||||
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
||||
|
||||
@@ -1835,7 +1835,7 @@ PODS:
|
||||
- ReactCommon/turbomodule/core
|
||||
- SocketRocket
|
||||
- Yoga
|
||||
- react-native-update (10.31.2):
|
||||
- react-native-update (10.34.4):
|
||||
- boost
|
||||
- DoubleConversion
|
||||
- fast_float
|
||||
@@ -1854,7 +1854,7 @@ PODS:
|
||||
- React-graphics
|
||||
- React-ImageManager
|
||||
- React-jsi
|
||||
- react-native-update/RCTPushy (= 10.31.2)
|
||||
- react-native-update/RCTPushy (= 10.34.4)
|
||||
- React-NativeModulesApple
|
||||
- React-RCTFabric
|
||||
- React-renderercss
|
||||
@@ -1866,7 +1866,7 @@ PODS:
|
||||
- SocketRocket
|
||||
- SSZipArchive
|
||||
- Yoga
|
||||
- react-native-update/RCTPushy (10.31.2):
|
||||
- react-native-update/RCTPushy (10.34.4):
|
||||
- boost
|
||||
- DoubleConversion
|
||||
- fast_float
|
||||
@@ -2800,7 +2800,7 @@ SPEC CHECKSUMS:
|
||||
React-Mapbuffer: 9d2434a42701d6144ca18f0ca1c4507808ca7696
|
||||
React-microtasksnativemodule: 75b6604b667d297292345302cc5bfb6b6aeccc1b
|
||||
react-native-safe-area-context: c6e2edd1c1da07bdce287fa9d9e60c5f7b514616
|
||||
react-native-update: 7a05a78c6da651c1961b8407859f44bd0aa9b03a
|
||||
react-native-update: 822780a6d3c8482d47ba50b5801ed295c0dfcaff
|
||||
React-NativeModulesApple: 879fbdc5dcff7136abceb7880fe8a2022a1bd7c3
|
||||
React-oscompat: 93b5535ea7f7dff46aaee4f78309a70979bdde9d
|
||||
React-perflogger: 5536d2df3d18fe0920263466f7b46a56351c0510
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
"test:e2e": "detox test --configuration android.emu.debug",
|
||||
"lint": "eslint .",
|
||||
"postinstall": "patch-package",
|
||||
"apk": "cd android && ./gradlew assembleRelease",
|
||||
"dev:harmony": "react-native bundle-harmony --dev"
|
||||
"apk": "cd android && ./gradlew assembleRelease"
|
||||
},
|
||||
"dependencies": {
|
||||
"form-data": "^4.0.4",
|
||||
@@ -22,7 +21,7 @@
|
||||
"react-native-paper": "^5.14.5",
|
||||
"react-native-safe-area-context": "^5.6.1",
|
||||
"react-native-svg": "^15.13.0",
|
||||
"react-native-update": "^10.31.2",
|
||||
"react-native-update": "^10.34.4",
|
||||
"react-native-vector-icons": "^10.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Binary file not shown.
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"meta": {
|
||||
"stableOrder": true
|
||||
"stableOrder": true,
|
||||
"enableUnifiedLockfile": false
|
||||
},
|
||||
"lockfileVersion": 3,
|
||||
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
|
||||
@@ -9,7 +10,7 @@
|
||||
},
|
||||
"packages": {
|
||||
"@rnoh/react-native-openharmony@0.72.38": {
|
||||
"name": "@rnoh/react-native-openharmony",
|
||||
"name": "",
|
||||
"version": "0.72.38",
|
||||
"integrity": "sha512-br5SIrbB0OarSLirenleE7eTOX1lNccMJ7nb/G7qWTyJ7kW4DalmTXVKYpoT2qaOLls1uEE7McD1OjbZZM9jug==",
|
||||
"resolved": "https://ohpm.openharmony.cn/ohpm/@rnoh/react-native-openharmony/-/react-native-openharmony-0.72.38.har",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"license": "ISC",
|
||||
"license": "MIT",
|
||||
"types": "",
|
||||
"devDependencies": {},
|
||||
"name": "pushy",
|
||||
@@ -8,5 +8,6 @@
|
||||
"version": "3.1.0-0.0.7",
|
||||
"dependencies": {
|
||||
"@rnoh/react-native-openharmony":"^0.72.38"
|
||||
}
|
||||
},
|
||||
"modelVersion": "5.0.0"
|
||||
}
|
||||
|
||||
1
harmony/pushy/src/main/cpp/HDiffPatch
Submodule
1
harmony/pushy/src/main/cpp/HDiffPatch
Submodule
Submodule harmony/pushy/src/main/cpp/HDiffPatch added at eb959d671c
1
harmony/pushy/src/main/cpp/lzma
Submodule
1
harmony/pushy/src/main/cpp/lzma
Submodule
Submodule harmony/pushy/src/main/cpp/lzma added at c80bb80bbb
@@ -12,7 +12,7 @@ export class PushyFileJSBundleProvider extends JSBundleProvider {
|
||||
this.updateContext = new UpdateContext(context);
|
||||
}
|
||||
getURL(): string {
|
||||
return this.updateContext.getBundleUrl().substring(1);
|
||||
return this.updateContext.getBundleUrl()?.substring(1);
|
||||
}
|
||||
|
||||
async getBundle(): Promise<ArrayBuffer> {
|
||||
|
||||
@@ -9,47 +9,47 @@ import { UpdateModuleImpl } from './UpdateModuleImpl';
|
||||
import { UpdateContext } from './UpdateContext';
|
||||
import { EventHub } from './EventHub';
|
||||
|
||||
const TAG = "PushyTurboModule"
|
||||
const TAG = 'PushyTurboModule';
|
||||
|
||||
export class PushyTurboModule extends TurboModule {
|
||||
mUiCtx: common.UIAbilityContext
|
||||
context: UpdateContext
|
||||
mUiCtx: common.UIAbilityContext;
|
||||
context: UpdateContext;
|
||||
|
||||
constructor(protected ctx: TurboModuleContext) {
|
||||
super(ctx);
|
||||
logger.debug(TAG, ",PushyTurboModule constructor");
|
||||
this.mUiCtx = ctx.uiAbilityContext
|
||||
this.context = new UpdateContext(this.mUiCtx)
|
||||
EventHub.getInstance().setRNInstance(ctx.rnInstance)
|
||||
logger.debug(TAG, ',PushyTurboModule constructor');
|
||||
this.mUiCtx = ctx.uiAbilityContext;
|
||||
this.context = new UpdateContext(this.mUiCtx);
|
||||
EventHub.getInstance().setRNInstance(ctx.rnInstance);
|
||||
}
|
||||
|
||||
|
||||
getConstants(): Object {
|
||||
logger.debug(TAG, ",call getConstants");
|
||||
logger.debug(TAG, ',call getConstants');
|
||||
const context = this.mUiCtx;
|
||||
const preferencesManager = dataPreferences.getPreferencesSync(context,{ name: 'update' });
|
||||
const isFirstTime = preferencesManager.getSync("isFirstTime", false) as boolean;
|
||||
const rolledBackVersion = preferencesManager.getSync("rolledBackVersion", "") as string;
|
||||
const uuid = preferencesManager.getSync("uuid", "") as string;
|
||||
const currentVersion = preferencesManager.getSync("currentVersion", "") as string;
|
||||
const isFirstTime = preferencesManager.getSync('isFirstTime', false) as boolean;
|
||||
const rolledBackVersion = preferencesManager.getSync('rolledBackVersion', '') as string;
|
||||
const uuid = preferencesManager.getSync('uuid', '') as string;
|
||||
const currentVersion = preferencesManager.getSync('currentVersion', '') as string;
|
||||
const currentVersionInfo = this.context.getKv(`hash_${currentVersion}`);
|
||||
const buildTime = preferencesManager.getSync("buildTime", "") as string;
|
||||
const buildTime = preferencesManager.getSync('buildTime', '') as string;
|
||||
const isUsingBundleUrl = this.context.getIsUsingBundleUrl();
|
||||
let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION;
|
||||
let packageVersion = '';
|
||||
try {
|
||||
const bundleInfo = bundleManager.getBundleInfoForSelfSync(bundleFlags);
|
||||
packageVersion = bundleInfo?.versionName || "Unknown"
|
||||
packageVersion = bundleInfo?.versionName || 'Unknown';
|
||||
} catch (error) {
|
||||
console.error("Failed to get bundle info:", error);
|
||||
console.error('Failed to get bundle info:', error);
|
||||
}
|
||||
|
||||
if (isFirstTime) {
|
||||
preferencesManager.deleteSync("isFirstTime");
|
||||
preferencesManager.deleteSync('isFirstTime');
|
||||
}
|
||||
|
||||
if (rolledBackVersion) {
|
||||
preferencesManager.deleteSync("rolledBackVersion");
|
||||
preferencesManager.deleteSync('rolledBackVersion');
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -62,12 +62,12 @@ getConstants(): Object {
|
||||
isFirstTime,
|
||||
rolledBackVersion,
|
||||
uuid,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
setLocalHashInfo(hash: string, info: string): boolean {
|
||||
logger.debug(TAG, ",call setLocalHashInfo");
|
||||
logger.debug(TAG, ',call setLocalHashInfo');
|
||||
return UpdateModuleImpl.setLocalHashInfo(this.context, hash, info);
|
||||
}
|
||||
|
||||
@@ -76,50 +76,50 @@ getConstants(): Object {
|
||||
}
|
||||
|
||||
async setUuid(uuid: string): Promise<boolean> {
|
||||
logger.debug(TAG, `,call setUuid`);
|
||||
logger.debug(TAG, ',call setUuid');
|
||||
return UpdateModuleImpl.setUuid(this.context,uuid);
|
||||
}
|
||||
|
||||
async reloadUpdate(options: { hash: string }): Promise<void> {
|
||||
logger.debug(TAG, `,call reloadUpdate`);
|
||||
logger.debug(TAG, ',call reloadUpdate');
|
||||
return UpdateModuleImpl.reloadUpdate(this.context, this.mUiCtx, options);
|
||||
}
|
||||
|
||||
async setNeedUpdate(options: { hash: string }): Promise<boolean> {
|
||||
logger.debug(TAG, `,call setNeedUpdate`);
|
||||
logger.debug(TAG, ',call setNeedUpdate');
|
||||
return UpdateModuleImpl.setNeedUpdate(this.context, options);
|
||||
}
|
||||
|
||||
async markSuccess(): Promise<boolean> {
|
||||
logger.debug(TAG, `,call markSuccess`);
|
||||
logger.debug(TAG, ',call markSuccess');
|
||||
return UpdateModuleImpl.markSuccess(this.context);
|
||||
}
|
||||
|
||||
async downloadPatchFromPpk(options: { updateUrl: string; hash: string; originHash: string }): Promise<void> {
|
||||
logger.debug(TAG, `,call downloadPatchFromPpk`);
|
||||
logger.debug(TAG, ',call downloadPatchFromPpk');
|
||||
return UpdateModuleImpl.downloadPatchFromPpk(this.context, options);
|
||||
}
|
||||
|
||||
async downloadPatchFromPackage(options: { updateUrl: string; hash: string }): Promise<void> {
|
||||
logger.debug(TAG, `,call downloadPatchFromPackage`);
|
||||
logger.debug(TAG, ',call downloadPatchFromPackage');
|
||||
return UpdateModuleImpl.downloadPatchFromPackage(this.context, options);
|
||||
}
|
||||
|
||||
async downloadFullUpdate(options: { updateUrl: string; hash: string }): Promise<void> {
|
||||
logger.debug(TAG, `,call downloadFullUpdate`);
|
||||
logger.debug(TAG, ',call downloadFullUpdate');
|
||||
return UpdateModuleImpl.downloadFullUpdate(this.context, options);
|
||||
}
|
||||
|
||||
async downloadAndInstallApk(options: { url: string; target: string; hash: string }): Promise<void> {
|
||||
logger.debug(TAG, `,call downloadAndInstallApk`);
|
||||
logger.debug(TAG, ',call downloadAndInstallApk');
|
||||
return UpdateModuleImpl.downloadAndInstallApk(this.mUiCtx, options);
|
||||
}
|
||||
|
||||
addListener(eventName: string): void {
|
||||
logger.debug(TAG, `,call addListener`);
|
||||
logger.debug(TAG, ',call addListener');
|
||||
}
|
||||
|
||||
removeListeners(count: number): void {
|
||||
logger.debug(TAG, `,call removeListeners`);
|
||||
logger.debug(TAG, ',call removeListeners');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
@import React;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-update",
|
||||
"version": "10.34.0",
|
||||
"version": "10.34.5",
|
||||
"description": "react-native hot update",
|
||||
"main": "src/index",
|
||||
"scripts": {
|
||||
@@ -9,7 +9,7 @@
|
||||
"lint": "eslint \"src/*.@(ts|tsx|js|jsx)\" && tsc --noEmit",
|
||||
"submodule": "git submodule update --init --recursive",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build-lib": "bun submodule && $ANDROID_HOME/ndk/28.2.13676358/ndk-build NDK_PROJECT_PATH=android APP_BUILD_SCRIPT=android/jni/Android.mk NDK_APPLICATION_MK=android/jni/Application.mk NDK_LIBS_OUT=android/lib",
|
||||
"build:so": "bun submodule && $ANDROID_HOME/ndk/28.2.13676358/ndk-build NDK_PROJECT_PATH=android APP_BUILD_SCRIPT=android/jni/Android.mk NDK_APPLICATION_MK=android/jni/Application.mk NDK_LIBS_OUT=android/lib",
|
||||
"build:ios-debug": "cd Example/testHotUpdate && bun && detox build --configuration ios.sim.debug",
|
||||
"build:ios-release": "cd Example/testHotUpdate && bun && detox build --configuration ios.sim.release",
|
||||
"test:ios-debug": "cd Example/testHotUpdate && detox test --configuration ios.sim.debug",
|
||||
@@ -72,6 +72,5 @@
|
||||
"react-native": "0.73",
|
||||
"ts-jest": "^29.3.2",
|
||||
"typescript": "^5.6.3"
|
||||
},
|
||||
"packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,6 @@ Pod::Spec.new do |s|
|
||||
|
||||
# Conditionally add Expo dependency
|
||||
if valid_expo_project
|
||||
s.public_header_files = ['ios/ImportReact.h']
|
||||
s.dependency 'ExpoModulesCore'
|
||||
end
|
||||
|
||||
|
||||
1
react-native.config.js
Normal file
1
react-native.config.js
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = {};
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
buildTime,
|
||||
cInfo,
|
||||
currentVersion,
|
||||
getCurrentVersionInfo,
|
||||
currentVersionInfo,
|
||||
isFirstTime,
|
||||
isRolledBack,
|
||||
packageVersion,
|
||||
@@ -110,8 +110,7 @@ export class Pushy {
|
||||
this.clientType = clientType || 'Pushy';
|
||||
this.options.server = SERVER_PRESETS[this.clientType];
|
||||
|
||||
// Initialize i18n based on clientType
|
||||
i18n.setLocale(this.clientType === 'Pushy' ? 'zh' : 'en');
|
||||
i18n.setLocale(options.locale ?? this.clientType === 'Pushy' ? 'zh' : 'en');
|
||||
|
||||
if (Platform.OS === 'ios' || Platform.OS === 'android') {
|
||||
if (!options.appKey) {
|
||||
@@ -163,7 +162,6 @@ export class Pushy {
|
||||
log(type + ' ' + message);
|
||||
await this.loggerPromise.promise;
|
||||
const { logger = noop, appKey } = this.options;
|
||||
const info = await getCurrentVersionInfo();
|
||||
const overridePackageVersion = this.options.overridePackageVersion;
|
||||
logger({
|
||||
type,
|
||||
@@ -175,7 +173,7 @@ export class Pushy {
|
||||
overridePackageVersion,
|
||||
buildTime,
|
||||
message,
|
||||
...info,
|
||||
...currentVersionInfo,
|
||||
...data,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -179,8 +179,8 @@ export const UpdateProvider = ({
|
||||
delete rootInfo.expVersion;
|
||||
for (const versionInfo of versions) {
|
||||
const info: CheckResult = {
|
||||
...versionInfo,
|
||||
...rootInfo,
|
||||
...versionInfo,
|
||||
};
|
||||
const rollout = info.config?.rollout?.[packageVersion];
|
||||
if (info.update && rollout) {
|
||||
|
||||
@@ -86,6 +86,7 @@ export interface ClientOptions {
|
||||
appKey: string;
|
||||
server?: UpdateServerConfig;
|
||||
logger?: UpdateEventsLogger;
|
||||
locale?: 'zh' | 'en';
|
||||
updateStrategy?:
|
||||
| 'alwaysAlert'
|
||||
| 'alertUpdateAndIgnoreError'
|
||||
|
||||
Reference in New Issue
Block a user