RandyWei пре 5 година
родитељ
комит
ba6bd08a75
4 измењених фајлова са 58 додато и 13 уклоњено
  1. 2 2
      CHANGELOG.md
  2. 53 9
      README.md
  3. 3 0
      example/android/app/proguard-rules.pro
  4. 0 2
      lib/face/face_plugin.dart

+ 2 - 2
CHANGELOG.md

@@ -1,3 +1,3 @@
-## 0.0.1
+## 1.0.0
 
 
-* TODO: Describe initial release.
+* 人脸识别功能

+ 53 - 9
README.md

@@ -1,14 +1,58 @@
-# fltbdface
+# 百度人脸采集SDK Flutter版本
 
 
 Baidu's face recognition SDK encapsulates the flutter version, calls native SDK and interface operations, and returns data to flutter
 Baidu's face recognition SDK encapsulates the flutter version, calls native SDK and interface operations, and returns data to flutter
 
 
-## Getting Started
+## 安装
 
 
-This project is a starting point for a Flutter
-[plug-in package](https://flutter.dev/developing-packages/),
-a specialized package that includes platform-specific implementation code for
-Android and/or iOS.
+```
+//pub方式
+dependencies:
+  flt_bd_face: ^0.0.4
 
 
-For help getting started with Flutter, view our 
-[online documentation](https://flutter.dev/docs), which offers tutorials, 
-samples, guidance on mobile development, and a full API reference.
+//导入方式
+dependencies:
+  flt_video_player:
+    git:
+      url: https://github.com/RandyWei/flt_bd_face.git
+```
+
+### Android
+android/app/build.gradle配置如下
+```
+android {
+
+    ....
+
+    //将签名配置完整
+    signingConfigs {
+        Release {
+            keyAlias 'keyAlias'
+            keyPassword 'keyPassword'
+            storeFile file('storeFile')
+            storePassword 'storePassword'
+        }
+    }
+
+    ....
+
+    buildTypes {
+        release {
+            signingConfig signingConfigs.Release
+            //开启混淆。新版Flutter默认将混淆打开了,所以要配置混淆规则,否则release版本会有问题
+            useProguard true
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+        }
+        debug {
+            signingConfig signingConfigs.Release
+        }
+    }
+}
+```
+
+混淆规则,也可以直接copy example中的规则文件
+
+```
+-keep class com.baidu.** {*;}
+-keep class vi.com.** {*;}
+-dontwarn com.baidu.**
+```

+ 3 - 0
example/android/app/proguard-rules.pro

@@ -0,0 +1,3 @@
+-keep class com.baidu.** {*;}
+-keep class vi.com.** {*;}
+-dontwarn com.baidu.**

+ 0 - 2
lib/face/face_plugin.dart

@@ -6,7 +6,6 @@ class FacePlugin {
   MethodChannel _channel = MethodChannel("plugin.bughub.dev/fltbdface");
   MethodChannel _channel = MethodChannel("plugin.bughub.dev/fltbdface");
 
 
   initialize({String licenseId, String licenseFileName}) {
   initialize({String licenseId, String licenseFileName}) {
-    //"android-license-0000-face-android", "idl-license.face-android"
     _channel.invokeMethod("initialize",
     _channel.invokeMethod("initialize",
         {"licenseId": licenseId, "licenseFileName": licenseFileName}).catchError((error) {
         {"licenseId": licenseId, "licenseFileName": licenseFileName}).catchError((error) {
       print("initialize:$error");
       print("initialize:$error");
@@ -15,7 +14,6 @@ class FacePlugin {
   }
   }
 
 
   setFaceConfig(FaceConfig _config) {
   setFaceConfig(FaceConfig _config) {
-    print(_config.toJson());
     _channel.invokeMethod("setFaceConfig", _config.toJson()).catchError((error) {
     _channel.invokeMethod("setFaceConfig", _config.toJson()).catchError((error) {
       print("setFaceConfig:$error");
       print("setFaceConfig:$error");
     });
     });