mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-10-23 17:48:55 +08:00
Update .gitignore to exclude new harmony package files, remove submodule entries from .gitmodules, and increment version in package.json to 10.34.1. Refactor build-profile.json5 for consistency and update PushyFileJSBundleProvider to handle optional chaining. Remove obsolete pushy.har file and adjust dependencies in oh-package.json5 for clarity.
This commit is contained in:
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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user