Compare commits

..

No commits in common. "phiz_2.42.7.11" and "master" have entirely different histories.

13 changed files with 41 additions and 200 deletions

View File

@ -91,6 +91,6 @@ kapt {
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.finogeeks.lib:finapplet:2.42.7'
implementation 'com.finogeeks.mop:plugins:2.42.7'
implementation 'com.finogeeks.lib:finapplet:2.41.11'
implementation 'com.finogeeks.mop:plugins:2.41.11'
}

View File

@ -133,7 +133,6 @@ public class InitSDKModule extends BaseApi {
configBuilder.setSchemes(schemes);
}
configBuilder.setDebugMode((Boolean) configMap.get("debug"));
configBuilder.setEnableLog((Boolean) configMap.get("debug"));
Integer maxRunningApplet = (Integer) configMap.get("maxRunningApplet");
if (maxRunningApplet != null) {
configBuilder.setMaxRunningApplet(maxRunningApplet);
@ -195,23 +194,11 @@ public class InitSDKModule extends BaseApi {
if (appletText != null) {
configBuilder.setAppletText(appletText);
}
Object localeLanguage = configMap.get("localeLanguage");
if (localeLanguage != null) {
String language = (String) localeLanguage;
if (language.contains("_")) {
String[] locales = language.split("_");
configBuilder.setLocale(new Locale(locales[0], locales[1]));
} else {
configBuilder.setLocale(new Locale(language));
}
Integer languageInteger = (Integer) configMap.get("language");
if (languageInteger == 1) {
configBuilder.setLocale(Locale.ENGLISH);
} else {
Integer languageInteger = (Integer) configMap.get("language");
if (languageInteger == 1) {
configBuilder.setLocale(Locale.ENGLISH);
} else {
configBuilder.setLocale(Locale.SIMPLIFIED_CHINESE);
}
configBuilder.setLocale(Locale.SIMPLIFIED_CHINESE);
}
// uiConfig

View File

@ -2,7 +2,7 @@ package com.finogeeks.mop.api.mop;
import android.content.Context;
import com.finogeeks.finclip.sdkcore.manager.FinClipSDKCoreManager;
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;
@ -25,7 +25,7 @@ public class SmSignModule extends BaseApi {
@Override
public void invoke(String event, Map param, ICallback callback) {
String text = (String) param.get("plainText");
String result = new FinClipSDKCoreManager.Builder().build().messageDigestBySM(text);
String result = FinoChatSDKCoreClient.getInstance().finoLicenseService().messageDigest(text);
Map<String, Object> res = new HashMap<>();
res.put("data", result);
callback.onSuccess(res);

View File

@ -1,68 +0,0 @@
export LANG=en_US.UTF-8
export FASTLANE_DISABLE_COLORS=1
export version="$1"
export iosVersion="$2"
export androidVersion="$3"
#version=`git describe --abbrev=0 --tags | tr -d '\\n' | tr -d '\\t'`
echo "当前版本号:${version}"
echo "依赖的iOS${iosVersion}"
echo "依赖的Android:${androidVersion}"
#git reset --hard
#git checkout ${version}
# pubspec.yaml
cp -r pubspec.tpl.yaml pubspec.yaml
sed -i "" "s/__mop_flutter_sdk_version__/${version}/g" pubspec.yaml
# iOS podspec
if [ -n "$iosVersion" ]
then
echo "更新mop.podspec====>"
cp -r ios/mop.podspec.tpl ios/mop.podspec
sed -i "" "s/__finapplet_version__/${iosVersion}/g" ios/mop.podspec
fi
# android gradle
if [ -n "$androidVersion" ]
then
echo "更新build.gradle====>"
cp -r android/build.gradle.tpl android/build.gradle
sed -i "" "s/__finapplet_version__/${androidVersion}/g" android/build.gradle
fi
cat pubspec.yaml
git remote add ssh-origin ssh://git@gitlab.finogeeks.club:2233/finclipsdk/finclip-flutter-sdk.git
git add .
git commit -m "release: version:$version"
git tag -d ${version}
git push ssh-origin --delete tag ${version}
git tag -a ${version} -m 'FinClip-Flutter-SDK发版'
git push ssh-origin HEAD:refs/heads/master --tags -f
#export http_proxy=http://127.0.0.1:1087
#export https_proxy=http://127.0.0.1:1087
flutter packages pub publish --dry-run --server=https://pub.dartlang.org
flutter packages pub publish --server=https://pub.dartlang.org --force
#unset http_proxy
#unset https_proxy
git remote add github ssh://git@github.com/finogeeks/mop-flutter-sdk.git
#git push github HEAD:refs/heads/master --tags
git push github HEAD:refs/heads/master

View File

@ -83,26 +83,9 @@ class _MyAppState extends State<MyApp> {
Mop.instance.registerExtensionApi('getUserProfile', getUserProfile);
Mop.instance.registerExtensionApi('pushNativePage', pushNativePage);
if (!mounted) return;
}
Future<Map<String, dynamic>> pushNativePage(dynamic params) async {
print(params);
Map<String, dynamic> result = {
"userInfo":{
"nickName" : "haley",
"avatarUrl" : "https://www.finclip.com",
"gender" : 1,
"country" : "China",
"province" : "Guangdong",
"city" : "shenzhen",
}
};
return Future.value(result);
}
Future<Map<String, dynamic>> getUserProfile(dynamic params) async {
Map<String, dynamic> result = {
"userInfo":{
@ -279,12 +262,6 @@ class MyAppletHandler extends AppletHandler {
return Future.value(result);
}
// @override
// Future<Map<String, dynamic>> getUserInfo() {
// // TODO: implement getUserInfo
// throw UnimplementedError();
// }
@override
Future<void> onCustomMenuClick(String appId, String path, String menuId, String appInfo) {
// TODO: implement onCustomMenuClick

View File

@ -47,59 +47,41 @@
- (NSDictionary *)getUserInfoWithAppletInfo:(FATAppletInfo *)appletInfo {
NSLog(@"getUserInfoWithAppletInfo");
__block NSDictionary *userInfo;
CFRunLoopRef runLoop = CFRunLoopGetCurrent();
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
[channel invokeMethod:@"extensionApi:getUserInfo" arguments:nil result:^(id _Nullable result) {
CFRunLoopStop(runLoop);
CFRunLoopStop(CFRunLoopGetMain());
userInfo = result;
}];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
CFRunLoopStop(runLoop);
});
CFRunLoopRun();
return userInfo;
}
- (BOOL)appletInfo:(FATAppletInfo *)appletInfo didClickMoreBtnAtPath:(NSString *)path {
NSLog(@"appletInfo:didClickMoreBtnAtPath");
__block BOOL flag;
CFRunLoopRef runLoop = CFRunLoopGetCurrent();
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
NSLog(@"appletInfo:didClickMoreBtnAtPath,appId=%@,path=%@,channel=%@",appletInfo.appId,path,channel);
[channel invokeMethod:@"extensionApi:customCapsuleMoreButtonClick" arguments:@{@"appId": appletInfo.appId} result:^(id _Nullable result) {
CFRunLoopStop(runLoop);
CFRunLoopStop(CFRunLoopGetMain());
if ([result isKindOfClass:[NSNumber class]]) {
flag = [result boolValue];
}
}];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
CFRunLoopStop(runLoop);
});
CFRunLoopRun();
return flag;
}
- (NSArray<id<FATAppletMenuProtocol>> *)customMenusInApplet:(FATAppletInfo *)appletInfo atPath:(NSString *)path {
NSLog(@"customMenusInApplet:%@,appletInfo=%@",path,appletInfo);
NSLog(@"customMenusInApplet");
__block NSArray *list;
CFRunLoopRef runLoop = CFRunLoopGetCurrent();
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
[channel invokeMethod:@"extensionApi:getCustomMenus" arguments:@{@"appId": appletInfo.appId} result:^(id _Nullable result) {
CFRunLoopStop(runLoop);
CFRunLoopStop(CFRunLoopGetMain());
if ([result isKindOfClass:[NSArray class]]) {
list = result;
NSLog(@"customMenusInApplet2222:list=%@",list);
}
}];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
CFRunLoopStop(runLoop);
});
CFRunLoopRun();
NSLog(@"customMenusInApplet:%@,list=%@",path,list);
NSMutableArray *models = [NSMutableArray array];
for (NSDictionary<NSString *, NSString *> *data in list) {
@ -130,9 +112,7 @@
return models;
}
- (void)clickCustomItemMenuWithInfo:(NSDictionary *)contentInfo inApplet:(FATAppletInfo *)appletInfo completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion {
NSLog(@"HJH1,clickCustomItemMenuWithInfo");
NSError *parseError = nil;
NSMutableDictionary *shareDic = [[NSMutableDictionary alloc] initWithDictionary:[self dictionaryRepresentation:appletInfo]];
[shareDic setValue:@{@"desc" : shareDic[@"originalInfo"][@"customData"][@"detailDescription"]} forKey:@"params"];
@ -140,10 +120,10 @@
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:shareDic options:NSJSONWritingPrettyPrinted error:&parseError];
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSDictionary *arguments = @{
@"appId": contentInfo[@"appId"],
@"path": contentInfo[@"path"],
@"menuId": contentInfo[@"menuId"],
@"appInfo": jsonString
@"appId": contentInfo[@"appId"],
@"path": contentInfo[@"path"],
@"menuId": contentInfo[@"menuId"],
@"appInfo": jsonString
};
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
[channel invokeMethod:@"extensionApi:onCustomMenuClick" arguments:arguments result:^(id _Nullable result) {
@ -153,7 +133,6 @@
if ([@"Desktop" isEqualToString:contentInfo[@"menuId"]]) {
[self addToDesktopItemClick:appletInfo path:contentInfo[@"path"]];
}
NSLog(@"HJH2,clickCustomItemMenuWithInfo");
}
- (NSDictionary *)dictionaryRepresentation:(FATAppletInfo *)object {

View File

@ -23,22 +23,6 @@
return _instance;
}
- (BOOL)getUserInfoWithAppletInfo:(FATAppletInfo *)appletInfo bindGetUserInfo:(void (^)(NSDictionary *result))bindGetUserInfo
{
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
NSLog(@"getUserInfoWithAppletInfo:%@", channel);
[channel invokeMethod:@"extensionApi:getUserInfo" arguments:nil result:^(id _Nullable result) {
NSDictionary *userInfo;
if (![result isKindOfClass:[NSDictionary class]]) {
userInfo = @{@"errMsg":@"getUserInfo:fail return value format invalid"};
} else {
userInfo = result;
}
bindGetUserInfo(userInfo);
}];
return YES;
}
- (BOOL)getUserProfileWithAppletInfo:(FATAppletInfo *)appletInfo
bindGetUserProfile:(void (^)(NSDictionary *result))bindGetUserProfile
{

View File

@ -69,7 +69,7 @@
} else {
config.language = FATPreferredLanguageSimplifiedChinese;
}
config.customLanguagePath = self.config[@"customLanguagePath"];
NSError* error = nil;
FATUIConfig *uiconfig = [[FATUIConfig alloc]init];

View File

@ -15,13 +15,15 @@
{
NSLog(@"MOP_registerExtensionApi");
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
NSString *name = self.name;
[[FATClient sharedClient] registerExtensionApi:name handler:^(FATAppletInfo *appletInfo, id param, FATExtensionApiCallback callback) {
NSLog(@"channel:%@---invoke ExtensionApi:%@, param:%@", channel, name, param);
NSString *api = [@"extensionApi:" stringByAppendingString:name];
[[FATClient sharedClient] registerExtensionApi:self.name handle:^(id param, FATExtensionApiCallback callback) {
NSLog(@"invoke ExtensionApi:");
NSLog(@"%@",self.name);
NSLog(@"%@",param);
NSString* api = [@"extensionApi:" stringByAppendingString:self.name];
[channel invokeMethod:api arguments:param result:^(id _Nullable result) {
NSLog(@"extensionApi [%@] reslut:%@", name, result);
NSLog(@"extensionApi reslut:%@",result);
// flutter
// BOOL isFlutterError = [result isKindOfClass:[FlutterError class]] || result == FlutterMethodNotImplemented;
BOOL isValid = [result isKindOfClass:[NSDictionary class]];
if (!isValid) {
NSLog(@"extensionApi reslut is not NSDictionary");
@ -32,7 +34,7 @@
BOOL hasError = [[result allKeys] containsObject:@"errMsg"];
if (hasError) {
NSString *errMsg = result[@"errMsg"];
NSString *errPrefix = [NSString stringWithFormat:@"%@:fail", name];
NSString *errPrefix = [NSString stringWithFormat:@"%@:fail", self.name];
BOOL isFail = [errMsg hasPrefix:errPrefix];
if (isFail) {
NSLog(@"extensionApi reslut:fail");

View File

@ -64,12 +64,7 @@ static MopPlugin *_instance;
binaryMessenger:[registrar messenger]];
[registrar addMethodCallDelegate:_instance channel:appletShareChannel];
_instance.shareAppletMethodChannel = appletShareChannel;
//phiz
FlutterMethodChannel* phizChannel = [FlutterMethodChannel
methodChannelWithName:@"Phiz"
binaryMessenger:[registrar messenger]];
[registrar addMethodCallDelegate:_instance channel:phizChannel];
_instance.phizMethodChannel = phizChannel;
}
+ (instancetype)instance{

View File

@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk.
s.dependency 'Flutter'
s.ios.deployment_target = '9.0'
s.dependency 'FinApplet' , '2.42.7'
s.dependency 'FinAppletExt' , '2.42.7'
s.dependency 'FinApplet' , '2.41.11'
s.dependency 'FinAppletExt' , '2.41.11'
end

View File

@ -210,19 +210,6 @@ class Config {
/// SDK
LanguageType language = LanguageType.Chinese;
/// iOS
/// SDK language
///
/// mainBundle @"abc.lproj"
/// Bundle @"bundleName.bundle/abc.lproj"
String? customLanguagePath;
/// Android
/// SDK language
/// https://uutool.cn/info-i18n/ Java java.util.Locale
/// zh_CNzh_TWen
String? localeLanguage;
/// Android
/// 使tbs
bool useLocalTbsCore = false;
@ -280,8 +267,6 @@ class Config {
"useLocalTbsCore": useLocalTbsCore,
"tbsCoreUrl": tbsCoreUrl,
"enableJ2V8": enableJ2V8,
"customLanguagePath": customLanguagePath,
"localeLanguage": localeLanguage,
};
}
}

View File

@ -1,6 +1,6 @@
name: mop
description: A Finogeeks MiniProgram Flutter SDK.
version: '2.42.7'
version: '2.41.11'
homepage: https://github.com/finogeeks/mop-flutter-sdk
environment: