浏览代码

1.2.5 其余bug fix 1.修改了扫码UI
2.修改配置文件路径,从Android/data/com.hh.bdface/files改到根目录下3.保活时的声音关闭

xulh 7 月之前
父节点
当前提交
184105c946

+ 2 - 1
app/src/main/AndroidManifest.xml

@@ -67,7 +67,7 @@
         android:supportsRtl="true"
         android:theme="@style/AppTheme"
         tools:replace="android:name,android:allowBackup,android:theme,android:icon,android:roundIcon">
-        <activity android:name=".ui.MainActivity">
+        <activity android:name=".ui.SplashActivity">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 
@@ -75,6 +75,7 @@
             </intent-filter>
         </activity>
         <activity android:name=".ui.SettingActivity" />
+        <activity android:name=".ui.MainActivity" />
 
         <receiver android:name=".broadcastreceiver.AutoStartBroadReceiver" />
         <service android:name=".utils.usbserialdemo.UsbService" />

+ 19 - 0
app/src/main/java/com/hh/bdface/bean/LocalConfigBean.java

@@ -0,0 +1,19 @@
+package com.hh.bdface.bean;
+
+import com.google.gson.annotations.SerializedName;
+
+public class LocalConfigBean {
+
+
+    private String baiduFaceOnlineCode;
+
+    public String getBaiduFaceOnlineCode() {
+        return baiduFaceOnlineCode;
+    }
+
+    public void setBaiduFaceOnlineCode(String baiduFaceOnlineCode) {
+        this.baiduFaceOnlineCode = baiduFaceOnlineCode;
+    }
+
+
+}

+ 2 - 1
app/src/main/java/com/hh/bdface/broadcastreceiver/AutoStartBroadReceiver.java

@@ -8,6 +8,7 @@ import android.os.Handler;
 import com.common.lib_base.common.local.AppLocalConfigHandler;
 import com.hh.bdface.common.IAppLocalConfig;
 import com.hh.bdface.ui.MainActivity;
