From 641681f9b6156e9299cf4763d1b21d60477b8304 Mon Sep 17 00:00:00 2001 From: kangxuyao Date: Mon, 27 Jul 2020 09:13:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E7=94=B3=E8=AF=B7=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/build.gradle | 2 +- .../java/com/finogeeks/mop/api/mop/BaseModule.java | 5 +++++ example/ios/Podfile.lock | 10 +++++----- ios/Classes/Api/MOP_initialize.h | 1 + ios/Classes/Api/MOP_initialize.m | 3 +++ ios/mop.podspec | 2 +- lib/mop.dart | 10 +++++++--- 7 files changed, 23 insertions(+), 10 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 019b617..4c0116c 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.9.2' + implementation 'com.finogeeks.lib:finapplet:2.8.81' } diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/BaseModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/BaseModule.java index 08b326b..385e89b 100644 --- a/android/src/main/java/com/finogeeks/mop/api/mop/BaseModule.java +++ b/android/src/main/java/com/finogeeks/mop/api/mop/BaseModule.java @@ -56,6 +56,10 @@ public class BaseModule extends BaseApi { apiPrefix = apiPrefix + "/"; } } + Boolean disablePermission = (Boolean) param.get("disablePermission"); + if (disablePermission == null) { + disablePermission = false; + } FinAppConfig config = new FinAppConfig.Builder() .setAppKey(appkey) .setAppSecret(secret) @@ -63,6 +67,7 @@ public class BaseModule extends BaseApi { .setApiPrefix(apiPrefix) .setGlideWithJWT(false) .setEncryptionType(cryptType) + .setDisableRequestPermissions(disablePermission) .build(); // SDK初始化结果回调,用于接收SDK初始化状态 FinCallback cb = new FinCallback() { diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 25168ca..52b35d5 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,8 +1,8 @@ PODS: - - FinApplet (2.2.0) + - FinApplet (2.4.16) - Flutter (1.0.0) - mop (0.1.0): - - FinApplet (= 2.2.0) + - FinApplet (= 2.4.16) - Flutter DEPENDENCIES: @@ -20,10 +20,10 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/mop/ios" SPEC CHECKSUMS: - FinApplet: 53f8235e950dd540c7cd1716b709a9154dfa05fc + FinApplet: 7e1996d9bc81279a675dda954c8386ea05e7fe26 Flutter: 0e3d915762c693b495b44d77113d4970485de6ec - mop: 0c8c250840b4e424d84c49ac4b747ee7113d1195 + mop: 64c0911b36f549bd62e06e63f5e8eb8d3de1e78d PODFILE CHECKSUM: fa591ea0d89752dd0191ae3f82c83db034678e82 -COCOAPODS: 1.9.1 +COCOAPODS: 1.9.3 diff --git a/ios/Classes/Api/MOP_initialize.h b/ios/Classes/Api/MOP_initialize.h index 4738795..5aff9f6 100644 --- a/ios/Classes/Api/MOP_initialize.h +++ b/ios/Classes/Api/MOP_initialize.h @@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic,copy)NSString* apiServer; @property(nonatomic,copy)NSString* apiPrefix; @property(nonatomic,copy)NSString* cryptType; +@property (nonatomic, assign) BOOL disablePermission; @end NS_ASSUME_NONNULL_END diff --git a/ios/Classes/Api/MOP_initialize.m b/ios/Classes/Api/MOP_initialize.m index 01a4e4b..6f046d6 100644 --- a/ios/Classes/Api/MOP_initialize.m +++ b/ios/Classes/Api/MOP_initialize.m @@ -33,7 +33,10 @@ { config.cryptType = FATApiCryptTypeMD5; } + + NSLog(@"disablePermission:%d",self.disablePermission); config.autoAdaptDarkMode = YES; + config.disableAuthorize = self.disablePermission; NSError* error = nil; [[FATClient sharedClient] initWithConfig:config error:&error]; if (error) { diff --git a/ios/mop.podspec b/ios/mop.podspec index ca5c5d1..1c9cede 100644 --- a/ios/mop.podspec +++ b/ios/mop.podspec @@ -17,6 +17,6 @@ A new flutter plugin project. s.dependency 'Flutter' s.ios.deployment_target = '8.0' - s.dependency 'FinApplet' , '2.5.6' + s.dependency 'FinApplet' , '2.4.16' end diff --git a/lib/mop.dart b/lib/mop.dart index 8f51b33..0155727 100644 --- a/lib/mop.dart +++ b/lib/mop.dart @@ -67,16 +67,20 @@ class Mop { /// [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 /// [cryptType] is optional. cryptType, should be MD5/SM - /// + /// [disablePermission] is optional. /// Future initialize(String appkey, String secret, - {String apiServer, String apiPrefix, String cryptType}) async { + {String apiServer, + String apiPrefix, + String cryptType, + bool disablePermission}) async { final Map ret = await _channel.invokeMethod('initialize', { 'appkey': appkey, 'secret': secret, 'apiServer': apiServer, 'apiPrefix': apiPrefix, - 'cryptType': cryptType + 'cryptType': cryptType, + 'disablePermission': disablePermission }); return ret; }