From 21a70adcfa929a0bd8e01ec3f7fa49cdbdfc99d0 Mon Sep 17 00:00:00 2001 From: xiaoyu Date: Tue, 15 Jun 2021 20:12:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=9C=BA=E5=88=B6=EF=BC=8C=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=BD=93?= =?UTF-8?q?=E9=AA=8C=E7=89=88=E3=80=81=E4=B8=B4=E6=97=B6=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/build.gradle | 2 +- .../finogeeks/mop/api/mop/AppletModule.java | 26 ++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 15097d6..29275b4 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.29.3' + implementation 'com.finogeeks.lib:finapplet:2.30.0-alpha20210615v04' implementation 'com.finogeeks.mop:plugins:2.29.3' } \ 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 b35821e..0a14ff9 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 @@ -1,9 +1,11 @@ package com.finogeeks.mop.api.mop; import android.content.Context; +import android.text.TextUtils; import android.util.Log; import com.finogeeks.lib.applet.client.FinAppClient; +import com.finogeeks.lib.applet.sdk.model.StartAppletDecryptRequest; import com.finogeeks.mop.api.BaseApi; import com.finogeeks.mop.interfaces.ICallback; @@ -26,11 +28,19 @@ public class AppletModule extends BaseApi { @Override public String[] apis() { - return new String[]{"openApplet"}; + return new String[]{"openApplet", "scanOpenApplet"}; } @Override public void invoke(String event, Map param, ICallback callback) { + if ("openApplet".equals(event)) { + openApplet(param, callback); + } else if ("scanOpenApplet".equals(event)) { + scanOpenApplet(param, callback); + } + } + + private void openApplet(Map param, ICallback callback) { if (param.get("appId") == null) { callback.onFail(new HashMap() { { @@ -89,4 +99,18 @@ public class AppletModule extends BaseApi { // } callback.onSuccess(new HashMap()); } + + private void scanOpenApplet(Map param, ICallback callback) { + String info = String.valueOf(param.get("info")); + if (TextUtils.isEmpty(info)) { + callback.onFail(new HashMap() { + { + put("info", "info不能为" + info); + } + }); + return; + } + FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, new StartAppletDecryptRequest(info)); + callback.onSuccess(new HashMap()); + } }