From 76fabf91878d548cb457204dc9f119f208543944 Mon Sep 17 00:00:00 2001 From: zhongweiguang Date: Fri, 24 Mar 2023 11:52:37 +0800 Subject: [PATCH] =?UTF-8?q?initSDK=E6=96=B0=E5=A2=9EuseLocalTbsCore?= =?UTF-8?q?=E3=80=81tbsCoreUrl=E9=85=8D=E7=BD=AE=E9=A1=B9=EF=BC=9Binitiali?= =?UTF-8?q?ze=E5=8E=BB=E9=99=A4useLocalTbsCore=E3=80=81tbsCoreUrl=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/finogeeks/mop/api/mop/BaseModule.java | 12 ------------ .../com/finogeeks/mop/api/mop/InitSDKModule.java | 6 +++++- lib/mop.dart | 16 +++++++++++----- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/BaseModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/BaseModule.java index d18d5c4..23a049c 100644 --- a/android/src/main/java/com/finogeeks/mop/api/mop/BaseModule.java +++ b/android/src/main/java/com/finogeeks/mop/api/mop/BaseModule.java @@ -67,16 +67,6 @@ public class BaseModule extends BaseApi { disablePermission = false; } - Boolean useLocalTbsCore = (Boolean) param.get("useLocalTbsCore"); - if (useLocalTbsCore == null) { - useLocalTbsCore = false; - } - - String tbsCoreUrl = ""; - if (param.get("tbsCoreUrl") != null) { - tbsCoreUrl = (String) param.get("tbsCoreUrl"); - } - String userId = ""; if (param.get("userId") != null) { userId = (String) param.get("userId"); @@ -135,8 +125,6 @@ public class BaseModule extends BaseApi { .setLogLevel(XLogLevel.LEVEL_VERBOSE) .setXLogDir(new File(getContext().getExternalCacheDir(),"xlog")) .setPageCountLimit(pageCountLimit) - .setUseLocalTbsCore(useLocalTbsCore) - .setTbsCoreUrl(tbsCoreUrl); if (customWebViewUserAgent != null) builder.setCustomWebViewUserAgent(customWebViewUserAgent); 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 fe11cdd..12a2b92 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 @@ -169,7 +169,11 @@ public class InitSDKModule extends BaseApi { configBuilder.setXLogDir(logDir); } configBuilder.setEnablePreNewProcess((Boolean) configMap.get("enablePreNewProcess")); - + configBuilder.setUseLocalTbsCore((Boolean) configMap.get("useLocalTbsCore")); + String tbsCoreUrl = (String) configMap.get("tbsCoreUrl"); + if (tbsCoreUrl != null) { + configBuilder.setTbsCoreUrl(tbsCoreUrl); + } Map uiConfigMap = (Map) param.get("uiConfig"); String appendingCustomUserAgent = (String) uiConfigMap.get("appendingCustomUserAgent"); if (appendingCustomUserAgent != null) { diff --git a/lib/mop.dart b/lib/mop.dart index f53f5d4..6b4db95 100644 --- a/lib/mop.dart +++ b/lib/mop.dart @@ -202,6 +202,14 @@ class Config { /// 是否提前创建进程 bool enablePreNewProcess = false; + /// Android属性 + /// 是否使用本地加载tbs内核 + bool useLocalTbsCore = false; + + /// Android属性 + /// tbs内核的下载地址,不包含文件名 + String? tbsCoreUrl; + Config(this.finStoreConfigs); Map toMap() { @@ -243,6 +251,8 @@ class Config { "logMaxAliveSec": logMaxAliveSec, "logDir": logDir, "enablePreNewProcess": enablePreNewProcess, + "useLocalTbsCore": useLocalTbsCore, + "tbsCoreUrl": tbsCoreUrl, }; } } @@ -964,9 +974,7 @@ class Mop { UIConfig? uiConfig, String? customWebViewUserAgent, int? appletIntervalUpdateLimit, - int? maxRunningApplet, - bool useLocalTbsCore = false, - String? tbsCoreUrl, + int? maxRunningApplet }) async { List>? storeConfigs = finStoreConfigs?.map((e) => e.toMap()).toList(); @@ -988,8 +996,6 @@ class Mop { "customWebViewUserAgent": customWebViewUserAgent, "appletIntervalUpdateLimit": appletIntervalUpdateLimit, "maxRunningApplet": maxRunningApplet, - "useLocalTbsCore": useLocalTbsCore, - "tbsCoreUrl": tbsCoreUrl }); return ret; }