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 70b1ed4538..f9a6b8f736 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 @@ -34,7 +34,6 @@ import android.text.TextUtils; import android.util.Log; import android.util.Pair; - import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; @@ -108,7 +107,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.Stack; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -1581,7 +1579,7 @@ private void invokeCreateInstance(@NonNull WXSDKInstance instance, Script templa data == null ? "{}" : data); WXJSObject apiObj; - if (type == BundType.Rax) { + if (type == BundType.Rax || instance.getRenderStrategy() == WXRenderStrategy.DATA_RENDER) { if (mRaxApi == null) { IWXJsFileLoaderAdapter iwxJsFileLoaderAdapter = WXSDKEngine.getIWXJsFileLoaderAdapter(); if(iwxJsFileLoaderAdapter != null) { @@ -1660,31 +1658,22 @@ private void invokeCreateInstance(@NonNull WXSDKInstance instance, Script templa } public WXJSObject optionObjConvert(boolean useSandBox, BundType type, WXJSObject opt) { - if (!useSandBox || type == BundType.Others) { + if (!useSandBox) { return opt; } try { String data = opt.data.toString(); JSONObject obj = JSON.parseObject(data); - if (obj.getJSONObject("env") != null) { - JSONObject optEnv = obj.getJSONObject("env"); - // obj.replace() - if (optEnv != null) { - JSONObject opts = optEnv.getJSONObject("options"); - if (opts!= null) { - optEnv.remove("options"); - Set set = opts.keySet(); - for(Iterator it = set.iterator(); it.hasNext();) { - String key = it.next().toString(); - optEnv.put(key, opts.getString(key)); - } + JSONObject optEnv; + if ((optEnv = obj.getJSONObject("env")) != null) { + JSONObject opts = optEnv.getJSONObject("options"); + if (opts != null) { + for (String s : opts.keySet()) { + optEnv.put(s, opts.getString(s)); } } - obj.remove("env"); - obj.put("env", optEnv); } - WXJSObject optionsObj = new WXJSObject(WXJSObject.JSON, obj.toString()); - return optionsObj; + return new WXJSObject(WXJSObject.JSON, obj.toString()); } catch (Throwable e) { e.printStackTrace(); } diff --git a/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp b/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp index 63d6f8b296..4ca6f96604 100644 --- a/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp +++ b/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp @@ -17,6 +17,7 @@ * under the License. */ +#include "cstring" #include "core/bridge/platform/core_side_in_platform.h" #include "base/string_util.h" #include "base/log_defines.h" @@ -491,7 +492,8 @@ int CoreSideInPlatform::CreateInstance(const char *instanceId, const char *func, ->script_side() ->CreateInstance(instanceId.c_str(), func.c_str(), result, opts_json.dump().c_str(), initData.c_str(), - extendsApi.c_str(),params); + strcmp("Rax", bundleType) ? "\0" : extendsApi.c_str(), + params); }; if (strcmp(render_strategy, "DATA_RENDER") == 0) { auto handler = EagleBridge::GetInstance()->data_render_handler();