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