mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-11-22 23:46:10 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c768705221 | ||
|
|
57206dd2f1 | ||
|
|
4e27d906c3 | ||
|
|
c24f469475 | ||
|
|
8f8a29eda8 | ||
|
|
a78542b214 | ||
|
|
8d9ae57a5f | ||
|
|
2502935fc0 | ||
|
|
8e6d9bf460 | ||
|
|
897f334343 |
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
|
||||
|
||||
@@ -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. */,
|
||||
};
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -25,6 +25,7 @@ import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Iterator;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.CRC32;
|
||||
import java.util.HashMap;
|
||||
|
||||
import okio.BufferedSink;
|
||||
@@ -100,7 +101,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
||||
if (UpdateContext.DEBUG) {
|
||||
Log.d("react-native-update", "Progress " + received + "/" + contentLength);
|
||||
}
|
||||
|
||||
|
||||
int percentage = (int)(received * 100.0 / contentLength + 0.5);
|
||||
if (percentage > currentPercentage) {
|
||||
currentPercentage = percentage;
|
||||
@@ -198,6 +199,10 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
||||
return fout.toByteArray();
|
||||
}
|
||||
|
||||
private String getCRC32AsDecimal(long crc32Value) {
|
||||
return String.valueOf(crc32Value & 0xFFFFFFFFL);
|
||||
}
|
||||
|
||||
private void copyFilesWithBlacklist(String current, File from, File to, JSONObject blackList) throws IOException {
|
||||
File[] files = from.listFiles();
|
||||
for (File file : files) {
|
||||
@@ -273,12 +278,41 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
||||
zipFile.close();
|
||||
}
|
||||
|
||||
private void copyFromResourceV2(HashMap<String, ArrayList<File>> resToCopy2) throws IOException {
|
||||
SafeZipFile zipFile = new SafeZipFile(new File(context.getPackageResourcePath()));
|
||||
Enumeration<? extends ZipEntry> entries = zipFile.entries();
|
||||
while (entries.hasMoreElements()) {
|
||||
ZipEntry ze = entries.nextElement();
|
||||
String fn = ze.getName();
|
||||
long zipCrc32 = ze.getCrc();
|
||||
String crc32Decimal = getCRC32AsDecimal(zipCrc32);
|
||||
ArrayList<File> targets = resToCopy2.get(crc32Decimal);
|
||||
if (targets != null) {
|
||||
File lastTarget = null;
|
||||
for (File target: targets) {
|
||||
if (UpdateContext.DEBUG) {
|
||||
Log.d("react-native-update", "Copying from resource " + fn + " to " + target);
|
||||
}
|
||||
if (lastTarget != null) {
|
||||
copyFile(lastTarget, target);
|
||||
} else {
|
||||
zipFile.unzipToFile(ze, target);
|
||||
lastTarget = target;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
zipFile.close();
|
||||
}
|
||||
|
||||
private void doPatchFromApk(DownloadTaskParams param) throws IOException, JSONException {
|
||||
downloadFile(param);
|
||||
|
||||
removeDirectory(param.unzipDirectory);
|
||||
param.unzipDirectory.mkdirs();
|
||||
HashMap<String, ArrayList<File>> copyList = new HashMap<String, ArrayList<File>>();
|
||||
HashMap<String, ArrayList<File>> copiesv2List = new HashMap<String, ArrayList<File>>();
|
||||
Boolean isV2 = false;
|
||||
|
||||
boolean foundDiff = false;
|
||||
boolean foundBundlePatch = false;
|
||||
@@ -297,29 +331,58 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
||||
JSONObject obj = (JSONObject)new JSONTokener(json).nextValue();
|
||||
|
||||
JSONObject copies = obj.getJSONObject("copies");
|
||||
JSONObject copiesv2 = obj.getJSONObject("copiesv2");
|
||||
Iterator<?> keys = copies.keys();
|
||||
while( keys.hasNext() ) {
|
||||
String to = (String)keys.next();
|
||||
String from = copies.getString(to);
|
||||
if (from.isEmpty()) {
|
||||
from = to;
|
||||
}
|
||||
ArrayList<File> target = null;
|
||||
if (!copyList.containsKey(from)) {
|
||||
target = new ArrayList<File>();
|
||||
copyList.put(from, target);
|
||||
} else {
|
||||
target = copyList.get((from));
|
||||
}
|
||||
File toFile = new File(param.unzipDirectory, to);
|
||||
Iterator<?> keysV2 = copiesv2.keys();
|
||||
if(keysV2.hasNext()){
|
||||
isV2 = true;
|
||||
while( keysV2.hasNext() ) {
|
||||
String from = (String)keysV2.next();
|
||||
String to = copiesv2.getString(from);
|
||||
if (from.isEmpty()) {
|
||||
from = to;
|
||||
}
|
||||
ArrayList<File> target = null;
|
||||
if (!copiesv2List.containsKey(from)) {
|
||||
target = new ArrayList<File>();
|
||||
copiesv2List.put(from, target);
|
||||
} else {
|
||||
target = copiesv2List.get((from));
|
||||
}
|
||||
File toFile = new File(param.unzipDirectory, to);
|
||||
|
||||
// Fixing a Zip Path Traversal Vulnerability
|
||||
// https://support.google.com/faqs/answer/9294009
|
||||
String canonicalPath = toFile.getCanonicalPath();
|
||||
if (!canonicalPath.startsWith(param.unzipDirectory.getCanonicalPath() + File.separator)) {
|
||||
throw new SecurityException("Illegal name: " + to);
|
||||
// Fixing a Zip Path Traversal Vulnerability
|
||||
// https://support.google.com/faqs/answer/9294009
|
||||
String canonicalPath = toFile.getCanonicalPath();
|
||||
if (!canonicalPath.startsWith(param.unzipDirectory.getCanonicalPath() + File.separator)) {
|
||||
throw new SecurityException("Illegal name: " + to);
|
||||
}
|
||||
target.add(toFile);
|
||||
}
|
||||
}else{
|
||||
while( keys.hasNext() ) {
|
||||
String to = (String)keys.next();
|
||||
String from = copies.getString(to);
|
||||
if (from.isEmpty()) {
|
||||
from = to;
|
||||
}
|
||||
ArrayList<File> target = null;
|
||||
if (!copyList.containsKey(from)) {
|
||||
target = new ArrayList<File>();
|
||||
copyList.put(from, target);
|
||||
} else {
|
||||
target = copyList.get((from));
|
||||
}
|
||||
File toFile = new File(param.unzipDirectory, to);
|
||||
|
||||
// Fixing a Zip Path Traversal Vulnerability
|
||||
// https://support.google.com/faqs/answer/9294009
|
||||
String canonicalPath = toFile.getCanonicalPath();
|
||||
if (!canonicalPath.startsWith(param.unzipDirectory.getCanonicalPath() + File.separator)) {
|
||||
throw new SecurityException("Illegal name: " + to);
|
||||
}
|
||||
target.add(toFile);
|
||||
}
|
||||
target.add(toFile);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -348,7 +411,11 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
||||
throw new Error("bundle patch not found");
|
||||
}
|
||||
|
||||
copyFromResource(copyList);
|
||||
if(isV2){
|
||||
copyFromResourceV2(copiesv2List);
|
||||
}else{
|
||||
copyFromResource(copyList);
|
||||
}
|
||||
|
||||
if (UpdateContext.DEBUG) {
|
||||
Log.d("react-native-update", "Unzip finished");
|
||||
|
||||
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
Symbolic link
1
harmony/pushy/src/main/cpp/HDiffPatch
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../../android/jni/HDiffPatch
|
||||
1
harmony/pushy/src/main/cpp/lzma
Symbolic link
1
harmony/pushy/src/main/cpp/lzma
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../../android/jni/lzma
|
||||
@@ -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,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-update",
|
||||
"version": "10.32.0",
|
||||
"version": "10.34.2",
|
||||
"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/20.1.5948944/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",
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
buildTime,
|
||||
cInfo,
|
||||
currentVersion,
|
||||
getCurrentVersionInfo,
|
||||
currentVersionInfo,
|
||||
isFirstTime,
|
||||
isRolledBack,
|
||||
packageVersion,
|
||||
@@ -163,7 +163,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 +174,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) {
|
||||
|
||||
Reference in New Issue
Block a user