From 1dce1597e0ea435100875e2c0401561ba2bfb92b Mon Sep 17 00:00:00 2001 From: kangxuyao Date: Wed, 29 Dec 2021 11:15:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=AB=E7=A0=81=E6=89=93?= =?UTF-8?q?=E5=BC=80=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=8E=A5=E5=8F=A3?= 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 | 29 ++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index e6a7106..9870b14 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.34.12' + implementation 'com.finogeeks.lib:finapplet:2.35.0-alpha20211229v01' implementation 'com.finogeeks.mop:plugins:2.34.12' } \ 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 15a7494..8345e46 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 @@ -5,6 +5,7 @@ import android.text.TextUtils; import android.util.Log; import com.finogeeks.lib.applet.client.FinAppClient; +import com.finogeeks.lib.applet.interfaces.FinCallback; import com.finogeeks.lib.applet.sdk.model.StartAppletDecryptRequest; import com.finogeeks.mop.api.BaseApi; import com.finogeeks.mop.interfaces.ICallback; @@ -28,7 +29,7 @@ public class AppletModule extends BaseApi { @Override public String[] apis() { - return new String[]{"openApplet", "scanOpenApplet"}; + return new String[]{"openApplet", "scanOpenApplet","qrcodeOpenApplet"}; } @Override @@ -37,6 +38,8 @@ public class AppletModule extends BaseApi { openApplet(param, callback); } else if ("scanOpenApplet".equals(event)) { scanOpenApplet(param, callback); + } else if ("qrcodeOpenApplet".equals(event)){ + qrcodeOpenApplet(param,callback); } } @@ -109,4 +112,28 @@ public class AppletModule extends BaseApi { FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, new StartAppletDecryptRequest(info)); 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() { + @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) { + + } + }); + } }