Skip to content

Commit

Permalink
[WEEX-527][Android] Sandbox support to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
miomin authored and YorkShen committed Jul 23, 2018
1 parent 291e48b commit a120d35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class WXEnvironment {
* Debug model
*/
public static boolean sDebugMode = false;
public static final boolean sForceEnableDevTool = false;
public static final boolean sForceEnableDevTool = true;
public static String sDebugWsUrl = "";
public static boolean sDebugServerConnectable = false;
public static boolean sRemoteDebugMode = false;
Expand Down Expand Up @@ -255,7 +255,7 @@ public static boolean isApkDebugable() {
*/
e.printStackTrace();
}
return false;
return true;
}

public static boolean isPerf() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public void setSandBoxContext(final boolean flag) {
setJSFrameworkInit(false);
WXModuleManager.resetAllModuleState();
String jsf = "";
if (!isSandBoxContext || WXEnvironment.sDebugServerConnectable) {
if (!isSandBoxContext) {
jsf = WXFileUtils.loadAsset("main.js", WXEnvironment.getApplication());
} else {
jsf = WXFileUtils.loadAsset("weex-main-jsfm.js", WXEnvironment.getApplication());
Expand All @@ -240,7 +240,7 @@ public void run() {
setJSFrameworkInit(false);
WXModuleManager.resetAllModuleState();
String jsf = "";
if (!isSandBoxContext || WXEnvironment.sDebugServerConnectable) {
if (!isSandBoxContext) {
jsf = WXFileUtils.loadAsset("main.js", WXEnvironment.getApplication());
} else {
jsf = WXFileUtils.loadAsset("weex-main-jsfm.js", WXEnvironment.getApplication());
Expand Down Expand Up @@ -1291,12 +1291,12 @@ private void invokeCreateInstance(@NonNull WXSDKInstance instance, String templa

// if { "framework": "Vue" } or { "framework": "Rax" } will use invokeCreateInstanceContext
// others will use invokeExecJS
if (!isSandBoxContext || WXEnvironment.sDebugServerConnectable) {
if (!isSandBoxContext) {
invokeExecJS(instance.getInstanceId(), null, METHOD_CREATE_INSTANCE, args, false);
return;
}
if (type == BundType.Vue || type == BundType.Rax) {
invokeCreateInstanceContext(instance.getInstanceId(), null, METHOD_CREATE_INSTANCE, args, false);
invokeCreateInstanceContext(instance.getInstanceId(), null, "createInstanceContext", args, false);
return;
} else {
invokeExecJS(instance.getInstanceId(), null, METHOD_CREATE_INSTANCE, args, false);
Expand All @@ -1315,7 +1315,7 @@ private void invokeCreateInstance(@NonNull WXSDKInstance instance, String templa
}

public WXJSObject optionObjConvert(boolean useSandBox, BundType type, WXJSObject opt) {
if (!useSandBox || type == BundType.Others || WXEnvironment.sDebugServerConnectable) {
if (!useSandBox || type == BundType.Others) {
return opt;
}
try {
Expand Down Expand Up @@ -1604,7 +1604,7 @@ private void initFramework(String framework) {
// if (WXEnvironment.isApkDebugable()) {
WXLogUtils.d("weex JS framework from assets");
// }
if (!isSandBoxContext || WXEnvironment.sDebugServerConnectable) {
if (!isSandBoxContext) {
framework = WXFileUtils.loadAsset("main.js", WXEnvironment.getApplication());
} else {
framework = WXFileUtils.loadAsset("weex-main-jsfm.js", WXEnvironment.getApplication());
Expand Down

0 comments on commit a120d35

Please sign in to comment.