+import com.hh.bdface.ui.SplashActivity;
 import com.hh.bdface.utils.log.AppLogUtils;
 
 public class AutoStartBroadReceiver extends BroadcastReceiver {
@@ -22,7 +23,7 @@ public class AutoStartBroadReceiver extends BroadcastReceiver {
         AppLogUtils.e("onReceive: " + intent.getAction());
 
 
-        Intent mainIntent = new Intent(context, MainActivity.class);
+        Intent mainIntent = new Intent(context, SplashActivity.class);
         /**
          * Intent.FLAG_ACTIVITY_NEW_TASK
          * Intent.FLAG_ACTIVITY_CLEAR_TOP

+ 6 - 2
app/src/main/java/com/hh/bdface/services/keeplive/LocalService.kt

@@ -67,7 +67,9 @@ class LocalService:Service() {
         //使Service变成前台服务
         var notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
         if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
-            var channel = NotificationChannel(NotificationChannelId, NotificationChannelName, NotificationManager.IMPORTANCE_HIGH);
+            var channel = NotificationChannel(NotificationChannelId, NotificationChannelName,
+                    // 音量
+                    NotificationManager.IMPORTANCE_MIN);
             notificationManager.createNotificationChannel(channel)
         }
         startForeground(1, getNotification());
@@ -111,7 +113,9 @@ class LocalService:Service() {
             super.onCreate()
             var notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
             if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
-                var channel = NotificationChannel(NotificationChannelId, NotificationChannelName, NotificationManager.IMPORTANCE_HIGH);
+                var channel = NotificationChannel(NotificationChannelId, NotificationChannelName,
+                        // 音量
+                        NotificationManager.IMPORTANCE_MIN);
                 notificationManager.createNotificationChannel(channel);
             }
             startForeground(1, getNotification())

+ 6 - 2
app/src/main/java/com/hh/bdface/services/keeplive/RemoteService.kt

@@ -59,7 +59,9 @@ class RemoteService: Service() {
         //使Service变成前台服务
         var notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
         if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
-            var channel = NotificationChannel(NotificationChannelId, NotificationChannelName, NotificationManager.IMPORTANCE_HIGH);
+            var channel = NotificationChannel(NotificationChannelId, NotificationChannelName,
+                    // 音量
+                    NotificationManager.IMPORTANCE_MIN);
             notificationManager.createNotificationChannel(channel);
         }
         startForeground(1, getNotification());
@@ -114,7 +116,9 @@ class RemoteService: Service() {
             super.onCreate()
             var notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
             if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
-                var channel = NotificationChannel(NotificationChannelId,  NotificationChannelName, NotificationManager.IMPORTANCE_HIGH);
+                var channel = NotificationChannel(NotificationChannelId,  NotificationChannelName,
+                        // 音量
+                        NotificationManager.IMPORTANCE_MIN);
                 notificationManager.createNotificationChannel(channel);
             }
             startForeground(1, getNotification())

文件差异内容过多而无法显示
+ 212 - 220
app/src/main/java/com/hh/bdface/ui/MainActivity.java


+ 719 - 0
app/src/main/java/com/hh/bdface/ui/SplashActivity.java

@@ -0,0 +1,719 @@
+package com.hh.bdface.ui;
+
+import android.annotation.SuppressLint;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.net.ConnectivityManager;
+import android.net.LinkProperties;
+import android.net.Network;
+import android.net.NetworkCapabilities;
+import android.net.NetworkRequest;
+import android.os.Handler;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.baidu.idl.main.facesdk.FaceAuth;
+import com.baidu.idl.main.facesdk.callback.Callback;
+import com.baidu.idl.main.facesdk.identifylibrary.utils.FaceUtils;
+import com.blankj.utilcode.util.PathUtils;
+import com.common.lib_base.base.BaseActivity;
+import com.common.lib_base.common.async.ThreadPoolManager;
+import com.common.lib_base.utils.NetworkUtils;
+import com.common.lib_base.utils.StringUtils;
+import com.common.lib_base.utils.ui.UIUtils;
+import com.common.lib_base.view.dialog.MessageRoundBtnDialog;
+import com.example.datalibrary.api.FaceApi;
+import com.example.datalibrary.listener.DBLoadListener;
+import com.example.datalibrary.listener.SdkInitListener;
+import com.example.datalibrary.manager.FaceSDKManager;
+import com.example.datalibrary.model.User;
+import com.google.gson.Gson;
+import com.hh.bdface.R;
+import com.hh.bdface.bean.LocalConfigBean;
+import com.hh.bdface.bean.LogcatAddRequestBean;
+import com.hh.bdface.bean.SimpleResultBean;
+import com.hh.bdface.common.deviceui.F10DeviceUI;
+import com.hh.bdface.mvp.contract.LogcatAddContract;
+import com.hh.bdface.mvp.presenter.LogcatAddPresenter;
+import com.hh.bdface.utils.DeviceUtils;
+import com.hh.bdface.utils.log.AppLogUtils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.List;
+
+import static com.hh.bdface.common.Constants.Value.TOKEN;
+
+public class SplashActivity extends BaseActivity implements LogcatAddContract.View, View.OnClickListener {
+
+    private TextView tv_config_status;
+    private TextView tv_version;
+    private TextView tv_sn;
+    private TextView tv_hello;
+    private TextView tv_net_no;
+    private ImageView iv_net_wifi;
+    private ImageView iv_net_flow;
+    private ImageView iv_net_line;
+    private ImageView iv_setting;
+    private RelativeLayout item_top;
+    private TextView tv_accredit_deviceTv;
+
+    @Override
+    public int setLayout() {
+        return R.layout.activity_splash;
+    }
+
+    @Override
+    protected void initView() {
+
+        tv_config_status = findViewById(R.id.tv_config_status);
+        tv_version = findViewById(R.id.tv_version);
+        tv_sn = findViewById(R.id.tv_sn);
+        tv_hello = findViewById(R.id.tv_hello);
+        tv_net_no = findViewById(R.id.tv_net_no);
+        iv_net_wifi = findViewById(R.id.iv_net_wifi);
+        iv_net_flow = findViewById(R.id.iv_net_flow);
+        iv_net_line = findViewById(R.id.iv_net_line);
+        iv_setting = findViewById(R.id.iv_setting);
+        tv_hello.setOnClickListener(this);
+        tv_net_no.setOnClickListener(this);
+        item_top = findViewById(R.id.item_top);
+        tv_accredit_deviceTv = findViewById(R.id.tv_accredit_deviceTv);
+    }
+
+    LogcatAddPresenter mLogcatAddPresenter;
+
+    String deviceSN;
+    String appVersionName;
+
+    F10DeviceUI deviceUI;
+
+    @Override
+    protected void initData() {
+
+        mContext = this;
+
+        deviceSN = DeviceUtils.getDeviceSN();
+        appVersionName = DeviceUtils.getAppVersionName(mContext);
+
+
+        // 版本号和sn
+        tv_version.setText("版本号:" + DeviceUtils.getAppVersionName(this));
+        tv_sn.setText("SN号:" + deviceSN);
+
+
+        deviceUI = F10DeviceUI.getInstance();
+
+        initNet();
+
+        faceAuth = new FaceAuth();
+
+        mLogcatAddPresenter = new LogcatAddPresenter(this);
+
+//        initBaiduLicense();
+
+
+        // 设备指纹
+        String deviceId = faceAuth.getDeviceId(mContext);
+        tv_accredit_deviceTv.setText("设备指纹:"+deviceId);
+
+
+    }
+
+    @Override
+    protected void initListener() {
+
+    }
+
+    Handler mHandler = new Handler();
+    Gson gson = new Gson();
+
+    private void initBaiduLicense() {
+
+        //获取外存路径
+//        LocalConfigBean localConfigBean = getLocalConfigData();
+//        if (localConfigBean != null) {
+//            String baiduFaceOnlineCode = localConfigBean.getBaiduFaceOnlineCode();
+//            startLicenseBaiduFace(baiduFaceOnlineCode);
+//        } else {
+//            // 有误,开始弹窗
+//            showErrorDailog();
+//        }
+
+
+        FaceSDKManager.getInstance().init(mContext, new SdkInitListener() {
+            @Override
+            public void initStart() {
+
+            }
+
+            public void initLicenseSuccess() {
+                // 已激活成功
+                AppLogUtils.e("initLicenseSuccess已激活成功");
+
+
+                // 日志
+                LogcatAddRequestBean bean = new LogcatAddRequestBean();
+                bean.setLogContent("已激活,进入识别MainActivity");
+                bean.setLogTag("百度人脸 " + appVersionName);
+                bean.setLogType("logcat");
+                requestLogcatAdd(bean);
+
+
+                mHandler.postDelayed(new Runnable() {
+                    @Override
+                    public void run() {
+                        startActivity(MainActivity.class);
+                        finish();
+                    }
+                }, delayTime);
+
+
+
+            }
+
+            @Override
+            public void initLicenseFail(int errorCode, String msg) {
+                // 激活失败,或未激活
+                // 开始激活
+
+                // 日志
+                LogcatAddRequestBean bean = new LogcatAddRequestBean();
+                bean.setLogContent("未激活,开始激活");
+                bean.setLogTag("百度人脸 " + appVersionName);
+                bean.setLogType("logcat");
+                requestLogcatAdd(bean);
+
+
+                //获取外存路径
+                LocalConfigBean localConfigBean = getLocalConfigData();
+                if (localConfigBean != null) {
+                    String baiduFaceOnlineCode = localConfigBean.getBaiduFaceOnlineCode();
+                    startLicenseBaiduFace(baiduFaceOnlineCode);
+                } else {
+                    // 有误,开始弹窗
+                    showErrorDailog();
+                }
+
+
+            }
+
+            @Override
+            public void initModelSuccess() {
+            }
+
+            @Override
+            public void initModelFail(int errorCode, String msg) {
+
+            }
+        });
+
+    }
+
+    private void showErrorDailog() {
+
+        // 未找到授权码,请联系厂商进行授权
+
+        MessageRoundBtnDialog.Builder builder = new MessageRoundBtnDialog.Builder(mContext);
+        builder.setTitle("温馨提示")
+                .setMessage("未找到授权码,请联系厂商进行授权")
+                .setRightButton("确定")
+                .setOnClickLisener(new MessageRoundBtnDialog.onDialogClickListener() {
+                    @Override
+                    public void onRightClick(Dialog dialog) {
+                        super.onRightClick(dialog);
+                    }
+                }).build().show();
+
+
+    }
+
+    private LocalConfigBean getLocalConfigData() {
+
+        String externalStoragePath = PathUtils.getExternalAppFilesPath();//   /storage/emulated/0/Android/data/com.hh.bdface/files
+        // app目录
+//        String jsonStr = readJsonFile(externalStoragePath + "/config.json");
+        // Android下目录,会被清除掉
+//        String jsonStr = readJsonFile("/storage/emulated/0/Android/config.json");
+        // 根目录
+        String jsonStr = readJsonFile("/storage/emulated/0/config.json");
+
+        AppLogUtils.e("jsonStr:"+jsonStr);
+
+        LocalConfigBean localConfigBean = gson.fromJson(jsonStr, LocalConfigBean.class);
+
+
+        // 日志
+        LogcatAddRequestBean bean = new LogcatAddRequestBean();
+        bean.setLogContent("本地json:" + jsonStr);
+        bean.setLogTag("百度人脸 " + appVersionName);
+        bean.setLogType("logcat");
+        requestLogcatAdd(bean);
+
+        return localConfigBean;
+
+    }
+
+
+    /**
+     * 方法名:readJsonFile(String filePath)
+     * 功    能:从本地读取json
+     * 参    数:String filePath
+     * 返回值:String
+     */
+    public static String readJsonFile(String filePath) {
+
+        AppLogUtils.e("filePath:"+filePath);
+
+        StringBuilder sb = new StringBuilder();
+        try {
+            File file = new File(filePath);
+            InputStream in = null;
+            in = new FileInputStream(file);
+            int tempbyte;
+            while ((tempbyte = in.read()) != -1) {
+                sb.append((char) tempbyte);
+            }
+            in.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return sb.toString();
+    }
+
+
+    // 百度
+    FaceAuth faceAuth;
+
+    // 测试激活码-----------begin
+    // X3
+    //    String baiduAuthCode = "FXCL-QGQD-9VGX-XMRG";
+    // F10-836
+    String baiduAuthCode = "3JEM-ZULP-TKXN-DV5X";
+    // 清真寺——现场使用的
+//    String baiduAuthCode = "WJRR-ZPM3-XAMJ-RGKT";
+    // X1   ZP2415000036
+//    String baiduAuthCode = "VRMD-XBLJ-SZBX-GPXW";
+//    String baiduAuthCode = "C6XZ-QDX3-MDXX-A2HK";
+    // 测试激活码-----------end
+
+
+    // 正式激活码---------begin
+    // F10-400406
+//    String baiduAuthCode = "KRKX-Y4MS-UNXK-ZTNL";
+    //
+//    String baiduAuthCode = "XX27-CTMS-BZF2-LPFW";
+    // 清真寺——现场使用的
+//    String baiduAuthCode = "XLXT-PXXW-NG2L-X2ZV";
+    // 正式激活码---------end
+
+
+    private void startLicenseBaiduFace(String baiduFaceOnlineCode) {
+
+
+
+        faceAuth.initLicenseOnLine(mContext, baiduFaceOnlineCode, new Callback() {
+            @Override
+            public void onResponse(final int code, final String response) {
+                if (code == 0) {
+                    AppLogUtils.e("BaiduFace激活成功");
+
+
+                    // 日志
+                    LogcatAddRequestBean bean = new LogcatAddRequestBean();
+                    bean.setLogContent("BaiduFace激活成功");
+                    bean.setLogTag("百度人脸 " + appVersionName);
+                    bean.setLogType("logcat");
+                    requestLogcatAdd(bean);
+
+
+
+                    mHandler.postDelayed(new Runnable() {
+                        @Override
+                        public void run() {
+                            startActivity(MainActivity.class);
+                            finish();
+                        }
+                    }, delayTime);
+
+
+
+                } else {
+                    AppLogUtils.e("BaiduFace激活失败");
+
+                    // 配置状态
+                    setConfigStatusText("Face激活失败,请联系厂商检查激活码是否匹配");
+
+                    // 日志
+                    LogcatAddRequestBean bean = new LogcatAddRequestBean();
+                    bean.setLogContent("BaiduFace激活失败,请联系厂商检查激活码是否匹配");
+                    bean.setLogTag("百度人脸 " + appVersionName);
+                    bean.setLogType("logcat");
+                    requestLogcatAdd(bean);
+
+                }
+            }
+        });
+    }
+
+    int delayTime = 3000;
+
+    private void initBaiduFaceListener() {
+        if (FaceSDKManager.initStatus != FaceSDKManager.SDK_MODEL_LOAD_SUCCESS) {
+            FaceSDKManager.getInstance().initModel(mContext,
+                    FaceUtils.getInstance().getBDFaceSDKConfig(), new SdkInitListener() {
+                        @Override
+                        public void initStart() {
+
+                        }
+
+                        @Override
+                        public void initLicenseSuccess() {
+                        }
+
+                        @Override
+                        public void initLicenseFail(int errorCode, String msg) {
+                        }
+
+                        @Override
+                        public void initModelSuccess() {
+                            FaceSDKManager.initModelSuccess = true;
+
+                            AppLogUtils.e("百度人脸模型加载成功,欢迎使用");
+
+                            // 日志
+                            LogcatAddRequestBean bean = new LogcatAddRequestBean();
+                            bean.setLogContent("百度人脸模型加载成功,欢迎使用");
+                            bean.setLogTag("百度人脸 " + appVersionName);
+                            bean.setLogType("logcat");
+                            requestLogcatAdd(bean);
+
+
+                            mHandler.postDelayed(new Runnable() {
+                                @Override
+                                public void run() {
+                                    startActivity(MainActivity.class);
+                                    finish();
+                                }
+                            },delayTime);
+
+
+//                                 initBaiduFaceListener();
+
+//                                runOnUiThread(new Runnable() {
+//                                    @Override
+//                                    public void run() {
+//                                        // 创建人脸预览界面
+//                                        createBaiduFaceWindowManager(mContext);
+//                                    }
+//                                });
+
+                        }
+
+                        @Override
+                        public void initModelFail(int errorCode, String msg) {
+                            FaceSDKManager.initModelSuccess = false;
+                            if (errorCode != -12) {
+
+                                // 配置状态
+                                setConfigStatusText("人脸模型加载失败,请尝试重启应用");
+
+                                // 日志
+                                LogcatAddRequestBean bean = new LogcatAddRequestBean();
+                                bean.setLogContent("百度人脸模型加载失败,请尝试重启应用");
+                                bean.setLogTag("百度人脸 " + appVersionName);
+                                bean.setLogType("logcat");
+                                requestLogcatAdd(bean);
+
+                            }
+                        }
+                    });
+        }
+    }
+
+    private void dbBaiduFaceInit() {
+        AppLogUtils.e("dbBaiduFaceInit");
+
+        FaceApi.getInstance().init(new DBLoadListener() {
+
+            @Override
+            public void onStart(int successCount) {
+                AppLogUtils.e("BaiduFace--onStart");
+//                if (successCount < 5000 && successCount != 0){
+//
+//                    runOnUiThread(new Runnable() {
+//                        @Override
+//                        public void run() {
+//                            loadProgress(10);
+//                        }
+//                    });
+//                }
+            }
+
+            @Override
+            public void onLoad(final int finishCount, final int successCount, final float progress) {
+//                 AppLogUtils.e(false,tag_baidu,"onLoad");
+//                if (successCount > 5000 || successCount == 0) {
+//                    runOnUiThread(new Runnable() {
+//                        @Override
+//                        public void run() {
+//                            progressBar.setProgress((int) (progress * 100));
+//                            progressText.setText(((int) (progress * 100)) + "%");
+//                        }
+//                    });
+//                }
+            }
+
+            @Override
+            public void onComplete(final List<User> users, final int successCount) {
+                AppLogUtils.e("BaiduFace--onComplete");
+//                        FileUtils.saveDBList(HomeActivity.this, users);
+//                runOnUiThread(new Runnable() {
+//                    @Override
+//                    public void run() {
+//                        FaceApi.getInstance().setUsers(users);
+//                        if (successCount > 5000 || successCount == 0) {
+//                            progressGroup.setVisibility(View.GONE);
+//                            isDBLoad = true;
+//                        }
+//                    }
+//                });
+
+
+                for (User user : users) {
+                    AppLogUtils.e("百度user--" + user.getId() + "   " + user.getUserName() + "   " + new String(user.getFeature()));
+                }
+
+                AppLogUtils.e("百度successCount--" + successCount);
+
+                FaceApi.getInstance().setUsers(users);
+                FaceSDKManager.getInstance().initDataBases(mContext);
+
+
+            }
+
+            @Override
+            public void onFail(final int finishCount, final int successCount, final List<User> users) {
+
+                AppLogUtils.e("百度onFail--1");
+//                runOnUiThread(new Runnable() {
+//                    @Override
+//                    public void run() {
+//                        FaceApi.getInstance().setUsers(users);
+//                        progressGroup.setVisibility(View.GONE);
+//                        ToastUtils.toast(HomeActivity.this,
+//                                "人脸库加载失败,共" + successCount + "条数据, 已加载" + finishCount + "条数据");
+//                        isDBLoad = true;
+//                    }
+//                });
+
+                FaceApi.getInstance().setUsers(users);
+                FaceSDKManager.getInstance().initDataBases(mContext);
+
+                AppLogUtils.e("百度onFail--2");
+
+            }
+        }, mContext);
+
+    }
+
+
+    public void setConfigStatusText(String text) {
+        runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                UIUtils.setText(tv_config_status, text);
+            }
+        });
+
+    }
+
+
+    // 在线日志
+    public void requestLogcatAdd(LogcatAddRequestBean bean) {
+
+        if (mLogcatAddPresenter == null) {
+            mLogcatAddPresenter = new LogcatAddPresenter(this);
+        }
+
+        bean.setToken(TOKEN);
+        bean.setSn(DeviceUtils.getDeviceSN());
+
+//        if (isNetAvailable) {
+        mLogcatAddPresenter.requestLogcatAdd(bean);
+//        }
+
+    }
+
+
+    @Override
+    public void showLogcatAddResult(SimpleResultBean resultBean) {
+
+    }
+
+    @Override
+    public void showLoading() {
+
+    }
+
+    @Override
+    public void dismissLoading() {
+
+    }
+
+    @Override
+    public void showError(String msg) {
+
+    }
+
+    @Override
+    public void showError(String url, String msg) {
+
+    }
+
+
+    boolean isNetAvailable;
+
+
+    private ConnectivityManager.NetworkCallback networkCallback;
+    private ConnectivityManager connectivityManager;
+
+    @SuppressLint("MissingPermission")
+    public void initNet() {
+        networkCallback = new NetworkCallbackImpl();
+        NetworkRequest.Builder builder = new NetworkRequest.Builder();
+        NetworkRequest request = builder.build();
+        connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
+        connectivityManager.registerNetworkCallback(request, networkCallback);
+
+    }
+
+    @Override
+    public void onClick(View var1) {
+        switch (var1.getId()) {
+            case R.id.tv_hello:
+
+                if (!isShowNavi) {
+                    deviceUI.showNavigationBar(mActivity);
+                    deviceUI.showNotification(mActivity);
+
+                    isShowNavi = true;
+                } else {
+                    deviceUI.hideNotification(mActivity);
+                    deviceUI.hideNavigationBar(mActivity);
+
+                    isShowNavi = false;
+                }
+
+                break;
+            case R.id.tv_net_no:
+                break;
+        }
+    }
+
+
+    boolean isShowNavi;
+
+
+    private class NetworkCallbackImpl extends ConnectivityManager.NetworkCallback {
+        @Override
+        public void onAvailable(Network network) {
+            super.onAvailable(network);
+            //
+            AppLogUtils.e("网络--连接--onAvailable");
+
+            isNetAvailable = true;
+
+
+            initBaiduLicense();
+
+//            try {
+
+//            } catch (Exception e) {
+//                e.printStackTrace();
+//
+//                AppLogUtils.e(e.toString());
+//
+//                // 日志
+//                LogcatAddRequestBean bean = new LogcatAddRequestBean();
+//                bean.setLogContent("initBaiduLicense--Exception:"+e.toString());
+//                bean.setLogTag("百度人脸 " + appVersionName);
+//                bean.setLogType("error");
+//                requestLogcatAdd(bean);
+//
+//                setConfigStatusText("百度人脸--未授权设备,请完成激活。具体信息"+e.toString());
+//
+//            }
+
+            getNetType();
+
+        }
+
+        @Override
+        public void onLosing(Network network, int maxMsToLive) {
+            super.onLosing(network, maxMsToLive);
+            AppLogUtils.e("网络--onLosing");
+        }
+
+        @Override
+        public void onLost(Network network) {
+            super.onLost(network);
+            AppLogUtils.e("网络--断开--onLost");
+
+            isNetAvailable = false;
+
+            getNetType();
+        }
+
+        @Override
+        public void onCapabilitiesChanged(Network network, NetworkCapabilities networkCapabilities) {
+            super.onCapabilitiesChanged(network, networkCapabilities);
+            AppLogUtils.i("网络-onCapabilitiesChanged");
+        }
+
+        @Override
+        public void onLinkPropertiesChanged(Network network, LinkProperties linkProperties) {
+            super.onLinkPropertiesChanged(network, linkProperties);
+            AppLogUtils.i("网络-onLinkPropertiesChanged");
+        }
+    }
+
+
+    String netType;
+
+    private void getNetType() {
+
+        runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+
+
+                boolean isNetworkAvaiable = NetworkUtils.isNetworkAvaiable(getApplicationContext());
+                if (isNetworkAvaiable) {
+
+                    netType = NetworkUtils.getNetType(getApplicationContext());
+
+                    AppLogUtils.e("netType--" + netType);
+
+                    setConfigStatusText("有网络");
+
+
+                } else {
+                    setConfigStatusText("无网络");
+                }
+
+
+            }
+        });
+
+
+    }
+
+
+}

