diff --git a/app/build.gradle b/app/build.gradle index 64f0e7f..00835a6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,8 +19,8 @@ android { applicationId "llc.arma.ble" minSdk 26 targetSdk 34 - versionCode 41 - versionName "1.4.13" + versionCode 44 + versionName "1.4.16" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { @@ -30,11 +30,11 @@ android { buildTypes { debug { - minifyEnabled true + minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } release { - minifyEnabled true + minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 76ef6a3..bcd82a5 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -35,6 +35,8 @@ -keeppackagenames org.apache.poi.ss.formula.function +-keep class org.apache.** + -keep class com.fasterxml.aalto.stax.InputFactoryImpl -keep class com.fasterxml.aalto.stax.OutputFactoryImpl -keep class com.fasterxml.aalto.stax.EventFactoryImpl diff --git a/app/src/main/java/llc/arma/ble/data/repository/ReadHostHistory.kt b/app/src/main/java/llc/arma/ble/data/repository/ReadHostHistory.kt index 6c031d0..8366ae1 100644 --- a/app/src/main/java/llc/arma/ble/data/repository/ReadHostHistory.kt +++ b/app/src/main/java/llc/arma/ble/data/repository/ReadHostHistory.kt @@ -39,12 +39,19 @@ suspend fun readTable( do { - val nextPackageDataCount = value.get2byteUIntAt(2) + val nextPackageDataCount = if(value.size > 3) + value.get2byteUIntAt(2) + else + UInt.MIN_VALUE - tableResult.addAll(value.asList().subList(4, value.size)) + if(value.size > 4) { - characteristic.write(DataByteArray(nextRequestPayload)) - value = characteristic.read().value + tableResult.addAll(value.asList().subList(4, value.size)) + + characteristic.write(DataByteArray(nextRequestPayload)) + value = characteristic.read().value + + } } while (nextPackageDataCount.toInt() != 0) @@ -91,7 +98,7 @@ fun readHostHistory( readTable( characteristic, //Чтение без удаления - byteArrayOf(1, 0, 0, -2, -1), + byteArrayOf(1, 0, 0, -1, -1), byteArrayOf(5) ) ) @@ -192,7 +199,6 @@ fun readHostHistory( periodBle = mutableListOf() continue - } if (bleIdTableCell.contentEquals(intervalEndAndHit.hexToByteArray())) { @@ -202,7 +208,6 @@ fun readHostHistory( periodBle = mutableListOf() continue - } val innerIndex = getInnerIndex(bleIdTableCell[1])