|
| 1 | +diff --git a/node_modules/nodejs-mobile-react-native/android/src/main/java/com/janeasystems/rn_nodejs_mobile/RNNodeJsMobileModule.java b/node_modules/nodejs-mobile-react-native/android/src/main/java/com/janeasystems/rn_nodejs_mobile/RNNodeJsMobileModule.java |
| 2 | +index e882a0c..02616d0 100644 |
| 3 | +--- a/node_modules/nodejs-mobile-react-native/android/src/main/java/com/janeasystems/rn_nodejs_mobile/RNNodeJsMobileModule.java |
| 4 | ++++ b/node_modules/nodejs-mobile-react-native/android/src/main/java/com/janeasystems/rn_nodejs_mobile/RNNodeJsMobileModule.java |
| 5 | +@@ -32,6 +32,7 @@ public class RNNodeJsMobileModule extends ReactContextBaseJavaModule implements |
| 6 | + private final ReactApplicationContext reactContext; |
| 7 | + private static final String TAG = "NODEJS-RN"; |
| 8 | + private static final String NODEJS_PROJECT_DIR = "nodejs-project"; |
| 9 | ++ private static final String NODEJS_ASSETS_DIR = "nodejs-assets"; |
| 10 | + private static final String NODEJS_BUILTIN_MODULES = "nodejs-builtin_modules"; |
| 11 | + private static final String TRASH_DIR = "nodejs-project-trash"; |
| 12 | + private static final String SHARED_PREFS = "NODEJS_MOBILE_PREFS"; |
| 13 | +@@ -42,6 +43,7 @@ public class RNNodeJsMobileModule extends ReactContextBaseJavaModule implements |
| 14 | + private static String trashDirPath; |
| 15 | + private static String filesDirPath; |
| 16 | + private static String nodeJsProjectPath; |
| 17 | ++ private static String nodeJsAssetsPath; |
| 18 | + private static String builtinModulesPath; |
| 19 | + private static String nativeAssetsPath; |
| 20 | + |
| 21 | +@@ -74,6 +76,7 @@ public class RNNodeJsMobileModule extends ReactContextBaseJavaModule implements |
| 22 | + |
| 23 | + // The paths where we expect the node project assets to be at runtime. |
| 24 | + nodeJsProjectPath = filesDirPath + "/" + NODEJS_PROJECT_DIR; |
| 25 | ++ nodeJsAssetsPath = filesDirPath + "/" + NODEJS_ASSETS_DIR; |
| 26 | + builtinModulesPath = filesDirPath + "/" + NODEJS_BUILTIN_MODULES; |
| 27 | + trashDirPath = filesDirPath + "/" + TRASH_DIR; |
| 28 | + nativeAssetsPath = BUILTIN_NATIVE_ASSETS_PREFIX + getCurrentABIName(); |
| 29 | +@@ -387,6 +390,9 @@ public class RNNodeJsMobileModule extends ReactContextBaseJavaModule implements |
| 30 | + // Copy the nodejs built-in modules to the application's data path. |
| 31 | + copyAssetFolder("builtin_modules", builtinModulesPath); |
| 32 | + |
| 33 | ++ // Copy nodejs assets (e.g. presets) which can vary between variants |
| 34 | ++ copyAssetFolder("nodejs-assets", nodeJsAssetsPath); |
| 35 | ++ |
| 36 | + saveLastUpdateTime(); |
| 37 | + Log.d(TAG, "Node assets copy completed successfully"); |
| 38 | + } |
0 commit comments