瀏覽代碼

1.升级gradle

JaycePC 1 年之前
父節點
當前提交
e79cc9996a

+ 18 - 20
HttpCoreLibrary/build.gradle

@@ -4,14 +4,11 @@ plugins {
 }
 
 android {
-    compileSdkVersion env.compileSdkVersion
-    buildToolsVersion env.buildToolsVersion
+    compileSdk 34
 
     defaultConfig {
-        minSdkVersion env.minSdkVersion
-        targetSdkVersion env.targetSdkVersion
-        versionCode 1
-        versionName "1.0"
+        minSdkVersion 21
+        targetSdkVersion 34
 
         consumerProguardFiles "consumer-rules.pro"
     }
@@ -23,29 +20,30 @@ android {
         }
     }
     compileOptions {
-        sourceCompatibility env.jdk_version
-        targetCompatibility env.jdk_version
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
     }
     kotlinOptions {
         jvmTarget = '1.8'
     }
+    namespace 'com.rc.httpcore'
 }
 
 dependencies {
 
     implementation fileTree(dir: "libs", include: ["*.jar"])
-    implementation dep.kotlinStdlib
-    implementation dep.androidxCoreKtx
-    implementation dep.androidxLocalbroadcastmanager
-
-    api dep.retrofit
-    implementation dep.converterGson
-    implementation dep.converterScalars
-    implementation dep.rxJavaAdapter
-    implementation dep.okhttp3Logs
-    api dep.rxJava
-    api dep.rxAndroid
-    api dep.gson
+    implementation "org.jetbrains.kotlin:kotlin-stdlib:1.6.21"
+    implementation "androidx.core:core-ktx:1.3.1"
+    implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0"
+
+    api "com.squareup.retrofit2:retrofit:2.9.0"
+    implementation "com.squareup.retrofit2:converter-gson:2.9.0"
+    implementation "com.squareup.retrofit2:converter-scalars:2.9.0"
+    implementation "com.squareup.retrofit2:adapter-rxjava2:2.9.0"
+    implementation "com.squareup.okhttp3:logging-interceptor:3.14.9"
+    api "io.reactivex.rxjava2:rxjava:2.2.21"
+    api "io.reactivex.rxjava2:rxandroid:2.1.1"
+    api "com.google.code.gson:gson:2.8.6"
 
 //    implementation dep.luban
 }

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

@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.rc.httpcore">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
 
 </manifest>

+ 13 - 15
RcCore/build.gradle

