屏蔽多服务器相关逻辑

master
xiaoyu 2020-12-04 16:58:22 +08:00
parent 3f0df9df4d
commit a58322a0f3
1 changed files with 40 additions and 28 deletions

View File

@ -6,7 +6,6 @@ import android.util.Log;
import com.finogeeks.lib.applet.client.FinAppClient; import com.finogeeks.lib.applet.client.FinAppClient;
import com.finogeeks.lib.applet.client.FinAppConfig; import com.finogeeks.lib.applet.client.FinAppConfig;
import com.finogeeks.lib.applet.client.FinAppInfo; import com.finogeeks.lib.applet.client.FinAppInfo;
import com.finogeeks.lib.applet.client.FinAppletStoreConfig;
import com.finogeeks.mop.api.BaseApi; import com.finogeeks.mop.api.BaseApi;
import com.finogeeks.mop.interfaces.ICallback; import com.finogeeks.mop.interfaces.ICallback;
@ -46,37 +45,50 @@ public class AppletModule extends BaseApi {
String appId = String.valueOf(param.get("appId")); String appId = String.valueOf(param.get("appId"));
Integer sequence = (Integer) param.get("sequence"); Integer sequence = (Integer) param.get("sequence");
Map<String, String> params = (Map) param.get("params"); Map<String, String> params = (Map) param.get("params");
String apiServer = (String) param.get("apiServer"); if (params == null) {
String apiPrefix = (String) param.get("apiPrefix"); if (sequence == null) {
if (apiServer == null || apiServer.isEmpty() || apiPrefix == null || apiPrefix.isEmpty()) { FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId);
if (params == null) {
if (sequence == null) {
FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId);
} else {
FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId, sequence, null);
}
} else { } else {
FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId, params); FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId, sequence, null);
} }
} else { } else {
String fingerprint = (String) param.get("fingerprint"); FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId, params);
if (fingerprint == null) {
fingerprint = "";
}
String cryptType = (String) param.get("cryptType");
if (cryptType == null || cryptType.isEmpty()) {
cryptType = FinAppConfig.ENCRYPTION_TYPE_MD5;
}
FinAppletStoreConfig finAppletStoreConfig = new FinAppletStoreConfig(apiServer, apiPrefix, fingerprint, cryptType);
FinAppInfo.StartParams startParams = null;
if (params != null) {
String pageURL = params.get("path");
String launchParams = params.get("query");
String scene = params.get("scene");
startParams = new FinAppInfo.StartParams(pageURL, launchParams, scene);
}
FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, finAppletStoreConfig, appId, sequence, startParams);
} }
// String apiServer = (String) param.get("apiServer");
// String apiPrefix = (String) param.get("apiPrefix");
// if (apiServer == null || apiServer.isEmpty() || apiPrefix == null || apiPrefix.isEmpty()) {
// if (params == null) {
// if (sequence == null) {
// FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId);
// } else {
// FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId, sequence, null);
// }
// } else {
// FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId, params);
// }
// } else {
// String fingerprint = (String) param.get("fingerprint");
// if (fingerprint == null) {
// fingerprint = "";
// }
// String cryptType = (String) param.get("cryptType");
// if (cryptType == null || cryptType.isEmpty()) {
// cryptType = FinAppConfig.ENCRYPTION_TYPE_MD5;
// }
// FinAppletStoreConfig finAppletStoreConfig = new FinAppletStoreConfig(apiServer, apiPrefix, fingerprint, cryptType);
// FinAppInfo.StartParams startParams = null;
// if (params != null) {
// String pageURL = params.get("path");
// String launchParams = params.get("query");
// String scene = params.get("scene");
// startParams = new FinAppInfo.StartParams(pageURL, launchParams, scene);
// }
// Log.d("MopPlugin", "openApplet:finAppletStoreConfig:" + finAppletStoreConfig.toString());
// Log.d("MopPlugin", "openApplet:appId:" + appId);
// Log.d("MopPlugin", "openApplet:sequence:" + sequence);
// Log.d("MopPlugin", "openApplet:startParams:" + startParams);
// FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, finAppletStoreConfig, appId, sequence, startParams);
// }
callback.onSuccess(new HashMap()); callback.onSuccess(new HashMap());
} }
} }