diff --git a/mobile/build.gradle b/mobile/build.gradle index a2084d71..78ed3dfb 100644 --- a/mobile/build.gradle +++ b/mobile/build.gradle @@ -64,11 +64,11 @@ androidExtensions { } def aux = [ - 'com.crashlytics.sdk.android:crashlytics:2.10.0', + 'com.crashlytics.sdk.android:crashlytics:2.10.1', 'com.google.firebase:firebase-core:16.0.9', ] def lifecycleVersion = '2.1.0-beta01' -def roomVersion = '2.1.0-beta01' +def roomVersion = '2.1.0-rc01' dependencies { kapt "androidx.room:room-compiler:$roomVersion" implementation fileTree(dir: 'libs', include: ['*.jar']) @@ -83,7 +83,7 @@ dependencies { implementation "androidx.room:room-ktx:$roomVersion" implementation 'com.android.billingclient:billing:2.0.0' implementation 'com.github.topjohnwu.libsu:core:2.5.0' - implementation 'com.google.android.material:material:1.1.0-alpha06' + implementation 'com.google.android.material:material:1.1.0-alpha07' implementation 'com.jakewharton.timber:timber:4.7.1' implementation 'com.linkedin.dexmaker:dexmaker:2.25.0' implementation 'com.takisoft.preferencex:preferencex-simplemenu:1.0.0' @@ -96,7 +96,7 @@ dependencies { } testImplementation 'junit:junit:4.12' androidTestImplementation "androidx.room:room-testing:$roomVersion" - androidTestImplementation 'androidx.test:runner:1.2.0-beta01' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0-beta01' + androidTestImplementation 'androidx.test:runner:1.2.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' androidTestImplementation 'androidx.test.ext:junit-ktx:1.1.1-beta01' } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetheringFragment.kt b/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetheringFragment.kt index 46fb8caf..c3bfd8da 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetheringFragment.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetheringFragment.kt @@ -191,6 +191,8 @@ class TetheringFragment : Fragment(), ServiceConnection, Toolbar.OnMenuItemClick WifiApManager.configuration = configuration } catch (e: IllegalArgumentException) { SmartSnackbar.make(R.string.configuration_rejected).show() + } catch (e: InvocationTargetException) { + SmartSnackbar.make(e.targetException).show() } else -> super.onActivityResult(requestCode, resultCode, data) } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/configuration/WifiApDialogFragment.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/configuration/WifiApDialogFragment.kt index c08b6b34..4315d655 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/configuration/WifiApDialogFragment.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/configuration/WifiApDialogFragment.kt @@ -194,8 +194,13 @@ class WifiApDialogFragment : AlertDialogFragment { - QRCodeDialog().withArg(ret.configuration.toQRString()) - .show(fragmentManager ?: return false, "QRCodeDialog") + val qrString = try { + ret.configuration.toQRString() + } catch (e: IllegalArgumentException) { + SmartSnackbar.make(e).show() + return false + } + QRCodeDialog().withArg(qrString).show(fragmentManager ?: return false, "QRCodeDialog") true } else -> false diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/configuration/WifiConfiguration.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/configuration/WifiConfiguration.kt index 5f290a14..66b36e38 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/configuration/WifiConfiguration.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/configuration/WifiConfiguration.kt @@ -70,9 +70,9 @@ fun frequencyToChannel(frequency: Int) = when (frequency % 5) { else -> throw IllegalArgumentException("Invalid frequency $frequency") } -val WifiConfiguration.apKeyManagement get() = allowedKeyManagement.nextSetBit(0).also { selected -> - check(selected >= 0) { "No key management selected" } +val WifiConfiguration.apKeyManagement get() = allowedKeyManagement.nextSetBit(0).let { selected -> check(allowedKeyManagement.nextSetBit(selected + 1) < 0) { "More than 1 key managements supplied" } + if (selected < 0) WifiConfiguration.KeyMgmt.NONE else selected // getAuthType returns NONE if nothing is selected } private val qrSanitizer = Regex("([\\\\\":;,])")