Skip to content

Commit 8621a25

Browse files
author
CyJaySong
committed
Version of no permission check.
1 parent 1a82179 commit 8621a25

File tree

6 files changed

+28
-66
lines changed

6 files changed

+28
-66
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.1.0
2+
3+
* Version of no permission check.
4+
* 无权限检查的版本。
5+
16
## 1.0.4
27

38
* update README, add old-sdk verison guide.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ a baidu face offline collect plugin. Only Android and IOS platforms are supporte
1414
| iOS | 4.1 |
1515

1616
## Preparing for use
17+
18+
PS:已注释隐私授权检查,故使用前请自行检查授权
19+
1720
### Android
1821
`AndroidManifest.xml``application` 标签内添加以下内容:
1922
```xml
@@ -24,8 +27,6 @@ a baidu face offline collect plugin. Only Android and IOS platforms are supporte
2427
在 Android 项目的`app/src/main/assets` 目录下放入百度离线采集SDK的Android授权文件,文件名固定为 `idl-license.face-android`
2528
SDK 会校验 apk 签名,请使用申请授权相符的签名证书
2629
### iOS
27-
由于使用了[permission_handler](https://pub.dev/packages/permission_handler)
28-
校验隐私授权,请按照permission_handler的使用文档添加使用相机的权限声明。
2930

3031
`Info.plist``dict` 标签内添加以下内容
3132
```xml

example/pubspec.lock

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ packages:
6868
path: ".."
6969
relative: true
7070
source: path
71-
version: "1.0.3"
71+
version: "1.1.0"
7272
flutter_test:
7373
dependency: "direct dev"
7474
description: flutter
@@ -95,27 +95,6 @@ packages:
9595
url: "https://pub.flutter-io.cn"
9696
source: hosted
9797
version: "1.8.0"
98-
permission_handler:
99-
dependency: transitive
100-
description:
101-
name: permission_handler
102-
url: "https://pub.flutter-io.cn"
103-
source: hosted
104-
version: "8.0.1"
105-
permission_handler_platform_interface:
106-
dependency: transitive
107-
description:
108-
name: permission_handler_platform_interface
109-
url: "https://pub.flutter-io.cn"
110-
source: hosted
111-
version: "3.5.1"
112-
plugin_platform_interface:
113-
dependency: transitive
114-
description:
115-
name: plugin_platform_interface
116-
url: "https://pub.flutter-io.cn"
117-
source: hosted
118-
version: "2.0.0"
11998
sky_engine:
12099
dependency: transitive
121100
description: flutter
@@ -179,4 +158,4 @@ packages:
179158
version: "2.1.0"
180159
sdks:
181160
dart: ">=2.12.0 <3.0.0"
182-
flutter: ">=1.22.0"
161+
flutter: ">=1.20.0"

lib/flutter_bdface_collect.dart

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'dart:async';
22
import 'dart:io';
33

44
import 'package:flutter/services.dart';
5-
import 'package:permission_handler/permission_handler.dart';
65

76
import 'constants.dart';
87
import 'model.dart';
@@ -25,22 +24,22 @@ class _ServiceApi {
2524

2625
/// 初始化
2726
Future<String?> init(String licenseId) async {
28-
var s = await Permission.camera.status;
29-
if (![PermissionStatus.granted, PermissionStatus.limited].contains(s)) {
30-
s = await Permission.camera.request();
31-
if (![PermissionStatus.granted, PermissionStatus.limited].contains(s)) {
32-
return "errCode: OTHER_ERROR, errMsg: 无相机使用权限";
33-
}
34-
}
35-
if (Platform.isAndroid) {
36-
s = await Permission.storage.status;
37-
if (![PermissionStatus.granted, PermissionStatus.limited].contains(s)) {
38-
s = await Permission.storage.request();
39-
if (![PermissionStatus.granted, PermissionStatus.limited].contains(s)) {
40-
return "errCode: OTHER_ERROR, errMsg: 无本地存储权限";
41-
}
42-
}
43-
}
27+
// var s = await Permission.camera.status;
28+
// if (![PermissionStatus.granted, PermissionStatus.limited].contains(s)) {
29+
// s = await Permission.camera.request();
30+
// if (![PermissionStatus.granted, PermissionStatus.limited].contains(s)) {
31+
// return "errCode: OTHER_ERROR, errMsg: 无相机使用权限";
32+
// }
33+
// }
34+
// if (Platform.isAndroid) {
35+
// s = await Permission.storage.status;
36+
// if (![PermissionStatus.granted, PermissionStatus.limited].contains(s)) {
37+
// s = await Permission.storage.request();
38+
// if (![PermissionStatus.granted, PermissionStatus.limited].contains(s)) {
39+
// return "errCode: OTHER_ERROR, errMsg: 无本地存储权限";
40+
// }
41+
// }
42+
// }
4443
final String? err = await _methodChannel.invokeMethod<String>(
4544
MethodConstants.Init, licenseId);
4645
return err;

pubspec.lock

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -81,27 +81,6 @@ packages:
8181
url: "https://pub.flutter-io.cn"
8282
source: hosted
8383
version: "1.8.0"
84-
permission_handler:
85-
dependency: "direct main"
86-
description:
87-
name: permission_handler
88-
url: "https://pub.flutter-io.cn"
89-
source: hosted
90-
version: "8.0.1"
91-
permission_handler_platform_interface:
92-
dependency: transitive
93-
description:
94-
name: permission_handler_platform_interface
95-
url: "https://pub.flutter-io.cn"
96-
source: hosted
97-
version: "3.5.1"
98-
plugin_platform_interface:
99-
dependency: transitive
100-
description:
101-
name: plugin_platform_interface
102-
url: "https://pub.flutter-io.cn"
103-
source: hosted
104-
version: "2.0.0"
10584
sky_engine:
10685
dependency: transitive
10786
description: flutter
@@ -165,4 +144,4 @@ packages:
165144
version: "2.1.0"
166145
sdks:
167146
dart: ">=2.12.0 <3.0.0"
168-
flutter: ">=1.22.0"
147+
flutter: ">=1.20.0"

pubspec.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_bdface_collect
22
description: a baidu face collect plugin. Only Android and IOS platforms are supported.
3-
version: 1.0.4
3+
version: 1.1.0
44
homepage: https://github.com/fluttercandies/flutter_bdface_collect
55
publish_to: https://pub.dev
66
environment:
@@ -10,7 +10,6 @@ environment:
1010
dependencies:
1111
flutter:
1212
sdk: flutter
13-
permission_handler: ^8.0.0
1413

1514
dev_dependencies:
1615
flutter_test:

0 commit comments

Comments
 (0)