From f2e161e4d2a0102a7d0065ad3b49ccfaf312680d Mon Sep 17 00:00:00 2001 From: kangxuyao Date: Thu, 22 Apr 2021 09:51:22 +0800 Subject: [PATCH] =?UTF-8?q?smsign=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/finogeeks/mop/api/ApisManager.java | 2 ++ .../finogeeks/mop/api/mop/SmSignModule.java | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 android/src/main/java/com/finogeeks/mop/api/mop/SmSignModule.java diff --git a/android/src/main/java/com/finogeeks/mop/api/ApisManager.java b/android/src/main/java/com/finogeeks/mop/api/ApisManager.java index c9dca8b..39bdfee 100644 --- a/android/src/main/java/com/finogeeks/mop/api/ApisManager.java +++ b/android/src/main/java/com/finogeeks/mop/api/ApisManager.java @@ -9,6 +9,7 @@ import com.finogeeks.mop.api.mop.AppletModule; import com.finogeeks.mop.api.mop.BaseModule; import com.finogeeks.mop.api.mop.ExtensionApiModule; import com.finogeeks.mop.api.mop.VersionModule; +import com.finogeeks.mop.api.mop.SmSignModule; import com.finogeeks.mop.interfaces.Event; import com.finogeeks.mop.interfaces.IApi; @@ -69,6 +70,7 @@ public class ApisManager { add(new AppletHandlerModule(activity)); add(new ExtensionApiModule(activity)); add(new VersionModule(activity)); + add(new SmSignModule(activity)); } private void add(IApi api) { diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/SmSignModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/SmSignModule.java new file mode 100644 index 0000000..2d948ae --- /dev/null +++ b/android/src/main/java/com/finogeeks/mop/api/mop/SmSignModule.java @@ -0,0 +1,34 @@ +package com.finogeeks.mop.api.mop; + +import android.content.Context; + +import com.finogeeks.finochat.sdkcore.client.FinoChatSDKCoreClient; +import com.finogeeks.lib.applet.client.FinAppClient; +import com.finogeeks.lib.applet.db.entity.FinApplet; +import com.finogeeks.mop.api.BaseApi; +import com.finogeeks.mop.interfaces.ICallback; + +import java.util.HashMap; +import java.util.Map; + +public class SmSignModule extends BaseApi { + + public SmSignModule(Context context) { + super(context); + } + + @Override + public String[] apis() { + return new String[]{"smsign"}; + } + + @Override + public void invoke(String event, Map param, ICallback callback) { + String text = (String) param.get("plainText"); + String result = FinoChatSDKCoreClient.getInstance().finoLicenseService().messageDigest(text); + Map res = new HashMap<>(); + res.put("data", result); + callback.onSuccess(res); + } + +}