From acea046f33d0570c1bdabc97009ab30e57f5045e Mon Sep 17 00:00:00 2001 From: zhongweiguang Date: Wed, 22 Mar 2023 17:27:17 +0800 Subject: [PATCH] =?UTF-8?q?initSDK=E8=A1=A5=E5=85=85=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/build.gradle | 2 +- .../finogeeks/mop/api/mop/InitSDKModule.java | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 5c3b04a..0465558 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -91,6 +91,6 @@ kapt { } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.finogeeks.lib:finapplet:2.39.12-alpha20230322v01' + implementation 'com.finogeeks.lib:finapplet:2.39.12-alpha20230322v02' implementation 'com.finogeeks.mop:plugins:2.39.11' } \ No newline at end of file diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/InitSDKModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/InitSDKModule.java index 6211059..e7029fe 100644 --- a/android/src/main/java/com/finogeeks/mop/api/mop/InitSDKModule.java +++ b/android/src/main/java/com/finogeeks/mop/api/mop/InitSDKModule.java @@ -13,6 +13,7 @@ import com.finogeeks.mop.api.BaseApi; import com.finogeeks.mop.api.mop.util.InitUtils; import com.finogeeks.mop.interfaces.ICallback; import com.finogeeks.mop.service.MopPluginService; +import com.finogeeks.xlog.XLogLevel; import com.google.gson.Gson; import java.util.ArrayList; @@ -121,6 +122,54 @@ public class InitSDKModule extends BaseApi { if (schemes != null) { configBuilder.setSchemes(schemes); } + configBuilder.setDebugMode((Boolean) configMap.get("debug")); + Integer maxRunningApplet = (Integer) configMap.get("maxRunningApplet"); + if (maxRunningApplet != null) { + configBuilder.setMaxRunningApplet(maxRunningApplet); + } + Integer webViewMixedContentMode = (Integer) configMap.get("webViewMixedContentMode"); + if (webViewMixedContentMode != null) { + configBuilder.setWebViewMixedContentMode(webViewMixedContentMode); + } + configBuilder.setBindAppletWithMainProcess((Boolean) configMap.get("bindAppletWithMainProcess")); + String killAppletProcessNotice = (String) configMap.get("killAppletProcessNotice"); + if (killAppletProcessNotice != null) { + configBuilder.setKillAppletProcessNotice(killAppletProcessNotice); + } + configBuilder.setMinAndroidSdkVersion((Integer) configMap.get("minAndroidSdkVersion")); + configBuilder.setEnableScreenShot((Boolean) configMap.get("enableScreenShot")); + int screenShotPriorityIndex = (Integer) configMap.get("screenShotPriority"); + if (screenShotPriorityIndex == 0) { + configBuilder.setScreenShotPriority(FinAppConfigPriority.GLOBAL); + } else if (screenShotPriorityIndex == 1) { + configBuilder.setScreenShotPriority(FinAppConfigPriority.SPECIFIED); + } else if (screenShotPriorityIndex == 2) { + configBuilder.setScreenShotPriority(FinAppConfigPriority.APPLET_FILE); + } + int logLevelIndex = (Integer) configMap.get("logLevel"); + if (logLevelIndex == 0) { + configBuilder.setLogLevel(XLogLevel.LEVEL_VERBOSE); + } else if (logLevelIndex == 1) { + configBuilder.setLogLevel(XLogLevel.LEVEL_DEBUG); + } else if (logLevelIndex == 2) { + configBuilder.setLogLevel(XLogLevel.LEVEL_INFO); + } else if (logLevelIndex == 3) { + configBuilder.setLogLevel(XLogLevel.LEVEL_WARNING); + } else if (logLevelIndex == 4) { + configBuilder.setLogLevel(XLogLevel.LEVEL_ERROR); + } else if (logLevelIndex == 5) { + configBuilder.setLogLevel(XLogLevel.LEVEL_NONE); + } + Integer logMaxAliveSec = (Integer) configMap.get("logMaxAliveSec"); + if (logMaxAliveSec != null) { + configBuilder.setLogMaxAliveSec(logMaxAliveSec); + } + String logDir = (String) configMap.get("logDir"); + if (logDir != null) { + configBuilder.setXLogDir(logDir); + } + configBuilder.setEnablePreNewProcess((Boolean) configMap.get("enablePreNewProcess")); + Map uiConfigMap = (Map) param.get("uiConfig"); String appendingCustomUserAgent = (String) uiConfigMap.get("appendingCustomUserAgent"); if (appendingCustomUserAgent != null) {