diff --git a/ios/Classes/Api/MOP_smsign.h b/ios/Classes/Api/MOP_smsign.h new file mode 100644 index 0000000..3ab4579 --- /dev/null +++ b/ios/Classes/Api/MOP_smsign.h @@ -0,0 +1,19 @@ +// +// MOP_smsign.h +// mop +// +// Created by beetle_92 on 2021/4/21. +// + +#import +#import "MOPBaseApi.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MOP_smsign : MOPBaseApi + +@property (nonatomic, copy) NSString *plainText; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ios/Classes/Api/MOP_smsign.m b/ios/Classes/Api/MOP_smsign.m new file mode 100644 index 0000000..9058ee4 --- /dev/null +++ b/ios/Classes/Api/MOP_smsign.m @@ -0,0 +1,21 @@ +// +// MOP_smsign.m +// mop +// +// Created by beetle_92 on 2021/4/21. +// + +#import "MOP_smsign.h" +#import + +@implementation MOP_smsign + +- (void)setupApiWithSuccess:(void (^)(NSDictionary * _Nonnull))success failure:(void (^)(id _Nullable))failure cancel:(void (^)(void))cancel +{ + NSLog(@"smsign"); + NSString *signature = [[FATClient sharedClient] getSM3String:self.plainText]; + NSLog(@"signature = %@", signature); + success(@{@"data": signature}); +} + +@end diff --git a/ios/mop.podspec b/ios/mop.podspec index 4cd4676..711d709 100644 --- a/ios/mop.podspec +++ b/ios/mop.podspec @@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk. s.dependency 'Flutter' s.ios.deployment_target = '9.0' - s.dependency 'FinApplet' , '2.24.3' - s.dependency 'FinAppletExt' , '2.24.3' + s.dependency 'FinApplet' , '2.25.0-alpha20210421v01' + s.dependency 'FinAppletExt' , '2.25.0-alpha20210421v01' end diff --git a/lib/mop.dart b/lib/mop.dart index 1ab0a4b..d8f6d69 100644 --- a/lib/mop.dart +++ b/lib/mop.dart @@ -195,4 +195,13 @@ class Mop { _extensionApis[name] = handler; _channel.invokeMethod("registerExtensionApi", {"name": name}); } + + /// 获取国密加密 + Future getSMSign(String plainText) async { + var result = + await _channel.invokeMapMethod("smsign", {'plainText': plainText}); + var data = result['data']['data']; + print(data); + return data; + } }