From 5e939fdc46dd2a2a42c7be2f0ba2b29750421b68 Mon Sep 17 00:00:00 2001 From: Sean Date: Mon, 25 Dec 2023 14:45:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A72.42.13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/build.gradle | 4 +- .../finogeeks/mop/api/mop/AppletModule.java | 42 +++++++++++++++---- ios/Classes/Api/MOP_initSDK.m | 16 ++++--- ios/mop.podspec | 39 ++++++++--------- ios/mop.podspec.tpl | 39 ++++++++--------- pubspec.yaml | 2 +- 6 files changed, 81 insertions(+), 61 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 1c9182e..4d05b42 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -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.42.13' + implementation 'com.finogeeks.mop:plugins:2.42.13' } \ No newline at end of file diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java index 8ac50c0..830e62d 100644 --- a/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java +++ b/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java @@ -5,8 +5,8 @@ import android.text.TextUtils; import android.util.Log; import com.finogeeks.lib.applet.client.FinAppClient; -import com.finogeeks.lib.applet.interfaces.FinCallback; import com.finogeeks.lib.applet.client.FinAppInfo; +import com.finogeeks.lib.applet.interfaces.FinCallback; import com.finogeeks.lib.applet.sdk.api.request.IFinAppletRequest; import com.finogeeks.lib.applet.sdk.model.StartAppletDecryptRequest; import com.finogeeks.mop.api.BaseApi; @@ -64,6 +64,12 @@ public class AppletModule extends BaseApi { Map params = (Map) param.get("params"); String apiServer = (String) param.get("apiServer"); Boolean isSingleProcess = (Boolean) param.get("isSingleProcess"); + IFinAppletRequest.ProcessMode processMode; + if (Boolean.TRUE.equals(isSingleProcess)) { + processMode = IFinAppletRequest.ProcessMode.SINGLE; + } else { + processMode = IFinAppletRequest.ProcessMode.MULTI; + } // mContext是FlutterActivity, // 在Android 6.0、7.0系统的部分设备中热启动小程序时,如果context参数用mContext,会出现无法启动小程序的问题 // 所以这里使用Application Context @@ -76,7 +82,7 @@ public class AppletModule extends BaseApi { IFinAppletRequest.Companion.fromAppId(apiServer, appId) .setStartParams(startParams) .setSequence(sequence) - .setSingleProcess(Boolean.TRUE.equals(isSingleProcess)), + .setProcessMode(processMode), null ); // FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, apiServer, appId, sequence, startParams,null); @@ -85,7 +91,7 @@ public class AppletModule extends BaseApi { IFinAppletRequest.Companion.fromAppId(appId) .setStartParams(startParams) .setSequence(sequence) - .setSingleProcess(Boolean.TRUE.equals(isSingleProcess)), + .setProcessMode(processMode), null ); } @@ -148,8 +154,14 @@ public class AppletModule extends BaseApi { String offlineMiniprogramZipPath = (String) param.get("offlineMiniprogramZipPath"); String offlineFrameworkZipPath = (String) param.get("offlineFrameworkZipPath"); Boolean isSingleProcess = (Boolean) param.get("isSingleProcess"); + IFinAppletRequest.ProcessMode processMode; + if (Boolean.TRUE.equals(isSingleProcess)) { + processMode = IFinAppletRequest.ProcessMode.SINGLE; + } else { + processMode = IFinAppletRequest.ProcessMode.MULTI; + } - Log.d("MopPlugin", "startApplet (appId=" + appId + ", sequence=" + sequence + " apiServer=" + apiServer + ")"); + Log.d("MopPlugin", "startApplet (appId=" + appId + ", sequence=" + sequence + ", apiServer=" + apiServer + ", isSingleProcess:" + isSingleProcess); // mContext是FlutterActivity, // 在Android 6.0、7.0系统的部分设备中热启动小程序时,如果context参数用mContext,会出现无法启动小程序的问题 // 所以这里使用Application Context @@ -163,7 +175,7 @@ public class AppletModule extends BaseApi { .setSequence(sequence) .setStartParams(params) .setOfflineParams(offlineFrameworkZipPath, offlineMiniprogramZipPath) - .setSingleProcess(Boolean.TRUE.equals(isSingleProcess)), + .setProcessMode(processMode), null); // 改成通过request来启动小程序 // FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, IFinAppletRequest.Companion.fromAppId("apiServer", "appId") @@ -174,17 +186,29 @@ public class AppletModule extends BaseApi { private void scanOpenApplet(Map param, ICallback callback) { String info = String.valueOf(param.get("info")); Boolean isSingleProcess = (Boolean) param.get("isSingleProcess"); + IFinAppletRequest.ProcessMode processMode; + if (Boolean.TRUE.equals(isSingleProcess)) { + processMode = IFinAppletRequest.ProcessMode.SINGLE; + } else { + processMode = IFinAppletRequest.ProcessMode.MULTI; + } FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, IFinAppletRequest.Companion.fromDecrypt(info) - .setSingleProcess(Boolean.TRUE.equals(isSingleProcess)), null); + .setProcessMode(processMode), null); // FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, new StartAppletDecryptRequest(info),null); callback.onSuccess(new HashMap()); } - private void qrcodeOpenApplet(Map param, ICallback callback){ + private void qrcodeOpenApplet(Map param, ICallback callback) { String qrcode = String.valueOf(param.get("qrcode")); Boolean isSingleProcess = (Boolean) param.get("isSingleProcess"); + IFinAppletRequest.ProcessMode processMode; + if (Boolean.TRUE.equals(isSingleProcess)) { + processMode = IFinAppletRequest.ProcessMode.SINGLE; + } else { + processMode = IFinAppletRequest.ProcessMode.MULTI; + } FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, IFinAppletRequest.Companion.fromQrCode(qrcode) - .setSingleProcess(Boolean.TRUE.equals(isSingleProcess)), new FinCallback() { + .setProcessMode(processMode), new FinCallback() { @Override public void onSuccess(String s) { callback.onSuccess(new HashMap()); @@ -235,4 +259,4 @@ public class AppletModule extends BaseApi { }); } } -} +} \ No newline at end of file diff --git a/ios/Classes/Api/MOP_initSDK.m b/ios/Classes/Api/MOP_initSDK.m index f5e6e1d..7e961b5 100644 --- a/ios/Classes/Api/MOP_initSDK.m +++ b/ios/Classes/Api/MOP_initSDK.m @@ -7,7 +7,6 @@ #import "Mop_initSDK.h" #import "MOPTools.h" -#import "FinAppletExt.h" @implementation MOP_initSDK @@ -67,6 +66,7 @@ config.h5AjaxHookRequestKey = self.config[@"h5AjaxHookRequestKey"]; config.pageCountLimit = [self.config[@"pageCountLimit"] integerValue]; config.schemes = self.config[@"schemes"]; + config.webViewInspectable = [self.config[@"debug"] boolValue]; NSInteger languageInteger = [self.config[@"language"] integerValue]; if (languageInteger == 1) { config.language = FATPreferredLanguageEnglish; @@ -260,17 +260,21 @@ return; } + int logMaxAliveSec = [self.config[@"logMaxAliveSec"] intValue]; + if (logMaxAliveSec) { + [[FATClient sharedClient].logManager setLogFileAliveDuration:logMaxAliveSec]; + } + + BOOL debug = [self.config[@"debug"] boolValue]; NSInteger logLevelIntValue = [self.config[@"logLevel"] integerValue]; - if (logLevelIntValue >= 5) { - [[FATClient sharedClient].logManager closeLog]; - } else { + if (debug && logLevelIntValue < 5) { FATLogLevel logLevel = logLevelIntValue; NSString *logDir = self.config[@"logDir"]; [[FATClient sharedClient].logManager initLogWithLogDir:logDir logLevel:logLevel consoleLog:YES]; + } else { + [FATClient sharedClient].enableLog = NO; } - [[FATClient sharedClient] setEnableLog:YES]; - success(@{}); } diff --git a/ios/mop.podspec b/ios/mop.podspec index fdce8c1..1abb16a 100644 --- a/ios/mop.podspec +++ b/ios/mop.podspec @@ -2,25 +2,22 @@ # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| -s.name = 'mop' -s.version = '0.1.1' -s.summary = 'finclip miniprogram flutter sdk' -s.description = <<-DESC - A finclip miniprogram flutter sdk. -DESC - s.homepage = 'https://www.finclip.com' -s.license = { :file => '../LICENSE' } -s.author = { 'finogeeks' => 'contact@finogeeks.com' } -s.source = { :path => '.' } -s.source_files = 'Classes/**/*' -s.public_header_files = 'Classes/**/*.h' -s.dependency 'Flutter' -s.ios.deployment_target = '9.0' -s.resources = ['Classes/FinAppletExt/Resource/FinAppletExt.bundle'] -s.vendored_libraries = 'Classes/FinAppletExt/Vendor/fincore/libfincore.a' -s.vendored_libraries = 'Classes/FinAppletExt/Vendor/Lame/libmp3lame.a' -s.static_framework = true + s.name = 'mop' + s.version = '0.1.1' + s.summary = 'finclip miniprogram flutter sdk' + s.description = <<-DESC +A finclip miniprogram flutter sdk. + DESC + s.homepage = 'https://www.finclip.com' + s.license = { :file => '../LICENSE' } + s.author = { 'finogeeks' => 'contact@finogeeks.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.public_header_files = 'Classes/**/*.h' + s.dependency 'Flutter' + s.ios.deployment_target = '9.0' + + s.dependency 'FinApplet' , '2.42.13' + s.dependency 'FinAppletExt' , '2.42.13' +end -s.dependency 'FinApplet' , '2.42.7' -s.dependency 'FinAppletBLE' -end \ No newline at end of file diff --git a/ios/mop.podspec.tpl b/ios/mop.podspec.tpl index 3b3e209..5071fdc 100644 --- a/ios/mop.podspec.tpl +++ b/ios/mop.podspec.tpl @@ -2,27 +2,22 @@ # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| -s.name = 'mop' -s.version = '0.1.1' -s.summary = 'finclip miniprogram flutter sdk' -s.description = <<-DESC - A finclip miniprogram flutter sdk. -DESC - s.homepage = 'https://www.finclip.com' -s.license = { :file => '../LICENSE' } -s.author = { 'finogeeks' => 'contact@finogeeks.com' } -s.source = { :path => '.' } -s.source_files = 'Classes/**/*' -s.public_header_files = 'Classes/**/*.h' -s.dependency 'Flutter' -s.ios.deployment_target = '9.0' -s.resources = ['Classes/FinAppletExt/Resource/FinAppletExt.bundle'] -s.vendored_libraries = 'Classes/FinAppletExt/Vendor/fincore/libfincore.a' -s.vendored_libraries = 'Classes/FinAppletExt/Vendor/Lame/libmp3lame.a' -s.static_framework = true + s.name = 'mop' + s.version = '0.1.1' + s.summary = 'finclip miniprogram flutter sdk' + s.description = <<-DESC +A finclip miniprogram flutter sdk. + DESC + s.homepage = 'https://www.finclip.com' + s.license = { :file => '../LICENSE' } + s.author = { 'finogeeks' => 'contact@finogeeks.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.public_header_files = 'Classes/**/*.h' + s.dependency 'Flutter' + s.ios.deployment_target = '9.0' -s.dependency 'FinApplet' , '__finapplet_version__' -# s.dependency 'FinAppletExt' , '__finapplet_version__' -s.dependency 'FinAppletBLE' + s.dependency 'FinApplet' , '__finapplet_version__' + s.dependency 'FinAppletExt' , '__finapplet_version__' +end -end \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 783ca20..6371b6b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: mop description: A Finogeeks MiniProgram Flutter SDK. -version: '2.42.7' +version: '2.42.13' homepage: https://github.com/finogeeks/mop-flutter-sdk environment: