【RT-27111】基础库预下载

master
raozhengfa 2023-06-14 10:22:24 +00:00 committed by yangbingqiao
parent 51b2f827f0
commit 347c40f940
4 changed files with 27 additions and 5 deletions

View File

@ -91,6 +91,6 @@ kapt {
} }
dependencies { dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') 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' implementation 'com.finogeeks.mop:plugins:2.40.11'
} }

View File

@ -2,6 +2,7 @@ package com.finogeeks.mop.api.mop;
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import com.finogeeks.lib.applet.client.FinAppClient; import com.finogeeks.lib.applet.client.FinAppClient;
@ -101,8 +102,14 @@ public class BaseModule extends BaseApi {
if (fingerprint == null) fingerprint = ""; if (fingerprint == null) fingerprint = "";
String encryptType = (String) config.get("cryptType"); String encryptType = (String) config.get("cryptType");
Boolean encryptServerData1 = (Boolean) config.get("encryptServerData"); 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; 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); FinAppClient.INSTANCE.init(application, config, cb);
} }
} }

View File

@ -2,6 +2,7 @@ package com.finogeeks.mop.api.mop;
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import com.finogeeks.lib.applet.client.FinAppClient; import com.finogeeks.lib.applet.client.FinAppClient;
@ -63,8 +64,15 @@ public class InitSDKModule extends BaseApi {
} }
String cryptType = (String) store.get("cryptType"); String cryptType = (String) store.get("cryptType");
Boolean encryptServerData = (Boolean) store.get("encryptServerData"); 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, "", storeConfigs.add(new FinStoreConfig(sdkKey, sdkSecret, apiServer, apmServer, "",
fingerprint, cryptType, encryptServerData)); fingerprint, cryptType, encryptServerData, enablePreloadFramework));
} }
configBuilder.setFinStoreConfigs(storeConfigs); configBuilder.setFinStoreConfigs(storeConfigs);
String userId = (String) configMap.get("userId"); 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); FinAppClient.INSTANCE.init(application, finAppConfig, cb);
} }

View File

@ -34,11 +34,15 @@ class FinStoreConfig {
/// 使YES /// 使YES
bool encryptServerData; bool encryptServerData;
///
bool enablePreloadFramework;
FinStoreConfig(this.sdkKey, this.sdkSecret, this.apiServer, FinStoreConfig(this.sdkKey, this.sdkSecret, this.apiServer,
{this.apmServer, {this.apmServer,
this.cryptType = "MD5", this.cryptType = "MD5",
this.fingerprint, this.fingerprint,
this.encryptServerData = false}); this.encryptServerData = false,
this.enablePreloadFramework = false});
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
return { return {
@ -48,7 +52,8 @@ class FinStoreConfig {
"apmServer": apmServer, "apmServer": apmServer,
"cryptType": cryptType, "cryptType": cryptType,
"fingerprint": fingerprint, "fingerprint": fingerprint,
"encryptServerData": encryptServerData "encryptServerData": encryptServerData,
"enablePreloadFramework": enablePreloadFramework
}; };
} }
} }