From d4db6821bdf9e84d5854e7af45e9595c10046e8d Mon Sep 17 00:00:00 2001 From: Manfred Wisniewski Date: Tue, 23 Jun 2026 13:45:11 +0200 Subject: [PATCH 1/6] Preconfigure: Allow setting the server_url via Managed Configuration in MDM Systems Signed-off-by: Manfred Wisniewski --- .vscode/settings.json | 3 + app/build.gradle.kts | 4 +- app/src/main/AndroidManifest.xml | 4 + .../talk/account/ServerSelectionActivity.kt | 18 +- .../talk/appconfig/AppConfigManager.kt | 31 + app/src/main/res/values/strings.xml | 4 + app/src/main/res/xml/app_restrictions.xml | 15 + gradle/verification-metadata.xml | 1470 ++++++++++++++++- settings.gradle | 4 +- 9 files changed, 1546 insertions(+), 7 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 app/src/main/java/com/nextcloud/talk/appconfig/AppConfigManager.kt create mode 100644 app/src/main/res/xml/app_restrictions.xml diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000000..c5f3f6b9c75 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "interactive" +} \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c29bd30a04c..966a9a06d08 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -62,8 +62,8 @@ android { // mayor.minor.hotfix.increment (for increment: 01-50=Alpha / 51-89=RC / 90-99=stable) // xx .xxx .xx .xx - versionCode = 240010014 - versionName = "24.1.0 Alpha 14" + versionCode = 240010015 + versionName = "24.1.0 WIT Alpha 15" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4271e3e2e2a..427e6c12ea1 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -97,6 +97,10 @@ tools:ignore="UnusedAttribute" tools:replace="label, icon, theme, name, allowBackup"> + + diff --git a/app/src/main/java/com/nextcloud/talk/account/ServerSelectionActivity.kt b/app/src/main/java/com/nextcloud/talk/account/ServerSelectionActivity.kt index 35d2c1e1ffd..4c376492fbe 100644 --- a/app/src/main/java/com/nextcloud/talk/account/ServerSelectionActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/account/ServerSelectionActivity.kt @@ -31,6 +31,7 @@ import com.github.dhaval2404.imagepicker.util.PermissionUtil import com.google.android.material.snackbar.Snackbar import com.nextcloud.talk.R import com.nextcloud.talk.activities.BaseActivity +import com.nextcloud.talk.appconfig.AppConfigManager import com.nextcloud.talk.api.NcApi import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication @@ -69,6 +70,9 @@ class ServerSelectionActivity : BaseActivity() { @Inject lateinit var networkMonitor: NetworkMonitor + @Inject + lateinit var appConfigManager: AppConfigManager + private var statusQueryDisposable: Disposable? = null private val onBackPressedCallback = object : OnBackPressedCallback(true) { @@ -127,9 +131,17 @@ class ServerSelectionActivity : BaseActivity() { } binding.serverEntryTextInputEditText.requestFocus() - if (!TextUtils.isEmpty(resources!!.getString(R.string.weblogin_url))) { - binding.serverEntryTextInputEditText.setText(resources!!.getString(R.string.weblogin_url)) - checkServerAndProceed() + + val managedBaseUrl = appConfigManager.getServerBaseUrl() + when { + !managedBaseUrl.isNullOrBlank() -> { + binding.serverEntryTextInputEditText.setText(managedBaseUrl) + checkServerAndProceed() + } + !TextUtils.isEmpty(resources!!.getString(R.string.weblogin_url)) -> { + binding.serverEntryTextInputEditText.setText(resources!!.getString(R.string.weblogin_url)) + checkServerAndProceed() + } } binding.serverEntryTextInputEditText.setOnEditorActionListener { _: TextView?, i: Int, _: KeyEvent? -> if (i == EditorInfo.IME_ACTION_DONE) { diff --git a/app/src/main/java/com/nextcloud/talk/appconfig/AppConfigManager.kt b/app/src/main/java/com/nextcloud/talk/appconfig/AppConfigManager.kt new file mode 100644 index 00000000000..9bb3c838969 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/appconfig/AppConfigManager.kt @@ -0,0 +1,31 @@ +/* + * Nextcloud Talk - Android Client + * + * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ +package com.nextcloud.talk.appconfig + +import android.content.RestrictionsManager +import android.content.Context +import androidx.annotation.VisibleForTesting +import javax.inject.Inject +import javax.inject.Singleton + +@Singleton +class AppConfigManager @Inject constructor(private val context: Context) { + + fun getServerBaseUrl(): String? = getString(KEY_SERVER_BASE_URL)?.takeIf { it.isNotBlank() } + + @VisibleForTesting + internal fun getString(key: String): String? { + val restrictionsManager = context.getSystemService(Context.RESTRICTIONS_SERVICE) as? RestrictionsManager + ?: return null + val restrictions = restrictionsManager.applicationRestrictions + return restrictions?.getString(key) + } + + companion object { + const val KEY_SERVER_BASE_URL = "nextcloud_url" + } +} diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index addf50e6037..bcb382e3f6f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -995,4 +995,8 @@ How to translate with transifex: Turn on background blur Turn off background blur Account not found + + + Server URL + Nextcloud server address that should be used by default. diff --git a/app/src/main/res/xml/app_restrictions.xml b/app/src/main/res/xml/app_restrictions.xml new file mode 100644 index 00000000000..366601af621 --- /dev/null +++ b/app/src/main/res/xml/app_restrictions.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 0213ea6381c..c50be0e3520 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -118,7 +118,10 @@ - + + + + @@ -1076,6 +1079,14 @@ + + + + + + + + @@ -1084,6 +1095,14 @@ + + + + + + + + @@ -1132,6 +1151,14 @@ + + + + + + + + @@ -1180,6 +1207,14 @@ + + + + + + + + @@ -1228,6 +1263,14 @@ + + + + + + + + @@ -1276,6 +1319,14 @@ + + + + + + + + @@ -1308,6 +1359,14 @@ + + + + + + + + @@ -1605,11 +1664,21 @@ + + + + + + + + + + @@ -1638,6 +1707,11 @@ + + + + + @@ -1723,6 +1797,14 @@ + + + + + + + + @@ -1796,6 +1878,11 @@ + + + + + @@ -1886,6 +1973,14 @@ + + + + + + + + @@ -1959,6 +2054,11 @@ + + + + + @@ -2047,6 +2147,14 @@ + + + + + + + + @@ -2123,6 +2231,11 @@ + + + + + @@ -2211,6 +2324,14 @@ + + + + + + + + @@ -2491,6 +2612,11 @@ + + + + + @@ -2571,6 +2697,14 @@ + + + + + + + + @@ -2692,6 +2826,11 @@ + + + + + @@ -2780,6 +2919,14 @@ + + + + + + + + @@ -2856,6 +3003,11 @@ + + + + + @@ -2912,6 +3064,14 @@ + + + + + + + + @@ -2956,6 +3116,11 @@ + + + + + @@ -2996,6 +3161,14 @@ + + + + + + + + @@ -3029,6 +3202,11 @@ + + + + + @@ -3127,6 +3305,14 @@ + + + + + + + + @@ -3211,6 +3397,11 @@ + + + + + @@ -3304,6 +3495,14 @@ + + + + + + + + @@ -3385,6 +3584,11 @@ + + + + + @@ -3473,6 +3677,14 @@ + + + + + + + + @@ -3549,6 +3761,11 @@ + + + + + @@ -3642,6 +3859,14 @@ + + + + + + + + @@ -3723,6 +3948,11 @@ + + + + + @@ -3811,6 +4041,14 @@ + + + + + + + + @@ -3887,6 +4125,11 @@ + + + + + @@ -3975,6 +4218,14 @@ + + + + + + + + @@ -4063,6 +4314,14 @@ + + + + + + + + @@ -4144,6 +4403,11 @@ + + + + + @@ -4237,6 +4501,14 @@ + + + + + + + + @@ -4315,6 +4587,11 @@ + + + + + @@ -4390,6 +4667,14 @@ + + + + + + + + @@ -4468,6 +4753,11 @@ + + + + + @@ -4543,6 +4833,14 @@ + + + + + + + + @@ -4624,6 +4922,11 @@ + + + + + @@ -4717,6 +5020,14 @@ + + + + + + + + @@ -4798,6 +5109,11 @@ + + + + + @@ -4886,6 +5202,14 @@ + + + + + + + + @@ -4962,6 +5286,11 @@ + + + + + @@ -5050,6 +5379,14 @@ + + + + + + + + @@ -5547,6 +5884,14 @@ + + + + + + + + @@ -5683,6 +6028,14 @@ + + + + + + + + @@ -5819,6 +6172,14 @@ + + + + + + + + @@ -7965,6 +8326,14 @@ + + + + + + + + @@ -8053,6 +8422,14 @@ + + + + + + + + @@ -8141,6 +8518,14 @@ + + + + + + + + @@ -8229,6 +8614,14 @@ + + + + + + + + @@ -8317,6 +8710,14 @@ + + + + + + + + @@ -8405,6 +8806,14 @@ + + + + + + + + @@ -8493,6 +8902,14 @@ + + + + + + + + @@ -8581,6 +8998,14 @@ + + + + + + + + @@ -8594,6 +9019,14 @@ + + + + + + + + @@ -10831,6 +11264,14 @@ + + + + + + + + @@ -10967,6 +11408,14 @@ + + + + + + + + @@ -11103,11 +11552,24 @@ + + + + + + + + + + + + + @@ -11340,6 +11802,14 @@ + + + + + + + + @@ -11476,6 +11946,14 @@ + + + + + + + + @@ -11612,6 +12090,14 @@ + + + + + + + + @@ -11652,6 +12138,14 @@ + + + + + + + + @@ -11788,6 +12282,14 @@ + + + + + + + + @@ -11924,6 +12426,14 @@ + + + + + + + + @@ -12060,6 +12570,14 @@ + + + + + + + + @@ -12196,6 +12714,14 @@ + + + + + + + + @@ -12332,6 +12858,14 @@ + + + + + + + + @@ -12468,6 +13002,14 @@ + + + + + + + + @@ -12604,6 +13146,14 @@ + + + + + + + + @@ -12844,6 +13394,14 @@ + + + + + + + + @@ -12980,6 +13538,14 @@ + + + + + + + + @@ -13116,6 +13682,14 @@ + + + + + + + + @@ -13252,6 +13826,14 @@ + + + + + + + + @@ -13388,6 +13970,14 @@ + + + + + + + + @@ -13524,6 +14114,14 @@ + + + + + + + + @@ -13660,6 +14258,14 @@ + + + + + + + + @@ -13876,6 +14482,14 @@ + + + + + + + + @@ -14028,6 +14642,14 @@ + + + + + + + + @@ -14052,6 +14674,14 @@ + + + + + + + + @@ -14060,6 +14690,14 @@ + + + + + + + + @@ -14212,6 +14850,14 @@ + + + + + + + + @@ -14364,6 +15010,14 @@ + + + + + + + + @@ -14524,6 +15178,14 @@ + + + + + + + + @@ -14660,6 +15322,14 @@ + + + + + + + + @@ -14700,6 +15370,14 @@ + + + + + + + + @@ -14740,6 +15418,14 @@ + + + + + + + + @@ -14780,6 +15466,14 @@ + + + + + + + + @@ -14916,6 +15610,14 @@ + + + + + + + + @@ -14956,6 +15658,14 @@ + + + + + + + + @@ -14996,6 +15706,14 @@ + + + + + + + + @@ -15036,6 +15754,14 @@ + + + + + + + + @@ -15076,6 +15802,14 @@ + + + + + + + + @@ -15212,6 +15946,14 @@ + + + + + + + + @@ -15348,6 +16090,14 @@ + + + + + + + + @@ -15484,6 +16234,14 @@ + + + + + + + + @@ -15620,6 +16378,14 @@ + + + + + + + + @@ -16172,6 +16938,14 @@ + + + + + + + + @@ -16308,6 +17082,14 @@ + + + + + + + + @@ -16444,6 +17226,14 @@ + + + + + + + + @@ -16580,6 +17370,14 @@ + + + + + + + + @@ -16716,6 +17514,14 @@ + + + + + + + + @@ -16852,6 +17658,14 @@ + + + + + + + + @@ -16988,6 +17802,14 @@ + + + + + + + + @@ -17124,6 +17946,14 @@ + + + + + + + + @@ -17260,6 +18090,14 @@ + + + + + + + + @@ -17396,6 +18234,14 @@ + + + + + + + + @@ -17532,6 +18378,14 @@ + + + + + + + + @@ -17668,6 +18522,14 @@ + + + + + + + + @@ -17948,6 +18810,14 @@ + + + + + + + + @@ -18084,6 +18954,14 @@ + + + + + + + + @@ -18092,6 +18970,14 @@ + + + + + + + + @@ -18100,6 +18986,14 @@ + + + + + + + + @@ -18236,6 +19130,14 @@ + + + + + + + + @@ -18339,6 +19241,11 @@ + + + + + @@ -19339,6 +20246,14 @@ + + + + + + + + @@ -19605,6 +20520,14 @@ + + + + + + + + @@ -19900,6 +20823,14 @@ + + + + + + + + @@ -19956,6 +20887,11 @@ + + + + + @@ -19979,6 +20915,14 @@ + + + + + + + + @@ -20057,6 +21001,11 @@ + + + + + @@ -20375,6 +21324,14 @@ + + + + + + + + @@ -20559,6 +21516,14 @@ + + + + + + + + @@ -20671,6 +21636,14 @@ + + + + + + + + @@ -21101,6 +22074,14 @@ + + + + + + + + @@ -21114,6 +22095,14 @@ + + + + + + + + @@ -21194,6 +22183,14 @@ + + + + + + + + @@ -21286,6 +22283,11 @@ + + + + + @@ -21381,6 +22383,11 @@ + + + + + @@ -21396,6 +22403,16 @@ + + + + + + + + + + @@ -21406,6 +22423,11 @@ + + + + + @@ -21526,6 +22548,11 @@ + + + + + @@ -21568,6 +22595,14 @@ + + + + + + + + @@ -21672,6 +22707,11 @@ + + + + + @@ -24157,6 +25197,14 @@ + + + + + + + + @@ -24393,6 +25441,14 @@ + + + + + + + + @@ -25284,6 +26340,19 @@ + + + + + + + + + + + + + @@ -25679,6 +26748,14 @@ + + + + + + + + @@ -25743,6 +26820,14 @@ + + + + + + + + @@ -25767,6 +26852,14 @@ + + + + + + + + @@ -25823,6 +26916,14 @@ + + + + + + + + @@ -25935,6 +27036,14 @@ + + + + + + + + @@ -26033,6 +27142,14 @@ + + + + + + + + @@ -26151,6 +27268,9 @@ + + + @@ -26179,6 +27299,14 @@ + + + + + + + + @@ -26187,6 +27315,14 @@ + + + + + + + + @@ -26259,6 +27395,14 @@ + + + + + + + + @@ -26380,6 +27524,14 @@ + + + + + + + + @@ -26498,6 +27650,9 @@ + + + @@ -26574,6 +27729,14 @@ + + + + + + + + @@ -26692,6 +27855,9 @@ + + + @@ -26817,6 +27983,14 @@ + + + + + + + + @@ -26889,6 +28063,14 @@ + + + + + + + + @@ -26961,6 +28143,14 @@ + + + + + + + + @@ -27051,6 +28241,14 @@ + + + + + + + + @@ -27123,6 +28321,14 @@ + + + + + + + + @@ -27195,6 +28401,14 @@ + + + + + + + + @@ -27346,6 +28560,9 @@ + + + @@ -27438,6 +28655,14 @@ + + + + + + + + @@ -27558,6 +28783,14 @@ + + + + + + + + @@ -27630,6 +28863,14 @@ + + + + + + + + @@ -27702,6 +28943,14 @@ + + + + + + + + @@ -27774,6 +29023,14 @@ + + + + + + + + @@ -27955,6 +29212,14 @@ + + + + + + + + @@ -28219,6 +29484,14 @@ + + + + + + + + @@ -28291,6 +29564,14 @@ + + + + + + + + @@ -28499,6 +29780,14 @@ + + + + + + + + @@ -28616,6 +29905,11 @@ + + + + + @@ -28907,6 +30201,9 @@ + + + @@ -28983,6 +30280,14 @@ + + + + + + + + @@ -29055,6 +30360,14 @@ + + + + + + + + @@ -29127,6 +30440,14 @@ + + + + + + + + @@ -29291,6 +30612,14 @@ + + + + + + + + @@ -29341,6 +30670,11 @@ + + + + + @@ -29361,6 +30695,11 @@ + + + + + @@ -29387,6 +30726,11 @@ + + + + + @@ -29437,6 +30781,14 @@ + + + + + + + + @@ -29519,6 +30871,14 @@ + + + + + + + + @@ -29556,6 +30916,14 @@ + + + + + + + + @@ -29585,6 +30953,14 @@ + + + + + + + + @@ -29622,6 +30998,11 @@ + + + + + @@ -29638,6 +31019,14 @@ + + + + + + + + @@ -29651,6 +31040,11 @@ + + + + + @@ -29681,6 +31075,11 @@ + + + + + @@ -29731,6 +31130,14 @@ + + + + + + + + @@ -29784,6 +31191,11 @@ + + + + + @@ -29826,6 +31238,14 @@ + + + + + + + + @@ -30140,6 +31560,14 @@ + + + + + + + + @@ -30236,6 +31664,14 @@ + + + + + + + + @@ -30332,6 +31768,14 @@ + + + + + + + + @@ -30364,6 +31808,14 @@ + + + + + + + + @@ -30460,6 +31912,14 @@ + + + + + + + + @@ -31660,6 +33120,14 @@ + + + + + + + + diff --git a/settings.gradle b/settings.gradle index b3d00a20971..e6330043daf 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,6 @@ -/* +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0' +}/* * Nextcloud Talk - Android Client * * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors From 9766a0f33e787da7f4d27b8d6d667d9656102389 Mon Sep 17 00:00:00 2001 From: Manfred Wisniewski Date: Tue, 23 Jun 2026 14:04:36 +0200 Subject: [PATCH 2/6] AppConfig: if server_url is set via Managed Configuration prefill the servver selection form with the configured url --- .../talk/account/ServerSelectionActivity.kt | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/account/ServerSelectionActivity.kt b/app/src/main/java/com/nextcloud/talk/account/ServerSelectionActivity.kt index 4c376492fbe..8993bdd317d 100644 --- a/app/src/main/java/com/nextcloud/talk/account/ServerSelectionActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/account/ServerSelectionActivity.kt @@ -96,6 +96,21 @@ class ServerSelectionActivity : BaseActivity() { initSystemBars() onBackPressedDispatcher.addCallback(this, onBackPressedCallback) + + if (savedInstanceState == null) { + val managedBaseUrl = appConfigManager.getServerBaseUrl() + when { + !managedBaseUrl.isNullOrBlank() -> { + binding.serverEntryTextInputEditText.setText(managedBaseUrl) + checkServerAndProceed() + } + + !TextUtils.isEmpty(resources!!.getString(R.string.weblogin_url)) -> { + binding.serverEntryTextInputEditText.setText(resources!!.getString(R.string.weblogin_url)) + checkServerAndProceed() + } + } + } } override fun onResume() { @@ -132,17 +147,6 @@ class ServerSelectionActivity : BaseActivity() { binding.serverEntryTextInputEditText.requestFocus() - val managedBaseUrl = appConfigManager.getServerBaseUrl() - when { - !managedBaseUrl.isNullOrBlank() -> { - binding.serverEntryTextInputEditText.setText(managedBaseUrl) - checkServerAndProceed() - } - !TextUtils.isEmpty(resources!!.getString(R.string.weblogin_url)) -> { - binding.serverEntryTextInputEditText.setText(resources!!.getString(R.string.weblogin_url)) - checkServerAndProceed() - } - } binding.serverEntryTextInputEditText.setOnEditorActionListener { _: TextView?, i: Int, _: KeyEvent? -> if (i == EditorInfo.IME_ACTION_DONE) { checkServerAndProceed() From 96165144d1b4b334dcbc703336e8ad11e31e72a3 Mon Sep 17 00:00:00 2001 From: Manfred Wisniewski Date: Tue, 23 Jun 2026 15:01:41 +0200 Subject: [PATCH 3/6] AppConfig: The App now allows preconfiguring the username and an app password in MDM systems for an automated login --- app/build.gradle.kts | 4 +-- .../talk/account/ServerSelectionActivity.kt | 28 ++++++++++++++++++- .../talk/appconfig/AppConfigManager.kt | 6 ++++ app/src/main/res/values/strings.xml | 4 +++ app/src/main/res/xml/app_restrictions.xml | 14 ++++++++++ 5 files changed, 53 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 966a9a06d08..175067b1f6f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -62,8 +62,8 @@ android { // mayor.minor.hotfix.increment (for increment: 01-50=Alpha / 51-89=RC / 90-99=stable) // xx .xxx .xx .xx - versionCode = 240010015 - versionName = "24.1.0 WIT Alpha 15" + versionCode = 240010016 + versionName = "24.1.0 WIT Alpha 16" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/com/nextcloud/talk/account/ServerSelectionActivity.kt b/app/src/main/java/com/nextcloud/talk/account/ServerSelectionActivity.kt index 8993bdd317d..297b900d791 100644 --- a/app/src/main/java/com/nextcloud/talk/account/ServerSelectionActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/account/ServerSelectionActivity.kt @@ -30,7 +30,10 @@ import com.blikoon.qrcodescanner.QrCodeActivity import com.github.dhaval2404.imagepicker.util.PermissionUtil import com.google.android.material.snackbar.Snackbar import com.nextcloud.talk.R +import com.nextcloud.talk.account.data.LoginRepository +import com.nextcloud.talk.account.data.model.LoginCompletion import com.nextcloud.talk.activities.BaseActivity +import com.nextcloud.talk.account.AccountVerificationActivity import com.nextcloud.talk.appconfig.AppConfigManager import com.nextcloud.talk.api.NcApi import com.nextcloud.talk.application.NextcloudTalkApplication @@ -45,6 +48,7 @@ import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.CapabilitiesUtil import com.nextcloud.talk.utils.UriUtils import com.nextcloud.talk.utils.bundle.BundleKeys +import java.net.HttpURLConnection import com.nextcloud.talk.utils.bundle.BundleKeys.ADD_ADDITIONAL_ACCOUNT import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_ACCOUNT_IMPORT import com.nextcloud.talk.utils.singletons.ApplicationWideMessageHolder @@ -73,6 +77,9 @@ class ServerSelectionActivity : BaseActivity() { @Inject lateinit var appConfigManager: AppConfigManager + @Inject + lateinit var loginRepository: LoginRepository + private var statusQueryDisposable: Disposable? = null private val onBackPressedCallback = object : OnBackPressedCallback(true) { @@ -365,8 +372,27 @@ class ServerSelectionActivity : BaseActivity() { } } } else { + val baseUrl = queryUrl.replace("/status.php", "") + val managedUsername = appConfigManager.getUsername() + val managedPassword = appConfigManager.getAppPassword() + if (!managedUsername.isNullOrBlank() && !managedPassword.isNullOrBlank()) { + val loginCompletion = LoginCompletion( + HttpURLConnection.HTTP_OK, + baseUrl, + managedUsername, + managedPassword + ) + val managedBundle = loginRepository.parseAndLogin(loginCompletion) + if (managedBundle != null) { + val intent = Intent(context, AccountVerificationActivity::class.java) + intent.putExtras(managedBundle) + startActivity(intent) + return@runOnUiThread + } + } + val bundle = Bundle() - bundle.putString(BundleKeys.KEY_BASE_URL, queryUrl.replace("/status.php", "")) + bundle.putString(BundleKeys.KEY_BASE_URL, baseUrl) val intent = Intent(context, BrowserLoginActivity::class.java) intent.putExtras(bundle) diff --git a/app/src/main/java/com/nextcloud/talk/appconfig/AppConfigManager.kt b/app/src/main/java/com/nextcloud/talk/appconfig/AppConfigManager.kt index 9bb3c838969..63cbd3fe6e6 100644 --- a/app/src/main/java/com/nextcloud/talk/appconfig/AppConfigManager.kt +++ b/app/src/main/java/com/nextcloud/talk/appconfig/AppConfigManager.kt @@ -17,6 +17,10 @@ class AppConfigManager @Inject constructor(private val context: Context) { fun getServerBaseUrl(): String? = getString(KEY_SERVER_BASE_URL)?.takeIf { it.isNotBlank() } + fun getUsername(): String? = getString(KEY_USERNAME)?.takeIf { it.isNotBlank() } + + fun getAppPassword(): String? = getString(KEY_APP_PASSWORD)?.takeIf { it.isNotBlank() } + @VisibleForTesting internal fun getString(key: String): String? { val restrictionsManager = context.getSystemService(Context.RESTRICTIONS_SERVICE) as? RestrictionsManager @@ -27,5 +31,7 @@ class AppConfigManager @Inject constructor(private val context: Context) { companion object { const val KEY_SERVER_BASE_URL = "nextcloud_url" + const val KEY_USERNAME = "nextcloud_username" + const val KEY_APP_PASSWORD = "nextcloud_password" } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bcb382e3f6f..926e54ae1e9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -999,4 +999,8 @@ How to translate with transifex: Server URL Nextcloud server address that should be used by default. + Username + Username that should be used by default. + App password + App-specific password or token for the user. diff --git a/app/src/main/res/xml/app_restrictions.xml b/app/src/main/res/xml/app_restrictions.xml index 366601af621..5d03a22f721 100644 --- a/app/src/main/res/xml/app_restrictions.xml +++ b/app/src/main/res/xml/app_restrictions.xml @@ -12,4 +12,18 @@ android:key="nextcloud_url" android:restrictionType="string" android:title="@string/nc_restriction_server_url_title" /> + + + + From c2f8862e1084eff2cd5a5dc373d77fb772c5959c Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Wed, 17 Jun 2026 12:23:44 +0200 Subject: [PATCH 4/6] fix: make hyperlinks in conversation description clickable Signed-off-by: Marcel Hibbe --- .../ui/ConversationInfoScreen.kt | 3 +- .../com/nextcloud/talk/utils/TextLinkUtils.kt | 57 +++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/com/nextcloud/talk/utils/TextLinkUtils.kt diff --git a/app/src/main/java/com/nextcloud/talk/conversationinfo/ui/ConversationInfoScreen.kt b/app/src/main/java/com/nextcloud/talk/conversationinfo/ui/ConversationInfoScreen.kt index 960dcb5f4cb..3fd87bd91b9 100644 --- a/app/src/main/java/com/nextcloud/talk/conversationinfo/ui/ConversationInfoScreen.kt +++ b/app/src/main/java/com/nextcloud/talk/conversationinfo/ui/ConversationInfoScreen.kt @@ -86,6 +86,7 @@ import com.nextcloud.talk.models.json.status.StatusType import com.nextcloud.talk.ui.StatusDrawable import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.DisplayUtils +import com.nextcloud.talk.utils.withLinks data class ConversationInfoScreenCallbacks( val onNavigateBack: () -> Unit = {}, @@ -328,7 +329,7 @@ private fun HeaderUserInfo(state: ConversationInfoUiState) { @Composable private fun ConversationDescriptionSection(description: String) { Text( - text = description, + text = description.withLinks(), style = MaterialTheme.typography.bodyMedium, modifier = Modifier .fillMaxWidth() diff --git a/app/src/main/java/com/nextcloud/talk/utils/TextLinkUtils.kt b/app/src/main/java/com/nextcloud/talk/utils/TextLinkUtils.kt new file mode 100644 index 00000000000..9c1cd4889ce --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/utils/TextLinkUtils.kt @@ -0,0 +1,57 @@ +/* + * Nextcloud Talk - Android Client + * + * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +package com.nextcloud.talk.utils + +import android.util.Patterns +import androidx.compose.material3.MaterialTheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.AnnotatedString +import androidx.compose.ui.text.LinkAnnotation +import androidx.compose.ui.text.SpanStyle +import androidx.compose.ui.text.buildAnnotatedString +import androidx.compose.ui.text.style.TextDecoration + +@Composable +fun String.withLinks(linkColor: Color = MaterialTheme.colorScheme.primary): AnnotatedString = + remember(this, linkColor) { + buildAnnotatedString { + val matcher = Patterns.WEB_URL.matcher(this@withLinks) + var lastIndex = 0 + + while (matcher.find()) { + append(this@withLinks, lastIndex, matcher.start()) + + val url = matcher.group() + val actualUrl = if (UriUtils.hasHttpProtocolPrefixed(url)) url else "https://$url" + + val start = length + append(url) + + addStyle( + SpanStyle( + color = linkColor, + textDecoration = TextDecoration.Underline + ), + start, + length + ) + + addLink( + LinkAnnotation.Url(actualUrl), + start, + length + ) + + lastIndex = matcher.end() + } + + append(this@withLinks, lastIndex, this@withLinks.length) + } + } From 1c5489760685d410d9a10d508bd75c51a9c29505 Mon Sep 17 00:00:00 2001 From: Nextcloud bot Date: Tue, 23 Jun 2026 03:33:07 +0000 Subject: [PATCH 5/6] fix(l10n): Update translations from Transifex Signed-off-by: Nextcloud bot --- app/src/main/res/values-ko/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 11dba41687a..997fd867cca 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -10,6 +10,7 @@ 전화 번호 스피커 유선 헤드셋 + 상태가 자동 설정되었습니다. 아바타 자리비움 배터리 설정 @@ -410,6 +411,7 @@ 설정 투표 투표가 제출되었습니다. + 이전 설정 손들기 모두 허가 없이 저장소에서 파일을 공유할 수 없습니다. @@ -422,6 +424,7 @@ 녹음/녹화 동의 통화가 녹음/녹화됩니다. 녹음/녹화 중 + 상태 초기화 통화 중 다른 대화방에 접속할 수 없습니다 저장 Scan QR Code From d114b4c1eb03ded71c5fff133e1bdd35c33c1c67 Mon Sep 17 00:00:00 2001 From: Manfred Wisniewski Date: Tue, 23 Jun 2026 15:55:23 +0200 Subject: [PATCH 6/6] reset versionCode to Origin --- app/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 175067b1f6f..c29bd30a04c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -62,8 +62,8 @@ android { // mayor.minor.hotfix.increment (for increment: 01-50=Alpha / 51-89=RC / 90-99=stable) // xx .xxx .xx .xx - versionCode = 240010016 - versionName = "24.1.0 WIT Alpha 16" + versionCode = 240010014 + versionName = "24.1.0 Alpha 14" vectorDrawables.useSupportLibrary = true