+ 50 - 51
app/src/main/res/layout/activity_main.xml

@@ -236,53 +236,6 @@
                     android:layout_marginRight="12dp"/>
 
 
-
-                <!-- 刷码提示 -->
-                <FrameLayout
-                    android:id="@+id/item_scan_qr"
-                    android:alpha="1"
-                    android:gravity="center"
-                    android:layout_gravity="center"
-                    android:orientation="vertical"
-                    android:layout_width="380dp"
-                    android:layout_height="380dp">
-
-
-                    <ImageView
-                        android:id="@+id/iv_notice_scan_qr"
-                        android:layout_gravity="center_horizontal"
-                        android:layout_marginTop="60dp"
-                        android:layout_marginLeft="35dp"
-                        android:layout_marginRight="35dp"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:maxWidth="380dp"
-                        android:maxHeight="380dp"
-                        android:src="@mipmap/ic_scan_qr_1x" />
-
-
-                    <!-- android:letterSpacing="0.2" -->
-                    <TextView
-                        android:id="@+id/tv_notice_scan_qr"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="50dp"
-                        android:layout_gravity="center_horizontal"
-                        android:textSize="38sp"
-                        android:text="请刷码"
-                        android:paddingEnd="3dp"
-                        android:textStyle="bold"
-                        android:shadowColor="#0258FF"
-                        android:shadowRadius="8"
-                        android:shadowDx="3"
-                        android:shadowDy="3"
-                        android:textColor="@color/white"
-                        android:layout_marginBottom="20dp"/>
-
-                </FrameLayout>
-                <!-- 刷码提示 -->
-
-
                 <!-- 结果提示 -->
                 <LinearLayout
                     android:id="@+id/item_notice_result"
