sdk 升级

phiz_2.43.5.1
Sean 2024-03-13 17:25:01 +08:00
parent a300a7b5b2
commit 3791672084
12 changed files with 131 additions and 104 deletions

View File

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

View File

@ -64,12 +64,19 @@ public class AppletModule extends BaseApi {
Map<String, String> params = (Map) param.get("params"); Map<String, String> params = (Map) param.get("params");
String apiServer = (String) param.get("apiServer"); String apiServer = (String) param.get("apiServer");
Boolean isSingleProcess = (Boolean) param.get("isSingleProcess"); Boolean isSingleProcess = (Boolean) param.get("isSingleProcess");
Boolean isSingTask = (Boolean) param.get("isSingTask");
IFinAppletRequest.ProcessMode processMode; IFinAppletRequest.ProcessMode processMode;
if (Boolean.TRUE.equals(isSingleProcess)) { if (Boolean.TRUE.equals(isSingleProcess)) {
processMode = IFinAppletRequest.ProcessMode.SINGLE; processMode = IFinAppletRequest.ProcessMode.SINGLE;
} else { } else {
processMode = IFinAppletRequest.ProcessMode.MULTI; processMode = IFinAppletRequest.ProcessMode.MULTI;
} }
IFinAppletRequest.TaskMode taskMode;
if (Boolean.TRUE.equals(isSingTask)) {
taskMode = IFinAppletRequest.TaskMode.SINGLE;
} else {
taskMode = IFinAppletRequest.TaskMode.MULTI;
}
// mContextFlutterActivity // mContextFlutterActivity
// Android 6.07.0contextmContext // Android 6.07.0contextmContext
// 使Application Context // 使Application Context
@ -82,7 +89,9 @@ public class AppletModule extends BaseApi {
IFinAppletRequest.Companion.fromAppId(apiServer, appId) IFinAppletRequest.Companion.fromAppId(apiServer, appId)
.setStartParams(startParams) .setStartParams(startParams)
.setSequence(sequence) .setSequence(sequence)
.setProcessMode(processMode), .setProcessMode(processMode)
.setTaskMode(taskMode)
,
null null
); );
// FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, apiServer, appId, sequence, startParams,null); // FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, apiServer, appId, sequence, startParams,null);
@ -154,12 +163,19 @@ public class AppletModule extends BaseApi {
String offlineMiniprogramZipPath = (String) param.get("offlineMiniprogramZipPath"); String offlineMiniprogramZipPath = (String) param.get("offlineMiniprogramZipPath");
String offlineFrameworkZipPath = (String) param.get("offlineFrameworkZipPath"); String offlineFrameworkZipPath = (String) param.get("offlineFrameworkZipPath");
Boolean isSingleProcess = (Boolean) param.get("isSingleProcess"); Boolean isSingleProcess = (Boolean) param.get("isSingleProcess");
Boolean isSingTask = (Boolean) param.get("isSingTask");
IFinAppletRequest.ProcessMode processMode; IFinAppletRequest.ProcessMode processMode;
if (Boolean.TRUE.equals(isSingleProcess)) { if (Boolean.TRUE.equals(isSingleProcess)) {
processMode = IFinAppletRequest.ProcessMode.SINGLE; processMode = IFinAppletRequest.ProcessMode.SINGLE;
} else { } else {
processMode = IFinAppletRequest.ProcessMode.MULTI; processMode = IFinAppletRequest.ProcessMode.MULTI;
} }
IFinAppletRequest.TaskMode taskMode;
if (Boolean.TRUE.equals(isSingTask)) {
taskMode = IFinAppletRequest.TaskMode.SINGLE;
} else {
taskMode = IFinAppletRequest.TaskMode.MULTI;
}
Log.d("MopPlugin", "startApplet (appId=" + appId + ", sequence=" + sequence + ", apiServer=" + apiServer + ", isSingleProcess:" + isSingleProcess); Log.d("MopPlugin", "startApplet (appId=" + appId + ", sequence=" + sequence + ", apiServer=" + apiServer + ", isSingleProcess:" + isSingleProcess);
// mContextFlutterActivity // mContextFlutterActivity
@ -175,7 +191,8 @@ public class AppletModule extends BaseApi {
.setSequence(sequence) .setSequence(sequence)
.setStartParams(params) .setStartParams(params)
.setOfflineParams(offlineFrameworkZipPath, offlineMiniprogramZipPath) .setOfflineParams(offlineFrameworkZipPath, offlineMiniprogramZipPath)
.setProcessMode(processMode), .setProcessMode(processMode)
.setTaskMode(taskMode),
null); null);
// request // request
// FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, IFinAppletRequest.Companion.fromAppId("apiServer", "appId") // FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, IFinAppletRequest.Companion.fromAppId("apiServer", "appId")
@ -186,14 +203,21 @@ public class AppletModule extends BaseApi {
private void scanOpenApplet(Map param, ICallback callback) { private void scanOpenApplet(Map param, ICallback callback) {
String info = String.valueOf(param.get("info")); String info = String.valueOf(param.get("info"));
Boolean isSingleProcess = (Boolean) param.get("isSingleProcess"); Boolean isSingleProcess = (Boolean) param.get("isSingleProcess");
Boolean isSingTask = (Boolean) param.get("isSingTask");
IFinAppletRequest.ProcessMode processMode; IFinAppletRequest.ProcessMode processMode;
if (Boolean.TRUE.equals(isSingleProcess)) { if (Boolean.TRUE.equals(isSingleProcess)) {
processMode = IFinAppletRequest.ProcessMode.SINGLE; processMode = IFinAppletRequest.ProcessMode.SINGLE;
} else { } else {
processMode = IFinAppletRequest.ProcessMode.MULTI; processMode = IFinAppletRequest.ProcessMode.MULTI;
} }
IFinAppletRequest.TaskMode taskMode;
if (Boolean.TRUE.equals(isSingTask)) {
taskMode = IFinAppletRequest.TaskMode.SINGLE;
} else {
taskMode = IFinAppletRequest.TaskMode.MULTI;
}
FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, IFinAppletRequest.Companion.fromDecrypt(info) FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, IFinAppletRequest.Companion.fromDecrypt(info)
.setProcessMode(processMode), null); .setProcessMode(processMode).setTaskMode(taskMode), null);
// FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, new StartAppletDecryptRequest(info),null); // FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, new StartAppletDecryptRequest(info),null);
callback.onSuccess(new HashMap()); callback.onSuccess(new HashMap());
} }
@ -201,14 +225,21 @@ public class AppletModule extends BaseApi {
private void qrcodeOpenApplet(Map param, ICallback callback) { private void qrcodeOpenApplet(Map param, ICallback callback) {
String qrcode = String.valueOf(param.get("qrcode")); String qrcode = String.valueOf(param.get("qrcode"));
Boolean isSingleProcess = (Boolean) param.get("isSingleProcess"); Boolean isSingleProcess = (Boolean) param.get("isSingleProcess");
Boolean isSingTask = (Boolean) param.get("isSingTask");
IFinAppletRequest.ProcessMode processMode; IFinAppletRequest.ProcessMode processMode;
if (Boolean.TRUE.equals(isSingleProcess)) { if (Boolean.TRUE.equals(isSingleProcess)) {
processMode = IFinAppletRequest.ProcessMode.SINGLE; processMode = IFinAppletRequest.ProcessMode.SINGLE;
} else { } else {
processMode = IFinAppletRequest.ProcessMode.MULTI; processMode = IFinAppletRequest.ProcessMode.MULTI;
} }
IFinAppletRequest.TaskMode taskMode;
if (Boolean.TRUE.equals(isSingTask)) {
taskMode = IFinAppletRequest.TaskMode.SINGLE;
} else {
taskMode = IFinAppletRequest.TaskMode.MULTI;
}
FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, IFinAppletRequest.Companion.fromQrCode(qrcode) FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, IFinAppletRequest.Companion.fromQrCode(qrcode)
.setProcessMode(processMode), new FinCallback<String>() { .setProcessMode(processMode).setTaskMode(taskMode), new FinCallback<String>() {
@Override @Override
public void onSuccess(String s) { public void onSuccess(String s) {
callback.onSuccess(new HashMap()); callback.onSuccess(new HashMap());

View File

@ -25,30 +25,24 @@ public class ExtensionApiModule extends BaseApi {
private static final String TAG = "ExtensionApiModule"; private static final String TAG = "ExtensionApiModule";
private final Context cur;
private Handler handler = new Handler(Looper.getMainLooper()); private Handler handler = new Handler(Looper.getMainLooper());
public ExtensionApiModule(Context context) { public ExtensionApiModule(Context context) {
super(context); super(context);
cur = context;
} }
@Override @Override
public String[] apis() { public String[] apis() {
return new String[]{"registerExtensionApi", "registerSyncExtensionApi", "addWebExtentionApi"}; return new String[]{"registerExtensionApi","registerSyncExtensionApi","addWebExtentionApi"};
} }
@Override @Override
public void invoke(String s, Map param, ICallback iCallback) { public void invoke(String s, Map param, ICallback iCallback) {
boolean isFinAppProcess = FinAppClient.INSTANCE.isFinAppProcess(cur);
Log.d(TAG, "ExtensionApiModule invoke register api s:" + s + " param:" + param +" isFinAppProcess:"+isFinAppProcess);
if(s.equals("registerExtensionApi")) { if(s.equals("registerExtensionApi")) {
MethodChannel channel = MopPluginService.getInstance().getMethodChannel(); MethodChannel channel = MopPluginService.getInstance().getMethodChannel();
String name = (String) param.get("name"); String name = (String) param.get("name");
Log.d(TAG, "registerExtensionApi:" + name); Log.d(TAG, "registerExtensionApi:" + name);
FinAppClient.INSTANCE.getExtensionApiManager().registerApi(new com.finogeeks.lib.applet.api.BaseApi(cur) { FinAppClient.INSTANCE.getExtensionApiManager().registerApi(new com.finogeeks.lib.applet.api.BaseApi(getContext()) {
@Override @Override
public String[] apis() { public String[] apis() {
return new String[]{name}; return new String[]{name};
@ -56,7 +50,7 @@ public class ExtensionApiModule extends BaseApi {
@Override @Override
public void invoke(String s, JSONObject jsonObject, com.finogeeks.lib.applet.interfaces.ICallback iCallback) { public void invoke(String s, JSONObject jsonObject, com.finogeeks.lib.applet.interfaces.ICallback iCallback) {
Log.d("MopPlugin", "invoke extensionApi:" + s + ",params:" + jsonObject+" isFinAppProcess:"+isFinAppProcess); Log.d("MopPlugin", "invoke extensionApi:" + s + ",params:" + jsonObject);
Map params = GsonUtil.gson.fromJson(jsonObject.toString(), HashMap.class); Map params = GsonUtil.gson.fromJson(jsonObject.toString(), HashMap.class);
handler.post(() -> { handler.post(() -> {
channel.invokeMethod("extensionApi:" + name, params, new MethodChannel.Result() { channel.invokeMethod("extensionApi:" + name, params, new MethodChannel.Result() {
@ -162,7 +156,7 @@ public class ExtensionApiModule extends BaseApi {
MethodChannel channel = MopPluginService.getInstance().getMethodChannel(); MethodChannel channel = MopPluginService.getInstance().getMethodChannel();
String name = (String) param.get("name"); String name = (String) param.get("name");
Log.d(TAG, "addWebExtentionApi:" + name); Log.d(TAG, "addWebExtentionApi:" + name);
FinAppClient.INSTANCE.getExtensionWebApiManager().registerApi(new com.finogeeks.lib.applet.api.BaseApi(cur) { FinAppClient.INSTANCE.getExtensionWebApiManager().registerApi(new com.finogeeks.lib.applet.api.BaseApi(getContext()) {
@Override @Override
public String[] apis() { public String[] apis() {
return new String[]{name}; return new String[]{name};

View File

@ -138,6 +138,12 @@ public class InitSDKModule extends BaseApi {
if (maxRunningApplet != null) { if (maxRunningApplet != null) {
configBuilder.setMaxRunningApplet(maxRunningApplet); configBuilder.setMaxRunningApplet(maxRunningApplet);
} }
Integer backgroundFetchPeriod = (Integer) configMap.get("backgroundFetchPeriod");
if (backgroundFetchPeriod != null) {
configBuilder.setBackgroundFetchPeriod(backgroundFetchPeriod);
}
Integer webViewMixedContentMode = (Integer) configMap.get("webViewMixedContentMode"); Integer webViewMixedContentMode = (Integer) configMap.get("webViewMixedContentMode");
if (webViewMixedContentMode != null) { if (webViewMixedContentMode != null) {
configBuilder.setWebViewMixedContentMode(webViewMixedContentMode); configBuilder.setWebViewMixedContentMode(webViewMixedContentMode);

View File

@ -39,6 +39,7 @@ public class InitUtils {
uiConfig.setHideShareAppletMenu((Boolean) map.get("isHideShareAppletMenu")); uiConfig.setHideShareAppletMenu((Boolean) map.get("isHideShareAppletMenu"));
uiConfig.setHideAddToDesktopMenu((Boolean) map.get("isHideAddToDesktopMenu")); uiConfig.setHideAddToDesktopMenu((Boolean) map.get("isHideAddToDesktopMenu"));
uiConfig.setHideFavoriteMenu((Boolean) map.get("isHideFavoriteMenu")); uiConfig.setHideFavoriteMenu((Boolean) map.get("isHideFavoriteMenu"));
uiConfig.setHideClearCacheMenu((Boolean) map.get("isHideClearCacheMenu"));
uiConfig.setHideSettingMenu((Boolean) map.get("isHideSettingMenu")); uiConfig.setHideSettingMenu((Boolean) map.get("isHideSettingMenu"));
uiConfig.setHideTransitionCloseButton((Boolean) map.get("hideTransitionCloseButton")); uiConfig.setHideTransitionCloseButton((Boolean) map.get("hideTransitionCloseButton"));
uiConfig.setUseNativeLiveComponent((Boolean) map.get("useNativeLiveComponent")); uiConfig.setUseNativeLiveComponent((Boolean) map.get("useNativeLiveComponent"));

View File

@ -37,46 +37,26 @@
if([result isKindOfClass:[FlutterError class]]|| [result isKindOfClass:[FlutterMethodNotImplemented class] ]) if([result isKindOfClass:[FlutterError class]]|| [result isKindOfClass:[FlutterMethodNotImplemented class] ])
{ {
completion(FATExtensionCodeFailure,nil); completion(FATExtensionCodeFailure,nil);
}else } else {
{
completion(FATExtensionCodeSuccess,result); completion(FATExtensionCodeSuccess,result);
} }
}]; }];
} }
- (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) {
userInfo = result;
CFRunLoopStop(runLoop);
}];
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 { - (BOOL)appletInfo:(FATAppletInfo *)appletInfo didClickMoreBtnAtPath:(NSString *)path {
__block BOOL flag; __block BOOL flag;
CFRunLoopRef runLoop = CFRunLoopGetCurrent(); CFRunLoopRef runLoop = CFRunLoopGetCurrent();
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel]; 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) { [channel invokeMethod:@"extensionApi:customCapsuleMoreButtonClick" arguments:@{@"appId": appletInfo.appId} result:^(id _Nullable result) {
if ([result isKindOfClass:[NSNumber class]]) { if ([result isKindOfClass:[NSNumber class]]) {
flag = [result boolValue]; flag = [result boolValue];
} }
CFRunLoopStop(runLoop); CFRunLoopStop(runLoop);
}]; }];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
CFRunLoopStop(runLoop); CFRunLoopStop(runLoop);
}); });
CFRunLoopRun(); CFRunLoopRun();
return flag; return flag;
} }
@ -89,16 +69,13 @@
[channel invokeMethod:@"extensionApi:getCustomMenus" arguments:@{@"appId": appletInfo.appId} result:^(id _Nullable result) { [channel invokeMethod:@"extensionApi:getCustomMenus" arguments:@{@"appId": appletInfo.appId} result:^(id _Nullable result) {
if ([result isKindOfClass:[NSArray class]]) { if ([result isKindOfClass:[NSArray class]]) {
list = result; list = result;
NSLog(@"customMenusInApplet2222:list=%@",list);
} }
CFRunLoopStop(runLoop); CFRunLoopStop(runLoop);
}]; }];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
CFRunLoopStop(runLoop); CFRunLoopStop(runLoop);
}); });
CFRunLoopRun(); CFRunLoopRun();
NSLog(@"customMenusInApplet:%@,list=%@",path,list);
NSMutableArray *models = [NSMutableArray array]; NSMutableArray *models = [NSMutableArray array];
for (NSDictionary<NSString *, NSString *> *data in list) { for (NSDictionary<NSString *, NSString *> *data in list) {
@ -129,9 +106,7 @@
return models; return models;
} }
- (void)clickCustomItemMenuWithInfo:(NSDictionary *)contentInfo inApplet:(FATAppletInfo *)appletInfo completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion { - (void)clickCustomItemMenuWithInfo:(NSDictionary *)contentInfo inApplet:(FATAppletInfo *)appletInfo completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion {
NSLog(@"HJH1,clickCustomItemMenuWithInfo");
NSError *parseError = nil; NSError *parseError = nil;
NSMutableDictionary *shareDic = [[NSMutableDictionary alloc] initWithDictionary:[self dictionaryRepresentation:appletInfo]]; NSMutableDictionary *shareDic = [[NSMutableDictionary alloc] initWithDictionary:[self dictionaryRepresentation:appletInfo]];
[shareDic setValue:@{@"desc" : shareDic[@"originalInfo"][@"customData"][@"detailDescription"]} forKey:@"params"]; [shareDic setValue:@{@"desc" : shareDic[@"originalInfo"][@"customData"][@"detailDescription"]} forKey:@"params"];
@ -152,7 +127,6 @@
if ([@"Desktop" isEqualToString:contentInfo[@"menuId"]]) { if ([@"Desktop" isEqualToString:contentInfo[@"menuId"]]) {
[self addToDesktopItemClick:appletInfo path:contentInfo[@"path"]]; [self addToDesktopItemClick:appletInfo path:contentInfo[@"path"]];
} }
NSLog(@"HJH2,clickCustomItemMenuWithInfo");
} }
- (NSDictionary *)dictionaryRepresentation:(FATAppletInfo *)object { - (NSDictionary *)dictionaryRepresentation:(FATAppletInfo *)object {

View File

@ -7,8 +7,6 @@
#import "Mop_initSDK.h" #import "Mop_initSDK.h"
#import "MOPTools.h" #import "MOPTools.h"
#import "FinAppletExt.h"
@implementation MOP_initSDK @implementation MOP_initSDK
@ -70,6 +68,9 @@
config.schemes = self.config[@"schemes"]; config.schemes = self.config[@"schemes"];
config.webViewInspectable = [self.config[@"debug"] boolValue]; config.webViewInspectable = [self.config[@"debug"] boolValue];
NSInteger languageInteger = [self.config[@"language"] integerValue]; NSInteger languageInteger = [self.config[@"language"] integerValue];
if (self.config[@"backgroundFetchPeriod"]) {
config.backgroundFetchPeriod = [self.config[@"backgroundFetchPeriod"] integerValue];
}
if (languageInteger == 1) { if (languageInteger == 1) {
config.language = FATPreferredLanguageEnglish; config.language = FATPreferredLanguageEnglish;
} else { } else {
@ -110,6 +111,7 @@
uiconfig.hideRefreshMenu = [_uiConfig[@"isHideRefreshMenu"] boolValue]; uiconfig.hideRefreshMenu = [_uiConfig[@"isHideRefreshMenu"] boolValue];
uiconfig.hideFavoriteMenu = [_uiConfig[@"isHideFavoriteMenu"] boolValue]; uiconfig.hideFavoriteMenu = [_uiConfig[@"isHideFavoriteMenu"] boolValue];
uiconfig.hideAddToDesktopMenu = [_uiConfig[@"isHideAddToDesktopMenu"] boolValue]; uiconfig.hideAddToDesktopMenu = [_uiConfig[@"isHideAddToDesktopMenu"] boolValue];
uiconfig.hideClearCacheMenu = [_uiConfig[@"isHideClearCacheMenu"] boolValue];
// //
if (_uiConfig[@"capsuleConfig"]) { if (_uiConfig[@"capsuleConfig"]) {

View File

@ -7,7 +7,7 @@
#import "MOP_initialize.h" #import "MOP_initialize.h"
#import <FinApplet/FinApplet.h> #import <FinApplet/FinApplet.h>
#import "FinAppletExt.h" #import <FinAppletExt/FinAppletExt.h>
#import <FinAppletBLE/FinAppletBLE.h> #import <FinAppletBLE/FinAppletBLE.h>
#import "MOPTools.h" #import "MOPTools.h"
@ -127,9 +127,6 @@
// [[FATExtClient sharedClient] fat_prepareExtensionApis]; // [[FATExtClient sharedClient] fat_prepareExtensionApis];
[[FATClient sharedClient].logManager initLogWithLogDir:nil logLevel:FATLogLevelVerbose consoleLog:YES]; [[FATClient sharedClient].logManager initLogWithLogDir:nil logLevel:FATLogLevelVerbose consoleLog:YES];
[[FATClient sharedClient] setEnableLog:YES];
success(@{}); success(@{});

View File

@ -21,9 +21,8 @@ A finclip miniprogram flutter sdk.
s.vendored_libraries = 'Classes/FinAppletExt/Vendor/Lame/libmp3lame.a' s.vendored_libraries = 'Classes/FinAppletExt/Vendor/Lame/libmp3lame.a'
s.static_framework = true s.static_framework = true
s.dependency 'FinApplet' , '2.43.0-dev20230103v05' s.dependency 'FinApplet' , '2.43.5'
s.dependency 'FinAppletExt' , '2.43.0-dev20230103v05' s.dependency 'FinAppletExt' , '2.43.5'
s.dependency 'FinAppletBLE' , '2.43.0-dev20230103v05' s.dependency 'FinAppletBLE' , '2.43.0-dev20230103v05'
end end

View File

@ -22,8 +22,7 @@ A finclip miniprogram flutter sdk.
s.static_framework = true s.static_framework = true
s.dependency 'FinApplet' , '__finapplet_version__' s.dependency 'FinApplet' , '__finapplet_version__'
# s.dependency 'FinAppletExt' , '__finapplet_version__'
s.dependency 'FinAppletBLE' s.dependency 'FinAppletBLE'
s.dependency 'FinAppletExt' , '__finapplet_version__'
end end

View File

@ -46,7 +46,7 @@ class FinStoreConfig {
this.cryptType = "MD5", this.cryptType = "MD5",
this.fingerprint, this.fingerprint,
this.encryptServerData = false, this.encryptServerData = false,
this.enablePreloadFramework = false, this.enablePreloadFramework = true,
this.googleMapApiKey = ''}); this.googleMapApiKey = ''});
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
@ -166,7 +166,6 @@ class Config {
/// scheme /// scheme
List<String>? schemes; List<String>? schemes;
/// Android
/// debug /// debug
bool debug = false; bool debug = false;
@ -201,7 +200,6 @@ class Config {
/// ///
LogLevel logLevel = LogLevel.LEVEL_NONE; LogLevel logLevel = LogLevel.LEVEL_NONE;
/// Android
/// ///
/// 1 1 * 24 * 60 * 60 /// 1 1 * 24 * 60 * 60
int? logMaxAliveSec; int? logMaxAliveSec;
@ -241,6 +239,9 @@ class Config {
/// j2v8 /// j2v8
bool enableJ2V8 = false; bool enableJ2V8 = false;
/// (), 03-12
int backgroundFetchPeriod = 12;
Config(this.finStoreConfigs); Config(this.finStoreConfigs);
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
@ -282,11 +283,12 @@ class Config {
"logMaxAliveSec": logMaxAliveSec, "logMaxAliveSec": logMaxAliveSec,
"logDir": logDir, "logDir": logDir,
"enablePreNewProcess": enablePreNewProcess, "enablePreNewProcess": enablePreNewProcess,
"language":language.index, "language": language.index,
"useLocalTbsCore": useLocalTbsCore, "useLocalTbsCore": useLocalTbsCore,
"tbsCoreUrl": tbsCoreUrl, "tbsCoreUrl": tbsCoreUrl,
"enableJ2V8": enableJ2V8, "enableJ2V8": enableJ2V8,
"customLanguagePath": customLanguagePath, "customLanguagePath": customLanguagePath,
"backgroundFetchPeriod": backgroundFetchPeriod,
"localeLanguage": localeLanguage, "localeLanguage": localeLanguage,
}; };
} }
@ -342,12 +344,15 @@ class UIConfig {
/// ... /// ...
bool isHideFavoriteMenu = true; bool isHideFavoriteMenu = true;
// ... false /// ... false
bool isHideRefreshMenu = false; bool isHideRefreshMenu = false;
// ... false /// ... false
bool isHideSettingMenu = false; bool isHideSettingMenu = false;
/// ... false
bool isHideClearCacheMenu = false;
/// ///
CapsuleConfig? capsuleConfig; CapsuleConfig? capsuleConfig;
@ -369,7 +374,7 @@ class UIConfig {
// true // true
bool autoAdaptDarkMode = false; bool autoAdaptDarkMode = false;
// 使livefalse(iOS) // 使livefalse
// trueLiveSDK // trueLiveSDK
bool useNativeLiveComponent = false; bool useNativeLiveComponent = false;
@ -421,6 +426,7 @@ class UIConfig {
"isHideSettingMenu": isHideSettingMenu, "isHideSettingMenu": isHideSettingMenu,
"isHideAddToDesktopMenu": isHideAddToDesktopMenu, "isHideAddToDesktopMenu": isHideAddToDesktopMenu,
"isHideFavoriteMenu": isHideFavoriteMenu, "isHideFavoriteMenu": isHideFavoriteMenu,
"isHideClearCacheMenu": isHideClearCacheMenu,
"hideTransitionCloseButton": hideTransitionCloseButton, "hideTransitionCloseButton": hideTransitionCloseButton,
"capsuleConfig": capsuleConfig?.toMap(), "capsuleConfig": capsuleConfig?.toMap(),
"navHomeConfig": navHomeConfig?.toMap(), "navHomeConfig": navHomeConfig?.toMap(),
@ -787,12 +793,16 @@ class BaseAppletRequest {
// androidfalse // androidfalse
bool isSingleProcess; bool isSingleProcess;
// androidfalse
bool isSingTask;
BaseAppletRequest({ BaseAppletRequest({
required this.apiServer, required this.apiServer,
required this.appletId, required this.appletId,
this.startParams, this.startParams,
this.animated = true, this.animated = true,
this.isSingleProcess = false, this.isSingleProcess = false,
this.isSingTask = false,
}); });
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
@ -802,6 +812,7 @@ class BaseAppletRequest {
"startParams": startParams, "startParams": startParams,
"animated": animated, "animated": animated,
"isSingleProcess": isSingleProcess, "isSingleProcess": isSingleProcess,
"isSingTask": isSingTask,
}; };
} }
} }
@ -835,6 +846,9 @@ class RemoteAppletRequest {
// androidfalse // androidfalse
bool isSingleProcess; bool isSingleProcess;
// androidfalse
bool isSingTask;
RemoteAppletRequest({ RemoteAppletRequest({
required this.apiServer, required this.apiServer,
required this.appletId, required this.appletId,
@ -845,6 +859,7 @@ class RemoteAppletRequest {
this.animated = true, this.animated = true,
this.transitionStyle = TranstionStyle.TranstionStyleUp, this.transitionStyle = TranstionStyle.TranstionStyleUp,
this.isSingleProcess = false, this.isSingleProcess = false,
this.isSingTask = false,
}); });
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
@ -853,7 +868,8 @@ class RemoteAppletRequest {
"appletId": appletId, "appletId": appletId,
"animated": animated, "animated": animated,
"isSingleProcess": isSingleProcess, "isSingleProcess": isSingleProcess,
"transitionStyle":transitionStyle.index, "isSingTask": isSingTask,
"transitionStyle": transitionStyle.index,
}; };
if (startParams != null) result["startParams"] = startParams; if (startParams != null) result["startParams"] = startParams;
if (offlineMiniprogramZipPath != null) if (offlineMiniprogramZipPath != null)
@ -876,13 +892,18 @@ class QRCodeAppletRequest {
// androidfalse // androidfalse
bool isSingleProcess; bool isSingleProcess;
QRCodeAppletRequest(this.qrCode, {this.isSingleProcess = false}); // androidfalse
bool isSingTask;
QRCodeAppletRequest(this.qrCode,
{this.isSingleProcess = false, this.isSingTask = false});
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
return { return {
"apiServer": qrCode, "apiServer": qrCode,
"animated": animated, "animated": animated,
"isSingleProcess": isSingleProcess, "isSingleProcess": isSingleProcess,
"isSingTask": isSingTask,
}; };
} }
} }
@ -1020,10 +1041,8 @@ class Mop {
/// [customWebViewUserAgent] webview ua /// [customWebViewUserAgent] webview ua
/// [appletIntervalUpdateLimit] /// [appletIntervalUpdateLimit]
/// [maxRunningApplet] /// [maxRunningApplet]
Future<Map> initialize( Future<Map> initialize(String sdkkey, String secret,
String sdkkey, {String? apiServer,
String secret, {
String? apiServer,
String? apiPrefix, String? apiPrefix,
String? cryptType, String? cryptType,
bool encryptServerData = false, bool encryptServerData = false,
@ -1036,8 +1055,7 @@ class Mop {
UIConfig? uiConfig, UIConfig? uiConfig,
String? customWebViewUserAgent, String? customWebViewUserAgent,
int? appletIntervalUpdateLimit, int? appletIntervalUpdateLimit,
int? maxRunningApplet int? maxRunningApplet}) async {
}) async {
List<Map<String, dynamic>>? storeConfigs = List<Map<String, dynamic>>? storeConfigs =
finStoreConfigs?.map((e) => e.toMap()).toList(); finStoreConfigs?.map((e) => e.toMap()).toList();
@ -1077,9 +1095,9 @@ class Mop {
/// [query] is miniprogram query parameters. example key1=value1&key2=value2 /// [query] is miniprogram query parameters. example key1=value1&key2=value2
/// [sequence] is miniprogram sequence. example 0,1.2.3,4,5... /// [sequence] is miniprogram sequence. example 0,1.2.3,4,5...
/// [apiServer] is optional. the mop server address. default is https://mp.finogeek.com /// [apiServer] is optional. the mop server address. default is https://mp.finogeek.com
/// [apiPrefix] is optional. the mop server prefix. default is /api/v1/mop /// [scene]
/// [fingerprint] is optional. the mop sdk fingerprint. is nullable /// [shareDepth]
/// [cryptType] is optional. cryptType, should be MD5/SM /// [isSingleProcess]
Future<Map> openApplet( Future<Map> openApplet(
final String appId, { final String appId, {
final String? path, final String? path,
@ -1089,6 +1107,7 @@ class Mop {
final String? scene, final String? scene,
final String? shareDepth, final String? shareDepth,
final bool isSingleProcess = false, final bool isSingleProcess = false,
final bool isSingTask = false,
}) async { }) async {
Map<String, Object> params = {'appId': appId}; Map<String, Object> params = {'appId': appId};
Map param = {}; Map param = {};
@ -1100,6 +1119,7 @@ class Mop {
if (scene != null) param["scene"] = scene; if (scene != null) param["scene"] = scene;
if (shareDepth != null) param["shareDepth"] = shareDepth; if (shareDepth != null) param["shareDepth"] = shareDepth;
params["isSingleProcess"] = isSingleProcess; params["isSingleProcess"] = isSingleProcess;
params["isSingTask"] = isSingTask;
final Map ret = await _channel.invokeMethod('openApplet', params); final Map ret = await _channel.invokeMethod('openApplet', params);
return ret; return ret;
} }
@ -1112,19 +1132,23 @@ class Mop {
/// ///
/// [qrcode] /// [qrcode]
Future qrcodeOpenApplet(String qrcode, {bool isSingleProcess = false}) async { Future qrcodeOpenApplet(String qrcode,
{bool isSingleProcess = false, bool isSingTask = false}) async {
Map<String, Object> params = { Map<String, Object> params = {
'qrcode': qrcode, 'qrcode': qrcode,
'isSingleProcess': isSingleProcess, 'isSingleProcess': isSingleProcess,
'isSingTask': isSingTask,
}; };
return await _channel.invokeMapMethod("qrcodeOpenApplet", params); return await _channel.invokeMapMethod("qrcodeOpenApplet", params);
} }
/// -- /// --
Future scanOpenApplet(String info, {bool isSingleProcess = false}) async { Future scanOpenApplet(String info,
{bool isSingleProcess = false, bool isSingTask = false}) async {
Map<String, Object> params = { Map<String, Object> params = {
'info': info, 'info': info,
'isSingleProcess': isSingleProcess, 'isSingleProcess': isSingleProcess,
'isSingTask': isSingTask,
}; };
return await _channel.invokeMapMethod("scanOpenApplet", params); return await _channel.invokeMapMethod("scanOpenApplet", params);
} }

View File

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