mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-24 21:25:35 +01:00
linter
Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
This commit is contained in:
parent
e643039488
commit
1918349c93
@ -150,7 +150,8 @@ class BrowserLoginActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private val qrScanResultLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
||||
private val qrScanResultLauncher =
|
||||
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
||||
if (result.resultCode == RESULT_OK) {
|
||||
val data = result.data
|
||||
|
||||
@ -282,7 +283,7 @@ class BrowserLoginActivity : BaseActivity() {
|
||||
val data = dataString.removePrefix(PREFIX)
|
||||
val values = data.split('&')
|
||||
|
||||
if(values.size !in 1..3) {
|
||||
if (values.size !in 1..MAX_ARGS) {
|
||||
throw IllegalArgumentException("Illegal number of login URL elements detected: ${values.size}")
|
||||
}
|
||||
|
||||
@ -293,9 +294,11 @@ class BrowserLoginActivity : BaseActivity() {
|
||||
value.startsWith(USER_KEY) -> {
|
||||
loginData.username = URLDecoder.decode(value.removePrefix(USER_KEY), "UTF-8")
|
||||
}
|
||||
|
||||
value.startsWith(PASS_KEY) -> {
|
||||
loginData.token = URLDecoder.decode(value.removePrefix(PASS_KEY), "UTF-8")
|
||||
}
|
||||
|
||||
value.startsWith(SERVER_KEY) -> {
|
||||
loginData.serverUrl = URLDecoder.decode(value.removePrefix(SERVER_KEY), "UTF-8")
|
||||
baseUrl = loginData.serverUrl
|
||||
@ -431,5 +434,6 @@ class BrowserLoginActivity : BaseActivity() {
|
||||
private const val SERVER_KEY = "server:"
|
||||
private const val PASS_KEY = "password:"
|
||||
private const val PREFIX = "nc://login/"
|
||||
private const val MAX_ARGS = 3
|
||||
}
|
||||
}
|
||||
|
@ -396,7 +396,8 @@ class ServerSelectionActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private val requestCameraPermissionLauncher = registerForActivityResult(ActivityResultContracts.RequestPermission()) { isGranted: Boolean ->
|
||||
private val requestCameraPermissionLauncher =
|
||||
registerForActivityResult(ActivityResultContracts.RequestPermission()) { isGranted: Boolean ->
|
||||
if (isGranted) {
|
||||
// Permission was granted
|
||||
startQRScanner()
|
||||
|
Loading…
Reference in New Issue
Block a user