@@ -4,14 +4,11 @@ plugins {
 }
 
 android {
-    compileSdkVersion env.compileSdkVersion
-    buildToolsVersion env.buildToolsVersion
+    compileSdk 34
 
     defaultConfig {
-        minSdkVersion env.minSdkVersion
-        targetSdkVersion env.targetSdkVersion
-        versionCode 1
-        versionName "1.0"
+        minSdkVersion 21
+        targetSdkVersion 34
 
         consumerProguardFiles "consumer-rules.pro"
     }
@@ -23,8 +20,8 @@ android {
         }
     }
     compileOptions {
-        sourceCompatibility env.jdk_version
-        targetCompatibility env.jdk_version
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
     }
     kotlinOptions {
         jvmTarget = '1.8'
@@ -32,6 +29,7 @@ android {
     buildFeatures{
         viewBinding = true
     }
+    namespace 'com.rc.core'
 }
 
 dependencies {
@@ -39,14 +37,14 @@ dependencies {
     implementation project(':HttpCoreLibrary')
 
     api fileTree(dir: "libs", include: ["*.jar"])
-    implementation dep.kotlinStdlib
-    implementation dep.androidxCoreKtx
-    implementation dep.androidxSwipeRefreshLayout
+    implementation "org.jetbrains.kotlin:kotlin-stdlib:1.6.21"
+    implementation "androidx.core:core-ktx:1.3.1"
+    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
 
-    implementation dep.androidxAppCompat
-    implementation dep.androidMaterial
-    implementation dep.RecyclerViewAdapterHelper
+    implementation "androidx.appcompat:appcompat:1.2.0"
+    implementation "com.google.android.material:material:1.2.1"
+    implementation "com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4"
 
-    implementation dep.eventbus
+    implementation "org.greenrobot:eventbus:3.2.0"
 
 }

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

@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.rc.core">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
 
 </manifest>

+ 34 - 34
app/build.gradle

@@ -4,15 +4,14 @@ plugins {
 }
 
 android {
-    compileSdkVersion env.compileSdkVersion
-    buildToolsVersion env.buildToolsVersion
+    compileSdk 34
 
     defaultConfig {
-        applicationId env.applicationId
-        minSdkVersion env.minSdkVersion
-        targetSdkVersion env.targetSdkVersion
-        versionCode env.versionCode
-        versionName env.versionName
+        applicationId "com.dlc.eboard"
+        minSdkVersion 21
+        targetSdkVersion 34
+        versionCode 11
+        versionName "1.1.1-alpha-kuangda"
 
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
 
@@ -45,8 +44,8 @@ android {
         }
     }
     compileOptions {
-        sourceCompatibility env.jdk_version
-        targetCompatibility env.jdk_version
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
     }
     kotlinOptions {
         jvmTarget = '1.8'
@@ -64,6 +63,7 @@ android {
             dirs 'libs'
         }
     }
+    namespace 'com.dlc.eboard'
     applicationVariants.all { variant ->
 //        variant.getPackageApplication().outputDirectory = new File("${rootDir.absolutePath}/Apk")
         variant.outputs.all {
@@ -80,28 +80,28 @@ dependencies {
     implementation project(':HttpCoreLibrary')
     implementation project(':RcCore')
 
-    implementation dep.kotlinStdlib
-    implementation dep.androidxCoreKtx
-    implementation dep.androidxAppCompat
-    implementation dep.androidxConstraintlayout
-    implementation dep.androidMaterial
-    implementation dep.androidxLocalbroadcastmanager
-    implementation dep.rxpermissions
-    implementation dep.androidxSwipeRefreshLayout
-    implementation dep.RecyclerViewAdapterHelper
-    implementation dep.glide
-
-    implementation dep.kotlinxCoroutinesCore
-    implementation dep.kotlinxCoroutinesAndroid
-
-    implementation dep.androidMultidex
-    implementation dep.buglySDK
-    implementation dep.buglyNDK
-    implementation dep.mqttv3
-    implementation dep.eventbus
-    implementation dep.bgaZxing
-
-    implementation 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'
+    implementation "org.jetbrains.kotlin:kotlin-stdlib:1.6.21"
+    implementation "androidx.core:core-ktx:1.3.1"
+    implementation "androidx.appcompat:appcompat:1.2.0"
+    implementation "androidx.constraintlayout:constraintlayout:2.0.1"
+    implementation "com.google.android.material:material:1.2.1"
+    implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0"
+    implementation "com.github.tbruyelle:rxpermissions:0.11"
+    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
+    implementation "com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4"
+    implementation "com.github.bumptech.glide:glide:4.11.0"
+
+    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7"
+    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1"
+
+    implementation "com.android.support:multidex:1.0.3"
+    implementation "com.tencent.bugly:crashreport:3.4.4"
+    implementation "com.tencent.bugly:nativecrashreport:3.9.2"
+    implementation "org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0"
+    implementation "org.greenrobot:eventbus:3.2.0"
+    implementation "com.github.bingoogolapple.BGAQRCode-Android:zxing:1.3.8"
+
+    implementation "com.joanzapata.pdfview:android-pdfview:1.0.4@aar"
 
     // CameraX core library using the camera2 implementation
     def camerax_version = "1.0.1"
@@ -114,13 +114,13 @@ dependencies {
     implementation "androidx.camera:camera-view:1.0.0-alpha20"
     // If you want to additionally use the CameraX Extensions library
     implementation "androidx.camera:camera-extensions:1.0.0-alpha20"
-    implementation 'com.squareup.leakcanary:leakcanary-android:1.5.1'
+    implementation "com.squareup.leakcanary:leakcanary-android:2.14"
 
-    implementation 'com.github.NodeMedia:NodeMediaClient-Android:2.9.23'
+    implementation "com.github.NodeMedia:NodeMediaClient-Android:2.9.23"
     implementation(name: 'facedetector-1.0.0', ext: 'aar')
     implementation 'io.fotoapparat:fotoapparat:2.7.0'
 
     implementation(name: 'flowlayout-1.0.0', ext: 'aar')
 
-
+    implementation 'com.blankj:utilcodex:1.31.1'
 }

+ 56 - 23
app/src/main/AndroidManifest.xml

@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    package="com.dlc.eboard">
+    xmlns:tools="http://schemas.android.com/tools">
 
     <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
     <uses-permission android:name="android.permission.INSTALL_PACKAGES" />
@@ -44,9 +43,6 @@
 
     <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
     <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
-    <uses-permission
-        android:name="android.hardware.usb.host"
-        android:required="false" />
 
     <application
         android:name=".LabApp"
@@ -60,7 +56,9 @@
         android:usesCleartextTraffic="true"
         tools:targetApi="m">
 
-        <receiver android:name=".broadcast.BootBroadcastReceiver">
+        <receiver
+            android:name=".broadcast.BootBroadcastReceiver"
+            android:exported="true">
             <intent-filter>
                 <action android:name="android.intent.action.BOOT_COMPLETED" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -70,9 +68,8 @@
         <activity
             android:name=".ui.SplashActivity"
             android:exported="true"
-            android:launchMode="singleTop"
-            android:screenOrientation="sensorLandscape"
-            >
+            android:launchMode="singleTask"
+            android:screenOrientation="sensorLandscape">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 
@@ -88,39 +85,38 @@
             android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale"
             android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
-            android:windowSoftInputMode="adjustPan"
-            />
+            android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.MainActivity"
             android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale"
             android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
-            android:windowSoftInputMode="adjustPan"
-            />
+            android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name="com.dlc.laboratory.ui.LabMainActivity"
             android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale"
             android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
-            
+
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.rule.SafetyRegulationActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
-            
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name="com.dlc.laboratory.ui.guide.GuideActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
-            
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.things.ThingsActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
@@ -128,162 +124,193 @@
             android:name=".ui.risk.RiskActivity"
             android:configChanges="orientation|keyboardHidden|navigation|screenSize"
             android:hardwareAccelerated="true"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.sign.SignInActivity"
             android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.leave.LeaveActivity"
             android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.settings.SettingsActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.settings.ScanSettingsActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.msds.InstructionActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.person.LaboratoryPersonActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.lib.LabDetailActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.rule.SafetyRegulationDetailActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.common.HtmlFullScreenActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name="com.dlc.laboratory.ui.things.SelectAuthMethodActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.notice.NoticeActivity"
-            android:launchMode="singleTop"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.lib.LabDescActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.monitor.MonitorListActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.monitor.MonitorFullScreenActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.auth.FourChoiceAuthActivity"
             android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale"
-            android:screenOrientation="sensorLandscape"
             android:hardwareAccelerated="true"
+            android:launchMode="singleTask"
+            android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.auth.TwoChoiceAuthActivity"
             android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.auth.FingerAuthActivity"
+
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.auth.DualAuthActivity"
+
             android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.finger.FingerEnrollActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.finger.EnrollAuthActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name=".ui.finger.SelectFingerActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name="com.dlc.laboratory.ui.lib.ExLabDetailActivity"
+            android:exported="true"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name="com.dlc.laboratory.ui.rule.ExSafetyRegulationActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name="com.dlc.laboratory.ui.msds.ExInstructionActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name="com.dlc.laboratory.ui.risk.ExRiskActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name="com.dlc.laboratory.ui.person.ExLaboratoryPersonActivity"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name="com.dlc.laboratory.ui.sign.ExSignInActivity"
             android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
         <activity
             android:name="com.dlc.laboratory.ui.leave.ExLeaveActivity"
             android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale"
+            android:launchMode="singleTask"
             android:screenOrientation="sensorLandscape"
             android:windowSoftInputMode="adjustPan" />
 
-<!--        <service-->
-<!--            android:name=".ui.HeartService"-->
-<!--            android:enabled="true"-->
-<!--            android:exported="false" />-->
+        <!--        <service-->
+        <!--            android:name=".ui.HeartService"-->
+        <!--            android:enabled="true"-->
+        <!--            android:exported="false" />-->
 
         <service
             android:name=".mqtt.MqttService"
@@ -315,7 +342,9 @@
                 android:resource="@xml/file_paths_public" />
         </provider>
 
-        <receiver android:name=".receiver.OpenApkReceiver">
+        <receiver
+            android:name=".receiver.OpenApkReceiver"
+            android:exported="true">
             <intent-filter>
                 <action android:name="android.intent.action.PACKAGE_REPLACED" />
                 <data android:scheme="${applicationId}" />
@@ -329,4 +358,8 @@
 
     </application>
 
+    <uses-permission
+        android:name="android.hardware.usb.host"
+        android:required="false" />
+
 </manifest>

+ 0 - 1
app/src/main/java/com/dlc/eboard/LabApp.kt

@@ -31,7 +31,6 @@ import com.rc.httpcore.config.ConfigFactory
 import com.rc.httpcore.vo.response.LabConfig
 import com.rc.httpcore.vo.response.NoticeSummaryVo
 import com.rc.httpcore.vo.response.UserVo
-import com.squareup.leakcanary.LeakCanary
 import com.tencent.bugly.crashreport.CrashReport
 import com.tencent.smtt.export.external.TbsCoreSettings
 import com.tencent.smtt.sdk.QbSdk

+ 40 - 32
app/src/main/java/com/dlc/eboard/ui/HomeActivity.kt

@@ -18,6 +18,7 @@ import android.widget.TextView
 import androidx.core.content.ContextCompat
 import androidx.recyclerview.widget.DividerItemDecoration
 import androidx.recyclerview.widget.RecyclerView
+import com.blankj.utilcode.util.AppUtils
 import com.bumptech.glide.Glide
 import com.chad.library.adapter.base.BaseQuickAdapter
 import com.chad.library.adapter.base.viewholder.BaseViewHolder
@@ -122,7 +123,7 @@ class HomeActivity :
         addDisposable(disposable)
     }
 
-    fun listenIn(){
+    fun listenIn() {
         val disposable = ApiRepository.heartbeat(CommonUtils.getAndroidId())
             .subscribe({
 
@@ -131,6 +132,7 @@ class HomeActivity :
             })
         addDisposable(disposable)
     }
+
     override fun onDestroy() {
         unbindService(mConnection)
 //        stopService(Intent(this, HeartService::class.java))
@@ -140,7 +142,7 @@ class HomeActivity :
         handler.removeCallbacks(runnable)
         handler.removeCallbacksAndMessages(null)
         super.onDestroy()
-
+        AppUtils.exitApp()
     }
 
     private val mConnection: ServiceConnection = object : ServiceConnection {
@@ -219,8 +221,9 @@ class HomeActivity :
         viewBinding.experimentExpand.setOnClickListener(FastClickDelegate {
             if (null == LabApp.sLabConfig) return@FastClickDelegate
 
-            val fragment = supportFragmentManager.findFragmentByTag(AccessPersonFragment.TAG_EXPERIMENT)
-                    as? AccessPersonFragment ?: AccessPersonFragment()
+            val fragment =
+                supportFragmentManager.findFragmentByTag(AccessPersonFragment.TAG_EXPERIMENT)
+                        as? AccessPersonFragment ?: AccessPersonFragment()
             fragment.arguments = Bundle().apply {
                 putInt("type", AccessPersonFragment.TYPE_EXPERIMENT)
                 putString("labId", LabApp.sLabConfig!!.labId)
@@ -260,33 +263,33 @@ class HomeActivity :
         viewBinding.labDesc.setOnClickListener(FastClickDelegate {
             startActivity(Intent(this, LabDescActivity::class.java))
         })
-        RcLog.info("==================LabApp.sLabConfig?.authType:"+LabApp.sLabConfig?.authType)
+        RcLog.info("==================LabApp.sLabConfig?.authType:" + LabApp.sLabConfig?.authType)
         // 身份验证
 
         viewBinding.accessVerify.setOnClickListener(FastClickDelegate {
-            RcLog.info("==================LabApp.sLabConfig?.authType:"+LabApp.sLabConfig?.authType)
+            RcLog.info("==================LabApp.sLabConfig?.authType:" + LabApp.sLabConfig?.authType)
             val authType = LabApp.sLabConfig?.authType ?: return@FastClickDelegate
             RcLog.info("==================authType:$authType")
-            when (authType) {
-                "1" -> {
-                    val intent = Intent(this, FingerAuthActivity::class.java)
-                    startActivity(intent)
-                }
-                "2" -> {
-                    val intent = Intent(this, FourChoiceAuthActivity::class.java)
-                    startActivity(intent)
-                }
-                "3" -> {
-                    val intent = Intent(this, TwoChoiceAuthActivity::class.java)
-                    startActivity(intent)
-                }
-                "4",
-                "5",
-                "6" -> {
-                    val intent = Intent(this, DualAuthActivity::class.java)
-                    startActivity(intent)
-                }
-            }
+//            when (authType) {
+//                "1" -> {
+//                    val intent = Intent(this, FingerAuthActivity::class.java)
+//                    startActivity(intent)
+//                }
+//                "2" -> {
+//                    val intent = Intent(this, FourChoiceAuthActivity::class.java)
+//                    startActivity(intent)
+//                }
+//                "3" -> {
+//                    val intent = Intent(this, TwoChoiceAuthActivity::class.java)
+//                    startActivity(intent)
+//                }
+//                "4",
+//                "5",
+//                "6" -> {
+            val intent = Intent(this, DualAuthActivity::class.java)
+            startActivity(intent)
+//                }
+//            }
         })
 //        viewBinding.accessVerify.setOnClickListener {
 //            showToast("当前返回:${LabApp.sLabConfig?.authType}")
@@ -619,9 +622,11 @@ class HomeActivity :
                     openDoor(userVo)
                 }
             }
+
             AuthTypeConfig.FOUR_CHOICE.type -> {
                 openDoor(userVo)
             }
+
             AuthTypeConfig.CARD_PASSWORD.type -> {
                 if (AuthType.CARD == authType) {
                     // 进入密码验证
@@ -848,7 +853,8 @@ private class PersonFlipperAdapter(
         val rootView: View
         val viewHolder: ViewHolder
         if (convertView == null) {
-            val viewBinding = ItemHomePersonFlipperBinding.inflate(LayoutInflater.from(parent!!.context))
+            val viewBinding =
+                ItemHomePersonFlipperBinding.inflate(LayoutInflater.from(parent!!.context))
             rootView = viewBinding.root
             viewHolder = ViewHolder(viewBinding.pPhoto, viewBinding.pName, viewBinding.pCardNumber)
             rootView.tag = viewHolder
@@ -881,14 +887,16 @@ private class PersonFlipperAdapter(
         return if (input.isNullOrEmpty()) "" else input.substring(2, input.length)
     }
 
-    class ViewHolder(val imageView: ImageView,
-                     val name: TextView,
-                     val number: TextView)
+    class ViewHolder(
+        val imageView: ImageView,
+        val name: TextView,
+        val number: TextView
+    )
 
 }
 
 // 实验人员Adapter
-private class ExperimentPersonAdapter:
+private class ExperimentPersonAdapter :
     BaseQuickAdapter<LabPersonVo, BaseViewHolder>(R.layout.item_home_person_flipper) {
 
     override fun convert(holder: BaseViewHolder, item: LabPersonVo) {
@@ -901,7 +909,7 @@ private class ExperimentPersonAdapter:
 
         // 签到时间:11-08 14:35
         holder.setText(R.id.pName, item.userName)
-            .setText(R.id.pCardNumber, "签到时间:${formatSignTime(item.signTime)}" )
+            .setText(R.id.pCardNumber, "签到时间:${formatSignTime(item.signTime)}")
             .setVisible(R.id.bottom_line, true)
     }
 

+ 6 - 1
app/src/main/java/com/dlc/eboard/ui/auth/DualAuthActivity.kt

@@ -62,7 +62,6 @@ class DualAuthActivity :
             val adapter = TabFragmentPagerAdapter(supportFragmentManager, it)
             viewBinding.viewPager.adapter = adapter
         }
-
         if (AuthTypeConfig.CARD_PASSWORD.type == mAuthTypeConfig) {
             if (intent.getBooleanExtra("card_auth", false)) {
                 val user: UserVo = intent.getParcelableExtra("user")!!
@@ -132,6 +131,11 @@ class DualAuthActivity :
         super.onPause()
     }
 
+    override fun onDestroy() {
+        super.onDestroy()
+
+    }
+
     override fun dispatchKeyEvent(event: KeyEvent?): Boolean {
         mSerialPortHelper.dispatchKeyEvent(event)
         return super.dispatchKeyEvent(event)
@@ -229,4 +233,5 @@ class DualAuthActivity :
             }
         }
     }
+
 }

+ 11 - 3
app/src/main/java/com/dlc/eboard/ui/auth/fragment/FaceAuthFragment.kt

@@ -7,6 +7,7 @@ import android.os.Message
 import android.view.LayoutInflater
 import android.view.ViewGroup
 import androidx.appcompat.app.AlertDialog
+import com.blankj.utilcode.util.LogUtils
 import com.dlc.eboard.LabApp
 import com.dlc.eboard.databinding.FragmentAuthFaceMatchingBinding
 import com.dlc.eboard.ui.auth.AuthType
@@ -40,7 +41,8 @@ class FaceAuthFragment :
         const val TAG = "FaceAuthFragment"
 
         private const val WHAT_TAKE_PICTURE = 1
-//        private const val TIMEOUT_TAKE_PICTURE = 2000L
+
+        //        private const val TIMEOUT_TAKE_PICTURE = 2000L
         private const val TIMEOUT_TAKE_PICTURE = 200L
 
         fun newInstance() = FaceAuthFragment()
@@ -71,6 +73,11 @@ class FaceAuthFragment :
             .frameProcessor(
                 FaceDetectorProcessor.with(requireActivity())
                     .listener { faces ->
+                        if (null != faces) {
+                            LogUtils.d("Jayce", "无人脸")
+                        } else {
+                            LogUtils.d("Jayce", "有人脸")
+                        }
                         viewBinding.rectanglesView.setRectangles(faces)
 //                        if (!isMatching && isResumed && !faces.isNullOrEmpty()) takePicture()
 //                        if (!isMatching && isResumed) {
@@ -154,7 +161,7 @@ class FaceAuthFragment :
     private fun callFaceMatchingApi(photoFile: File) {
         if (!photoFile.exists()) return
         val disposable = ApiRepository.authFace(photoFile, LabApp.sLabConfig!!.labId)
-            .subscribe({ userVo->
+            .subscribe({ userVo ->
                 MediaUtils.deleteFile(photoFile)
                 if (!isResumed) return@subscribe
 
@@ -192,7 +199,8 @@ class FaceAuthFragment :
                     }.show()
                 return true
             } else if ("500" == throwable.code
-                && throwable.message == "识别中") {
+                && throwable.message == "识别中"
+            ) {
                 isMatching = false
                 return true
             }

+ 0 - 1
app/src/main/res/layout/fragment_auth_face_matching.xml

@@ -20,7 +20,6 @@
             android:layout_height="match_parent"
             app:rectanglesColor="#FF4081"
             app:rectanglesStrokeWidth="2dp" />
-
     </io.fotoapparat.facedetector.view.CameraOverlayLayout>
 
     <androidx.constraintlayout.widget.Guideline

+ 3 - 3
build.gradle

@@ -14,10 +14,10 @@ buildscript {
 
     }
 
-    apply from: 'config/config.gradle'
+//    apply from: 'config/config.gradle'
     dependencies {
-        classpath "com.android.tools.build:gradle:4.1.2"
-        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${env.kotlin_version}"
+        classpath 'com.android.tools.build:gradle:8.6.0'
+        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21"
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files

+ 56 - 56
config/config.gradle

@@ -1,56 +1,56 @@
-ext {
-
-    env = [
-            jdk_version      : JavaVersion.VERSION_1_8,
-            kotlin_version   : "1.4.21",
-
-            compileSdkVersion: 29,
-            buildToolsVersion: '29.0.3',
-            minSdkVersion    : 21,
-            targetSdkVersion : 28,
-            applicationId    : "com.dlc.eboard",
-            versionCode      : 11,
-            versionName      : "1.1.1-alpha-kuangda"
-    ]
-
-    test = [
-            junit       : "junit:junit:4.12",
-            extJunit    : "androidx.test.ext:junit:1.1.2",
-            espressoCore: "androidx.test.espresso:espresso-core:3.3.0",
-    ]
-
-    dep = [
-            kotlinStdlib                 : 'org.jetbrains.kotlin:kotlin-stdlib:${env.kotlin_version}',
-            androidxCoreKtx              : 'androidx.core:core-ktx:1.3.1',
-            androidxAppCompat            : 'androidx.appcompat:appcompat:1.2.0',
-            androidxConstraintlayout     : 'androidx.constraintlayout:constraintlayout:2.0.1',
-            androidMaterial              : 'com.google.android.material:material:1.2.1',
-            androidxLocalbroadcastmanager: 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0',
-            androidxSwipeRefreshLayout   : "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0",
-            androidMultidex              : "com.android.support:multidex:1.0.3",
-            kotlinxCoroutinesCore        : 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7',
-            kotlinxCoroutinesAndroid     : 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1',
-
-            okhttp3                      : 'com.squareup.okhttp3:okhttp:3.14.9',
-            okhttp3Logs                  : 'com.squareup.okhttp3:logging-interceptor:3.14.9',
-            gson                         : 'com.google.code.gson:gson:2.8.6',
-            retrofit                     : 'com.squareup.retrofit2:retrofit:2.9.0',
-            converterGson                : 'com.squareup.retrofit2:converter-gson:2.9.0',
-            converterScalars             : 'com.squareup.retrofit2:converter-scalars:2.9.0',
-            rxJavaAdapter                : 'com.squareup.retrofit2:adapter-rxjava2:2.9.0',
-            rxJava                       : 'io.reactivex.rxjava2:rxjava:2.2.21',
-            rxAndroid                    : 'io.reactivex.rxjava2:rxandroid:2.1.1',
-            rxKotlin                     : 'io.reactivex.rxjava2:rxandroid:2.4.0',
-
-            luban                        : 'top.zibin:Luban:1.1.8',
-            RecyclerViewAdapterHelper    : 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4',
-            eventbus                     : 'org.greenrobot:eventbus:3.2.0',
-            rxpermissions                : 'com.github.tbruyelle:rxpermissions:0.11',
-            glide                        : 'com.github.bumptech.glide:glide:4.11.0',
-            buglySDK                     : 'com.tencent.bugly:crashreport:3.4.4',
-            buglyNDK                     : 'com.tencent.bugly:nativecrashreport:3.9.2',
-            mqttv3                       : 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0',
-            bgaZxing                     : 'com.github.bingoogolapple.BGAQRCode-Android:zxing:1.3.8',
-    ]
-
-}
+//ext {
+//
+////    env = [
+////            jdk_version      : JavaVersion.VERSION_1_8,
+////            kotlin_version   : '1.6.21',
+////
+////            compileSdkVersion: 29,
+////            buildToolsVersion: '29.0.3',
+////            minSdkVersion    : 21,
+////            targetSdkVersion : 28,
+////            applicationId    : "com.dlc.eboard",
+////            versionCode      : 11,
+////            versionName      : "1.1.1-alpha-kuangda"
+////    ]
+//
+//    test = [
+//            junit       : "junit:junit:4.12",
+//            extJunit    : "androidx.test.ext:junit:1.1.2",
+//            espressoCore: "androidx.test.espresso:espresso-core:3.3.0",
+//    ]
+//
+//    dep = [
+////            kotlinStdlib                 : 'org.jetbrains.kotlin:kotlin-stdlib:${env.kotlin_version}',
+////            androidxCoreKtx              : 'androidx.core:core-ktx:1.3.1',
+////            androidxAppCompat            : 'androidx.appcompat:appcompat:1.2.0',
+////            androidxConstraintlayout     : 'androidx.constraintlayout:constraintlayout:2.0.1',
+////            androidMaterial              : 'com.google.android.material:material:1.2.1',
+////            androidxLocalbroadcastmanager: 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0',
+////            androidxSwipeRefreshLayout   : "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0",
+////            androidMultidex              : "com.android.support:multidex:1.0.3",
+////            kotlinxCoroutinesCore        : 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7',
+////            kotlinxCoroutinesAndroid     : 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1',
+//
+////            okhttp3                      : 'com.squareup.okhttp3:okhttp:3.14.9',
+////            okhttp3Logs                  : 'com.squareup.okhttp3:logging-interceptor:3.14.9',
+////            gson                         : 'com.google.code.gson:gson:2.8.6',
+////            retrofit                     : 'com.squareup.retrofit2:retrofit:2.9.0',
+////            converterGson                : 'com.squareup.retrofit2:converter-gson:2.9.0',
+////            converterScalars             : 'com.squareup.retrofit2:converter-scalars:2.9.0',
+////            rxJavaAdapter                : 'com.squareup.retrofit2:adapter-rxjava2:2.9.0',
+////            rxJava                       : 'io.reactivex.rxjava2:rxjava:2.2.21',
+////            rxAndroid                    : 'io.reactivex.rxjava2:rxandroid:2.1.1',
+////            rxKotlin                     : 'io.reactivex.rxjava2:rxandroid:2.4.0',
+//
+////            luban                        : 'top.zibin:Luban:1.1.8',
+////            RecyclerViewAdapterHelper    : 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4',
+////            eventbus                     : 'org.greenrobot:eventbus:3.2.0',
+////            rxpermissions                : 'com.github.tbruyelle:rxpermissions:0.11',
+////            glide                        : 'com.github.bumptech.glide:glide:4.11.0',
+////            buglySDK                     : 'com.tencent.bugly:crashreport:3.4.4',
+////            buglyNDK                     : 'com.tencent.bugly:nativecrashreport:3.9.2',
+////            mqttv3                       : 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0',
+////            bgaZxing                     : 'com.github.bingoogolapple.BGAQRCode-Android:zxing:1.3.8',
+//    ]
+//
+//}

+ 4 - 1
gradle.properties

@@ -18,4 +18,7 @@ android.useAndroidX=true
 # Kotlin code style for this project: "official" or "obsolete":
 kotlin.code.style=official
 
-android.useDeprecatedNdk=true
+android.useDeprecatedNdk=true
+android.defaults.buildfeatures.buildconfig=true
+android.nonTransitiveRClass=false
+android.nonFinalResIds=false

+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
 #Tue Sep 28 09:08:05 CST 2021
 distributionBase=GRADLE_USER_HOME
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
+distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.7-bin.zip
 distributionPath=wrapper/dists
 zipStorePath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME