You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by GitBox <gi...@apache.org> on 2018/07/31 18:13:30 UTC

[GitHub] miomin closed pull request #1354: [WEEX-527][Android] Sandbox support to debug

miomin closed pull request #1354: [WEEX-527][Android] Sandbox support to debug
URL: https://github.com/apache/incubator-weex/pull/1354
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 86d70c4aa9..cdb3aebb15 100644
--- a/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
+++ b/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
@@ -79,7 +79,7 @@
    * 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;
@@ -255,7 +255,7 @@ public static boolean isApkDebugable() {
        */
       e.printStackTrace();
     }
-    return false;
+    return true;
   }
 
   public static boolean isPerf() {
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 02ae49cfab..c0bf2c5596 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
@@ -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());
@@ -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());
@@ -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);
@@ -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 {
@@ -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());


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services