From 719bef7889fdb3191d5e68160ec988483c42e4fc Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Mon, 1 Feb 2021 22:54:04 +0800 Subject: [PATCH 1/3] potential fix for the rare mapbox native crash (use onDestroyView) --- app/build.gradle | 2 +- app/proguard-rules.pro | 4 ++++ app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7d1bfea3d..10d04ea14 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -156,7 +156,7 @@ dependencies { implementation 'com.github.mik3y:usb-serial-for-android:v3.0.0' // mapbox - implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.5.0' + implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.6.0' // mapbox specifies a really old version of okhttp3 which causes lots of API warnings. trying a newer version implementation 'com.squareup.okhttp3:okhttp:4.9.0' diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index abd97ff52..41240d9b4 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -30,6 +30,10 @@ -keep class com.geeksville.mesh.**{*;} -keepclassmembers class * extends com.google.protobuf.GeneratedMessageLite { ; } +# Recommended by mapbox to prevent native crashes +-dontwarn com.mapbox.** +-keep class com.mapbox.** { *; } + # for kotlinx.serialization -keepattributes *Annotation*, InnerClasses -dontnote kotlinx.serialization.SerializationKt diff --git a/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt index a35eff231..21d5a650c 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt @@ -204,9 +204,9 @@ class MapFragment : ScreenFragment("Map"), Logging { mapView?.onResume() } - override fun onDestroy() { + override fun onDestroyView() { mapView?.onDestroy() - super.onDestroy() + super.onDestroyView() } override fun onSaveInstanceState(outState: Bundle) { From 4db838b5e3878a4b1aafe3681f0b237221f690fe Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Mon, 1 Feb 2021 23:01:15 +0800 Subject: [PATCH 2/3] when in sim, allow user to toggle between service on and off --- .../main/java/com/geeksville/mesh/ui/SettingsFragment.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt index 26cb3263c..78f772151 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt @@ -270,8 +270,12 @@ class BTScanModel(app: Application) : AndroidViewModel(app), Logging { val testnodes = listOf( DeviceListEntry("Simulated interface", "m", true), + DeviceListEntry(context.getString(R.string.none), "n", true) + /* Don't populate fake bluetooth devices, because we don't want testlab inside of google + to try and use them. + DeviceListEntry("Meshtastic_ab12", "xaa", false), - DeviceListEntry("Meshtastic_32ac", "xbb", true) + DeviceListEntry("Meshtastic_32ac", "xbb", true) */ ) devices.value = (testnodes.map { it.address to it }).toMap().toMutableMap() From a618aba7f0b6b1e896e8ef6b65f41fb0426f3139 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Mon, 1 Feb 2021 23:01:29 +0800 Subject: [PATCH 3/3] 1.1.39 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 10d04ea14..112bb7572 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,8 +31,8 @@ android { applicationId "com.geeksville.mesh" minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works) targetSdkVersion 29 - versionCode 20138 // format is Mmmss (where M is 1+the numeric major number - versionName "1.1.38" + versionCode 20139 // format is Mmmss (where M is 1+the numeric major number + versionName "1.1.39" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" // per https://developer.android.com/studio/write/vector-asset-studio