diff --git a/app/build.gradle b/app/build.gradle index 875ca8dd..0ae34f20 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId = 'com.tutpro.baresip' minSdkVersion 21 targetSdkVersion 27 - versionCode = 47 - versionName = '6.0.1' + versionCode = 48 + versionName = '6.0.2' externalNativeBuild { cmake { cFlags '-DHAVE_INTTYPES_H' diff --git a/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt index fe8316ff..73f344fe 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt @@ -264,25 +264,24 @@ class AccountActivity : AppCompatActivity() { if (iceCheck.isChecked) { val newStunServer = stunServer.text.toString().trim() if (acc.stunServer != newStunServer) { - if ((newStunServer != "") && - !Utils.checkHostPort(newStunServer, false)) { + if (!Utils.checkHostPort(newStunServer, false)) { Utils.alertView(this, "Notice", - "Invalid STUN Server: $newStunServer") + "Invalid STUN Server '$newStunServer'") return false } var host = "" - var port = "" + var port = 0 if (newStunServer != "") { val hostPort = newStunServer.split(":") host = hostPort[0] - if (hostPort.size == 2) port = hostPort[1] + if (hostPort.size == 2) port = hostPort[1].toInt() } if ((account_set_stun_host(acc.accp, host) == 0) && - (account_set_stun_port(acc.accp, port.toInt()) == 0)) { + (account_set_stun_port(acc.accp, port) == 0)) { acc.stunServer = account_stun_host(acc.accp) - if (port != "") + if (port != 0) acc.stunServer += ":" + account_stun_port(acc.accp).toString() - Log.d("Baresip", "New StunServer is ${acc.stunServer}") + Log.d("Baresip", "New StunServer is '${acc.stunServer}'") save = true } else { Log.e("Baresip", "Setting of StunServer failed") diff --git a/app/src/main/kotlin/com/tutpro/baresip/ChatActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/ChatActivity.kt index f2acff43..60e6d2d2 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/ChatActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/ChatActivity.kt @@ -114,7 +114,7 @@ class ChatActivity : AppCompatActivity() { } newMessage = findViewById(R.id.text) as EditText - newMessage.setOnFocusChangeListener(View.OnFocusChangeListener { v, hasFocus -> + newMessage.setOnFocusChangeListener(View.OnFocusChangeListener { _, hasFocus -> if (hasFocus) { window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) } diff --git a/fastlane/metadata/android/en-US/changelogs/6.0.2.txt b/fastlane/metadata/android/en-US/changelogs/6.0.2.txt new file mode 100644 index 00000000..575601a6 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/6.0.2.txt @@ -0,0 +1 @@ +- Fixed crash when stun server is defined without port number.