@@ -326,6 +279,52 @@
             </FrameLayout>
 
 
+
+            <!-- 刷码提示 -->
+            <LinearLayout
+                android:layout_alignParentBottom="true"
+                android:layout_centerHorizontal="true"
+                android:id="@+id/item_scan_qr"
+                android:alpha="1"
+                android:gravity="center"
+                android:layout_gravity="center"
+                android:orientation="vertical"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+
+                <!-- android:letterSpacing="0.2" -->
+                <TextView
+                    android:id="@+id/tv_notice_scan_qr"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:textSize="38sp"
+                    android:text="请刷码"
+                    android:paddingEnd="3dp"
+                    android:textStyle="bold"
+                    android:shadowColor="#0258FF"
+                    android:shadowRadius="8"
+                    android:shadowDx="3"
+                    android:shadowDy="3"
+                    android:textColor="@color/white"/>
+
+
+                <ImageView
+                    android:id="@+id/iv_notice_scan_qr"
+                    android:layout_gravity="center_horizontal|bottom"
+                    android:gravity="center_horizontal|bottom"
+                    android:scaleType="fitXY"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:src="@mipmap/ic_scan_qr_1x_613" />
+
+
+
+
+            </LinearLayout>
+            <!-- 刷码提示 -->
+
+
             <!-- 底部提示 -->
             <FrameLayout
                 android:id="@+id/item_bottom_face_notice"
