react-native-update 10.34.0-beta.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 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": "@rnoh/react-native-openharmony",
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": "ISC",
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().substring(1);
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 = "PushyTurboModule"
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, ",PushyTurboModule constructor");
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, ",call getConstants");
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("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;
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("buildTime", "") as string;
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 || "Unknown"
42
+ packageVersion = bundleInfo?.versionName || 'Unknown';
43
43
  } catch (error) {
44
- console.error("Failed to get bundle info:", error);
44
+ console.error('Failed to get bundle info:', error);
45
45
  }
46
46
 
47
47
  if (isFirstTime) {
48
- preferencesManager.deleteSync("isFirstTime");
48
+ preferencesManager.deleteSync('isFirstTime');
49
49
  }
50
50
 
51
51
  if (rolledBackVersion) {
52
- preferencesManager.deleteSync("rolledBackVersion");
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, ",call setLocalHashInfo");
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, `,call setUuid`);
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, `,call reloadUpdate`);
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, `,call setNeedUpdate`);
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, `,call markSuccess`);
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, `,call downloadPatchFromPpk`);
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, `,call downloadPatchFromPackage`);
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, `,call downloadFullUpdate`);
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, `,call downloadAndInstallApk`);
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, `,call addListener`);
119
+ logger.debug(TAG, ',call addListener');
120
120
  }
121
121
 
