From fc3dd3e5508fc8e3d7da68f14305214042e9d9a7 Mon Sep 17 00:00:00 2001 From: gaoyunfei Date: Wed, 27 Jul 2022 18:35:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=8D=93=E6=89=93=E5=BC=80=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E4=BF=AE=E6=94=B9=E4=B8=BA=E5=B0=81=E8=A3=85?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=9A=84API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/build.gradle | 4 +-- .../finogeeks/mop/api/mop/AppletModule.java | 34 +++++++++++++++++-- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index ddb2708..d8876e9 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.37.3' - implementation 'com.finogeeks.mop:plugins:2.37.3' + implementation 'com.finogeeks.lib:finapplet:2.37.4-alpha20220727v13' + implementation 'com.finogeeks.mop:plugins:2.37.1' } \ No newline at end of file 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 48deed5..c16941a 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 @@ -7,6 +7,7 @@ import android.util.Log; import com.finogeeks.lib.applet.client.FinAppClient; import com.finogeeks.lib.applet.interfaces.FinCallback; import com.finogeeks.lib.applet.client.FinAppInfo; +import com.finogeeks.lib.applet.sdk.api.request.IFinAppletRequest; import com.finogeeks.lib.applet.sdk.model.StartAppletDecryptRequest; import com.finogeeks.mop.api.BaseApi; import com.finogeeks.mop.interfaces.ICallback; @@ -68,7 +69,13 @@ public class AppletModule extends BaseApi { Log.d(TAG, "openApplet:" + appId + "," + param + "," + sequence + "," + apiServer); if (apiServer != null) { - FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, apiServer, appId, sequence, startParams,null); + FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, + IFinAppletRequest.Companion.fromAppId(apiServer, appId) + .setStartParams(startParams) + .setSequence(sequence), + null + ); +// FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, apiServer, appId, sequence, startParams,null); } else { FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, appId, sequence, startParams,null); } @@ -113,13 +120,14 @@ public class AppletModule extends BaseApi { private void scanOpenApplet(Map param, ICallback callback) { String info = String.valueOf(param.get("info")); - FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, new StartAppletDecryptRequest(info),null); + FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, IFinAppletRequest.Companion.fromDecrypt(info), null); +// FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, new StartAppletDecryptRequest(info),null); callback.onSuccess(new HashMap()); } private void qrcodeOpenApplet(Map param, ICallback callback){ String qrcode = String.valueOf(param.get("qrcode")); - FinAppClient.INSTANCE.getAppletApiManager().startAppletByQrcode(mContext, qrcode, new FinCallback() { + FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, IFinAppletRequest.Companion.fromQrCode(qrcode), new FinCallback() { @Override public void onSuccess(String s) { callback.onSuccess(new HashMap()); @@ -139,6 +147,26 @@ public class AppletModule extends BaseApi { } }); + /*FinAppClient.INSTANCE.getAppletApiManager().startAppletByQrcode(mContext, qrcode, new FinCallback() { + @Override + public void onSuccess(String s) { + callback.onSuccess(new HashMap()); + } + + @Override + public void onError(int i, String s) { + callback.onFail(new HashMap(){ + { + put("info",s); + } + }); + } + + @Override + public void onProgress(int i, String s) { + + } + });*/ } private void changeUserId(Map param, ICallback callback) {