@@ -391,8 +390,8 @@
                         android:layout_height="wrap_content"
                         android:layout_centerVertical="true"
                         android:text="版本号"
-                        android:textColor="@color/white"
-                        android:textSize="12sp" />
+                        android:textColor="@color/black"
+                        android:textSize="11sp" />
 
                     <TextView
                         android:id="@+id/tv_sn"
@@ -401,8 +400,8 @@
                         android:layout_centerVertical="true"
                         android:layout_marginLeft="12dp"
                         android:text="sn号"
-                        android:textColor="@color/white"
-                        android:textSize="12sp" />
+                        android:textColor="@color/black"
+                        android:textSize="11sp" />
                 </LinearLayout>
 
             </LinearLayout>

+ 422 - 0
app/src/main/res/layout/activity_main_612.xml

@@ -0,0 +1,422 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".ui.MainActivity">
+
+
+    <FrameLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+
+        <com.example.datalibrary.gl.view.GlMantleSurfacView
+            android:id="@+id/camera_textureview_baidu"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent" />
+
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:orientation="vertical">
+
+
+                <RelativeLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="6dp"
+                    android:layout_marginTop="10dp"
+                    android:layout_marginRight="6dp">
+
+                    <TextView
+                        android:id="@+id/tv_time"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_centerVertical="true"
+                        android:text="当前时间"
+                        android:textColor="@color/white"
+                        android:textSize="14sp" />
+
+                    <LinearLayout
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_alignParentRight="true"
+                        android:layout_centerVertical="true"
+                        android:orientation="horizontal">
+
+
+                        <TextView
+                            android:id="@+id/tv_net_no"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_vertical"
+                            android:layout_marginRight="8dp"
+                            android:text="无网络"
+                            android:textColor="@color/white"
+                            android:textSize="14sp" />
+
+                        <ImageView
+                            android:id="@+id/iv_net_wifi"
+                            android:layout_width="15dp"
+                            android:layout_height="15dp"
+                            android:layout_gravity="center_vertical"
+                            android:layout_marginRight="8dp"
+                            android:src="@mipmap/ic_net_wifi_1x" />
+
+                        <ImageView
+                            android:id="@+id/iv_net_flow"
+                            android:layout_width="15dp"
+                            android:layout_height="15dp"
+                            android:layout_gravity="center_vertical"
+                            android:layout_marginRight="8dp"
+                            android:src="@mipmap/ic_net_flow" />
+
+                        <ImageView
+                            android:id="@+id/iv_net_line"
+                            android:layout_width="15dp"
+                            android:layout_height="15dp"
+                            android:layout_gravity="center_vertical"
+                            android:layout_marginRight="8dp"
+                            android:src="@mipmap/ic_net_line" />
+
+
+                        <ImageView
+                            android:id="@+id/iv_setting"
+                            android:layout_width="20dp"
+                            android:layout_height="20dp"
+                            android:layout_gravity="center_vertical"
+                            android:src="@mipmap/ic_setting_1x"
+                            android:visibility="gone" />
+
+
+                    </LinearLayout>
+
+
+                </RelativeLayout>
+
+
+                <TextView
+                    android:id="@+id/tv_usb_status"
+                    android:layout_marginTop="5dp"
+                    android:layout_marginLeft="6dp"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_vertical"
+                    android:layout_marginRight="8dp"
+                    android:visibility="gone"
+                    android:text="usb连接"
+                    android:textColor="@color/white"
+                    android:textSize="14sp" />
+
+
+                <!-- 用户信息begin -->
+                <RelativeLayout
+                    android:background="@drawable/shape_solid_white_corner_15"
+                    android:alpha="0.8"
+                    android:visibility="visible"
+                    android:layout_marginTop="7dp"
+                    android:layout_marginLeft="12dp"
+                    android:layout_marginRight="12dp"
+                    android:id="@+id/item_user_info"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingTop="6dp"
+                    android:paddingBottom="6dp"
+                    >
+
+                    <com.example.datalibrary.view.CircleImageView
+                        android:layout_marginLeft="13dp"
+                        android:id="@+id/iv_user"
+                        android:layout_width="55dp"
+                        android:layout_height="55dp"
+                        android:src="@color/red"/>
+
+                    <LinearLayout
+                        android:layout_centerInParent="true"
+                        android:layout_marginRight="16dp"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_alignParentRight="true"
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:id="@+id/tv_user_name"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:gravity="right"
+                            android:layout_gravity="right"
+                            android:text="231321"
+                            android:textStyle="bold"
+                            android:textSize="14sp"
+                            android:textColor="#324360"/>
+
+                        <TextView
+                            android:layout_marginTop="2dp"
+                            android:id="@+id/tv_user_idcardNum"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="right"
+                            android:gravity="right"
+                            android:textStyle="bold"
+                            android:textSize="14sp"
+                            android:textColor="#324360"
+                            android:text="231321"/>
+
+                    </LinearLayout>
+
+
+                </RelativeLayout>
+                <!-- 用户信息end -->
+
+
+                <!-- 中间提示框 -->
+
+
+                <!--<com.hh.bdface.view.MaskImageView-->
+
+                <!-- android:background="@drawable/shape_solid_gray_3f4471_corner_2"  -->
+                <!--<ImageView
+                    android:id="@+id/iv_notice"
+                    android:layout_width="222dp"
+                    android:layout_height="222dp"
+                    android:layout_centerInParent="true"
+                    android:layout_gravity="center_horizontal"
+                    android:layout_marginLeft="25dp"
+                    android:layout_marginRight="25dp" />-->
+
+
+            </LinearLayout>
+
+
+
+
+            <!--<ImageView
+                android:id="@+id/iv_notice"
+                android:layout_alignParentBottom="true"
+                android:layout_centerHorizontal="true"
+                android:layout_marginBottom="30dp"
+                android:layout_width="380dp"
+                android:layout_height="380dp"
+                android:maxWidth="380dp"
+                android:maxHeight="380dp"
+                android:layout_centerInParent="true"
+                android:layout_gravity="center_horizontal"
+                android:src="@mipmap/bg_comparison_fail"
+                 />-->
+
+
+
+            <!-- 中间提示 -->
+            <FrameLayout
+                android:id="@+id/item_notice"
+                android:layout_width="match_parent"
+                android:layout_height="300dp"
+                android:layout_marginLeft="12dp"
+                android:layout_marginRight="12dp"
+                android:layout_alignParentBottom="true"
+                android:layout_centerHorizontal="true"
+                android:layout_marginBottom="40dp">
+
+
+                <!-- 透明背景 -->
+                <LinearLayout
+                    android:orientation="vertical"
+                    android:alpha="0.9"
+                    android:background="@drawable/shape_solid_white_corner_58"
+                    android:layout_width="match_parent"
+                    android:layout_height="300dp"
+                    android:layout_marginLeft="12dp"
+                    android:layout_marginRight="12dp"/>
+
+
+
+                <!-- 刷码提示 -->
+                <FrameLayout
+                    android:id="@+id/item_scan_qr"
+                    android:alpha="1"
+                    android:gravity="center"
+                    android:layout_gravity="center"
+                    android:orientation="vertical"
+                    android:layout_width="380dp"
+                    android:layout_height="380dp">
+
+
+                    <ImageView
+                        android:id="@+id/iv_notice_scan_qr"
+                        android:layout_gravity="center_horizontal"
+                        android:layout_marginTop="60dp"
+                        android:layout_marginLeft="35dp"
+                        android:layout_marginRight="35dp"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:maxWidth="380dp"
+                        android:maxHeight="380dp"
+                        android:src="@mipmap/ic_scan_qr_1x" />
+
+
+                    <!-- android:letterSpacing="0.2" -->
+                    <TextView
+                        android:id="@+id/tv_notice_scan_qr"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="50dp"
+                        android:layout_gravity="center_horizontal"
+                        android:textSize="38sp"
+                        android:text="请刷码"
+                        android:paddingEnd="3dp"
+                        android:textStyle="bold"
+                        android:shadowColor="#0258FF"
+                        android:shadowRadius="8"
+                        android:shadowDx="3"
+                        android:shadowDy="3"
+                        android:textColor="@color/white"
+                        android:layout_marginBottom="20dp"/>
+
+                </FrameLayout>
+                <!-- 刷码提示 -->
+
+
+                <!-- 结果提示 -->
+                <LinearLayout
+                    android:id="@+id/item_notice_result"
+                    android:alpha="1"
+                    android:gravity="center_horizontal"
+                    android:layout_gravity="center"
+                    android:orientation="vertical"
+                    android:layout_width="380dp"
+                    android:layout_height="380dp"
+                    >
+
+
+                    <ImageView
+                        android:id="@+id/iv_notice"
+                        android:layout_marginTop="75dp"
+                        android:layout_marginLeft="12dp"
+                        android:layout_marginRight="12dp"
+                        android:layout_width="150dp"
+                        android:layout_height="150dp"
+                        android:maxWidth="380dp"
+                        android:maxHeight="380dp"
+                        android:src="@mipmap/ic_comparison_fail" />
+
+
+                    <!-- android:letterSpacing="0.2" -->
+                    <TextView
+                        android:id="@+id/tv_notice"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center"
+                        android:layout_marginTop="20dp"
+                        android:text="比对"
+                        android:gravity="center_horizontal"
+                        android:textStyle="bold"
+                        android:textSize="30sp"
+                        android:layout_marginBottom="20dp"/>
+
+                </LinearLayout>
+                <!-- 结果提示 -->
+
+            </FrameLayout>
+
+
+            <!-- 底部提示 -->
+            <FrameLayout
+                android:id="@+id/item_bottom_face_notice"
+                android:layout_width="match_parent"
+                android:layout_height="160dp"
+                android:layout_alignParentBottom="true"
+                android:background="@mipmap/ic_bottom_notice">
+
+                <TextView
+                    android:id="@+id/tv_scanface_notice"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:gravity="center"
+                    android:textSize="40sp"
+                    android:text="Face The Screen
+                    5S"
+                    android:textStyle="bold"
+                    android:shadowColor="#0A7AFF"
+                    android:shadowRadius="5"
+                    android:shadowDx="5"
+                    android:shadowDy="5"
+                    android:textColor="@color/white"
+                    android:layout_marginBottom="35dp"/>
+
+
+            </FrameLayout>
+
+
+
+            <!-- 底部状态 -->
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_alignParentBottom="true"
+                android:layout_marginLeft="10dp"
+                android:layout_marginBottom="4dp"
+                android:orientation="vertical">
+
+
+                <TextView
+                    android:id="@+id/tv_config_status"
+                    android:visibility="gone"
+                    android:layout_marginBottom="10dp"
+                    android:layout_gravity="center"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_centerVertical="true"
+                    android:text="状态:网络连接中"
+                    android:textColor="@color/white"
+                    android:textSize="12sp" />
+
+
+                <LinearLayout
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+
+
+                    <TextView
+                        android:id="@+id/tv_version"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_centerVertical="true"
+                        android:text="版本号"
+                        android:textColor="@color/white"
+                        android:textSize="12sp" />
+
+                    <TextView
+                        android:id="@+id/tv_sn"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_centerVertical="true"
+                        android:layout_marginLeft="12dp"
+                        android:text="sn号"
+                        android:textColor="@color/white"
+                        android:textSize="12sp" />
+                </LinearLayout>
+
+            </LinearLayout>
+            <!-- 底部状态 -->
+
+
+        </RelativeLayout>
+
+
+
+
+
+
+    </FrameLayout>
+
+
+</RelativeLayout>

