diff --git a/android/build.gradle b/android/build.gradle index 4c15ea0..3339b18 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.40.11' + implementation 'com.finogeeks.lib:finapplet:2.40.12-dev20230614v05' implementation 'com.finogeeks.mop:plugins:2.40.11' } \ No newline at end of file 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 30e6680..4f93e26 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 @@ -2,6 +2,7 @@ package com.finogeeks.mop.api.mop; import android.app.Application; import android.content.Context; +import android.text.TextUtils; import android.util.Log; import com.finogeeks.lib.applet.client.FinAppClient; @@ -101,8 +102,14 @@ public class BaseModule extends BaseApi { if (fingerprint == null) fingerprint = ""; String encryptType = (String) config.get("cryptType"); Boolean encryptServerData1 = (Boolean) config.get("encryptServerData"); + Boolean enablePreloadFramework = (Boolean) config.get("enablePreloadFramework"); + //凡泰助手里,服务器是https://api.finclip.com,默认开启预加载基础库 + if(!TextUtils.isEmpty(apiServer) && apiServer.equals("https://api.finclip.com")) { + enablePreloadFramework = true; + } + if (encryptServerData1 == null) encryptServerData1 = false; - finStoreConfigs.add(new FinStoreConfig(sdkKey, sdkSecret, apiUrl, apmUrl, "", fingerprint, encryptType, encryptServerData1)); + finStoreConfigs.add(new FinStoreConfig(sdkKey, sdkSecret, apiUrl, apmUrl, "", fingerprint, encryptType, encryptServerData1, enablePreloadFramework)); } } } @@ -155,6 +162,7 @@ public class BaseModule extends BaseApi { } }; + FinAppClient.INSTANCE.preloadFramework(config, application); FinAppClient.INSTANCE.init(application, config, cb); } } \ 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 a55e5de..542a11c 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 @@ -2,6 +2,7 @@ package com.finogeeks.mop.api.mop; import android.app.Application; import android.content.Context; +import android.text.TextUtils; import android.util.Log; import com.finogeeks.lib.applet.client.FinAppClient; @@ -63,8 +64,15 @@ public class InitSDKModule extends BaseApi { } String cryptType = (String) store.get("cryptType"); Boolean encryptServerData = (Boolean) store.get("encryptServerData"); + Boolean enablePreloadFramework = (Boolean) store.get("enablePreloadFramework"); + //凡泰助手里,服务器是https://api.finclip.com,默认开启预加载基础库 + if (!TextUtils.isEmpty(apiServer) && apiServer.equals("https://api.finclip.com")) { + enablePreloadFramework = true; + } + + storeConfigs.add(new FinStoreConfig(sdkKey, sdkSecret, apiServer, apmServer, "", - fingerprint, cryptType, encryptServerData)); + fingerprint, cryptType, encryptServerData, enablePreloadFramework)); } configBuilder.setFinStoreConfigs(storeConfigs); String userId = (String) configMap.get("userId"); @@ -216,6 +224,7 @@ public class InitSDKModule extends BaseApi { } }; + FinAppClient.INSTANCE.preloadFramework(finAppConfig, application); FinAppClient.INSTANCE.init(application, finAppConfig, cb); } diff --git a/lib/mop.dart b/lib/mop.dart index f8eefc0..bdd933f 100644 --- a/lib/mop.dart +++ b/lib/mop.dart @@ -34,11 +34,15 @@ class FinStoreConfig { /// 是否需要接口加密验证(初始化多服务器时使用)默认为不开启,当设置为YES时开启,接口返回加密数据并处理 bool encryptServerData; + /// 是否开启预加载基础库 + bool enablePreloadFramework; + FinStoreConfig(this.sdkKey, this.sdkSecret, this.apiServer, {this.apmServer, this.cryptType = "MD5", this.fingerprint, - this.encryptServerData = false}); + this.encryptServerData = false, + this.enablePreloadFramework = false}); Map toMap() { return { @@ -48,7 +52,8 @@ class FinStoreConfig { "apmServer": apmServer, "cryptType": cryptType, "fingerprint": fingerprint, - "encryptServerData": encryptServerData + "encryptServerData": encryptServerData, + "enablePreloadFramework": enablePreloadFramework }; } }