You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ky...@apache.org on 2019/07/17 03:19:26 UTC
[incubator-weex] branch master updated: [Android] Update for
libweexjsb path (#2712)
This is an automated email from the ASF dual-hosted git repository.
kyork pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git
The following commit(s) were added to refs/heads/master by this push:
new 57bd65c [Android] Update for libweexjsb path (#2712)
57bd65c is described below
commit 57bd65c64600a9e1d8ffd2fca23156f22a3605ae
Author: darin <dy...@qq.com>
AuthorDate: Wed Jul 17 11:19:21 2019 +0800
[Android] Update for libweexjsb path (#2712)
---
.../main/java/com/taobao/weex/WXEnvironment.java | 116 +++++++++++-
.../com/taobao/weex/bridge/WXBridgeManager.java | 1 +
.../main/java/com/taobao/weex/bridge/WXParams.java | 11 ++
.../com/taobao/weex/utils/WXSoInstallMgrSdk.java | 202 +++++++++------------
.../android/multiprocess/weex_js_connection.cpp | 4 +-
weex_core/Source/android/utils/params_utils.cpp | 14 ++
weex_core/Source/android/utils/so_utils.cpp | 1 +
weex_core/Source/android/utils/so_utils.h | 7 +
8 files changed, 227 insertions(+), 129 deletions(-)
diff --git a/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java b/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
index 2ed60bd..cac4e2c 100644
--- a/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
+++ b/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
@@ -20,6 +20,7 @@ package com.taobao.weex;
import android.app.Application;
import android.content.Context;
+import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
@@ -27,6 +28,7 @@ import android.graphics.Typeface;
import android.os.Environment;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
+import android.util.Log;
import com.taobao.weex.common.WXConfig;
import com.taobao.weex.utils.FontDO;
@@ -49,6 +51,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import static android.content.Context.MODE_PRIVATE;
+
public class WXEnvironment {
public static final String OS = "android";
@@ -132,11 +136,6 @@ public class WXEnvironment {
public static final String CORE_JSB_SO_NAME = "weexjsb";
public static final String CORE_JST_SO_NAME = "weexjst";
public static final String CORE_JSC_SO_NAME = "JavaScriptCore";
- /**
- * this marked jsb.so's version, Change this if we want to update jsb.so
- */
- public static final int CORE_JSB_SO_VERSION = 1;
-
private static String CORE_JSS_SO_PATH = null;
public static String CORE_JSS_RUNTIME_SO_PATH = null;
@@ -145,8 +144,11 @@ public class WXEnvironment {
private static String CORE_JSC_SO_PATH = null;
- private static String LIB_LD_PATH = null;
+ public static String CORE_JSB_SO_PATH = null;
+ private static String COPY_SO_DES_DIR = null;
+
+ private static String LIB_LD_PATH = null;
private static Map<String, String> options = new ConcurrentHashMap<>();
static {
@@ -154,6 +156,34 @@ public class WXEnvironment {
options.put(WXConfig.osName, OS);
}
+
+ public static synchronized WXDefaultSettings getWXDefaultSettings() {
+ if (mWXDefaultSettings == null && getApplication() != null) {
+ mWXDefaultSettings = new WXDefaultSettings(getApplication());
+ }
+ return mWXDefaultSettings;
+ }
+
+ public static synchronized String getDefaultSettingValue(String key, String defaultValue) {
+ WXDefaultSettings wxDefaultSettings = getWXDefaultSettings();
+ if (wxDefaultSettings == null || TextUtils.isEmpty(key)) {
+ return defaultValue;
+ }
+ return wxDefaultSettings.getValue(key, defaultValue);
+ }
+
+ public static synchronized void writeDefaultSettingsValue(String key, String value) {
+ WXDefaultSettings wxDefaultSettings = getWXDefaultSettings();
+ if (wxDefaultSettings == null
+ || TextUtils.isEmpty(key)
+ || TextUtils.isEmpty(value)) {
+ return;
+ }
+ wxDefaultSettings.saveValue(key, value);
+ }
+
+ private static WXDefaultSettings mWXDefaultSettings;
+
/**
* dynamic
*/
@@ -200,7 +230,7 @@ public class WXEnvironment {
/**
* Get the version of the current app.
*/
- private static String getAppVersionName() {
+ public static String getAppVersionName() {
String versionName = "";
PackageManager manager;
PackageInfo info = null;
@@ -247,6 +277,39 @@ public class WXEnvironment {
return options.get(key);
}
+
+ public static String copySoDesDir() {
+ try {
+ if (TextUtils.isEmpty(COPY_SO_DES_DIR)) {
+ if (sApplication == null) {
+ WXLogUtils.e("sApplication is null, so copy path will be null");
+ return null;
+ }
+
+ String dirName = "/cache/weex/libs";
+ File desDir = null;
+ String cachePath = WXEnvironment.getApplication().getApplicationContext().getCacheDir().getPath();
+
+ if (TextUtils.isEmpty(cachePath)) {
+ desDir = new File(cachePath, dirName);
+ } else {
+ String pkgName = sApplication.getPackageName();
+ String toPath = "/data/data/" + pkgName + dirName;
+ desDir = new File(toPath);
+ }
+
+ if (!desDir.exists()) {
+ desDir.mkdirs();
+ }
+ COPY_SO_DES_DIR = desDir.getAbsolutePath();
+ }
+ } catch (Throwable e) {
+ WXLogUtils.e(WXLogUtils.getStackTrace(e));
+ }
+ return COPY_SO_DES_DIR;
+
+ }
+
@Deprecated
/**
* Use {@link #isHardwareSupport()} if you want to see whether current hardware support Weex.
@@ -439,10 +502,10 @@ public class WXEnvironment {
public static boolean extractSo() {
File sourceFile = new File(getApplication().getApplicationContext().getApplicationInfo().sourceDir);
- final String cacheDir = getCacheDir();
- if (sourceFile.exists() && !TextUtils.isEmpty(cacheDir)) {
+ final String soDesPath = copySoDesDir();
+ if (sourceFile.exists() && !TextUtils.isEmpty(soDesPath)) {
try {
- WXFileUtils.extractSo(sourceFile.getAbsolutePath(), cacheDir);
+ WXFileUtils.extractSo(sourceFile.getAbsolutePath(), soDesPath);
} catch (IOException e) {
WXLogUtils.e("extractSo error " + e.getMessage());
// e.printStackTrace();
@@ -583,4 +646,37 @@ public class WXEnvironment {
WXLogUtils.e("getLibLdPath is " + LIB_LD_PATH);
return LIB_LD_PATH;
}
+
+ public static class WXDefaultSettings {
+ private String configName = "weex_default_settings";
+ private SharedPreferences sharedPreferences = null;
+ public WXDefaultSettings(Application application) {
+ if(application != null) {
+ sharedPreferences = application.getSharedPreferences(configName, MODE_PRIVATE);
+ }
+ }
+
+ public synchronized String getValue(String key, String defaultValue) {
+ if(sharedPreferences == null || TextUtils.isEmpty(key)) {
+ WXLogUtils.i("get default settings " + key + " return default value :" + defaultValue);
+ return defaultValue;
+ }
+
+ String result = sharedPreferences.getString(key, defaultValue);
+ WXLogUtils.i("get default settings " + key + " : " + result);
+ return result;
+ }
+
+ public synchronized void saveValue(String key, String value) {
+ if (sharedPreferences == null
+ || TextUtils.isEmpty(key)
+ || TextUtils.isEmpty(value)) {
+ return;
+ }
+ WXLogUtils.i("save default settings " + key + ":" + value);
+ SharedPreferences.Editor editor = sharedPreferences.edit();
+ editor.putString(key, value);
+ editor.apply();
+ }
+ }
}
diff --git a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
index 758d4d1..3ffe7ab 100644
--- a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
+++ b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
@@ -2166,6 +2166,7 @@ public class WXBridgeManager implements Callback, BactchExecutor {
wxParams.setLayoutDirection(config.get(WXConfig.layoutDirection));
wxParams.setUseSingleProcess(isUseSingleProcess ? "true" : "false");
wxParams.setCrashFilePath(WXEnvironment.getCrashFilePath(WXEnvironment.getApplication().getApplicationContext()));
+ wxParams.setLibJsbPath(WXEnvironment.CORE_JSB_SO_PATH);
wxParams.setLibJssPath(WXEnvironment.getLibJssRealPath());
wxParams.setLibIcuPath(WXEnvironment.getLibJssIcuPath());
wxParams.setLibLdPath(WXEnvironment.getLibLdPath());
diff --git a/android/sdk/src/main/java/com/taobao/weex/bridge/WXParams.java b/android/sdk/src/main/java/com/taobao/weex/bridge/WXParams.java
index 9b2ad2a..2898f13 100644
--- a/android/sdk/src/main/java/com/taobao/weex/bridge/WXParams.java
+++ b/android/sdk/src/main/java/com/taobao/weex/bridge/WXParams.java
@@ -48,6 +48,7 @@ public class WXParams implements Serializable {
private String libJscPath;
private String libIcuPath;
private String libLdPath;
+ private String libJsbPath;
private Map<String, String> options;
@@ -215,6 +216,16 @@ public class WXParams implements Serializable {
}
@CalledByNative
+ public String getLibJsbPath() {
+ WXLogUtils.e("getLibJsbPath is running " + libJsbPath);
+ return libJsbPath;
+ }
+
+ public void setLibJsbPath(String libJsbPath) {
+ this.libJsbPath = libJsbPath;
+ }
+
+ @CalledByNative
public String getLibJscPath() {
WXLogUtils.e("getLibJscPath is running " + libJscPath);
return libJscPath;
diff --git a/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java b/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java
index 1fc329a..7edb3f8 100644
--- a/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java
+++ b/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java
@@ -76,11 +76,12 @@ public class WXSoInstallMgrSdk {
private final static String STARTUPSO = "/libweexjsb.so";
private final static String STARTUPSOANDROID15 = "/libweexjst.so";
-
static Context mContext = null;
private static IWXSoLoaderAdapter mSoLoader = null;
private static IWXStatisticsListener mStatisticsListener = null;
+ private static String mAbi = null;
+
public static void init(Context c,
IWXSoLoaderAdapter loader,
IWXStatisticsListener listener) {
@@ -121,10 +122,12 @@ public class WXSoInstallMgrSdk {
}
// copy startup so
- copyStartUpSo();
+ if (WXEnvironment.CORE_SO_NAME.equals(libName)) {
+ copyStartUpSo();
+ }
+
boolean InitSuc = false;
-// if (checkSoIsValid(libName, BuildConfig.ARMEABI_Size) ||checkSoIsValid(libName, BuildConfig.X86_Size)) {
try {
// If a library loader adapter exists, use this adapter to load library
// instead of System.loadLibrary.
@@ -162,7 +165,7 @@ public class WXSoInstallMgrSdk {
if (cpuType.contains(ARMEABI) || cpuType.contains(X86)) {
WXExceptionUtils.commitCriticalExceptionRT(null,
WXErrorCode.WX_KEY_EXCEPTION_SDK_INIT,
- "initSo", "[WX_KEY_EXCEPTION_SDK_INIT_CPU_NOT_SUPPORT] for android cpuType is " +cpuType +
+ "initSo", libName + "[WX_KEY_EXCEPTION_SDK_INIT_CPU_NOT_SUPPORT] for android cpuType is " +cpuType +
"\n Detail Error is: " +e2.getMessage(),
null);
}
@@ -208,110 +211,80 @@ public class WXSoInstallMgrSdk {
return InitSuc;
}
+ private static File _desSoCopyFile(String soName) {
+ String cpuType = _cpuType();
+ String copyPath = WXEnvironment.copySoDesDir();
+ if (TextUtils.isEmpty(copyPath)) {
+ return null;
+ }
+ File desDir = new File(copyPath, soName + "/" + cpuType);
+ return desDir;
+ }
+
/**
* copyStartUpSo
*/
public static void copyStartUpSo() {
try {
- boolean installOnSdcard = true;
+ // copy libjsb.so to cache/weex/jsb/cputype
String pkgName = WXEnvironment.getApplication().getPackageName();
- // cp weexjsb any way
-// try {
-// PackageManager pm = WXEnvironment.getApplication().getApplicationContext().getPackageManager();
-// ApplicationInfo appInfo = pm.getApplicationInfo(pkgName, 0);
-// if ((appInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) {
-// // App on sdcard
-// installOnSdcard = true;
-// }
-// } catch (Throwable e) {
-// }
-
- if (installOnSdcard) {
-
- String cacheFile = WXEnvironment.getApplication().getApplicationContext().getCacheDir().getPath();
- // if android api < 16 copy libweexjst.so else copy libweexjsb.so
- boolean pieSupport = true;
- File newfile;
- String startSoName = WXEnvironment.CORE_JSB_SO_NAME;
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
- pieSupport = false;
- newfile = new File(cacheFile + STARTUPSOANDROID15);
- startSoName = WXEnvironment.CORE_JST_SO_NAME;
- } else {
- newfile = new File(cacheFile + STARTUPSO);
- }
-
- String jsbVersionFile = "jsb.version";
-
- File versionFile = new File(cacheFile,jsbVersionFile);
- Closeable r = null;
-
- if(newfile.exists() && versionFile.exists()) {
- try {
- FileReader fileReader = new FileReader(versionFile);
- r = fileReader;
- BufferedReader br = new BufferedReader(fileReader);
- String s = br.readLine();
- if(!TextUtils.isEmpty(s)) {
- boolean same = String.valueOf(WXEnvironment.CORE_JSB_SO_VERSION).equals(s.trim());
- if(same)
- return;
- }
- } catch (FileNotFoundException e) {
- //do nothing and copy so file
- } finally {
- if (r != null)
- r.close();
- }
- }
-
- String path = "/data/data/" + pkgName + "/lib";
- if (cacheFile != null && cacheFile.indexOf("/cache") > 0) {
- path = cacheFile.replace("/cache", "/lib");
- }
-
- String soName;
- if (pieSupport) {
- soName = path + STARTUPSO;
- } else {
- soName = path + STARTUPSOANDROID15;
- }
-
- File oldfile = new File(soName);
+ String cacheFile = WXEnvironment.getApplication().getApplicationContext().getCacheDir().getPath();
+ // cp weexjsb any way
+ // if android api < 16 copy libweexjst.so else copy libweexjsb.so
+ boolean pieSupport = true;
+ File newfile;
+ String startSoName = WXEnvironment.CORE_JSB_SO_NAME;
+ String startSoPath = STARTUPSO;
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
+ pieSupport = false;
+ startSoName = WXEnvironment.CORE_JST_SO_NAME;
+ startSoPath = STARTUPSOANDROID15;
+ }
- if(!oldfile.exists()) {
- try {
- String weexjsb = ((PathClassLoader) (WXSoInstallMgrSdk.class.getClassLoader())).findLibrary(startSoName);
- oldfile = new File(weexjsb);
- } catch (Throwable throwable) {
- // do nothing
- }
+ final File copyPath = _desSoCopyFile(startSoName);
+ if(!copyPath.exists()) {
+ copyPath.mkdirs();
+ }
+ newfile = new File(copyPath, startSoPath);
+ WXEnvironment.CORE_JSB_SO_PATH = newfile.getAbsolutePath();
+ String jsb = WXEnvironment.getDefaultSettingValue(startSoName, "-1");
+ if(newfile.exists() && TextUtils.equals(WXEnvironment.getAppVersionName(), jsb)) {
+ // no update so skip copy
+ return;
+ }
- }
+ String path = "/data/data/" + pkgName + "/lib";
+ if (cacheFile != null && cacheFile.indexOf("/cache") > 0) {
+ path = cacheFile.replace("/cache", "/lib");
+ }
+ File oldfile = null;
+ if (pieSupport) {
+ oldfile = new File(path, STARTUPSO);
+ } else {
+ oldfile = new File(path , STARTUPSOANDROID15);
+ }
- if (oldfile.exists()) {
- WXFileUtils.copyFile(oldfile, newfile);
- } else {
- WXEnvironment.extractSo();
- }
- Closeable w = null;
+ if (!oldfile.exists()) {
try {
- if(!versionFile.exists())
- versionFile.createNewFile();
- FileWriter fileWriter = new FileWriter(versionFile);
- w = fileWriter;
- fileWriter.write(String.valueOf(WXEnvironment.CORE_JSB_SO_VERSION));
- fileWriter.flush();
- } catch (Exception e ) {
+ String weexjsb = ((PathClassLoader) (WXSoInstallMgrSdk.class.getClassLoader())).findLibrary(startSoName);
+ oldfile = new File(weexjsb);
+ } catch (Throwable throwable) {
// do nothing
- } finally {
- if(w != null)
- w.close();
}
+ }
+
+
+ if(!oldfile.exists()) {
+ WXEnvironment.extractSo();
+ oldfile = new File(copyPath, STARTUPSO);
+ }
+ if (oldfile.exists()) {
+ WXFileUtils.copyFile(oldfile, newfile);
}
+ WXEnvironment.writeDefaultSettingsValue(startSoName, WXEnvironment.getAppVersionName());
} catch (Throwable e) {
e.printStackTrace();
}
@@ -325,25 +298,19 @@ public class WXSoInstallMgrSdk {
}
try {
WXLogUtils.e("weex", "copyJssRuntimeSo: ");
- Context c = WXEnvironment.getApplication();
- String pkgName = c.getPackageName();
- String toPath = "/data/data/" + pkgName + "/weex";
- String cachePath = WXEnvironment.getApplication().getApplicationContext().getCacheDir().getPath();
- if (cachePath != null && cachePath.indexOf("/cache") > 0) {
- toPath = cachePath.replace("/cache", "/weex/libs");
- }
- File dir = new File(toPath);
- if (!dir.exists()){
- dir.mkdirs();
+ File toPath = _desSoCopyFile(WXEnvironment.CORE_JSS_SO_NAME);
+ if(!toPath.exists()) {
+ toPath.mkdirs();
}
File targetFile = new File(toPath,"libweexjss.so");
/** 1. check so and versionCode. if update, then rm old jss.so(runtime) in pkg/libs, and copy new so from apk **/
String keyVersionCode = "app_version_code_weex";
- SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(c);
- PackageInfo info = c.getPackageManager().getPackageInfo(c.getPackageName(), 0);
+ String defaultSettingValue = WXEnvironment.getDefaultSettingValue(keyVersionCode, "-1");
+
+
if (targetFile.exists()){
- if (prefs.getInt(keyVersionCode,-1) < info.versionCode){
+ if (!TextUtils.equals(WXEnvironment.getAppVersionName(),defaultSettingValue)){
targetFile.delete();
}else {
WXEnvironment.CORE_JSS_RUNTIME_SO_PATH= targetFile.getAbsolutePath();
@@ -361,7 +328,7 @@ public class WXSoInstallMgrSdk {
WXFileUtils.copyFileWithException(new File(fromPath),targetFile);
/**3. update flag **/
WXEnvironment.CORE_JSS_RUNTIME_SO_PATH= targetFile.getAbsolutePath();
- prefs.edit().putInt(keyVersionCode,info.versionCode).apply();
+ WXEnvironment.writeDefaultSettingsValue(keyVersionCode,WXEnvironment.getAppVersionName());
WXEnvironment.sUseRunTimeApi = true;
WXLogUtils.e("weex", "copyJssRuntimeSo: cp end and return ");
}catch (Throwable e){
@@ -381,18 +348,19 @@ public class WXSoInstallMgrSdk {
}
private static String _cpuType() {
- String abi ;
- try {
- abi = Build.CPU_ABI;
- }catch (Exception e){
- e.printStackTrace();
- abi = ARMEABI;
- }
- if (TextUtils.isEmpty(abi)){
- abi = ARMEABI;
+ if(TextUtils.isEmpty(mAbi)) {
+ try {
+ mAbi = Build.CPU_ABI;
+ }catch (Throwable e){
+ e.printStackTrace();
+ mAbi = ARMEABI;
+ }
+ if (TextUtils.isEmpty(mAbi)){
+ mAbi = ARMEABI;
+ }
+ mAbi = mAbi.toLowerCase();
}
- abi = abi.toLowerCase();
- return abi;
+ return mAbi;
}
/**
diff --git a/weex_core/Source/android/multiprocess/weex_js_connection.cpp b/weex_core/Source/android/multiprocess/weex_js_connection.cpp
index 6cfe208..ffc3d45 100644
--- a/weex_core/Source/android/multiprocess/weex_js_connection.cpp
+++ b/weex_core/Source/android/multiprocess/weex_js_connection.cpp
@@ -518,7 +518,7 @@ void doExec(int fdClient, int fdServer, bool traceEnable, bool startupPie) {
<< result << " startupPie:" << startupPie << std::endl;
#endif
if (result == -1) {
- executableName = std::string(SoUtils::cache_dir()) + '/' + start_so;
+ executableName = std::string(SoUtils::jsb_so_path());
int result_cache = access(executableName.c_str(), 00);
if (result_cache == -1) {
std::string sourceSo = executablePath + '/' + start_so;
@@ -536,7 +536,7 @@ void doExec(int fdClient, int fdServer, bool traceEnable, bool startupPie) {
const char *argv[] = {executableName.c_str(), fdStr, fdServerStr, traceEnable ? "1" : "0", g_crashFileName.c_str(), nullptr};
if (-1 == execve(argv[0], const_cast<char *const *>(&argv[0]),
const_cast<char *const *>(envp.get()))) {
- LOGE("aaaaaaaa execve failed errno %s \n", strerror(errno));
+ LOGE("execve failed errno %s \n", strerror(errno));
#if PRINT_LOG_CACHEFILE
mcfile << "execve failed11:" << strerror(errno) << std::endl;
#endif
diff --git a/weex_core/Source/android/utils/params_utils.cpp b/weex_core/Source/android/utils/params_utils.cpp
index ef401d8..b4226a4 100644
--- a/weex_core/Source/android/utils/params_utils.cpp
+++ b/weex_core/Source/android/utils/params_utils.cpp
@@ -272,6 +272,20 @@ std::vector<INIT_FRAMEWORK_PARAMS*> initFromParam(
}
}
+ jmethodID m_get_jsb_so_path =
+ env->GetMethodID(c_params, "getLibJsbPath", "()Ljava/lang/String;");
+ if (m_get_jsb_so_path != nullptr) {
+ jobject j_get_jsb_so_path =
+ env->CallObjectMethod(params, m_get_jsb_so_path);
+ if (j_get_jsb_so_path != nullptr) {
+ SoUtils::set_jsb_so_path(const_cast<char*>(
+ env->GetStringUTFChars((jstring)(j_get_jsb_so_path), nullptr)));
+ LOGE("g_jsbSoPath is %s ", SoUtils::jsb_so_path());
+ env->DeleteLocalRef(j_get_jsb_so_path);
+ }
+ }
+
+
jmethodID m_get_lib_ld_path =
env->GetMethodID(c_params, "getLibLdPath", "()Ljava/lang/String;");
if (m_get_lib_ld_path != nullptr) {
diff --git a/weex_core/Source/android/utils/so_utils.cpp b/weex_core/Source/android/utils/so_utils.cpp
index fa0c34d..d7d8439 100644
--- a/weex_core/Source/android/utils/so_utils.cpp
+++ b/weex_core/Source/android/utils/so_utils.cpp
@@ -28,6 +28,7 @@
namespace WeexCore {
char * SoUtils::g_cache_dir = nullptr;
char * SoUtils::g_jss_so_path = nullptr;
+ char * SoUtils::g_jsb_so_path = nullptr;
char * SoUtils::g_jsc_so_path = nullptr;
char * SoUtils::g_crash_file_path = nullptr;
char * SoUtils::g_jss_icu_path = nullptr;
diff --git a/weex_core/Source/android/utils/so_utils.h b/weex_core/Source/android/utils/so_utils.h
index 75f6e22..8924778 100644
--- a/weex_core/Source/android/utils/so_utils.h
+++ b/weex_core/Source/android/utils/so_utils.h
@@ -69,6 +69,12 @@ class SoUtils {
inline static const char* jss_icu_path() { return g_jss_icu_path; }
+ inline static void set_jsb_so_path(char* jsb_so_path) {
+ g_jsb_so_path = jsb_so_path;
+ }
+
+ inline static const char* jsb_so_path() { return g_jsb_so_path; }
+
inline static void set_lib_ld_path(char* lib_ld_path) {
g_lib_ld_path = lib_ld_path;
}
@@ -81,6 +87,7 @@ class SoUtils {
static const char* GetDefaultCacheDir(JNIEnv* env);
static char* g_cache_dir;
static char* g_jss_so_path;
+ static char* g_jsb_so_path;
static char* g_crash_file_path;
static char* g_jss_so_name;
static char* g_jss_icu_path;