+ 151 - 0
app/src/main/res/layout/activity_splash.xml

@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+
+    <RelativeLayout
+        android:id="@+id/item_top"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="6dp"
+        android:layout_marginTop="10dp"
+        android:layout_marginRight="6dp">
+
+        <TextView
+            android:id="@+id/tv_hello"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:text="欢迎使用"
+            android:textColor="@color/black"
+            android:textSize="14sp" />
+
+        <LinearLayout
+            android:visibility="gone"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:layout_centerVertical="true"
+            android:orientation="horizontal">
+
+
+            <TextView
+                android:id="@+id/tv_net_no"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_vertical"
+                android:layout_marginRight="8dp"
+                android:text="无网络"
+                android:textColor="@color/white"
+                android:textSize="14sp" />
+
+            <ImageView
+                android:id="@+id/iv_net_wifi"
+                android:layout_width="15dp"
+                android:layout_height="15dp"
+                android:layout_gravity="center_vertical"
+                android:layout_marginRight="8dp"
+                android:src="@mipmap/ic_net_wifi_1x" />
+
+            <ImageView
+                android:id="@+id/iv_net_flow"
+                android:layout_width="15dp"
+                android:layout_height="15dp"
+                android:layout_gravity="center_vertical"
+                android:layout_marginRight="8dp"
+                android:src="@mipmap/ic_net_flow" />
+
+            <ImageView
+                android:id="@+id/iv_net_line"
+                android:layout_width="15dp"
+                android:layout_height="15dp"
+                android:layout_gravity="center_vertical"
+                android:layout_marginRight="8dp"
+                android:src="@mipmap/ic_net_line" />
+
+
+            <ImageView
+                android:id="@+id/iv_setting"
+                android:layout_width="20dp"
+                android:layout_height="20dp"
+                android:layout_gravity="center_vertical"
+                android:src="@mipmap/ic_setting_1x"
+                android:visibility="gone" />
+
+
+        </LinearLayout>
+
+
+    </RelativeLayout>
+
+
+
+
+    <!-- 底部状态 -->
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:layout_marginLeft="10dp"
+        android:layout_marginBottom="4dp"
+        android:orientation="vertical">
+
+
+        <TextView
+            android:id="@+id/tv_accredit_deviceTv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:layout_gravity="center"
+            android:layout_marginBottom="10dp"
+            android:text="设备指纹"
+            android:textColor="@color/black"
+            android:textSize="12sp" />
+
+
+
+        <TextView
+            android:id="@+id/tv_config_status"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:layout_gravity="center"
+            android:layout_marginBottom="10dp"
+            android:text="状态:网络连接中,请检测网络"
+            android:textColor="@color/black"
+            android:textSize="12sp" />
+
+
+        <LinearLayout
+            android:orientation="horizontal"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+
+            <TextView
+                android:id="@+id/tv_version"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_centerVertical="true"
+                android:text="版本号"
+                android:textColor="@color/black"
+                android:textSize="12sp" />
+
+            <TextView
+                android:id="@+id/tv_sn"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_centerVertical="true"
+                android:layout_marginLeft="12dp"
+                android:text="sn号"
+                android:textColor="@color/black"
+                android:textSize="12sp" />
+        </LinearLayout>
+
+    </LinearLayout>
+    <!-- 底部状态 -->
+
+
+</RelativeLayout>

