react-native-update 10.34.0 → 10.34.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/.gitmodules +0 -6
- package/harmony/pushy/oh-package-lock.json5 +3 -2
- package/harmony/pushy/oh-package.json5 +3 -2
- package/harmony/pushy/src/main/ets/PushyFileJSBundleProvider.ets +1 -1
- package/harmony/pushy/src/main/ets/PushyTurboModule.ts +30 -30
- package/package.json +3 -4
- package/src/client.ts +2 -3
- package/src/provider.tsx +1 -1
- package/harmony/pushy.har +0 -0
package/.gitmodules
CHANGED
|
@@ -4,9 +4,3 @@
|
|
|
4
4
|
[submodule "android/jni/HDiffPatch"]
|
|
5
5
|
path = android/jni/HDiffPatch
|
|
6
6
|
url = https://github.com/sisong/HDiffPatch.git
|
|
7
|
-
[submodule "harmony/src/main/cpp/HDiffPatch"]
|
|
8
|
-
path = harmony/src/main/cpp/HDiffPatch
|
|
9
|
-
url = https://github.com/sisong/HDiffPatch.git
|
|
10
|
-
[submodule "harmony/src/main/cpp/lzma"]
|
|
11
|
-
path = harmony/src/main/cpp/lzma
|
|
12
|
-
url = https://github.com/sisong/lzma.git
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
|
-
"stableOrder": true
|
|
3
|
+
"stableOrder": true,
|
|
4
|
+
"enableUnifiedLockfile": false
|
|
4
5
|
},
|
|
5
6
|
"lockfileVersion": 3,
|
|
6
7
|
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
|
|
@@ -9,7 +10,7 @@
|
|
|
9
10
|
},
|
|
10
11
|
"packages": {
|
|
11
12
|
"@rnoh/react-native-openharmony@0.72.38": {
|
|
12
|
-
"name": "
|
|
13
|
+
"name": "",
|
|
13
14
|
"version": "0.72.38",
|
|
14
15
|
"integrity": "sha512-br5SIrbB0OarSLirenleE7eTOX1lNccMJ7nb/G7qWTyJ7kW4DalmTXVKYpoT2qaOLls1uEE7McD1OjbZZM9jug==",
|
|
15
16
|
"resolved": "https://ohpm.openharmony.cn/ohpm/@rnoh/react-native-openharmony/-/react-native-openharmony-0.72.38.har",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"license": "
|
|
2
|
+
"license": "MIT",
|
|
3
3
|
"types": "",
|
|
4
4
|
"devDependencies": {},
|
|
5
5
|
"name": "pushy",
|
|
@@ -8,5 +8,6 @@
|
|
|
8
8
|
"version": "3.1.0-0.0.7",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@rnoh/react-native-openharmony":"^0.72.38"
|
|
11
|
-
}
|
|
11
|
+
},
|
|
12
|
+
"modelVersion": "5.0.0"
|
|
12
13
|
}
|
|
@@ -12,7 +12,7 @@ export class PushyFileJSBundleProvider extends JSBundleProvider {
|
|
|
12
12
|
this.updateContext = new UpdateContext(context);
|
|
13
13
|
}
|
|
14
14
|
getURL(): string {
|
|
15
|
-
return this.updateContext.getBundleUrl()
|
|
15
|
+
return this.updateContext.getBundleUrl()?.substring(1);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
async getBundle(): Promise<ArrayBuffer> {
|
|
@@ -9,47 +9,47 @@ import { UpdateModuleImpl } from './UpdateModuleImpl';
|
|
|
9
9
|
import { UpdateContext } from './UpdateContext';
|
|
10
10
|
import { EventHub } from './EventHub';
|
|
11
11
|
|
|
12
|
-
const TAG =
|
|
12
|
+
const TAG = 'PushyTurboModule';
|
|
13
13
|
|
|
14
14
|
export class PushyTurboModule extends TurboModule {
|
|
15
|
-
mUiCtx: common.UIAbilityContext
|
|
16
|
-
context: UpdateContext
|
|
15
|
+
mUiCtx: common.UIAbilityContext;
|
|
16
|
+
context: UpdateContext;
|
|
17
17
|
|
|
18
18
|
constructor(protected ctx: TurboModuleContext) {
|
|
19
19
|
super(ctx);
|
|
20
|
-
logger.debug(TAG,
|
|
21
|
-
this.mUiCtx = ctx.uiAbilityContext
|
|
22
|
-
this.context = new UpdateContext(this.mUiCtx)
|
|
23
|
-
EventHub.getInstance().setRNInstance(ctx.rnInstance)
|
|
20
|
+
logger.debug(TAG, ',PushyTurboModule constructor');
|
|
21
|
+
this.mUiCtx = ctx.uiAbilityContext;
|
|
22
|
+
this.context = new UpdateContext(this.mUiCtx);
|
|
23
|
+
EventHub.getInstance().setRNInstance(ctx.rnInstance);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
getConstants(): Object {
|
|
28
|
-
logger.debug(TAG,
|
|
28
|
+
logger.debug(TAG, ',call getConstants');
|
|
29
29
|
const context = this.mUiCtx;
|
|
30
30
|
const preferencesManager = dataPreferences.getPreferencesSync(context,{ name: 'update' });
|
|
31
|
-
const isFirstTime = preferencesManager.getSync(
|
|
32
|
-
const rolledBackVersion = preferencesManager.getSync(
|
|
33
|
-
const uuid = preferencesManager.getSync(
|
|
34
|
-
const currentVersion = preferencesManager.getSync(
|
|
31
|
+
const isFirstTime = preferencesManager.getSync('isFirstTime', false) as boolean;
|
|
32
|
+
const rolledBackVersion = preferencesManager.getSync('rolledBackVersion', '') as string;
|
|
33
|
+
const uuid = preferencesManager.getSync('uuid', '') as string;
|
|
34
|
+
const currentVersion = preferencesManager.getSync('currentVersion', '') as string;
|
|
35
35
|
const currentVersionInfo = this.context.getKv(`hash_${currentVersion}`);
|
|
36
|
-
const buildTime = preferencesManager.getSync(
|
|
36
|
+
const buildTime = preferencesManager.getSync('buildTime', '') as string;
|
|
37
37
|
const isUsingBundleUrl = this.context.getIsUsingBundleUrl();
|
|
38
38
|
let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION;
|
|
39
39
|
let packageVersion = '';
|
|
40
40
|
try {
|
|
41
41
|
const bundleInfo = bundleManager.getBundleInfoForSelfSync(bundleFlags);
|
|
42
|
-
packageVersion = bundleInfo?.versionName ||
|
|
42
|
+
packageVersion = bundleInfo?.versionName || 'Unknown';
|
|
43
43
|
} catch (error) {
|
|
44
|
-
console.error(
|
|
44
|
+
console.error('Failed to get bundle info:', error);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
if (isFirstTime) {
|
|
48
|
-
preferencesManager.deleteSync(
|
|
48
|
+
preferencesManager.deleteSync('isFirstTime');
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
if (rolledBackVersion) {
|
|
52
|
-
preferencesManager.deleteSync(
|
|
52
|
+
preferencesManager.deleteSync('rolledBackVersion');
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
return {
|
|
@@ -62,12 +62,12 @@ getConstants(): Object {
|
|
|
62
62
|
isFirstTime,
|
|
63
63
|
rolledBackVersion,
|
|
64
64
|
uuid,
|
|
65
|
-
}
|
|
65
|
+
};
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
setLocalHashInfo(hash: string, info: string): boolean {
|
|
70
|
-
logger.debug(TAG,
|
|
70
|
+
logger.debug(TAG, ',call setLocalHashInfo');
|
|
71
71
|
return UpdateModuleImpl.setLocalHashInfo(this.context, hash, info);
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -76,50 +76,50 @@ getConstants(): Object {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
async setUuid(uuid: string): Promise<boolean> {
|
|
79
|
-
logger.debug(TAG,
|
|
79
|
+
logger.debug(TAG, ',call setUuid');
|
|
80
80
|
return UpdateModuleImpl.setUuid(this.context,uuid);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
async reloadUpdate(options: { hash: string }): Promise<void> {
|
|
84
|
-
logger.debug(TAG,
|
|
84
|
+
logger.debug(TAG, ',call reloadUpdate');
|
|
85
85
|
return UpdateModuleImpl.reloadUpdate(this.context, this.mUiCtx, options);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
async setNeedUpdate(options: { hash: string }): Promise<boolean> {
|
|
89
|
-
logger.debug(TAG,
|
|
89
|
+
logger.debug(TAG, ',call setNeedUpdate');
|
|
90
90
|
return UpdateModuleImpl.setNeedUpdate(this.context, options);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
async markSuccess(): Promise<boolean> {
|
|
94
|
-
logger.debug(TAG,
|
|
94
|
+
logger.debug(TAG, ',call markSuccess');
|
|
95
95
|
return UpdateModuleImpl.markSuccess(this.context);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
async downloadPatchFromPpk(options: { updateUrl: string; hash: string; originHash: string }): Promise<void> {
|
|
99
|
-
logger.debug(TAG,
|
|
99
|
+
logger.debug(TAG, ',call downloadPatchFromPpk');
|
|
100
100
|
return UpdateModuleImpl.downloadPatchFromPpk(this.context, options);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
async downloadPatchFromPackage(options: { updateUrl: string; hash: string }): Promise<void> {
|
|
104
|
-
logger.debug(TAG,
|
|
104
|
+
logger.debug(TAG, ',call downloadPatchFromPackage');
|
|
105
105
|
return UpdateModuleImpl.downloadPatchFromPackage(this.context, options);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
async downloadFullUpdate(options: { updateUrl: string; hash: string }): Promise<void> {
|
|
109
|
-
logger.debug(TAG,
|
|
109
|
+
logger.debug(TAG, ',call downloadFullUpdate');
|
|
110
110
|
return UpdateModuleImpl.downloadFullUpdate(this.context, options);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
async downloadAndInstallApk(options: { url: string; target: string; hash: string }): Promise<void> {
|
|
114
|
-
logger.debug(TAG,
|
|
114
|
+
logger.debug(TAG, ',call downloadAndInstallApk');
|
|
115
115
|
return UpdateModuleImpl.downloadAndInstallApk(this.mUiCtx, options);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
addListener(eventName: string): void {
|
|
119
|
-
logger.debug(TAG,
|
|
119
|
+
logger.debug(TAG, ',call addListener');
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
removeListeners(count: number): void {
|
|
123
|
-
logger.debug(TAG,
|
|
123
|
+
logger.debug(TAG, ',call removeListeners');
|
|
124
124
|
}
|
|
125
|
-
}
|
|
125
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-update",
|
|
3
|
-
"version": "10.34.
|
|
3
|
+
"version": "10.34.1",
|
|
4
4
|
"description": "react-native hot update",
|
|
5
5
|
"main": "src/index",
|
|
6
6
|
"scripts": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"lint": "eslint \"src/*.@(ts|tsx|js|jsx)\" && tsc --noEmit",
|
|
10
10
|
"submodule": "git submodule update --init --recursive",
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
|
-
"build
|
|
12
|
+
"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",
|
|
13
13
|
"build:ios-debug": "cd Example/testHotUpdate && bun && detox build --configuration ios.sim.debug",
|
|
14
14
|
"build:ios-release": "cd Example/testHotUpdate && bun && detox build --configuration ios.sim.release",
|
|
15
15
|
"test:ios-debug": "cd Example/testHotUpdate && detox test --configuration ios.sim.debug",
|
|
@@ -72,6 +72,5 @@
|
|
|
72
72
|
"react-native": "0.73",
|
|
73
73
|
"ts-jest": "^29.3.2",
|
|
74
74
|
"typescript": "^5.6.3"
|
|
75
|
-
}
|
|
76
|
-
"packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
|
|
75
|
+
}
|
|
77
76
|
}
|
package/src/client.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
buildTime,
|
|
9
9
|
cInfo,
|
|
10
10
|
currentVersion,
|
|
11
|
-
|
|
11
|
+
currentVersionInfo,
|
|
12
12
|
isFirstTime,
|
|
13
13
|
isRolledBack,
|
|
14
14
|
packageVersion,
|
|
@@ -163,7 +163,6 @@ export class Pushy {
|
|
|
163
163
|
log(type + ' ' + message);
|
|
164
164
|
await this.loggerPromise.promise;
|
|
165
165
|
const { logger = noop, appKey } = this.options;
|
|
166
|
-
const info = await getCurrentVersionInfo();
|
|
167
166
|
const overridePackageVersion = this.options.overridePackageVersion;
|
|
168
167
|
logger({
|
|
169
168
|
type,
|
|
@@ -175,7 +174,7 @@ export class Pushy {
|
|
|
175
174
|
overridePackageVersion,
|
|
176
175
|
buildTime,
|
|
177
176
|
message,
|
|
178
|
-
...
|
|
177
|
+
...currentVersionInfo,
|
|
179
178
|
...data,
|
|
180
179
|
},
|
|
181
180
|
});
|
package/src/provider.tsx
CHANGED
|
@@ -179,8 +179,8 @@ export const UpdateProvider = ({
|
|
|
179
179
|
delete rootInfo.expVersion;
|
|
180
180
|
for (const versionInfo of versions) {
|
|
181
181
|
const info: CheckResult = {
|
|
182
|
-
...versionInfo,
|
|
183
182
|
...rootInfo,
|
|
183
|
+
...versionInfo,
|
|
184
184
|
};
|
|
185
185
|
const rollout = info.config?.rollout?.[packageVersion];
|
|
186
186
|
if (info.update && rollout) {
|
package/harmony/pushy.har
DELETED
|
Binary file
|