mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-18 00:46:10 +08:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
261427705c | ||
![]() |
f71419be45 | ||
![]() |
eabacaa1e3 | ||
![]() |
22d80890e2 | ||
![]() |
0df8261acb | ||
![]() |
1578130e17 |
@@ -1,6 +1,7 @@
|
|||||||
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
|
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
export function generatePushyBuildTime(str?: string) {
|
export function generatePushyBuildTime(str?: string) {
|
||||||
return {
|
return {
|
||||||
pluginId: 'PushyBuildTimePlugin',
|
pluginId: 'PushyBuildTimePlugin',
|
||||||
@@ -13,11 +14,22 @@ export function generatePushyBuildTime(str?: string) {
|
|||||||
if (!fs.existsSync(dirPath)) {
|
if (!fs.existsSync(dirPath)) {
|
||||||
fs.mkdirSync(dirPath, { recursive: true });
|
fs.mkdirSync(dirPath, { recursive: true });
|
||||||
}
|
}
|
||||||
|
const moduleJsonPath = path.resolve(__dirname, './oh-package.json5');
|
||||||
|
let versionName = '';
|
||||||
|
if (fs.existsSync(moduleJsonPath)) {
|
||||||
|
const moduleContent = fs.readFileSync(moduleJsonPath, 'utf-8');
|
||||||
|
const versionMatch = moduleContent.match(/"version":\s*"([^"]+)"/);
|
||||||
|
if (versionMatch && versionMatch[1]) {
|
||||||
|
versionName = versionMatch[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
const buildTime = new Date().toISOString();
|
const buildTime = new Date().toISOString();
|
||||||
const metaContent = { pushy_build_time : buildTime };
|
const metaContent = {
|
||||||
|
pushy_build_time: buildTime,
|
||||||
|
versionName: versionName
|
||||||
|
};
|
||||||
fs.writeFileSync(metaFilePath, JSON.stringify(metaContent, null, 4));
|
fs.writeFileSync(metaFilePath, JSON.stringify(metaContent, null, 4));
|
||||||
console.log(`Build time written to ${metaFilePath}`);
|
console.log(`Build time written to ${metaFilePath}`);
|
||||||
|
|
||||||
},
|
},
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
postDependencies: ['default@BuildJS']
|
postDependencies: ['default@BuildJS']
|
||||||
|
@@ -72,8 +72,8 @@ def jscFlavor = 'org.webkit:android-jsc:+'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
ndkVersion rootProject.ext.ndkVersion
|
ndkVersion rootProject.ext.ndkVersion
|
||||||
|
buildToolsVersion rootProject.ext.buildToolsVersion
|
||||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
compileSdk rootProject.ext.compileSdkVersion
|
||||||
|
|
||||||
namespace "com.awesomeproject"
|
namespace "com.awesomeproject"
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
|
@@ -2,12 +2,8 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
tools:targetApi="28"
|
tools:targetApi="28"
|
||||||
tools:ignore="GoogleAppIndexingWarning">
|
tools:ignore="GoogleAppIndexingWarning"/>
|
||||||
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
|
|
||||||
</application>
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
package="com.awesomeproject">
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
@@ -1,32 +0,0 @@
|
|||||||
package com.awesomeproject;
|
|
||||||
|
|
||||||
import com.facebook.react.ReactActivity;
|
|
||||||
import com.facebook.react.ReactActivityDelegate;
|
|
||||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
|
||||||
import com.facebook.react.defaults.DefaultReactActivityDelegate;
|
|
||||||
|
|
||||||
public class MainActivity extends ReactActivity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
||||||
* rendering of the component.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected String getMainComponentName() {
|
|
||||||
return "AwesomeProject";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link
|
|
||||||
* DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React
|
|
||||||
* (aka React 18) with two boolean flags.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected ReactActivityDelegate createReactActivityDelegate() {
|
|
||||||
return new DefaultReactActivityDelegate(
|
|
||||||
this,
|
|
||||||
getMainComponentName(),
|
|
||||||
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
|
|
||||||
DefaultNewArchitectureEntryPoint.getFabricEnabled());
|
|
||||||
}
|
|
||||||
}
|
|
@@ -0,0 +1,22 @@
|
|||||||
|
package com.awesomeproject
|
||||||
|
|
||||||
|
import com.facebook.react.ReactActivity
|
||||||
|
import com.facebook.react.ReactActivityDelegate
|
||||||
|
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
||||||
|
import com.facebook.react.defaults.DefaultReactActivityDelegate
|
||||||
|
|
||||||
|
class MainActivity : ReactActivity() {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
||||||
|
* rendering of the component.
|
||||||
|
*/
|
||||||
|
override fun getMainComponentName(): String = "AwesomeProject"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
|
||||||
|
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
|
||||||
|
*/
|
||||||
|
override fun createReactActivityDelegate(): ReactActivityDelegate =
|
||||||
|
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
|
||||||
|
}
|
@@ -1,69 +0,0 @@
|
|||||||
package com.awesomeproject;
|
|
||||||
|
|
||||||
import android.app.Application;
|
|
||||||
import com.facebook.react.PackageList;
|
|
||||||
import com.facebook.react.ReactApplication;
|
|
||||||
import com.facebook.react.ReactNativeHost;
|
|
||||||
import com.facebook.react.ReactPackage;
|
|
||||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
|
||||||
import com.facebook.react.defaults.DefaultReactNativeHost;
|
|
||||||
import com.facebook.soloader.SoLoader;
|
|
||||||
import java.util.List;
|
|
||||||
import cn.reactnative.modules.update.UpdateContext;
|
|
||||||
|
|
||||||
public class MainApplication extends Application implements ReactApplication {
|
|
||||||
|
|
||||||
private final ReactNativeHost mReactNativeHost =
|
|
||||||
new DefaultReactNativeHost(this) {
|
|
||||||
@Override
|
|
||||||
public boolean getUseDeveloperSupport() {
|
|
||||||
return BuildConfig.DEBUG;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getJSBundleFile() {
|
|
||||||
return UpdateContext.getBundleUrl(MainApplication.this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected List<ReactPackage> getPackages() {
|
|
||||||
@SuppressWarnings("UnnecessaryLocalVariable")
|
|
||||||
List<ReactPackage> packages = new PackageList(this).getPackages();
|
|
||||||
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
||||||
// packages.add(new MyReactNativePackage());
|
|
||||||
return packages;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean isNewArchEnabled() {
|
|
||||||
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Boolean isHermesEnabled() {
|
|
||||||
return BuildConfig.IS_HERMES_ENABLED;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getJSMainModuleName() {
|
|
||||||
return "index";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReactNativeHost getReactNativeHost() {
|
|
||||||
return mReactNativeHost;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate() {
|
|
||||||
super.onCreate();
|
|
||||||
SoLoader.init(this, /* native exopackage */ false);
|
|
||||||
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
||||||
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
|
||||||
DefaultNewArchitectureEntryPoint.load();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -0,0 +1,48 @@
|
|||||||
|
package com.awesomeproject
|
||||||
|
|
||||||
|
import android.app.Application
|
||||||
|
import cn.reactnative.modules.update.UpdateContext
|
||||||
|
import com.facebook.react.PackageList
|
||||||
|
import com.facebook.react.ReactApplication
|
||||||
|
import com.facebook.react.ReactHost
|
||||||
|
import com.facebook.react.ReactNativeHost
|
||||||
|
import com.facebook.react.ReactPackage
|
||||||
|
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
|
||||||
|
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
|
||||||
|
import com.facebook.react.defaults.DefaultReactNativeHost
|
||||||
|
import com.facebook.react.soloader.OpenSourceMergedSoMapping
|
||||||
|
import com.facebook.soloader.SoLoader
|
||||||
|
|
||||||
|
class MainApplication : Application(), ReactApplication {
|
||||||
|
|
||||||
|
override val reactNativeHost: ReactNativeHost =
|
||||||
|
object : DefaultReactNativeHost(this) {
|
||||||
|
|
||||||
|
override fun getJSBundleFile(): String? = UpdateContext.getBundleUrl(this@MainApplication)
|
||||||
|
|
||||||
|
override fun getPackages(): List<ReactPackage> =
|
||||||
|
PackageList(this).packages.apply {
|
||||||
|
// Packages that cannot be autolinked yet can be added manually here, for example:
|
||||||
|
// add(MyReactNativePackage())
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getJSMainModuleName(): String = "index"
|
||||||
|
|
||||||
|
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
|
||||||
|
|
||||||
|
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
||||||
|
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
|
||||||
|
}
|
||||||
|
|
||||||
|
override val reactHost: ReactHost
|
||||||
|
get() = getDefaultReactHost(applicationContext, reactNativeHost)
|
||||||
|
|
||||||
|
override fun onCreate() {
|
||||||
|
super.onCreate()
|
||||||
|
SoLoader.init(this, OpenSourceMergedSoMapping)
|
||||||
|
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
||||||
|
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
||||||
|
load()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,6 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@@ -2,6 +2,5 @@ pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
|
|||||||
plugins { id("com.facebook.react.settings") }
|
plugins { id("com.facebook.react.settings") }
|
||||||
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
|
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
|
||||||
rootProject.name = 'AwesomeProject'
|
rootProject.name = 'AwesomeProject'
|
||||||
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
|
|
||||||
include ':app'
|
include ':app'
|
||||||
includeBuild('../node_modules/@react-native/gradle-plugin')
|
includeBuild('../node_modules/@react-native/gradle-plugin')
|
||||||
|
376
Example/testHotUpdate/bun.lock
Executable file → Normal file
376
Example/testHotUpdate/bun.lock
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -18,37 +18,40 @@
|
|||||||
"patch-package": "^8.0.0",
|
"patch-package": "^8.0.0",
|
||||||
"postinstall-postinstall": "^2.1.0",
|
"postinstall-postinstall": "^2.1.0",
|
||||||
"react": "18.3.1",
|
"react": "18.3.1",
|
||||||
"react-native": "0.76.3",
|
"react-native": "0.76.6",
|
||||||
"react-native-camera-kit": "^14.1.0",
|
"react-native-camera-kit": "^14.1.0",
|
||||||
"react-native-paper": "^5.12.5",
|
"react-native-paper": "^5.13.1",
|
||||||
"react-native-safe-area-context": "^4.14.0",
|
"react-native-safe-area-context": "^5.1.0",
|
||||||
"react-native-update": "^10.17.1",
|
"react-native-update": "^10.19.6",
|
||||||
"react-native-vector-icons": "^10.2.0"
|
"react-native-vector-icons": "^10.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.26.0",
|
"@babel/core": "^7.26.0",
|
||||||
"@babel/preset-env": "^7.26.0",
|
"@babel/preset-env": "^7.26.0",
|
||||||
"@babel/runtime": "^7.26.0",
|
"@babel/runtime": "^7.26.0",
|
||||||
"@react-native-community/cli": "15.0.0-alpha.2",
|
"@react-native-community/cli": "15.0.1",
|
||||||
"@react-native-community/cli-platform-android": "15.0.0-alpha.2",
|
"@react-native-community/cli-platform-android": "15.0.1",
|
||||||
"@react-native-community/cli-platform-ios": "15.0.0-alpha.2",
|
"@react-native-community/cli-platform-ios": "15.0.1",
|
||||||
"@react-native/babel-preset": "0.76.3",
|
"@react-native/babel-preset": "0.76.6",
|
||||||
"@react-native/eslint-config": "0.76.3",
|
"@react-native/eslint-config": "0.76.6",
|
||||||
"@react-native/metro-config": "0.76.3",
|
"@react-native/metro-config": "0.76.6",
|
||||||
"@react-native/typescript-config": "0.76.3",
|
"@react-native/typescript-config": "0.76.6",
|
||||||
"@types/react": "^18.2.6",
|
"@types/react": "^18.2.6",
|
||||||
"@types/react-test-renderer": "^18.0.0",
|
"@types/react-test-renderer": "^18.0.0",
|
||||||
"babel-jest": "^29.6.3",
|
"babel-jest": "^29.6.3",
|
||||||
|
"detox": "^20.32.0",
|
||||||
"eslint": "^8.19.0",
|
"eslint": "^8.19.0",
|
||||||
"jest": "^29.6.3",
|
"jest": "^29.6.3",
|
||||||
"prettier": "2.8.8",
|
"prettier": "2.8.8",
|
||||||
"react-test-renderer": "18.3.1",
|
"react-test-renderer": "18.3.1",
|
||||||
"typescript": "5.7.2"
|
"typescript": "5.7.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16"
|
"node": ">=18"
|
||||||
},
|
},
|
||||||
"trustedDependencies": [
|
"trustedDependencies": [
|
||||||
|
"detox",
|
||||||
|
"dtrace-provider",
|
||||||
"postinstall-postinstall"
|
"postinstall-postinstall"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,10 @@ package cn.reactnative.modules.update;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.facebook.react.ReactActivity;
|
||||||
import com.facebook.react.ReactApplication;
|
import com.facebook.react.ReactApplication;
|
||||||
|
import com.facebook.react.ReactDelegate;
|
||||||
import com.facebook.react.ReactInstanceManager;
|
import com.facebook.react.ReactInstanceManager;
|
||||||
import com.facebook.react.bridge.JSBundleLoader;
|
import com.facebook.react.bridge.JSBundleLoader;
|
||||||
import com.facebook.react.bridge.Promise;
|
import com.facebook.react.bridge.Promise;
|
||||||
@@ -12,16 +15,10 @@ import com.facebook.react.bridge.ReadableMap;
|
|||||||
import com.facebook.react.bridge.UiThreadUtil;
|
import com.facebook.react.bridge.UiThreadUtil;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
public class UpdateModuleImpl {
|
public class UpdateModuleImpl {
|
||||||
|
|
||||||
@@ -105,20 +102,6 @@ public class UpdateModuleImpl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadBundleLegacy() {
|
|
||||||
final Activity currentActivity = mContext.getCurrentActivity();
|
|
||||||
if (currentActivity == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
currentActivity.runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
currentActivity.recreate();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void reloadUpdate(UpdateContext updateContext, ReactApplicationContext mContext, ReadableMap options, Promise promise) {
|
public static void reloadUpdate(UpdateContext updateContext, ReactApplicationContext mContext, ReadableMap options, Promise promise) {
|
||||||
final String hash = options.getString("hash");
|
final String hash = options.getString("hash");
|
||||||
|
|
||||||
@@ -156,7 +139,21 @@ public class UpdateModuleImpl {
|
|||||||
} catch (Throwable err) {
|
} catch (Throwable err) {
|
||||||
promise.reject(err);
|
promise.reject(err);
|
||||||
Log.e("pushy", "switchVersion failed ", err);
|
Log.e("pushy", "switchVersion failed ", err);
|
||||||
loadBundleLegacy();
|
final Activity currentActivity = mContext.getCurrentActivity();
|
||||||
|
if (currentActivity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
final ReactDelegate reactDelegate = ((ReactActivity) currentActivity).getReactDelegate();
|
||||||
|
reactDelegate.reload();
|
||||||
|
} catch (Throwable e) {
|
||||||
|
currentActivity.runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
currentActivity.recreate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -9,9 +9,6 @@ import com.facebook.react.module.model.ReactModuleInfoProvider;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by tdzl2003 on 3/31/16.
|
|
||||||
*/
|
|
||||||
public class UpdatePackage extends TurboReactPackage {
|
public class UpdatePackage extends TurboReactPackage {
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
@@ -25,7 +22,9 @@ public class UpdatePackage extends TurboReactPackage {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ReactModuleInfoProvider getReactModuleInfoProvider() {
|
public ReactModuleInfoProvider getReactModuleInfoProvider() {
|
||||||
return () -> {
|
return new ReactModuleInfoProvider() {
|
||||||
|
@Override
|
||||||
|
public Map<String, ReactModuleInfo> getReactModuleInfos() {
|
||||||
final Map<String, ReactModuleInfo> moduleInfos = new HashMap<>();
|
final Map<String, ReactModuleInfo> moduleInfos = new HashMap<>();
|
||||||
boolean isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
boolean isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
||||||
moduleInfos.put(
|
moduleInfos.put(
|
||||||
@@ -40,6 +39,7 @@ public class UpdatePackage extends TurboReactPackage {
|
|||||||
isTurboModule // isTurboModule
|
isTurboModule // isTurboModule
|
||||||
));
|
));
|
||||||
return moduleInfos;
|
return moduleInfos;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,7 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.facebook.react.ReactApplication;
|
import com.facebook.react.ReactApplication;
|
||||||
import com.facebook.react.ReactInstanceManager;
|
import com.facebook.react.ReactInstanceManager;
|
||||||
import com.facebook.react.bridge.LifecycleEventListener;
|
// import com.facebook.react.bridge.LifecycleEventListener;
|
||||||
import com.facebook.react.bridge.Promise;
|
import com.facebook.react.bridge.Promise;
|
||||||
import com.facebook.react.bridge.ReactApplicationContext;
|
import com.facebook.react.bridge.ReactApplicationContext;
|
||||||
import com.facebook.react.bridge.ReactContext;
|
import com.facebook.react.bridge.ReactContext;
|
||||||
@@ -32,7 +32,7 @@ import static androidx.core.content.FileProvider.getUriForFile;
|
|||||||
public class UpdateModule extends ReactContextBaseJavaModule {
|
public class UpdateModule extends ReactContextBaseJavaModule {
|
||||||
UpdateContext updateContext;
|
UpdateContext updateContext;
|
||||||
public static ReactApplicationContext mContext;
|
public static ReactApplicationContext mContext;
|
||||||
private LifecycleEventListener mLifecycleEventListener = null;
|
// private LifecycleEventListener mLifecycleEventListener = null;
|
||||||
|
|
||||||
public UpdateModule(ReactApplicationContext reactContext, UpdateContext updateContext) {
|
public UpdateModule(ReactApplicationContext reactContext, UpdateContext updateContext) {
|
||||||
super(reactContext);
|
super(reactContext);
|
||||||
@@ -171,7 +171,7 @@ public class UpdateModule extends ReactContextBaseJavaModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadBundleLegacy() {
|
private void loadBundleLegacy() {
|
||||||
final Activity currentActivity = mContext.getCurrentActivity();
|
final Activity currentActivity = getCurrentActivity();
|
||||||
if (currentActivity == null) {
|
if (currentActivity == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-native-update",
|
"name": "react-native-update",
|
||||||
"version": "10.19.4",
|
"version": "10.20.0",
|
||||||
"description": "react-native hot update",
|
"description": "react-native hot update",
|
||||||
"main": "src/index",
|
"main": "src/index",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Reference in New Issue
Block a user