二进制
app/src/main/res/mipmap-xhdpi/ic_scan_qr_1x_613.png


+ 2 - 2
config.gradle

@@ -7,8 +7,8 @@ ext {
 //            minSdkVersion    : 24,
             minSdkVersion    : 22,
             targetSdkVersion : 22,
-            versionCode      : 3,
-            versionName      : "1.2.3"
+            versionCode      : 6,
+            versionName      : "1.2.5"
     ]
     //依赖 配置
     dependencies = [

+ 7 - 0
datalibrary/src/main/java/com/example/datalibrary/manager/FaceModel.java

@@ -1,6 +1,7 @@
 package com.example.datalibrary.manager;
 
 import android.content.Context;
+import android.util.Log;
 
 import com.baidu.idl.main.facesdk.FaceCrop;
 import com.baidu.idl.main.facesdk.FaceDarkEnhance;
@@ -109,6 +110,7 @@ public class FaceModel implements SdkInitListener{
     @Override
     public void initModelFail(int errorCode, String msg) {
         isModelInit = false;
+        Log.e(TAG,"FaceModel--errorCode:"+errorCode+"   msg:"+msg);
         listener.initModelFail(errorCode , msg);
     }
     public FaceFeature getFacePersonFeature(){
@@ -143,4 +145,9 @@ public class FaceModel implements SdkInitListener{
     }public FaceLive getFaceLive(){
         return liveBuilder.getExample();
     }
+
+
+
+    String TAG ="TEST";
+
 }

+ 107 - 0
datalibrary/src/main/java/com/example/datalibrary/manager/FaceSDKManager.java

@@ -14,12 +14,14 @@ import com.baidu.idl.main.facesdk.FaceFeature;
 import com.baidu.idl.main.facesdk.FaceInfo;
 import com.baidu.idl.main.facesdk.FaceSearch;
 import com.baidu.idl.main.facesdk.ImageIllum;
+import com.baidu.idl.main.facesdk.callback.Callback;
 import com.baidu.idl.main.facesdk.model.BDFaceDetectListConf;
 import com.baidu.idl.main.facesdk.model.BDFaceImageInstance;
 import com.baidu.idl.main.facesdk.model.BDFaceOcclusion;
 import com.baidu.idl.main.facesdk.model.BDFaceSDKCommon;
 import com.baidu.idl.main.facesdk.model.BDFaceSDKConfig;
 import com.baidu.idl.main.facesdk.model.Feature;
+import com.baidu.idl.main.facesdk.utils.PreferencesUtil;
 import com.example.datalibrary.api.FaceApi;
 import com.example.datalibrary.callback.FaceDetectCallBack;
 import com.example.datalibrary.callback.FaceQualityBack;
@@ -1330,4 +1332,109 @@ public class FaceSDKManager {
         return ret;
     }
 
+
+
+    public static final int SDK_UNINIT = 2;
+    public static final int SDK_INITING = 3;
+    public static final int SDK_INITED = 4;
+    public static final int SDK_INIT_FAIL = 5;
+    public static final int SDK_INIT_SUCCESS = 6;
+
+
+    String TAG = "TEST";
+
+
+    /**
+     * 初始化鉴权,如果鉴权通过,直接初始化模型
+     *
+     * @param context
+     * @param listener
+     */
+    public void init(final Context context, final SdkInitListener listener) {
+
+        PreferencesUtil.initPrefs(context.getApplicationContext());
+        final String licenseOfflineKey = PreferencesUtil.getString("activate_offline_key", "");
+        final String licenseOnlineKey = PreferencesUtil.getString("activate_online_key", "");
+        final String licenseBatchlineKey = PreferencesUtil.getString("activate_batchline_key", "");
+
+        Log.e(TAG,"licenseOnlineKey--"+licenseOnlineKey);
+
+        // 如果licenseKey 不存在提示授权码为空,并跳转授权页面授权
+        if (TextUtils.isEmpty(licenseOfflineKey) && TextUtils.isEmpty(licenseOnlineKey)
+                && TextUtils.isEmpty(licenseBatchlineKey)) {
+            ToastUtils.toast(context, "未授权设备,请完成授权激活");
+            if (listener != null) {
+                listener.
+                        initLicenseFail
+                                (-1,
+                                        "授权码不存在,请重新输入!");
+            }
+            return;
+        }
+        // todo 增加判空处理
+        if (listener != null) {
+            listener.initStart();
+        }
+
+        if (!TextUtils.isEmpty(licenseOnlineKey)) {
+            // 在线激活
+            faceAuth.initLicenseOnLine(context, licenseOnlineKey, new Callback() {
+                @Override
+                public void onResponse(int code, String response) {
+                    Log.e(TAG,"在线激活--code:"+code+"  response:"+response);
+                    if (code == 0) {
+                        initStatus = SDK_INIT_SUCCESS;
+                        if (listener != null) {
+                            listener.initLicenseSuccess();
+                        }
+//                        initModel(context, listener);
+                        return;
+                    } else {
+                        listener.initLicenseFail(code, response);
+                    }
+                }
+            });
+        } else if (!TextUtils.isEmpty(licenseOfflineKey)) {
+            // 离线激活
+            faceAuth.initLicenseOffLine(context, new Callback() {
+                @Override
+                public void onResponse(int code, String response) {
+                    if (code == 0) {
+                        initStatus = SDK_INIT_SUCCESS;
+                        if (listener != null) {
+                            listener.initLicenseSuccess();
+                        }
+//                        initModel(context, listener);
+                        return;
+                    } else {
+                        listener.initLicenseFail(code, response);
+                    }
+                }
+            });
+        } else if (!TextUtils.isEmpty(licenseBatchlineKey)) {
+            // 应用激活
+            faceAuth.initLicenseBatchLine(context, licenseBatchlineKey, new Callback() {
+                @Override
+                public void onResponse(int code, String response) {
+                    if (code == 0) {
+                        initStatus = SDK_INIT_SUCCESS;
+                        if (listener != null) {
+                            listener.initLicenseSuccess();
+                        }
+//                        initModel(context, listener);
+                        return;
+                    } else {
+                        listener.initLicenseFail(code, response);
+                    }
+                }
+            });
+        } else {
+            if (listener != null) {
+                listener.initLicenseFail(-1, "授权码不存在,请重新输入!");
+            }
+        }
+    }
+
+
+
 }

+ 5 - 4
lib_baidu_face/src/main/java/com/common/lib_baidu_face/BaseConfig.java

@@ -203,8 +203,9 @@ public class BaseConfig {
 //    private int nirVideoDirection = 90;
     private int nirVideoDirection = 270;
 
-    // 0:RGB无镜像,1:有镜像  设置镜像
-    private int mirrorVideoRGB = 1;
+    // 0:RGB无镜像,1:有镜像  设置镜像      该值修改
+//    private int mirrorVideoRGB = 1;
+    private int mirrorVideoRGB = 0;
 
     // 0:Nir无镜像,1:有镜像
 //    private int mirrorVideoNIR = 0;
@@ -222,8 +223,8 @@ public class BaseConfig {
     private int mirrorDetectRGB = 0;
 
     // nir人脸检测 0:RGB无镜像,1:有镜像
-//    private int mirrorDetectNIR = 0;
-    private int mirrorDetectNIR = 1;
+    private int mirrorDetectNIR = 0;
+//    private int mirrorDetectNIR = 1;
 
     public int getRgbDetectDirection() {
         return rgbDetectDirection;

部分文件因为文件数量过多而无法显示