Browse Source

2.7.2 麦克风状态,ER301在线身份证阅读器,修改串口c文件,马里奥通知栏和导航栏

xulh 8 months ago
parent
commit
00bcd3220b
30 changed files with 1288 additions and 317 deletions
  1. 86 20
      SeriaApp/src/main/cpp/native-lib.c
  2. 44 0
      SeriaApp/src/main/java/com/silencefun/comtest/MyFunc.java
  3. 6 1
      SeriaApp/src/main/java/com/silencefun/comtest/SerialHelper.java
  4. 11 0
      SeriaApp/src/main/java/com/silencefun/comtest/been/ComBean.java
  5. 6 1
      SeriaApp/src/main/java/com/silencefun/comtest/serialport/SerialPort.java
  6. 6 1
      app/build.gradle
  7. BIN
      app/libs/IDOCR.PubSdk.Android.SerialPort.Release-1.0.4.jar
  8. BIN
      app/libs/armeabi-v7a/libeidserial_lib.so
  9. 38 0
      app/src/main/java/com/hh/arome/bean/ampe/AmpeAppletResultBean.java
  10. 30 0
      app/src/main/java/com/hh/arome/common/Constants.java
  11. 5 0
      app/src/main/java/com/hh/arome/common/IAppLocalConfig.java
  12. 130 0
      app/src/main/java/com/hh/arome/common/SerialPortUtils.java
  13. 6 6
      app/src/main/java/com/hh/arome/common/deviceui/MlaDeviceUI.java
  14. 25 0
      app/src/main/java/com/hh/arome/common/microphone/IMicroPhoneStateCallback.java
  15. 54 32
      app/src/main/java/com/hh/arome/common/microphone/ZlwRecordManager.java
  16. 16 9
      app/src/main/java/com/hh/arome/common/scan/idcard/base/IDCardScanEngine.java
  17. 4 4
      app/src/main/java/com/hh/arome/common/scan/idcard/lifecycle/IDCardScanManager.java
  18. 4 4
      app/src/main/java/com/hh/arome/common/scan/idcard/lifecycle/SupportManagerFragment.java
  19. 257 0
      app/src/main/java/com/hh/arome/common/scan/idcard/manymodels/JlhtER301IDCardScan.java
  20. 9 9
      app/src/main/java/com/hh/arome/common/scan/idcard/manymodels/NfcIDCardScan.java
  21. 26 26
      app/src/main/java/com/hh/arome/common/scan/idcard/manymodels/XzxIDCardScan.java
  22. 39 0
      app/src/main/java/com/hh/arome/common/scan/idcard/manymodels/er301/ReadCardManagerER301.java
  23. 1 1
      app/src/main/java/com/hh/arome/common/scan/idcard/manymodels/k8/ReadCardManagerNfc.java
  24. 106 0
      app/src/main/java/com/hh/arome/common/voice/VolumeUtil.java
  25. 6 6
      app/src/main/java/com/hh/arome/ui/IDCardScanNfcActivity.java
  26. 258 168
      app/src/main/java/com/hh/arome/ui/MainActivity.java
  27. 37 5
      app/src/main/java/com/hh/arome/ui/setting/FunctionActivity.java
  28. 21 6
      app/src/main/res/layout/activity_main.xml
  29. 55 16
      app/src/main/res/layout/activity_main_hp.xml
  30. 2 2
      config.gradle

+ 86 - 20
SeriaApp/src/main/cpp/native-lib.c

@@ -241,18 +241,18 @@ int set_opt(jint nBits, jchar nEvent, jint nStop)
  * Signature: (Ljava/lang/String;II)Ljava/io/FileDescriptor;
  */
 JNIEXPORT jobject JNICALL Java_com_silencefun_comtest_serialport_SerialPort_open
