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) { + + } + }); + } }