From a58322a0f3213c6739198bae108e40f68699a6c3 Mon Sep 17 00:00:00 2001 From: xiaoyu Date: Fri, 4 Dec 2020 16:58:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=8F=E8=94=BD=E5=A4=9A=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../finogeeks/mop/api/mop/AppletModule.java | 68 +++++++++++-------- 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java index 2a01f6d..6dff660 100644 --- a/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java +++ b/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java @@ -6,7 +6,6 @@ import android.util.Log; import com.finogeeks.lib.applet.client.FinAppClient; import com.finogeeks.lib.applet.client.FinAppConfig; import com.finogeeks.lib.applet.client.FinAppInfo; -import com.finogeeks.lib.applet.client.FinAppletStoreConfig; import com.finogeeks.mop.api.BaseApi; import com.finogeeks.mop.interfaces.ICallback; @@ -46,37 +45,50 @@ public class AppletModule extends BaseApi { String appId = String.valueOf(param.get("appId")); Integer sequence = (Integer) param.get("sequence"); Map params = (Map) param.get("params"); - 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); - } + if (params == null) { + if (sequence == null) { + FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId); } else { - FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId, params); + FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId, sequence, null); } } 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); - } - FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, finAppletStoreConfig, appId, sequence, startParams); + FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId, params); } +// 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()); } }