From 44e6431b12b721331ba83eee78d3cdbe6cc49fec Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Tue, 1 Aug 2023 10:14:06 +0100 Subject: [PATCH 1/3] Resolved conflict with master --- CHANGELOG.md | 11 ++++++----- changelog/unreleased/4113 | 6 ++++++ owncloud-android-library | 2 +- .../android/dependecyinjection/RepositoryModule.kt | 2 +- .../data/appregistry/OCAppRegistryRepository.kt | 6 +++++- .../datasources/RemoteAppRegistryDataSource.kt | 3 ++- .../implementation/OCRemoteAppRegistryDataSource.kt | 4 ++-- 7 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 changelog/unreleased/4113 diff --git a/CHANGELOG.md b/CHANGELOG.md index 413a9b35436..0b70390ad76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ Summary * Enhancement - Improve grid mode: [#4027](https://github.com/owncloud/android/issues/4027) * Enhancement - Improve UX of creation dialog: [#4031](https://github.com/owncloud/android/issues/4031) * Enhancement - File name conflict starting by (1): [#4040](https://github.com/owncloud/android/pull/4040) -* Enhancement - Prevent http traffic with branding options: [#4066](https://github.com/owncloud/android/issues/4066) +* Enhancement - Respect app_providers_appsUrl value from capabilities: [#4075](https://github.com/owncloud/android/issues/4075) * Enhancement - Support "per app" language change on Android 13+: [#4082](https://github.com/owncloud/android/issues/4082) * Enhancement - Align Sharing icons with other platforms: [#4101](https://github.com/owncloud/android/issues/4101) @@ -140,12 +140,13 @@ Details https://github.com/owncloud/android/issues/3946 https://github.com/owncloud/android/pull/4040 -* Enhancement - Prevent http traffic with branding options: [#4066](https://github.com/owncloud/android/issues/4066) +* Enhancement - Respect app_providers_appsUrl value from capabilities: [#4075](https://github.com/owncloud/android/issues/4075) - Adding branding option for prevent http traffic. + Now, the app receives the app_providers_appsUrl from the local database. Before of this + issue, the value was hardcoded. - https://github.com/owncloud/android/issues/4066 - https://github.com/owncloud/android/pull/4110 + https://github.com/owncloud/android/issues/4075 + https://github.com/owncloud/android/pull/4113 * Enhancement - Support "per app" language change on Android 13+: [#4082](https://github.com/owncloud/android/issues/4082) diff --git a/changelog/unreleased/4113 b/changelog/unreleased/4113 new file mode 100644 index 00000000000..e91b92287f0 --- /dev/null +++ b/changelog/unreleased/4113 @@ -0,0 +1,6 @@ +Enhancement: Respect app_providers_appsUrl value from capabilities + +Now, the app receives the app_providers_appsUrl from the local database. Before of this issue, the value was hardcoded. + +https://github.com/owncloud/android/issues/4075 +https://github.com/owncloud/android/pull/4113 diff --git a/owncloud-android-library b/owncloud-android-library index fa143804d20..052566d2059 160000 --- a/owncloud-android-library +++ b/owncloud-android-library @@ -1 +1 @@ -Subproject commit fa143804d20a8c580dd332faeee623b7b2b701ab +Subproject commit 052566d2059c24ecb42b5c287060ea1d8636c5b6 diff --git a/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/RepositoryModule.kt b/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/RepositoryModule.kt index f06323e4859..ee741111e89 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/RepositoryModule.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/RepositoryModule.kt @@ -51,7 +51,7 @@ import com.owncloud.android.domain.webfinger.WebFingerRepository import org.koin.dsl.module val repositoryModule = module { - factory { OCAppRegistryRepository(get(), get()) } + factory { OCAppRegistryRepository(get(), get(), get()) } factory { OCAuthenticationRepository(get(), get()) } factory { OCCapabilityRepository(get(), get(), get()) } factory { OCFileRepository(get(), get(), get(), get()) } diff --git a/owncloudData/src/main/java/com/owncloud/android/data/appregistry/OCAppRegistryRepository.kt b/owncloudData/src/main/java/com/owncloud/android/data/appregistry/OCAppRegistryRepository.kt index 733e5367b1b..51f872f7f3e 100644 --- a/owncloudData/src/main/java/com/owncloud/android/data/appregistry/OCAppRegistryRepository.kt +++ b/owncloudData/src/main/java/com/owncloud/android/data/appregistry/OCAppRegistryRepository.kt @@ -23,6 +23,7 @@ package com.owncloud.android.data.appregistry import com.owncloud.android.data.appregistry.datasources.LocalAppRegistryDataSource import com.owncloud.android.data.appregistry.datasources.RemoteAppRegistryDataSource +import com.owncloud.android.data.capabilities.datasources.LocalCapabilitiesDataSource import com.owncloud.android.domain.appregistry.AppRegistryRepository import com.owncloud.android.domain.appregistry.model.AppRegistryMimeType import kotlinx.coroutines.flow.Flow @@ -30,9 +31,12 @@ import kotlinx.coroutines.flow.Flow class OCAppRegistryRepository( private val localAppRegistryDataSource: LocalAppRegistryDataSource, private val remoteAppRegistryDataSource: RemoteAppRegistryDataSource, + private val localCapabilitiesDataSource: LocalCapabilitiesDataSource ) : AppRegistryRepository { override fun refreshAppRegistryForAccount(accountName: String) { - remoteAppRegistryDataSource.getAppRegistryForAccount(accountName).also { + val capabilities = localCapabilitiesDataSource.getCapabilityForAccount(accountName)//remoteAppRegistryDataSource.getCapabilities(accountName) + val appUrl = capabilities?.filesAppProviders?.appsUrl?.substring(1) + remoteAppRegistryDataSource.getAppRegistryForAccount(accountName, appUrl).also { localAppRegistryDataSource.saveAppRegistryForAccount(it) } } diff --git a/owncloudData/src/main/java/com/owncloud/android/data/appregistry/datasources/RemoteAppRegistryDataSource.kt b/owncloudData/src/main/java/com/owncloud/android/data/appregistry/datasources/RemoteAppRegistryDataSource.kt index 3ab7ae2879a..0078e1398f3 100644 --- a/owncloudData/src/main/java/com/owncloud/android/data/appregistry/datasources/RemoteAppRegistryDataSource.kt +++ b/owncloudData/src/main/java/com/owncloud/android/data/appregistry/datasources/RemoteAppRegistryDataSource.kt @@ -25,7 +25,8 @@ import com.owncloud.android.domain.appregistry.model.AppRegistry interface RemoteAppRegistryDataSource { fun getAppRegistryForAccount( - accountName: String + accountName: String, + appUrl: String? ): AppRegistry fun getUrlToOpenInWeb( diff --git a/owncloudData/src/main/java/com/owncloud/android/data/appregistry/datasources/implementation/OCRemoteAppRegistryDataSource.kt b/owncloudData/src/main/java/com/owncloud/android/data/appregistry/datasources/implementation/OCRemoteAppRegistryDataSource.kt index 171fffe8ef6..6a920a29058 100644 --- a/owncloudData/src/main/java/com/owncloud/android/data/appregistry/datasources/implementation/OCRemoteAppRegistryDataSource.kt +++ b/owncloudData/src/main/java/com/owncloud/android/data/appregistry/datasources/implementation/OCRemoteAppRegistryDataSource.kt @@ -32,9 +32,9 @@ import com.owncloud.android.lib.resources.appregistry.responses.AppRegistryRespo class OCRemoteAppRegistryDataSource( private val clientManager: ClientManager ) : RemoteAppRegistryDataSource { - override fun getAppRegistryForAccount(accountName: String): AppRegistry = + override fun getAppRegistryForAccount(accountName: String, appUrl: String?): AppRegistry = executeRemoteOperation { - clientManager.getAppRegistryService(accountName).getAppRegistry() + clientManager.getAppRegistryService(accountName).getAppRegistry(appUrl) }.toModel(accountName) override fun getUrlToOpenInWeb( From 6f9d3ebaefc03c841b5ec54d53cc76f89835a84e Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Tue, 1 Aug 2023 10:22:20 +0100 Subject: [PATCH 2/3] Code review fixes --- .../android/data/appregistry/OCAppRegistryRepository.kt | 4 ++-- .../appregistry/datasources/RemoteAppRegistryDataSource.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/owncloudData/src/main/java/com/owncloud/android/data/appregistry/OCAppRegistryRepository.kt b/owncloudData/src/main/java/com/owncloud/android/data/appregistry/OCAppRegistryRepository.kt index 51f872f7f3e..0d71643e7e3 100644 --- a/owncloudData/src/main/java/com/owncloud/android/data/appregistry/OCAppRegistryRepository.kt +++ b/owncloudData/src/main/java/com/owncloud/android/data/appregistry/OCAppRegistryRepository.kt @@ -31,10 +31,10 @@ import kotlinx.coroutines.flow.Flow class OCAppRegistryRepository( private val localAppRegistryDataSource: LocalAppRegistryDataSource, private val remoteAppRegistryDataSource: RemoteAppRegistryDataSource, - private val localCapabilitiesDataSource: LocalCapabilitiesDataSource + private val localCapabilitiesDataSource: LocalCapabilitiesDataSource, ) : AppRegistryRepository { override fun refreshAppRegistryForAccount(accountName: String) { - val capabilities = localCapabilitiesDataSource.getCapabilityForAccount(accountName)//remoteAppRegistryDataSource.getCapabilities(accountName) + val capabilities = localCapabilitiesDataSource.getCapabilityForAccount(accountName) val appUrl = capabilities?.filesAppProviders?.appsUrl?.substring(1) remoteAppRegistryDataSource.getAppRegistryForAccount(accountName, appUrl).also { localAppRegistryDataSource.saveAppRegistryForAccount(it) diff --git a/owncloudData/src/main/java/com/owncloud/android/data/appregistry/datasources/RemoteAppRegistryDataSource.kt b/owncloudData/src/main/java/com/owncloud/android/data/appregistry/datasources/RemoteAppRegistryDataSource.kt index 0078e1398f3..661caac6a7b 100644 --- a/owncloudData/src/main/java/com/owncloud/android/data/appregistry/datasources/RemoteAppRegistryDataSource.kt +++ b/owncloudData/src/main/java/com/owncloud/android/data/appregistry/datasources/RemoteAppRegistryDataSource.kt @@ -26,7 +26,7 @@ import com.owncloud.android.domain.appregistry.model.AppRegistry interface RemoteAppRegistryDataSource { fun getAppRegistryForAccount( accountName: String, - appUrl: String? + appUrl: String?, ): AppRegistry fun getUrlToOpenInWeb( From 5ea3e1b46d149381248cdd46c888de6717225486 Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Tue, 1 Aug 2023 09:23:05 +0000 Subject: [PATCH 3/3] Calens changelog updated --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b70390ad76..a35d15f6c4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ Summary * Enhancement - Improve grid mode: [#4027](https://github.com/owncloud/android/issues/4027) * Enhancement - Improve UX of creation dialog: [#4031](https://github.com/owncloud/android/issues/4031) * Enhancement - File name conflict starting by (1): [#4040](https://github.com/owncloud/android/pull/4040) +* Enhancement - Prevent http traffic with branding options: [#4066](https://github.com/owncloud/android/issues/4066) * Enhancement - Respect app_providers_appsUrl value from capabilities: [#4075](https://github.com/owncloud/android/issues/4075) * Enhancement - Support "per app" language change on Android 13+: [#4082](https://github.com/owncloud/android/issues/4082) * Enhancement - Align Sharing icons with other platforms: [#4101](https://github.com/owncloud/android/issues/4101) @@ -140,6 +141,13 @@ Details https://github.com/owncloud/android/issues/3946 https://github.com/owncloud/android/pull/4040 +* Enhancement - Prevent http traffic with branding options: [#4066](https://github.com/owncloud/android/issues/4066) + + Adding branding option for prevent http traffic. + + https://github.com/owncloud/android/issues/4066 + https://github.com/owncloud/android/pull/4110 + * Enhancement - Respect app_providers_appsUrl value from capabilities: [#4075](https://github.com/owncloud/android/issues/4075) Now, the app receives the app_providers_appsUrl from the local database. Before of this