配置流程

最近更新时间:2019-07-09 14:57:30

接入配置

注意事项

  • 人脸核身 SDK(WbCloudFaceVerify)最低支持到 Android API 14: Android 4.0(ICS) ,请在构建项目时注意。
  • 人脸核身 SDK 将以 AAR 文件的形式提供,默认黑色皮肤,无需格外设置。
  • 人脸核身 SDK 同时需要依赖云公共组件 WbCloudNormal,同样也是以 AAR 文件的形式提供。
  • 需要为人脸核身 SDK 添加依赖,方式如下:
    将提供的 AAR 文件加入到 App 工程的 libs 文件夹下面,并且在 build.gradle 中添加下面的配置。
android{
     //...
     repositories {
        flatDir {
            dirs 'libs' //this way we can find the .aar file in libs folder
        }
    }
}
//添加依赖
dependencies {
     //0. appcompat-v7
 compile 'com.android.support:appcompat-v7:23.0.1'
 //1. 云刷脸SDK
 compile(name: 'WbCloudFaceVerifySdk', ext: 'aar')
 //2. 云normal SDK
 compile(name: 'WbCloudNormal', ext: 'aar')
}
    }

混淆配置

云人脸核身产品的混淆规则分为:云人脸核身 SDK(光线活体)的混淆规则、云公共组件的混淆规则、依赖的第三方库混淆规则,下面将为您详细介绍。

云人脸核身 SDK(光线活体)的混淆规则

您可以将如下代码拷贝到您的混淆文件中,也可以将 SDK 中的webank-cloud-face-light-proguard-rules.pro拷贝到主工程根目录下,然后通过-include webank-cloud-face-light-rules.pro加入到您的混淆文件中。

###############云刷脸(光线活体)混淆规则 faceverify-BEGIN##################
#不混淆内部类
-keepattributes InnerClasses

-keep public class com.webank.facelight.tools.WbCloudFaceVerifySdk{
    public <methods>;
    public static final *;
}
-keep public class com.webank. facelight.tools.WbCloudFaceVerifySdk$*{
    *;
}
-keep public class com.webank.record.**{
    public <methods>;
    public static final *;
}
-keep public class com.webank. facelight.ui.FaceVerifyStatus{

}
-keep public class com.webank. facelight.ui.FaceVerifyStatus$Mode{
    *;
}
-keep public class com.webank. facelight.tools.IdentifyCardValidate{
    public <methods>;
}
-keep public class com.tencent.youtulivecheck.**{
    *;
}
-keep public class com.webank. facelight.contants.**{
    *;
}
-keep public class com.webank. facelight.listerners.**{
    *;
}
-keep public class com.webank. facelight.Request.*$*{
    *;
}
-keep public class com.webank. facelight.Request.*{
    *;
}
-keep public class com.webank. facelight.config.FaceVerifyConfig {
    public <methods>;
}

-keep public class com.webank. facelight.ui.fragment.FaceLiveUseCase{
     *;
}
-keep public class com.webank. facelight.ui.fragment.FaceLiveUseCase$YTFaceLiveCallback{
     *;
}
-keep class com.tencent.youtuface.**{
    *;
}
-keep class com.tencent.youtulivecheck.**{
    *;
}
-keep class com.tencent.youtufacetrack.**{
    *;
}
-keep class com.tencent.youtufacelive.model.**{
    *;
}
-keep class com.tencent.youtufacelive.tools.YTUtils{
    public <methods>;
}
-keep class com.tencent.youtufacelive.tools.YTFaceLiveLogger{
    public <methods>;
}
-keep class com.tencent.youtufacelive.tools.YTFaceLiveLogger$IFaceLiveLogger{
     *;
}
-keep class com.tencent.youtufacelive.IYTMaskStateListener{
    *;
}
-keep class com.tencent.youtufacelive.YTPreviewHandlerThread{
    public static *;
    public <methods>;
}
-keep class com.tencent.youtufacelive.YTPreviewHandlerThread$IUploadListener{
     *;
}
-keep class com.tencent.youtufacelive.YTPreviewHandlerThread$ISetCameraParameterListener{
     *;
}
-keep class com.tencent.youtufacelive.YTPreviewMask{
    public <methods>;
}
-keep class com.tencent.youtufacelive.YTPreviewMask$TickCallback{
    *;
}
# 保留自定义控件(继承自View)不能被混淆
-keep public class * extends android.view.View {
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
    public void set*(***);
    *** get* ();
}
################云刷脸混淆规则 faceverify-END########################

云公共组件的混淆规则

您可以将如下代码拷贝到您的混淆文件中,也可以将 SDK 中的webank-cloud-normal-proguard-rules.pro拷贝到主工程根目录下,然后通过-include webank-cloud-normal-rules.pro加入到您的混淆文件中。

#############webank normal混淆规则-BEGIN###################
#不混淆内部类
-keepattributes InnerClasses
-keepattributes *Annotation*
-keepattributes Signature

-keep, allowobfuscation @interface com.webank.normal.xview.Inflater
-keep, allowobfuscation @interface com.webank.normal.xview.Find
-keep, allowobfuscation @interface com.webank.normal.xview.BindClick

-keep @com.webank.normal.xview.Inflater class *
-keepclassmembers class * {
    @com.webank.normal.Find *;
    @com.webank.normal.BindClick *;
}

-keep public class com.webank.normal.net.*$*{
    *;
}
-keep public class com.webank.normal.net.*{
    *;
}
-keep public class com.webank.normal.thread.*$*{
   *;
}
-keep public class com.webank.normal.thread. *{
   *;
}
-keep public class com.webank.normal.tools.WLogger{
    *;
}
-keep public class com.webank.normal.tools.*{
*;
}

#wehttp混淆规则
-dontwarn com.webank.mbank.okio.**

-keep class com.webank.mbank.wehttp.**{
    public <methods>;
}
-keep interface com.webank.mbank.wehttp.**{
    public <methods>;
}
-keep public class com.webank.mbank.wehttp.WeLog$Level{
    *;
}
-keep class com.webank.mbank.wejson.WeJson{
    public <methods>;
}

#webank normal包含的第三方库bugly
-keep class com.tencent.bugly.webank.**{
    *;
}
###########webank normal混淆规则-END#######################

云人脸核身依赖的第三方库的混淆规则

您可以根据您现有的混淆规则,将缺少的第三库混淆规则拷贝到您的混淆文件中。

########云产品依赖的第三方库 混淆规则-BEGIN############

## support:appcompat-v7
-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }

-keep public class * extends android.support.v4.view.ActionProvider {
    public <init>(android.content.Context);
}

#########云产品依赖的第三方库 混淆规则-END#############