【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 {
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'
}

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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<String, dynamic> toMap() {
return {
@ -48,7 +52,8 @@ class FinStoreConfig {
"apmServer": apmServer,
"cryptType": cryptType,
"fingerprint": fingerprint,
"encryptServerData": encryptServerData
"encryptServerData": encryptServerData,
"enablePreloadFramework": enablePreloadFramework
};
}
}