-        (JNIEnv *env, jclass thiz, jstring path, jint baudrate,
-         jint databits, jint stopbits, jchar parity)
-{
+        (JNIEnv *env, jclass thiz, jstring path, jint baudrate, jint stopBits, jint dataBits,
+         jint parity, jint flowCon, jint flags) {
 
+    int fd;
     speed_t speed;
     jobject mFileDescriptor;
 
-    /*波特率 */
+    //检查参数,获取波特率参数信息
+    /* Check arguments */
     {
         speed = getBaudrate(baudrate);
-        if (speed == -1)
-        {
+        if (speed == -1) {
             /* TODO: throw an exception */
             LOGE("Invalid baudrate");
             return NULL;
@@ -261,16 +261,13 @@ JNIEXPORT jobject JNICALL Java_com_silencefun_comtest_serialport_SerialPort_open
 
     /* Opening device */
     {
-        jint flags = 0;
         jboolean iscopy;
         const char *path_utf = (*env)->GetStringUTFChars(env, path, &iscopy);
         LOGD("Opening serial port %s with flags 0x%x", path_utf, O_RDWR | flags);
-        fd = open(path_utf, O_RDWR | O_NONBLOCK);
-        //fd=fd;
+        fd = open(path_utf, O_RDWR | flags);
         LOGD("open() fd = %d", fd);
         (*env)->ReleaseStringUTFChars(env, path, path_utf);
-        if (fd == -1)
-        {
+        if (fd == -1) {
             /* Throw an exception */
             LOGE("Cannot open port");
             /* TODO: throw an exception */
@@ -282,29 +279,98 @@ JNIEXPORT jobject JNICALL Java_com_silencefun_comtest_serialport_SerialPort_open
     {
         struct termios cfg;
         LOGD("Configuring serial port");
-        if (tcgetattr(fd, &cfg))
-        {
+        // 获取串口属性
+        if (tcgetattr(fd, &cfg)) {
             LOGE("tcgetattr() failed");
             close(fd);
             /* TODO: throw an exception */
             return NULL;
         }
-
+        //将串口设置成原始模式,并且让fd(文件句柄 对串口可读可写)
         cfmakeraw(&cfg);
-        //设置波特率
+        // 设置串口读取波特率
         cfsetispeed(&cfg, speed);
+        // 设置串口写入波特率
         cfsetospeed(&cfg, speed);
 
-        if (tcsetattr(fd, TCSANOW, &cfg))
-        {
+        cfg.c_cflag &= ~CSIZE;
+        switch (dataBits) {
+            case 5:
+                cfg.c_cflag |= CS5;    //使用5位数据位
+                break;
+            case 6:
+                cfg.c_cflag |= CS6;    //使用6位数据位
+                break;
+            case 7:
+                cfg.c_cflag |= CS7;    //使用7位数据位
+                break;
+            case 8:
+                cfg.c_cflag |= CS8;    //使用8位数据位
+                break;
+            default:
+                cfg.c_cflag |= CS8;
+                break;
+        }
+
+        switch (parity) {
+            case 0:
+                cfg.c_cflag &= ~PARENB;    //无奇偶校验
+                break;
+            case 1:
+                cfg.c_cflag |= (PARODD | PARENB);   //奇校验
+                break;
+            case 2:
+                cfg.c_iflag &= ~(IGNPAR | PARMRK); // 偶校验
+                cfg.c_iflag |= INPCK;
+                cfg.c_cflag |= PARENB;
+                cfg.c_cflag &= ~PARODD;
+                break;
+            case 3:
+                cfg.c_cflag &= ~PARODD;
+                cfg.c_cflag |= PARENB | CS8 | CMSPAR;   //使用Space校验 标记数据
+                break;
+            case 4:
+                cfg.c_cflag |= PARENB | CS8 | CMSPAR | PARODD;  //使用Mark校验 标记地址
+                break;
+            default:
+                cfg.c_cflag &= ~PARENB;
+                break;
+        }
+
+        switch (stopBits) {
+            case 1:
+                cfg.c_cflag &= ~CSTOPB;    //1位停止位
+                break;
+            case 2:
+                cfg.c_cflag |= CSTOPB;    //2位停止位
+                break;
+            default:
+                break;
+        }
+
+        // hardware flow control
+        switch (flowCon) {
+            case 0:
+                cfg.c_cflag &= ~CRTSCTS;    //不使用流控
+                break;
+            case 1:
+                cfg.c_cflag |= CRTSCTS;    //硬件流控
+                break;
+            case 2:
+                cfg.c_cflag |= IXON | IXOFF | IXANY;    //软件流控
+                break;
+            default:
+                cfg.c_cflag &= ~CRTSCTS;
+                break;
+        }
+
+        // 根据上面的配置,再次获取串口属性
+        if (tcsetattr(fd, TCSANOW, &cfg)) {
             LOGE("tcsetattr() failed");
             close(fd);
             /* TODO: throw an exception */
             return NULL;
         }
-
-        //配置校验位 停止位等等
-        set_opt(databits, parity, stopbits);
     }
 
     /* Create a corresponding file descriptor */

+ 44 - 0
SeriaApp/src/main/java/com/silencefun/comtest/MyFunc.java

@@ -1,5 +1,7 @@
 package com.silencefun.comtest;
 
+import java.io.UnsupportedEncodingException;
+
 /**
  * @author benjaminwan
  *???????????
@@ -71,4 +73,46 @@ public class MyFunc {
 		}
 	    return result; 
 	}
+
+
+
+	public static byte[] stringToHexByteArray(String s) {
+		String cleanString = s.replace(" ", ""); // 去除字符串中的空格
+		byte[] byteArray = new byte[cleanString.length() / 2]; // 每两个字符代表一个字节
+		for (int i = 0; i < cleanString.length(); i += 2) {
+			byteArray[i / 2] = (byte) ((Character.digit(cleanString.charAt(i), 16) << 4)
+					+ Character.digit(cleanString.charAt(i+1), 16));
+		}
+		return byteArray;
+	}
+
+
+
+	public static String strToHex(String str) {
+		String hexString = "0123456789ABCDEF";
+		byte[] bytes = str.getBytes();
+		StringBuilder hex = new StringBuilder(bytes.length * 2);
+		for (int i = 0; i < bytes.length; i++) {
+			hex.append(hexString.charAt((bytes[i] & 0xf0) >> 4));  // 作用同 n / 16
+			hex.append(hexString.charAt((bytes[i] & 0x0f) >> 0));  // 作用同 n
+			hex.append(' ');  //中间用空格隔开
+		}
+		return hex.toString();
+	}
+
+
+	public static String ByteArrToStr(byte[] bytes) {
+		String str = "";
+		try {
+			str = new String(bytes, "UTF-8");
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+		return str.toString();
+	}
+
+
+
+
+
 }

+ 6 - 1
SeriaApp/src/main/java/com/silencefun/comtest/SerialHelper.java

@@ -93,7 +93,7 @@ public abstract class SerialHelper {
             }
         }
 
-        Log.e(mTag, "串口地址" + sPort +" "+ iBaudRate+" " + dataBits+" " + stopBits+" " + parity);
+        Log.e(mTag, "串口地址" + sPort +" 波特率:"+ iBaudRate+" 数据位:" + dataBits+" 停止位:" + stopBits+" 校验位:" + parity);
         try {
             mSerialPort = new SerialPort(new File(sPort), iBaudRate, dataBits, stopBits, parity);
         } catch (SecurityException e) {
@@ -132,11 +132,16 @@ public abstract class SerialHelper {
     public void send(byte[] bOutArray) {
         try {
             mOutputStream.write(bOutArray);
+            mOutputStream.flush(); // 清空缓冲区,确保数据发送出去
+            Log.i(mTag, "-----------数据发送-转十六进制:"+MyFunc.ByteArrToHex(bOutArray));
+            Log.i(mTag, "-----------数据发送-转String:"+MyFunc.ByteArrToStr(bOutArray));
         } catch (IOException e) {
             e.printStackTrace();
+            Log.e(mTag, "-----------数据发送异常:"+e.toString());
         }
     }
 
+
     //----------------------------------------------------
     public void sendHex(String sHex) {
         byte[] bOutArray = MyFunc.HexToByteArr(sHex);

+ 11 - 0
SeriaApp/src/main/java/com/silencefun/comtest/been/ComBean.java

@@ -4,6 +4,7 @@ import android.util.Log;
 
 import com.google.gson.Gson;
 
+import java.io.UnsupportedEncodingException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.List;
@@ -29,6 +30,16 @@ public class ComBean {
         for (int i = 0; i < list.size(); i++) {
             bRec[i]=list.get(i);
         }
+
+        try {
+            String byteToStr=new String(bRec,"UTF-8");
+            Log.e("HHArome","byteToStr--"+byteToStr);
+            String byteToStr1=new String(bRec,"UTF-16LE");
+            Log.e("HHArome","byteToStr1--"+byteToStr1);
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
         Log.e("-----------数据 bRec  ",new Gson().toJson(bRec));
         SimpleDateFormat sDateFormat = new SimpleDateFormat("hh:mm:ss");
         sRecTime = sDateFormat.format(new java.util.Date());

+ 6 - 1
SeriaApp/src/main/java/com/silencefun/comtest/serialport/SerialPort.java

@@ -45,7 +45,10 @@ public class SerialPort {
 
        // mFd = open(device.getAbsolutePath(), baudrate, flags);
 
-        mFd = open(device.getAbsolutePath(), baudrate,dataBits,stopBits,parity);
+//        mFd = open(device.getAbsolutePath(), baudrate,dataBits,stopBits,parity);
+//        mFd = open(device.getAbsolutePath(), baudrate, 1, 8, 0, 0, 0);
+//        mFd = open(device.getAbsolutePath(), baudrate,dataBits,stopBits,parity, 0, 0);
+        mFd = open(device.getAbsolutePath(), baudrate, 1, 8, 0, 0, 0);
         if (mFd == null) {
             Log.e(TAG, "native open returns null");
             throw new IOException();
@@ -65,6 +68,8 @@ public class SerialPort {
     // JNI
     private native static FileDescriptor open(String path, int baudrate, int flags);
 
+    private native static FileDescriptor open(String path, int baudrate, int stopBits, int dataBits, int parity, int flowCon, int flags); //打开串口
+
     // 调用JNI中 打开方法的声明
 
     /**

+ 6 - 1
app/build.gradle

@@ -201,8 +201,10 @@ dependencies {
 
     // 支付宝刷脸
     implementation(name: 'ABCP-API-5.5.2.4-lite', ext: 'aar')
-    // 在线身份证
+    // 金联汇通-在线身份证-nfc
     implementation files('libs/IDOCR.PubSdk.Android.Std.NFC.Release-11.0.4.jar')
+    // 金联汇通-在线身份证-usb
+    implementation files('libs/IDOCR.PubSdk.Android.SerialPort.Release-1.0.4.jar')
     // 关机
     implementation files('libs/PosUtil.jar')
     // 马里奥y9——硬件所需
@@ -255,6 +257,9 @@ dependencies {
     // bugly
     implementation 'com.tencent.bugly:crashreport:4.0.4'
 
+    //GT基础功能(必要的)
+//    implementation 'com.github.1079374315:GSLS_Tool:v1.4.5.2'
+
 }
 repositories {
     mavenCentral()

BIN
app/libs/IDOCR.PubSdk.Android.SerialPort.Release-1.0.4.jar


BIN
app/libs/armeabi-v7a/libeidserial_lib.so


+ 38 - 0
app/src/main/java/com/hh/arome/bean/ampe/AmpeAppletResultBean.java

@@ -61,6 +61,9 @@ public class AmpeAppletResultBean {
     }
 
     public static class Data {
+        // 主要把int改为Integer,不然会出现默认值0
+
+
         // 二维码
         private String qrCode;
 
@@ -119,7 +122,25 @@ public class AmpeAppletResultBean {
         String deviceDisplay;
         // -----------设备信息---------end
 
+        // -----------麦克风录音---------begin
         String voiceContent;
+        /**
+         * 录音状态
+         * -1 错误
+         * 0  空闲
+         * 1  录音中
+         * 2  结束
+         * 3  暂停
+         * 4  停止
+         */
+        Integer microphoneState;
+        /**
+         * 持续录音监听状态
+         * 0 关闭
+         * 1 开启
+         */
+        Integer microphoneListenerState;
+        // -----------麦克风录音---------end
 
         public String getVoiceContent() {
             return voiceContent;
@@ -129,6 +150,23 @@ public class AmpeAppletResultBean {
             this.voiceContent = voiceContent;
         }
 
+
+        public Integer getMicrophoneState() {
+            return microphoneState;
+        }
+
+        public void setMicrophoneState(Integer microphoneState) {
+            this.microphoneState = microphoneState;
+        }
+
+        public Integer getMicrophoneListenerState() {
+            return microphoneListenerState;
+        }
+
+        public void setMicrophoneListenerState(Integer microphoneListenerState) {
+            this.microphoneListenerState = microphoneListenerState;
+        }
+
         public String getOriginFaceInfo() {
             return originFaceInfo;
         }

+ 30 - 0
app/src/main/java/com/hh/arome/common/Constants.java

@@ -66,6 +66,23 @@ public class Constants {
         // 麦克风持续录音输出间隔
         public static final int TIME_RECORD_INTERVAL = 1000;
 
+
+        // 启动红外感应的指令
+        public static final String INDUCTION_INSTRUCT = "O(00,26,1)E";
+
+        // 红外感应——有人
+        public static final String INDUCTION_PEOPLE_YES = "I(00,26,1)E";
+
+        // 红外感应——无人
+        public static final String INDUCTION_PEOPLE_NO = "I(00,26,0)E";
+
+        // 红外感应——勿动key,对外的文档key
+        public static final String INDUCTION_CODE = "inductionCode";
+
+        // 麦克风持续录音输出间隔
+        public static final int TIME_INDUCTION_INTERVAL = 3000;
+
+
     }
 
 
@@ -84,6 +101,8 @@ public class Constants {
         public static final String LOG_NODE_SPEECH = "设备信息---";
         public static final String LOG_NODE_MICROPHONE = "麦克风---";
         public static final String LOG_NODE_AIDL = "aidl---";
+        public static final String LOG_NODE_INFRARED_INDUCTION = "红外感应---";
+
 
         // 对应web的日志类型
         public static final String NET_LOGCAT = "Logcat";
@@ -141,6 +160,17 @@ public class Constants {
         public static final String ACTION_START_MICROPHONE_LISTENER = "startMicrophoneListener";
         // 结束麦克风——持续返回
         public static final String ACTION_STOP_MICROPHONE_LISTENER = "stopMicrophoneListener";
+        // 获取麦克风录音状态
+        public static final String ACTION_MICROPHONE_STATE = "getMicrophoneState";
+
+
+        // 红外感应监听,app有消息,就推给小程序
+        public static final String EVENT_INFRARED_INDUCTION_LISTENER = "initInfraredInductionListener";
+        // 开启红外感应——持续返回
+        public static final String ACTION_START_INFRARED_INDUCTION_LISTENER = "startInfraredInductionListener";
+        // 结束红外感应——持续返回
+        public static final String ACTION_STOP_INFRARED_INDUCTION_LISTENER = "stopInfraredInductionListener";
+
 
 
         public static final String AMPE_EVENT = "";

+ 5 - 0
app/src/main/java/com/hh/arome/common/IAppLocalConfig.java

@@ -45,4 +45,9 @@ public interface IAppLocalConfig {
     void setScanIdCardOverTime(boolean isOverTime);
     boolean getScanIdCardOverTime();
 
+
+    void setAppletOperationTimeout(int time);
+    int getAppletOperationTimeout();
+
+
 }

+ 130 - 0
app/src/main/java/com/hh/arome/common/SerialPortUtils.java

@@ -0,0 +1,130 @@
+package com.hh.arome.common;
+
+import android.util.Log;
+
+import com.silencefun.comtest.MyFunc;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import android_serialport_api.SerialPort;
+
+public class SerialPortUtils {
+
+
+    private final String TAG = "SerialPortUtils";
+    private String path = "/dev/ttysWK2";
+    private int baudrate = 9600;
+    public boolean serialPortStatus = false; //是否打开串口标志
+    public String data_;
+    public boolean threadStatus; //线程状态,为了安全终止线程
+
+    public SerialPort serialPort = null;
+    public InputStream inputStream = null;
+    public OutputStream outputStream = null;
+
+
+    /**
+     * 打开串口
+     * @return serialPort串口对象
+     */
+    public SerialPort openSerialPort(){
+        try {
+            serialPort = new SerialPort(new File(path),baudrate,0);
+            this.serialPortStatus = true;
+            threadStatus = false; //线程状态
+
+            //获取打开的串口中的输入输出流,以便于串口数据的收发
+            inputStream = serialPort.getInputStream();
+            outputStream = serialPort.getOutputStream();
+
+            new ReadThread().start(); //开始线程监控是否有数据要接收
+        } catch (IOException e) {
+            Log.e(TAG, "openSerialPort: 打开串口异常:" + e.toString());
+            return serialPort;
+        }
+        Log.d(TAG, "openSerialPort: 打开串口");
+        return serialPort;
+    }
+
+    /**
+     * 关闭串口
+     */
+    public void closeSerialPort(){
+        try {
+            inputStream.close();
+            outputStream.close();
+
+            this.serialPortStatus = false;
+            this.threadStatus = true; //线程状态
+            serialPort.close();
+        } catch (IOException e) {
+            Log.e(TAG, "closeSerialPort: 关闭串口异常:"+e.toString());
+            return;
+        }
+        Log.d(TAG, "closeSerialPort: 关闭串口成功");
+    }
+
+    /**
+     * 发送串口指令(字符串)
+     * @param data String数据指令
+     */
+    public void sendSerialPort(String data){
+        Log.d(TAG, "sendSerialPort: 发送数据");
+
+        try {
+            byte[] sendData = data.getBytes(); //string转byte[]
+            this.data_ = new String(sendData); //byte[]转string
+            if (sendData.length > 0) {
+                outputStream.write(sendData);
+                outputStream.write('\n');
+                //outputStream.write('\r'+'\n');
+                outputStream.flush();
+                Log.d(TAG, "sendSerialPort: 串口数据发送成功");
+            }
+        } catch (IOException e) {
+            Log.e(TAG, "sendSerialPort: 串口数据发送失败:"+e.toString());
+        }
+
+    }
+
+    /**
+     * 单开一线程,来读数据
+     */
+    private class ReadThread extends Thread{
+        @Override
+        public void run() {
+            super.run();
+            //判断进程是否在运行,更安全的结束进程
+            while (!threadStatus){
+                Log.d(TAG, "进入线程run");
+                //64   1024
+                byte[] buffer = new byte[64];
+                int size; //读取数据的大小
+                try {
+                    size = inputStream.read(buffer);
+                    if (size > 0){
+                        Log.d(TAG, "run: 接收到了数据:" + MyFunc.ByteArrToHex(buffer));
+                        Log.d(TAG, "run: 接收到了数据大小:" + String.valueOf(size));
+                        onDataReceiveListener.onDataReceive(buffer,size);
+                    }
+                } catch (IOException e) {
+                    Log.e(TAG, "run: 数据读取异常:" +e.toString());
+                }
+            }
+
+        }
+    }
+
+    //这是写了一监听器来监听接收数据
+    public OnDataReceiveListener onDataReceiveListener = null;
+    public static interface OnDataReceiveListener {
+        public void onDataReceive(byte[] buffer, int size);
+    }
+    public void setOnDataReceiveListener(OnDataReceiveListener dataReceiveListener) {
+        onDataReceiveListener = dataReceiveListener;
+    }
+
+}

+ 6 - 6
app/src/main/java/com/hh/arome/common/deviceui/MlaDeviceUI.java

@@ -51,11 +51,11 @@ public class MlaDeviceUI implements IDeviceUI{
         OrbbecSSDKApi.getInstance().init(MyApplication.getContext(), extInfo, new OrbbecSSDKInitCallback() {
             @Override
             public void onSuccess() {
-                AppLogUtils.e("y9初始化--onSuccess");
+                AppLogUtils.i("y9初始化--onSuccess");
             }
             @Override
             public void onFail(int errorCode, String errorMsg) {
-                AppLogUtils.e("y9初始化--onFail:"+errorCode+" "+errorMsg);
+                AppLogUtils.i("y9初始化--onFail:"+errorCode+" "+errorMsg);
             }
         });
     }
@@ -66,7 +66,7 @@ public class MlaDeviceUI implements IDeviceUI{
             @Override
             public void onResponse(OrbbecSSDKResponse orbbecSSDKResponse) {
                 Object data = orbbecSSDKResponse.getResult().get(KEY_RESULT_DATA);
-                AppLogUtils.e("showNotification--设置是否成功:"+(Boolean)data);
+                AppLogUtils.i("showNotification--设置是否成功:"+(Boolean)data);
             }
         });
     }
@@ -77,7 +77,7 @@ public class MlaDeviceUI implements IDeviceUI{
             @Override
             public void onResponse(OrbbecSSDKResponse orbbecSSDKResponse) {
                 Object data = orbbecSSDKResponse.getResult().get(KEY_RESULT_DATA);
-                AppLogUtils.e("hideNotification--设置是否成功:"+(Boolean)data);
+                AppLogUtils.i("hideNotification--设置是否成功:"+(Boolean)data);
             }
         });
     }
@@ -88,7 +88,7 @@ public class MlaDeviceUI implements IDeviceUI{
             @Override
             public void onResponse(OrbbecSSDKResponse orbbecSSDKResponse) {
                 Object data = orbbecSSDKResponse.getResult().get(KEY_RESULT_DATA);
-                AppLogUtils.e("showNavigationBar--设置是否成功:"+(Boolean)data);
+                AppLogUtils.i("showNavigationBar--设置是否成功:"+(Boolean)data);
             }
         });
     }
@@ -99,7 +99,7 @@ public class MlaDeviceUI implements IDeviceUI{
             @Override
             public void onResponse(OrbbecSSDKResponse orbbecSSDKResponse) {
                 Object data = orbbecSSDKResponse.getResult().get(KEY_RESULT_DATA);
-                AppLogUtils.e("hideNavigationBar--设置是否成功:"+(Boolean)data);
+                AppLogUtils.i("hideNavigationBar--设置是否成功:"+(Boolean)data);
             }
         });
     }

+ 25 - 0
app/src/main/java/com/hh/arome/common/microphone/IMicroPhoneStateCallback.java

@@ -0,0 +1,25 @@
+package com.hh.arome.common.microphone;
+
+
+
+/**
+ * Created by L470 on 2020/4/11.
+ * 成功失败返回结果的回调接口,给最上调用层的回调
+ */
+public interface IMicroPhoneStateCallback {
+
+    /**
+     * -1 错误
+     * 0  空闲
+     * 1  录音中
+     * 2  结束
+     * 3  暂停
+     * 4  停止
+     * @param state
+     */
+    void onState(int state);
+
+
+    void onError(int state,String msg);
+
+}

+ 54 - 32
app/src/main/java/com/hh/arome/common/microphone/ZlwRecordManager.java

@@ -21,9 +21,11 @@ import com.hh.arome.utlis.log.AppLogUtils;
 import com.hh.arome.utlis.log.LogType;
 import com.zlw.main.recorderlib.RecordManager;
 import com.zlw.main.recorderlib.recorder.RecordConfig;
+import com.zlw.main.recorderlib.recorder.RecordHelper;
 import com.zlw.main.recorderlib.recorder.RecordService;
 import com.zlw.main.recorderlib.recorder.listener.RecordResultListener;
 import com.zlw.main.recorderlib.recorder.listener.RecordSoundSizeListener;
+import com.zlw.main.recorderlib.recorder.listener.RecordStateListener;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -110,6 +112,8 @@ public class ZlwRecordManager {
         this.intervalTime = intervalTime;
         this.iMicroPhoneSizeCallback = iMicroPhoneSizeCallback;
 
+        isStart = true;
+
         if (intervalTime == null) {
             intervalTime = TIME_RECORD_INTERVAL;
         }
@@ -190,6 +194,7 @@ public class ZlwRecordManager {
 
                         lastFilePosition = curLength;
 
+                        isStart = true;
                         iMicroPhoneSizeCallback.onSizeSuccess(str);
 
 
@@ -205,8 +210,12 @@ public class ZlwRecordManager {
                         }
 
                         String str = fileToBase64RandomAccessFile(file, lastFilePosition, Integer.parseInt(file.length() + ""));
+
+                        isStart = false;
                         iMicroPhoneSizeCallback.onSizeSuccess(str);
 
+                        stopAll();
+
                     }
 
                 };
@@ -323,9 +332,9 @@ public class ZlwRecordManager {
 
 
     public void stopAll(){
-        isStart = false;
         if(recordManager!=null){
             recordManager.stop();
+            isStart = false;
         }
     }
 
@@ -487,41 +496,54 @@ public class ZlwRecordManager {
     }
 
 
-    public void extractMp3Info(String filePath) {
-        MediaExtractor extractor = new MediaExtractor();
-        try {
-            extractor.setDataSource(filePath);
-
-            int trackCount = extractor.getTrackCount();
-            for (int i = 0; i < trackCount; i++) {
-                MediaFormat format = extractor.getTrackFormat(i);
-                String mime = format.getString(MediaFormat.KEY_MIME);
-
-                if (mime.startsWith("audio/")) {
-                    // 获取帧率
-                    float frameRate = Float.parseFloat(format.getInteger(MediaFormat.KEY_SAMPLE_RATE)+"");
-
-
-                    int integer = format.getInteger(MediaFormat.KEY_SAMPLE_RATE);
-
-                    AppLogUtils.e("帧率: " + frameRate,
-                            "帧率: " + integer);
+    IMicroPhoneStateCallback iMicroPhoneStateCallback;
 
-                    // 获取帧大小
-                    int frameSize = format.getInteger(MediaFormat.KEY_MAX_INPUT_SIZE);
+    public void getState(IMicroPhoneStateCallback iMicroPhoneStateCallback){
+        this.iMicroPhoneStateCallback = iMicroPhoneStateCallback;
+        AppLogUtils.e("onState--state--1");
 
-                    AppLogUtils.e("帧率: " + frameRate,
-                            "帧大小: " + frameSize,
-                            "帧率: " + integer);
-                }
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            extractor.release();
+        if(isStart){
+            iMicroPhoneStateCallback.onState(1);
+        }else{
+            iMicroPhoneStateCallback.onState(0);
         }
-    }
 
+//        recordManager.setRecordStateListener(new RecordStateListener() {
+//            @Override
+//            public void onStateChange(RecordHelper.RecordState state) {
+//                AppLogUtils.e("onState--state--2");
+//                switch (state) {
+//                    case IDLE:
+//                        // 空闲
+//                        iMicroPhoneStateCallback.onState(0);
+//                        AppLogUtils.e("onState--state--3");
+//                        break;
+//                    case RECORDING:
+//                        // 录音中
+//                        iMicroPhoneStateCallback.onState(1);
+//                        break;
+//                    case FINISH:
+//                        // 录音结束
+//                        iMicroPhoneStateCallback.onState(2);
+//                        break;
+//                    case PAUSE:
+//                        iMicroPhoneStateCallback.onState(3);
+//                        break;
+//                    case STOP:
+//                        iMicroPhoneStateCallback.onState(4);
+//                        break;
+//                    default:
+//                        break;
+//                }
+//            }
+//
+//            @Override
+//            public void onError(String error) {
+//                AppLogUtils.e("error:"+error);
+//                iMicroPhoneStateCallback.onError(-1,error+"");
+//            }
+//        });
+    }
 
 
 

+ 16 - 9
app/src/main/java/com/hh/arome/common/scan/idcard/base/IDCardScanEngine.java

@@ -5,6 +5,7 @@ import android.content.Context;
 import com.hh.arome.common.scan.idcard.abstractidcard.IIDCardScan;
 import com.hh.arome.common.scan.idcard.callback.IDCardInitResultCallback;
 import com.hh.arome.common.scan.idcard.callback.IDCardScanResultCallback;
+import com.hh.arome.common.scan.idcard.manymodels.JlhtER301IDCardScan;
 import com.hh.arome.common.scan.idcard.manymodels.TbIDCardScan;
 import com.hh.arome.common.scan.idcard.manymodels.NfcIDCardScan;
 import com.hh.arome.common.scan.idcard.manymodels.NullIDCardScan;
@@ -60,7 +61,7 @@ public class IDCardScanEngine
     public IIDCardScan getIDCardScanEngine(Context context,int idCardReaderBrand) {
 
 //        String model = Build.MODEL;
-//        AppLogUtils.e("model:" + model);
+//        AppLogUtils.i("model:" + model);
 //
 //        if (Constants.DeviceModel.D2.equals(model)) {
 //            // D2
@@ -73,8 +74,8 @@ public class IDCardScanEngine
 //            return NullIDCardScan.getInstance(context);
 //        }
 
-        AppLogUtils.e("idCardReaderBrand:" + idCardReaderBrand);
-        AppLogUtils.e("isOverTime:" + isOverTime);
+        AppLogUtils.i("idCardReaderBrand:" + idCardReaderBrand);
+        AppLogUtils.i("isOverTime:" + isOverTime);
         /**
          * NFC(1, "NFC在线阅读器"),
          * TB(2, "天波阅读器"),
@@ -91,11 +92,17 @@ public class IDCardScanEngine
         } else if (2 == idCardReaderBrand) {
             // 天波阅读器,适用于D2
             return TbIDCardScan.getInstance(context);
-        } else if (4 == idCardReaderBrand) {
+        }
+        else if (4 == idCardReaderBrand) {
             // 新中新
             XzxIDCardScan xzxIDCardScan = XzxIDCardScan.getInstance(context);
             return xzxIDCardScan;
-        } else {
+        }
+        else if (10 == idCardReaderBrand) {
+            // er301
+            return JlhtER301IDCardScan.getInstance(context);
+        }
+        else {
             // 未适配的设备,空实现
             return NullIDCardScan.getInstance(context);
         }
@@ -124,22 +131,22 @@ public class IDCardScanEngine
     }
 
     public void resumeScanIDCard() {
-        AppLogUtils.e("IDCardScanEngine--resumeScanIDCard");
+        AppLogUtils.i("IDCardScanEngine--resumeScanIDCard");
         mIIDCardScan.resumeIDCardScan();
     }
 
     public void pauseScanIDCard(){
-        AppLogUtils.e("IDCardScanEngine--pauseScanIDCard");
+        AppLogUtils.i("IDCardScanEngine--pauseScanIDCard");
         mIIDCardScan.pauseIDCardScan();
     }
 
     public void stopScanIDCard() {
-        AppLogUtils.e("IDCardScanEngine--stopScanIDCard");
+        AppLogUtils.i("IDCardScanEngine--stopScanIDCard");
         mIIDCardScan.stopIDCardScan();
     }
 
     public void destoryIDCardScan() {
-        AppLogUtils.e("IDCardScanEngine--destoryIDCardScan");
+        AppLogUtils.i("IDCardScanEngine--destoryIDCardScan");
         mIIDCardScan.destoryIDCardScan();
         instance = null;
     }

+ 4 - 4
app/src/main/java/com/hh/arome/common/scan/idcard/lifecycle/IDCardScanManager.java

@@ -106,25 +106,25 @@ public class IDCardScanManager implements LifeCycleListener {
 
     @Override
     public void onResume() {
-        AppLogUtils.e("IDCardScanManager--onResume");
+        AppLogUtils.i("IDCardScanManager--onResume");
         mIDCardScanEngine.resumeScanIDCard();
     }
 
     @Override
     public void onPause() {
-        AppLogUtils.e("IDCardScanManager--onPause");
+        AppLogUtils.i("IDCardScanManager--onPause");
         mIDCardScanEngine.pauseScanIDCard();
     }
 
     @Override
     public void onStop() {
-        AppLogUtils.e("IDCardScanManager--onStop");
+        AppLogUtils.i("IDCardScanManager--onStop");
         mIDCardScanEngine.stopScanIDCard();
     }
 
     @Override
     public void onDestroy() {
-        AppLogUtils.e("IDCardScanManager--onDestroy");
+        AppLogUtils.i("IDCardScanManager--onDestroy");
         mIDCardScanEngine.destoryIDCardScan();
     }
 

+ 4 - 4
app/src/main/java/com/hh/arome/common/scan/idcard/lifecycle/SupportManagerFragment.java

@@ -34,7 +34,7 @@ public class SupportManagerFragment extends Fragment {
     @Override
     public void onResume() {
         super.onResume();
-        AppLogUtils.e("SupportManagerFragment--onResume");
+        AppLogUtils.i("SupportManagerFragment--onResume");
         if (lifeCycle != null) {
             lifeCycle.onResume();
         }
@@ -43,7 +43,7 @@ public class SupportManagerFragment extends Fragment {
     @Override
     public void onPause() {
         super.onPause();
-        AppLogUtils.e("SupportManagerFragment--onPause");
+        AppLogUtils.i("SupportManagerFragment--onPause");
         if (lifeCycle != null) {
             lifeCycle.onPause();
         }
@@ -52,7 +52,7 @@ public class SupportManagerFragment extends Fragment {
     @Override
     public void onStop() {
         super.onStop();
-        AppLogUtils.e("SupportManagerFragment--onStop");
+        AppLogUtils.i("SupportManagerFragment--onStop");
         if (lifeCycle != null) {
             lifeCycle.onStop();
         }
@@ -61,7 +61,7 @@ public class SupportManagerFragment extends Fragment {
     @Override
     public void onDestroy() {
         super.onDestroy();
-        AppLogUtils.e("SupportManagerFragment--onDestroy");
+        AppLogUtils.i("SupportManagerFragment--onDestroy");
         if (lifeCycle != null) {
             lifeCycle.onDestroy();
         }

+ 257 - 0
app/src/main/java/com/hh/arome/common/scan/idcard/manymodels/JlhtER301IDCardScan.java

@@ -0,0 +1,257 @@
+package com.hh.arome.common.scan.idcard.manymodels;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.text.TextUtils;
+import android.util.Base64;
+import android.util.Log;
+import android.view.View;
+import android.widget.Toast;
+
+import androidx.fragment.app.FragmentActivity;
+
+import com.common.lib_base.utils.ui.ToastUtils;
+import com.eidlink.serial_idocr.bean.EidlinkResult;
+import com.eidlink.serial_idocr.bean.IdInfoBean;
+import com.eidlink.serial_idocr.listener.InitCallback;
+import com.eidlink.serial_idocr.listener.OnGetResultListener;
+import com.hh.arome.common.scan.idcard.abstractidcard.IIDCardScan;
+import com.hh.arome.common.scan.idcard.bean.IDCardInfoBean;
+import com.hh.arome.common.scan.idcard.callback.IDCardInitResultCallback;
+import com.hh.arome.common.scan.idcard.callback.IDCardScanResultCallback;
+import com.hh.arome.common.scan.idcard.manymodels.er301.ReadCardManagerER301;
+import com.hh.arome.utlis.log.AppLogUtils;
+
+import java.io.ByteArrayOutputStream;
+
+/**
+ * 金联汇通
+ * 适用于ER301在线身份证设备
+ */
+public class JlhtER301IDCardScan implements IIDCardScan {
+
+
+    //用volatile关键字确保 instance 在多线程下的可见性
+    private static volatile JlhtER301IDCardScan instance = null;
+
+    //将构造方法私有化,禁止外部通过构造方法创建实例
+    private JlhtER301IDCardScan() {}
+
+    //提供一个公共的访问方法,用于获取该类的唯一实例
+    public static JlhtER301IDCardScan getInstance(Context context) {
+        //如果instance为空,就进行实例化
+        if (instance == null) {
+            //保证多线程下只有一个线程进行实例化
+            synchronized (JlhtER301IDCardScan.class) {
+                //第二次判断,避免多线程下创建多个实例
+                if (instance == null) {
+                    instance = new JlhtER301IDCardScan(context);
+                }
+            }
+        }
+        return instance;
+    }
+
+
+    Context mContext;
+    Activity mActivity;
+
+    public JlhtER301IDCardScan(Context context) {
+        if (context instanceof FragmentActivity) {
+            this.mActivity = (Activity) context;
+        }
+        this.mContext = context;
+        init();
+    }
+
+    private void init() {
+        //
+        ReadCardManagerER301.initEid(1, 1);
+
+
+    }
+
+    private boolean deviceIsConnect = false;//当前usb设备是否连接
+
+    /**
+     * 初始化USB设备
+     */
+    private void initUsbDevice() {
+        ReadCardManagerER301.eid.initlUSbDevice(mContext, 8898, 12289, new InitCallback() {
+            @Override
+            public void onSuccess() {
+                deviceIsConnect = true;
+                idCardInitResultCallback.onIDCardInitSuccess();
+
+            }
+
+            @Override
+            public void onFailed() {
+                deviceIsConnect = false;
+                idCardInitResultCallback.onIDCardInitError("-1","初始化USB失败");
+
+            }
+        });
+
+
+    }
+
+    IDCardInitResultCallback idCardInitResultCallback;
+
+    @Override
+    public void initIDCard(IDCardInitResultCallback idCardInitResultCallback) {
+        this.idCardInitResultCallback = idCardInitResultCallback;
+        initUsbDevice();
+    }
+
+    IDCardScanResultCallback idCardScanResultCallback;
+
+    @Override
+    public void startIDCardScan(IDCardScanResultCallback idCardScanResultCallback) {
+
+        this.idCardScanResultCallback = idCardScanResultCallback;
+
+        initStartCard();
+    }
+
+    private void initStartCard() {
+        if (deviceIsConnect) { //当前usb是否连接
+            readCard();
+        } else {
+            AppLogUtils.e("未找到设备,初始化USB");
+            initUsbDevice();
+        }
+    }
+
+    private long startTime;
+
+    private void readCard() {
+        ReadCardManagerER301.eid.readCard(new OnGetResultListener() {
+            @Override
+            public void onSuccess(EidlinkResult result) {
+
+                AppLogUtils.e("\n读卡成功耗时:" + (System.currentTimeMillis() - startTime) + "ms");
+                IdInfoBean idInfoBean = result.getIdInfoBean();
+                handleIDCardData(idInfoBean);
+            }
+
+            @Override
+            public void onFailed(int code, String msg) {
+                AppLogUtils.e("\n读卡失败---code:"+code+"  msg:"+msg);
+
+                if(code == 401){
+                    msg = "该域名无法解析身份证,请检查网络错误";
+                }else if(code == 405){
+                    msg = "USB初始化失败";
+                    initUsbDevice();
+                    return;
+                }
+
+                if(TextUtils.isEmpty(msg)){
+                    msg = "读卡失败,请重试";
+                }
+
+                idCardScanResultCallback.onIDCardError(code+"",msg);
+                // 开始读取
+                readCard();
+
+            }
+
+            @Override
+            public void onStart() {
+                super.onStart();
+                AppLogUtils.e("开始读卡");
+            }
+
+            @Override
+            public void findCard() {
+                super.findCard();
+                startTime = System.currentTimeMillis();
+            }
+
+        });
+
+
+    }
+
+
+
+    private void handleIDCardData(final IdInfoBean idcard) {
+
+        IDCardInfoBean idCardInfoBean = new IDCardInfoBean();
+        idCardInfoBean.setIdcardName(idcard.getName());
+        idCardInfoBean.setIdcardNumber(idcard.getIdnum());
+        idCardInfoBean.setSex(idcard.getSex());
+        idCardInfoBean.setAddress(idcard.getAddress());
+        idCardInfoBean.setBirth(idcard.getBirthDate());
+        idCardInfoBean.setNation(idcard.getNation());
+        idCardInfoBean.setSigningOrganization(idcard.getSigningOrganization());
+        idCardInfoBean.setBeginTime(idcard.getBeginTime());
+        idCardInfoBean.setEndTime(idcard.getEndTime());
+
+        String bmpPhotos = "";
+        try {
+            byte[] picData = Base64.decode(idcard.getPicture(), Base64.DEFAULT);
+            // 头像图片
+            Bitmap bmp = BitmapFactory.decodeByteArray(picData, 0, picData.length);
+            if (bmp == null) {
+                AppLogUtils.i("新中新身份证照片解码null ");
+            } else {
+                bmpPhotos = bitmapToString(bmp);
+//                AppLogUtils.i("新中新身份证照片解码有值bmpPhotos--" +bmpPhotos);
+                AppLogUtils.i("新中新身份证照片解码有值bmpPhotos--");
+
+                idCardInfoBean.setPhotoBase64(bmpPhotos);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            AppLogUtils.i("新中新身份证照片解码异常 "+e);
+        }
+
+        idCardScanResultCallback.onIDCardScanSuccess(idCardInfoBean);
+
+        readCard();
+
+
+
+    }
+
+
+        //将Bitmap转换成字符串
+        public static String bitmapToString(Bitmap bitmap) {
+            try {
+                String string = null;
+                ByteArrayOutputStream bStream = new ByteArrayOutputStream();
+                bitmap.compress(Bitmap.CompressFormat.PNG, 100, bStream);
+                byte[] bytes = bStream.toByteArray();
+                string = Base64.encodeToString(bytes, Base64.DEFAULT);
+                return string;
+            } catch (Exception e) {
+                e.printStackTrace();
+                return "";
+            }
+        }
+
+
+    @Override
+    public void resumeIDCardScan() {
+
+    }
+
+    @Override
+    public void pauseIDCardScan() {
+
+    }
+
+    @Override
+    public void stopIDCardScan() {
+
+    }
+
+    @Override
+    public void destoryIDCardScan() {
+
+    }
+}

+ 9 - 9
app/src/main/java/com/hh/arome/common/scan/idcard/manymodels/NfcIDCardScan.java

@@ -20,7 +20,7 @@ import com.hh.arome.common.scan.idcard.bean.IDCardInfoBean;
 import com.hh.arome.common.scan.idcard.callback.IDCardInitResultCallback;
 import com.hh.arome.common.scan.idcard.callback.IDCardScanResultCallback;
 import com.hh.arome.common.scan.idcard.manymodels.k8.MyNfcManager;
-import com.hh.arome.common.scan.idcard.manymodels.k8.ReadCardManager;
+import com.hh.arome.common.scan.idcard.manymodels.k8.ReadCardManagerNfc;
 import com.hh.arome.utlis.log.AppLogUtils;
 import com.hh.arome.utlis.log.LogType;
 
@@ -75,10 +75,10 @@ public class NfcIDCardScan implements IIDCardScan {
 
     private void k8Init() {
 
-        ReadCardManager.initEid(getApplicationContext());
-        ReadCardManager.eid.setGetDataFromSdk(true);
+        ReadCardManagerNfc.initEid(getApplicationContext());
+        ReadCardManagerNfc.eid.setGetDataFromSdk(true);
 
-        if (ReadCardManager.eid == null) {
+        if (ReadCardManagerNfc.eid == null) {
             idCardInitResultCallback.onIDCardInitError("-1", "在线身份证---初始化失败---eid对象为空,请初始化sdk成功后再使用sdk功能---");
         }else{
             // 初始化成功
@@ -96,9 +96,9 @@ public class NfcIDCardScan implements IIDCardScan {
         public void onNfcEvent(Tag tag) {
 
             AppLogUtils.e("mNfcListener");
-            AppLogUtils.e("mNfcListener--"+ReadCardManager.eid);
+            AppLogUtils.e("mNfcListener--"+ ReadCardManagerNfc.eid);
 
-            if (ReadCardManager.eid == null) {
+            if (ReadCardManagerNfc.eid == null) {
 
                 idCardInitResultCallback.onIDCardInitError("-1", "Nfc在线身份证---初始化失败---eid对象为空,请初始化sdk成功后再使用sdk功能---");
 
@@ -112,7 +112,7 @@ public class NfcIDCardScan implements IIDCardScan {
              * 通用模式,同时支持二代证读取和eID电子证照读取
              */
 
-            ReadCardManager.eid.readIDCard(tag, mResultListener);
+            ReadCardManagerNfc.eid.readIDCard(tag, mResultListener);
 
             /**
              * ReadCardManager.eid.readIDCard(IDOCRCardType.IDCARD,tag, mResultListener);
@@ -202,8 +202,8 @@ public class NfcIDCardScan implements IIDCardScan {
 
     @Override
     public void destoryIDCardScan() {
-        if(ReadCardManager.eid!=null){
-            ReadCardManager.eid.release();
+        if(ReadCardManagerNfc.eid!=null){
+            ReadCardManagerNfc.eid.release();
         }
     }
 

+ 26 - 26
app/src/main/java/com/hh/arome/common/scan/idcard/manymodels/XzxIDCardScan.java

@@ -98,27 +98,27 @@ public class XzxIDCardScan implements IIDCardScan {
             String devName = DeviceConnectManager.getInstance().getDevName();
             switch (msg.what) {
                 case DeviceConnectManager.MESSAGE_CONNECTED:
-                    AppLogUtils.e(devName + "新中新身份证阅读器连接成功");
+                    AppLogUtils.i(devName + "新中新身份证阅读器连接成功");
                     idCardInitResultCallback.onIDCardInitSuccess();
                     break;
                 case DeviceConnectManager.MESSAGE_CONNECTING_DEVICE:
-                    AppLogUtils.e(devName + "新中新身份证阅读器正在连接");
+                    AppLogUtils.i(devName + "新中新身份证阅读器正在连接");
                     break;
                 case DeviceConnectManager.MESSAGE_CONNECTFAILED:
-                    AppLogUtils.e(devName + "新中新身份证阅读器连接失败,尝试重连");
+                    AppLogUtils.i(devName + "新中新身份证阅读器连接失败,尝试重连");
 //                    idCardInitResultCallback.onIDCardInitError("-1",devName + "新中新身份证阅读器连接失败,尝试重连");
 
                     retryCount++;
-                    AppLogUtils.e("retryCount--"+retryCount);
-                    AppLogUtils.e("retryMaxCount--"+retryMaxCount);
+                    AppLogUtils.i("retryCount--"+retryCount);
+                    AppLogUtils.i("retryMaxCount--"+retryMaxCount);
 
                     if(retryCount >= retryMaxCount){
-                        AppLogUtils.e(devName + "新中新身份证阅读器连接失败回调");
+                        AppLogUtils.i(devName + "新中新身份证阅读器连接失败回调");
                         idCardInitResultCallback.onIDCardInitError("-1",devName + "新中新身份证阅读器连接"+retryCount+"次后连接失败");
                         return;
                     }
 
-                    AppLogUtils.e("重连--");
+                    AppLogUtils.i("重连--");
 
                     clearXzx();
 
@@ -133,22 +133,22 @@ public class XzxIDCardScan implements IIDCardScan {
                     closeRead();
                     break;
                 case DeviceConnectManager.MESSAGE_RECONNECT_DEVICE:
-                    AppLogUtils.e(devName + "新中新身份证阅读器重新连接");
+                    AppLogUtils.i(devName + "新中新身份证阅读器重新连接");
                     break;
                 case DeviceConnectManager.MESSAGE_STOP_READCARD:
                     break;
                 case IDCardReaderThread.MESSAGE_START_READ:
-                    AppLogUtils.e("新中新身份证阅读器开始读卡");
+                    AppLogUtils.i("新中新身份证阅读器开始读卡");
                     ThreadPoolManager.getInstance().executeIOTask(new MyTimer());
 //                    new MyTimer().start();
                     break;
                 case IDCardReaderThread.MESSAGE_DISPLAY_IDCARD:
-                    AppLogUtils.e("新中新身份证读卡信息  " + new Gson().toJson((IDCards) msg.obj));
+                    AppLogUtils.i("新中新身份证读卡信息  " + new Gson().toJson((IDCards) msg.obj));
                     SendIdCard((IDCards) msg.obj);
 //                    overtime = allTime;
                     break;
                 case IDCardReaderThread.MESSAGE_STOP_READ:
-                    AppLogUtils.e("新中新身份证阅读器停止读卡");
+                    AppLogUtils.i("新中新身份证阅读器停止读卡");
                     break;
                 case UPDATE_READER_STATUS:
                     AppLogUtils.i("身份证读卡耗时等信息  " + idCardReaderThread.getReadStatus());
@@ -177,11 +177,11 @@ public class XzxIDCardScan implements IIDCardScan {
     class MyTimer extends Thread {
         @Override
         public void run() {
-            AppLogUtils.e("MyTimer");
+            AppLogUtils.i("MyTimer");
 
 
 //            isOverTime = localConfig.getScanIdCardOverTime();
-//            AppLogUtils.e("isOverTime--"+isOverTime);
+//            AppLogUtils.i("isOverTime--"+isOverTime);
 //
 //            if(isOverTime){
 //                isComplete = false;
@@ -203,7 +203,7 @@ public class XzxIDCardScan implements IIDCardScan {
                 }
             } catch (Exception e) {
                 e.printStackTrace();
-                AppLogUtils.e(e.toString());
+                AppLogUtils.i(e.toString());
             }
         }
     }
@@ -214,7 +214,7 @@ public class XzxIDCardScan implements IIDCardScan {
 
 
         if(idCardScanResultCallback == null){
-            AppLogUtils.e("idCardScanResultCallback == null");
+            AppLogUtils.i("idCardScanResultCallback == null");
             return;
         }
 
@@ -225,7 +225,7 @@ public class XzxIDCardScan implements IIDCardScan {
             return;
         }
 
-        AppLogUtils.e("idcard:"+idcard.toString());
+        AppLogUtils.i("idcard:"+idcard.toString());
 
         String type = "";
         String name = "";
@@ -241,7 +241,7 @@ public class XzxIDCardScan implements IIDCardScan {
             Cardid = card.getIDCardNo();
         }
 
-        AppLogUtils.e(true, "mHandler_新中新身份证阅读器","新中新身份证读卡人员" + name
+        AppLogUtils.i(true, "mHandler_新中新身份证阅读器","新中新身份证读卡人员" + name
                 + "新中新身份证读卡时间 " + idcard.getReadTime());
 
 
@@ -260,16 +260,16 @@ public class XzxIDCardScan implements IIDCardScan {
         try {
             Bitmap bmp = idcard.getPhoto();
             if (bmp == null) {
-                AppLogUtils.e("新中新身份证照片解码null ");
+                AppLogUtils.i("新中新身份证照片解码null ");
             } else {
                 bmpPhotos = bitmapToString(bmp);
-//                AppLogUtils.e("新中新身份证照片解码有值bmpPhotos--" +bmpPhotos);
-                AppLogUtils.e("新中新身份证照片解码有值bmpPhotos--");
+//                AppLogUtils.i("新中新身份证照片解码有值bmpPhotos--" +bmpPhotos);
+                AppLogUtils.i("新中新身份证照片解码有值bmpPhotos--");
                 idCardInfoBean.setPhotoBase64(bmpPhotos);
             }
         } catch (Exception e) {
             e.printStackTrace();
-            AppLogUtils.e("新中新身份证照片解码异常 "+e);
+            AppLogUtils.i("新中新身份证照片解码异常 "+e);
         }
 
         // 因为aidl解析图片出错,试试原始的wlt
@@ -326,7 +326,7 @@ public class XzxIDCardScan implements IIDCardScan {
 
     private void init() {
 
-        AppLogUtils.e("init");
+        AppLogUtils.i("init");
         if(mHandler == null){
             mHandler = new Handler();
         }
@@ -336,7 +336,7 @@ public class XzxIDCardScan implements IIDCardScan {
 //        ThreadPoolManager.getInstance().executeIOTask(new Runnable() {
 //            @Override
 //            public void run() {
-//                AppLogUtils.e("initIDCard---idCardReaderThread");
+//                AppLogUtils.i("initIDCard---idCardReaderThread");
 
                 idCardReaderThread = new IDCardReaderThread();
                 idCardReaderThread.setActivityAndHandler(mActivity, mHandler);
@@ -369,8 +369,8 @@ public class XzxIDCardScan implements IIDCardScan {
 //                return;
 //            }
 //
-//            AppLogUtils.e("isComplete:"+isComplete);
-//            AppLogUtils.e("overtime:"+overtime);
+//            AppLogUtils.i("isComplete:"+isComplete);
+//            AppLogUtils.i("overtime:"+overtime);
 //            if (overtime == 0 && !isComplete) {
 //                idCardScanResultCallback.onIDCardError("-1","超时");
 //                isComplete = true;
@@ -400,7 +400,7 @@ public class XzxIDCardScan implements IIDCardScan {
 
 //        overtime = allTime;
 //        isComplete = false;
-//        AppLogUtils.e("startIDCardScan--重置倒计时");
+//        AppLogUtils.i("startIDCardScan--重置倒计时");
         startRead(100);
 
     }

+ 39 - 0
app/src/main/java/com/hh/arome/common/scan/idcard/manymodels/er301/ReadCardManagerER301.java

@@ -0,0 +1,39 @@
+package com.hh.arome.common.scan.idcard.manymodels.er301;
+
+import android.util.Log;
+
+import com.eidlink.serial_idocr.bean.EidlinkInitParams;
+import com.eidlink.serial_idocr.sdk.EidLinkSE;
+import com.eidlink.serial_idocr.sdk.EidLinkSEFactory;
+
+
+public class ReadCardManagerER301 {
+    public static EidLinkSE eid;
+    public static boolean isJpg;
+
+
+    public static void initEid(int modelType, int findFlag) {
+
+        /**
+         * @param declevel    是否读照片 0 读照片 1读文本
+         * @param model       模式  0 串口 1usb
+         * @param find_flag   寻卡类型 0 一次 1 循环
+         * @param read_model  读卡模式 0 触发式读卡(贴一下读一下),1 重复读卡(测试环境中使用)
+         * @param pic_type   0 原始数据,1 明文数据 (读头掉电重启生效)
+         * @param usb_receive usb的收发模式,0 64字节循环接收,1 单次接收
+         * @brief 初始化参数
+         */
+
+        EidlinkInitParams eidlinkInitParams = new EidlinkInitParams(0, modelType, findFlag, 1, 1, 1);
+        eid = EidLinkSEFactory.getEidLinkSE(eidlinkInitParams);
+
+        // 设置环境和port
+//        eid.setIP("es-new.beekey.com.cn");
+
+        eid.setIP("es.eidlink.com");
+        eid.setPort(9699);
+
+    }
+
+
+}

+ 1 - 1
app/src/main/java/com/hh/arome/common/scan/idcard/manymodels/k8/ReadCardManager.java → app/src/main/java/com/hh/arome/common/scan/idcard/manymodels/k8/ReadCardManagerNfc.java

@@ -7,7 +7,7 @@ import com.eidlink.idocr.sdk.EidLinkSE;
 import com.eidlink.idocr.sdk.EidLinkSEFactory;
 import com.eidlink.idocr.sdk.bean.EidlinkInitParams;
 
-public class ReadCardManager {
+public class ReadCardManagerNfc {
     public static EidLinkSE eid;
     public static String tag_need_add_picture = "tag_need_add_picture";
 

+ 106 - 0
app/src/main/java/com/hh/arome/common/voice/VolumeUtil.java

@@ -0,0 +1,106 @@
+package com.hh.arome.common.voice;
+
+import android.app.Service;
+import android.content.Context;
+import android.media.AudioManager;
+
+/**
+ * 音量控制
+ */
+public class VolumeUtil {
+    private AudioManager mAudioManager;
+
+    public VolumeUtil(Context context){
+        mAudioManager = (AudioManager) context.getSystemService(Service.AUDIO_SERVICE);
+    }
+    //获取最大多媒体音量
+    public int getMediaMaxVolume(){
+        return mAudioManager.getStreamMaxVolume( AudioManager.STREAM_MUSIC );
+    }
+    //获取当前多媒体音量
+    public int getMediaVolume(){
+        return mAudioManager.getStreamVolume( AudioManager.STREAM_MUSIC );
+    }
+
+    //获取最大通话音量
+    public int getCallMaxVolume(){
+        return mAudioManager.getStreamMaxVolume( AudioManager.STREAM_VOICE_CALL );
+    }
+
+    //获取当前通话音量
+    public int getCallVolume(){
+        return mAudioManager.getStreamVolume( AudioManager.STREAM_VOICE_CALL );
+    }
+
+    //获取最大系统音量
+    public int getSystemMaxVolume(){
+
+        return mAudioManager.getStreamMaxVolume(AudioManager.STREAM_SYSTEM );
+    }
+
+    //获取当前系统音量
+    public int getSystemVolume(){
+        return mAudioManager.getStreamVolume(AudioManager.STREAM_SYSTEM );
+    }
+
+    //获取最大提示音量
+    public int getAlermMaxVolume(){
+        return mAudioManager.getStreamMaxVolume(AudioManager.STREAM_ALARM );
+    }
+
+    //获取当前提示音量
+    public int getAlermVolume(){
+        return mAudioManager.getStreamVolume(AudioManager.STREAM_ALARM );
+    }
+
+    // 设置多媒体音量
+
+    /**
+     * 第一个是streamType,streamType是需要调整音量的类型
+     * 第二个direction,是音量调节的方向,可以取下面的几个值:
+     * ADJUST_LOWER 降低音量
+     * ADJUST_RAISE 升高音量
+     * ADJUST_SAME 保持不变,使用这个值UI上会向用户展示当前的音量
+     * 第三个flags,是附加参数,用于影响设置过程中的一些系统行为,两个常用的是:
+     * FLAG_PLAY_SOUND 调整音量时播放声音
+     * FLAG_SHOW_UI 调整时显示音量条,跟按按键调节音量时出现的音量条一致
+     * 0 表示什么额外行为也没有,比如想自己绘制音量条时,可以使用这个值防止显示系统默认的音量条
+     * @param volume
+     */
+    public void setMediaVolume(int volume){
+        mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, //音量类型
+                volume,
+                AudioManager.FLAG_PLAY_SOUND|0);
+    }
+
+    //设置通话音量
+    public void setCallVolume(int volume){
+        mAudioManager.setStreamVolume( AudioManager.STREAM_VOICE_CALL,
+                volume,
+                AudioManager.FLAG_PLAY_SOUND
+                        | AudioManager.FLAG_SHOW_UI);
+    }
+
+    //设置提示音量
+    public void setAlermVolume(int volume){
+        mAudioManager.setStreamVolume( AudioManager.STREAM_ALARM,
+                volume,AudioManager.FLAG_PLAY_SOUND
+                        |AudioManager.FLAG_SHOW_UI);
+    }
+
+    // 关闭/打开扬声器播放
+    public void setSpeakerStatus(boolean on) {
+        if (on) { //扬声器
+            mAudioManager.setSpeakerphoneOn(true);
+            mAudioManager.setMode(AudioManager.MODE_NORMAL);
+        } else {
+            // 设置最大音量
+            int max = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL);
+            mAudioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, max, AudioManager.STREAM_VOICE_CALL);
+            // 设置成听筒模式
+            mAudioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
+            mAudioManager.setSpeakerphoneOn(false);// 关闭扬声器
+            mAudioManager.setRouting(AudioManager.MODE_NORMAL, AudioManager.ROUTE_EARPIECE, AudioManager.ROUTE_ALL);
+        }
+    }
+}

+ 6 - 6
app/src/main/java/com/hh/arome/ui/IDCardScanNfcActivity.java

@@ -21,7 +21,7 @@ import com.hh.arome.bean.LogcatAddRequestBean;
 import com.hh.arome.bean.SimpleResultBean;
 import com.hh.arome.bean.ampe.AmpeAppletResultBean;
 import com.hh.arome.common.scan.idcard.manymodels.k8.MyNfcManager;
-import com.hh.arome.common.scan.idcard.manymodels.k8.ReadCardManager;
+import com.hh.arome.common.scan.idcard.manymodels.k8.ReadCardManagerNfc;
 import com.hh.arome.mvp.contract.LogcatAddContract;
 import com.hh.arome.mvp.presenter.LogcatAddPresenter;
 import com.hh.arome.ui.base.BaseHHActivity;
@@ -99,7 +99,7 @@ public class IDCardScanNfcActivity extends BaseHHActivity implements LogcatAddCo
         mLogcatAddPresenter = new LogcatAddPresenter(this);
 
         EventBus.getDefault().register(this);
-        ReadCardManager.eid.setGetDataFromSdk(true);
+        ReadCardManagerNfc.eid.setGetDataFromSdk(true);
 
         // 日志开始保存----------------begin
         // 日志行数——对应web端"日志标签"
@@ -174,7 +174,7 @@ public class IDCardScanNfcActivity extends BaseHHActivity implements LogcatAddCo
             // 日志开始----------------end
 
 
-            if (ReadCardManager.eid == null) {
+            if (ReadCardManagerNfc.eid == null) {
 
                 // 日志开始----------------begin
                 // 日志行数——对应web端"日志标签"
@@ -214,7 +214,7 @@ public class IDCardScanNfcActivity extends BaseHHActivity implements LogcatAddCo
              * 通用模式,同时支持二代证读取和eID电子证照读取
              */
 
-            ReadCardManager.eid.readIDCard(tag, mResultListener);
+            ReadCardManagerNfc.eid.readIDCard(tag, mResultListener);
 
             /**
              * ReadCardManager.eid.readIDCard(IDOCRCardType.IDCARD,tag, mResultListener);
@@ -457,8 +457,8 @@ public class IDCardScanNfcActivity extends BaseHHActivity implements LogcatAddCo
 
     @Override
     protected void onDestroy() {
-        if(ReadCardManager.eid!=null){
-            ReadCardManager.eid.release();
+        if(ReadCardManagerNfc.eid!=null){
+            ReadCardManagerNfc.eid.release();
         }
         super.onDestroy();
         EventBus.getDefault().unregister(this);

File diff suppressed because it is too large
+ 258 - 168
app/src/main/java/com/hh/arome/ui/MainActivity.java


+ 37 - 5
app/src/main/java/com/hh/arome/ui/setting/FunctionActivity.java

@@ -7,11 +7,16 @@ import android.widget.TextView;
 
 import androidx.appcompat.widget.Toolbar;
 
+import com.common.lib_base.common.local.AppLocalConfigHandler;
+import com.common.lib_base.utils.StringUtils;
+import com.common.lib_base.utils.ui.ToastUtils;
+import com.common.lib_base.utils.ui.UIUtils;
 import com.hh.arome.R;
 import com.hh.arome.bean.DeviceConfigResultBean;
 import com.hh.arome.bean.SimpleResultBean;
 import com.hh.arome.common.ConfigData;
 import com.hh.arome.common.Constants;
+import com.hh.arome.common.IAppLocalConfig;
 import com.hh.arome.mvp.contract.DeviceConfigUpdateContract;
 import com.hh.arome.mvp.presenter.DeviceConfigUpdatePresenter;
 import com.hh.arome.ui.base.BaseHHActivity;
@@ -55,6 +60,8 @@ public class FunctionActivity extends BaseHHActivity implements View.OnClickList
 
     DeviceConfigResultBean deviceConfigBean;
 
+    IAppLocalConfig localConfig;
+
     @Override
     protected void initData() {
 
@@ -62,6 +69,12 @@ public class FunctionActivity extends BaseHHActivity implements View.OnClickList
 
         mDeviceConfigUpdatePresenter = new DeviceConfigUpdatePresenter(this);
 
+        localConfig = AppLocalConfigHandler.create(mContext.getApplicationContext(), IAppLocalConfig.class);
+
+        int appletOperationTimeout = localConfig.getAppletOperationTimeout();
+        UIUtils.setEditText(et_timeout,appletOperationTimeout+"");
+
+
         deviceConfigBean = ConfigData.getDeviceConfigResultBean();
 
         if (deviceConfigBean == null) {
@@ -83,7 +96,8 @@ public class FunctionActivity extends BaseHHActivity implements View.OnClickList
                 finish();
                 break;
             case R.id.tv_confirm:
-//                handleDataAndRequest();
+
+                handleDataAndRequest();
 
                 break;
         }
@@ -92,13 +106,31 @@ public class FunctionActivity extends BaseHHActivity implements View.OnClickList
 
     private void handleDataAndRequest() {
 
+
+        String timeStr = UIUtils.getEditText(et_timeout);
+        if(StringUtils.isNull(timeStr)){
+            ToastUtils.showLongToast("时间不能为空,或点击左上角返回");
+            return;
+        }else{
+            int i = Integer.parseInt(timeStr);
+            if(i > 600){
+                ToastUtils.showLongToast("不能大于600秒");
+                return;
+            }
+            localConfig.setAppletOperationTimeout(i);
+        }
+
+        ToastUtils.showLongToast("本地配置已生效");
+
+        delayFinish();
+
 //        deviceConfigBean.setUseAlipayFace(isUseAlipayFace);
 
-//        ToastUtils.showLongToast("本地配置已生效");
-        ConfigData.setDeviceConfigResultBean(deviceConfigBean);
 
-        // 开始请求接口
-        mDeviceConfigUpdatePresenter.requestDeviceConfigUpdate(deviceConfigBean);
+//        ConfigData.setDeviceConfigResultBean(deviceConfigBean);
+//
+//        // 开始请求接口
+//        mDeviceConfigUpdatePresenter.requestDeviceConfigUpdate(deviceConfigBean);
 
     }
 

+ 21 - 6
app/src/main/res/layout/activity_main.xml

@@ -175,17 +175,32 @@
             android:id="@+id/tv_exit"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginTop="150dp"
+            android:layout_marginTop="10dp"
             android:text="退出"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintRight_toRightOf="parent"
             app:layout_constraintTop_toTopOf="parent" />
 
-        <ImageView
-            android:id="@+id/iv_test"
-            android:layout_width="40dp"
-            android:layout_height="40dp"/>
+        <LinearLayout
+            android:orientation="horizontal"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <ImageView
+                android:id="@+id/iv_test"
+                android:layout_width="40dp"
+                android:layout_height="40dp"/>
+
+            <TextView
+                android:id="@+id/tv_idcard_info"
+                android:layout_width="wrap_content"
+                android:layout_height="100dp"/>
+
+
+        </LinearLayout>
+
+
 
         <Button
             android:id="@+id/tv_init_scan"
@@ -282,7 +297,7 @@
             app:layout_constraintTop_toTopOf="parent" />
 
     </LinearLayout>
-
+    <!-- 测试按钮end -->
 
     <LinearLayout
         android:layout_width="match_parent"

+ 55 - 16
app/src/main/res/layout/activity_main_hp.xml

@@ -149,16 +149,23 @@
         android:layout_height="wrap_content"
         android:orientation="vertical">
 
-        <ImageView
-            android:id="@+id/iv_text"
-            android:layout_width="40dp"
-            android:layout_height="40dp"/>
+        <Button
+            android:id="@+id/tv_record_start"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="20dp"
+            android:text="录音"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
 
         <Button
-            android:id="@+id/tv_init_scan"
+            android:id="@+id/tv_record_stop"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="刷脸初始化"
+            android:layout_marginTop="20dp"
+            android:text="停止录音"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintRight_toRightOf="parent"
@@ -166,20 +173,51 @@
 
 
         <Button
-            android:id="@+id/tv_scan"
+            android:id="@+id/tv_exit"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="刷脸"
+            android:layout_marginTop="10dp"
+            android:text="退出"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <LinearLayout
+            android:orientation="horizontal"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <ImageView
+                android:id="@+id/iv_test"
+                android:layout_width="40dp"
+                android:layout_height="40dp"/>
+
+            <TextView
+                android:id="@+id/tv_idcard_info"
+                android:layout_width="wrap_content"
+                android:layout_height="100dp"/>
+
+
+        </LinearLayout>
+
+
+
+        <Button
+            android:id="@+id/tv_init_scan"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="刷脸初始化"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintRight_toRightOf="parent"
             app:layout_constraintTop_toTopOf="parent" />
 
         <Button
-            android:id="@+id/tv_idcard"
+            android:id="@+id/tv_scan"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="刷身份证"
+            android:text="刷"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintRight_toRightOf="parent"
@@ -187,10 +225,10 @@
 
 
         <Button
-            android:id="@+id/tv_idcard_jump"
+            android:id="@+id/tv_idcard"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="跳转刷身份证"
+            android:text="刷身份证"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintRight_toRightOf="parent"
@@ -198,20 +236,20 @@
 
 
         <Button
-            android:id="@+id/tv_qr"
+            android:id="@+id/tv_idcard_jump"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="二维码"
+            android:text="跳转刷身份证"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintRight_toRightOf="parent"
             app:layout_constraintTop_toTopOf="parent" />
 
         <Button
-            android:id="@+id/tv_exit"
+            android:id="@+id/tv_qr"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="退出"
+            android:text="二维码"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintRight_toRightOf="parent"
@@ -260,6 +298,7 @@
             app:layout_constraintTop_toTopOf="parent" />
 
     </LinearLayout>
+    <!-- 测试按钮end -->
 
 
     <LinearLayout

+ 2 - 2
config.gradle

@@ -7,8 +7,8 @@ ext {
 //            minSdkVersion    : 24,
             minSdkVersion    : 21,
             targetSdkVersion : 22,
-            versionCode      : 20,
-            versionName      : "2.7.0"
+            versionCode      : 22,
+            versionName      : "2.7.2"
     ]
     //依赖 配置
     dependencies = [

Some files were not shown because too many files changed in this diff