122
122
  removeListeners(count: number): void {
123
- logger.debug(TAG, `,call removeListeners`);
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.0-beta.0",
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-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",
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
- getCurrentVersionInfo,
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
- ...info,
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/.cursor/mcp.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "mcpServers": {
3
- "RadonAi": {
4
- "url": "http://127.0.0.1:54799/mcp",
5
- "type": "http",
6
- "headers": {
7
- "nonce": "cb2b8be3-7423-4e07-8d04-aaaa9cc3a7e8"
8
- }
9
- }
10
- }
11
- }
package/android/.project DELETED
@@ -1,28 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <projectDescription>
3
- <name>react-native-update</name>
4
- <comment>Project react-native-update created by Buildship.</comment>
5
- <projects>
6
- </projects>
7
- <buildSpec>
8
- <buildCommand>
9
- <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
10
- <arguments>
11
- </arguments>
12
- </buildCommand>
13
- </buildSpec>
14
- <natures>
15
- <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
16
- </natures>
17
- <filteredResources>
18
- <filter>
19
- <id>1727963310481</id>
20
- <name></name>
21
- <type>30</type>
22
- <matcher>
23
- <id>org.eclipse.core.resources.regexFilterMatcher</id>
24
- <arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
25
- </matcher>
26
- </filter>
27
- </filteredResources>
28
- </projectDescription>
@@ -1,34 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <projectDescription>
3
- <name>react-native-update</name>
4
- <comment>Project react-native-update created by Buildship.</comment>
5
- <projects>
6
- </projects>
7
- <buildSpec>
8
- <buildCommand>
9
- <name>org.eclipse.jdt.core.javabuilder</name>
10
- <arguments>
11
- </arguments>
12
- </buildCommand>
13
- <buildCommand>
14
- <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
15
- <arguments>
16
- </arguments>
17
- </buildCommand>
18
- </buildSpec>
19
- <natures>
20
- <nature>org.eclipse.jdt.core.javanature</nature>
21
- <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
22
- </natures>
23
- <filteredResources>
24
- <filter>
25
- <id>1727963310481</id>
26
- <name></name>
27
- <type>30</type>
28
- <matcher>
29
- <id>org.eclipse.core.resources.regexFilterMatcher</id>
30
- <arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
31
- </matcher>
32
- </filter>
33
- </filteredResources>
34
- </projectDescription>
@@ -1,13 +0,0 @@
1
- arguments=--init-script /var/folders/l6/0fn3x28s5s585ld3p04gsy1h0000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/l6/0fn3x28s5s585ld3p04gsy1h0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
2
- auto.sync=false
3
- build.scans.enabled=false
4
- connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.9))
5
- connection.project.dir=
6
- eclipse.preferences.version=1
7
- gradle.user.home=
8
- java.home=/Users/sunny/.sdkman/candidates/java/17.0.9-zulu/zulu-17.jdk/Contents/Home
9
- jvm.arguments=
10
- offline.mode=false
11
- override.workspace.settings=true
12
- show.console.view=true
13
- show.executions.view=true
@@ -1,113 +0,0 @@
1
- #!/bin/bash
2
- progname="${0##*/}"
3
- progname="${progname%.sh}"
4
-
5
- # usage: check_elf_alignment.sh [path to *.so files|path to *.apk]
6
-
7
- cleanup_trap() {
8
- if [ -n "${tmp}" -a -d "${tmp}" ]; then
9
- rm -rf ${tmp}
10
- fi
11
- exit $1
12
- }
13
-
14
- usage() {
15
- echo "Host side script to check the ELF alignment of shared libraries."
16
- echo "Shared libraries are reported ALIGNED when their ELF regions are"
17
- echo "16 KB or 64 KB aligned. Otherwise they are reported as UNALIGNED."
18
- echo
19
- echo "Usage: ${progname} [input-path|input-APK|input-APEX]"
20
- }
21
-
22
- if [ ${#} -ne 1 ]; then
23
- usage
24
- exit
25
- fi
26
-
27
- case ${1} in
28
- --help | -h | -\?)
29
- usage
30
- exit
31
- ;;
32
-
33
- *)
34
- dir="${1}"
35
- ;;
36
- esac
37
-
38
- if ! [ -f "${dir}" -o -d "${dir}" ]; then
39
- echo "Invalid file: ${dir}" >&2
40
- exit 1
41
- fi
42
-
43
- if [[ "${dir}" == *.apk ]]; then
44
- trap 'cleanup_trap' EXIT
45
-
46
- echo
47
- echo "Recursively analyzing $dir"
48
- echo
49
-
50
- if { zipalign --help 2>&1 | grep -q "\-P <pagesize_kb>"; }; then
51
- echo "=== APK zip-alignment ==="
52
- zipalign -v -c -P 16 4 "${dir}" | egrep 'lib/arm64-v8a|lib/x86_64|Verification'
53
- echo "========================="
54
- else
55
- echo "NOTICE: Zip alignment check requires build-tools version 35.0.0-rc3 or higher."
56
- echo " You can install the latest build-tools by running the below command"
57
- echo " and updating your \$PATH:"
58
- echo
59
- echo " sdkmanager \"build-tools;35.0.0-rc3\""
60
- fi
61
-
62
- dir_filename=$(basename "${dir}")
63
- tmp=$(mktemp -d -t "${dir_filename%.apk}_out_XXXXX")
64
- unzip "${dir}" lib/* -d "${tmp}" >/dev/null 2>&1
65
- dir="${tmp}"
66
- fi
67
-
68
- if [[ "${dir}" == *.apex ]]; then
69
- trap 'cleanup_trap' EXIT
70
-
71
- echo
72
- echo "Recursively analyzing $dir"
73
- echo
74
-
75
- dir_filename=$(basename "${dir}")
76
- tmp=$(mktemp -d -t "${dir_filename%.apex}_out_XXXXX")
77
- deapexer extract "${dir}" "${tmp}" || { echo "Failed to deapex." && exit 1; }
78
- dir="${tmp}"
79
- fi
80
-
81
- RED="\e[31m"
82
- GREEN="\e[32m"
83
- ENDCOLOR="\e[0m"
84
-
85
- unaligned_libs=()
86
-
87
- echo
88
- echo "=== ELF alignment ==="
89
-
90
- matches="$(find "${dir}" -type f)"
91
- IFS=$'\n'
92
- for match in $matches; do
93
- # We could recursively call this script or rewrite it to though.
94
- [[ "${match}" == *".apk" ]] && echo "WARNING: doesn't recursively inspect .apk file: ${match}"
95
- [[ "${match}" == *".apex" ]] && echo "WARNING: doesn't recursively inspect .apex file: ${match}"
96
-
97
- [[ $(file "${match}") == *"ELF"* ]] || continue
98
-
99
- res="$(objdump -p "${match}" | grep LOAD | awk '{ print $NF }' | head -1)"
100
- if [[ $res =~ 2\*\*(1[4-9]|[2-9][0-9]|[1-9][0-9]{2,}) ]]; then
101
- echo -e "${match}: ${GREEN}ALIGNED${ENDCOLOR} ($res)"
102
- else
103
- echo -e "${match}: ${RED}UNALIGNED${ENDCOLOR} ($res)"
104
- unaligned_libs+=("${match}")
105
- fi
106
- done
107
-
108
- if [ ${#unaligned_libs[@]} -gt 0 ]; then
109
- echo -e "${RED}Found ${#unaligned_libs[@]} unaligned libs (only arm64-v8a/x86_64 libs need to be aligned).${ENDCOLOR}"
110
- elif [ -n "${dir_filename}" ]; then
111
- echo -e "ELF Verification Successful"
112
- fi
113
- echo "====================="
package/harmony/pushy.har DELETED
Binary file