From 919197e1e8ef788d381511e36d3e2c2ce8d81aaf Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Sat, 20 Apr 2024 18:27:22 +0600 Subject: [PATCH] chore: use default userAgent provided by nc-android-lib --- app/build.gradle | 2 +- .../foundation/e/drive/utils/AppConstants.kt | 22 +------------------ .../e/drive/utils/DavClientProvider.java | 4 ---- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e2aac80f..fd69b2c1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -97,7 +97,7 @@ android { } dependencies { - implementation 'foundation.e:Nextcloud-Android-Library:1.0.8-u2.17-release' + implementation 'foundation.e:Nextcloud-Android-Library:1.0.9-u2.17-release' implementation "commons-httpclient:commons-httpclient:3.1@jar" implementation fileTree(include: ['*.jar'], dir: 'libs') api 'androidx.annotation:annotation:1.7.0' diff --git a/app/src/main/java/foundation/e/drive/utils/AppConstants.kt b/app/src/main/java/foundation/e/drive/utils/AppConstants.kt index 99423f99..57a107de 100644 --- a/app/src/main/java/foundation/e/drive/utils/AppConstants.kt +++ b/app/src/main/java/foundation/e/drive/utils/AppConstants.kt @@ -8,11 +8,6 @@ */ package foundation.e.drive.utils -import android.os.Build -import foundation.e.drive.BuildConfig -import java.text.SimpleDateFormat -import java.util.Locale - /** * @author Vincent Bourgmayer * @author Abhishek Aggarwal @@ -39,19 +34,4 @@ object AppConstants { const val WORK_GENERIC_TAG = "eDrive" const val WORK_SETUP_TAG = "eDrive-init" const val CORRUPTED_TIMESTAMP_IN_MILLISECOND = 4294967295000L - - @JvmField - val USER_AGENT = "eos(" + buildTime + ")-eDrive(" + BuildConfig.VERSION_NAME + ")" - - /** - * Get a readable OS's build date String - * - * @return Os'build date - */ - private val buildTime: String - get() { - val ts = Build.TIME - val sdf = SimpleDateFormat("yyyyMMdd", Locale.getDefault()) - return sdf.format(ts) - } -} \ No newline at end of file +} diff --git a/app/src/main/java/foundation/e/drive/utils/DavClientProvider.java b/app/src/main/java/foundation/e/drive/utils/DavClientProvider.java index 842db665..8b8e26e7 100644 --- a/app/src/main/java/foundation/e/drive/utils/DavClientProvider.java +++ b/app/src/main/java/foundation/e/drive/utils/DavClientProvider.java @@ -47,8 +47,6 @@ public class DavClientProvider { return null; } - OwnCloudClientManagerFactory.setUserAgent(AppConstants.USER_AGENT); - try { final OwnCloudClientManager ownCloudClientManager = OwnCloudClientManagerFactory.getDefaultSingleton(); final OwnCloudAccount ocAccount = new OwnCloudAccount(account, context); @@ -66,8 +64,6 @@ public class DavClientProvider { return null; } - OwnCloudClientManagerFactory.setUserAgent(AppConstants.USER_AGENT); - try { final OwnCloudClientManager ownCloudClientManager = OwnCloudClientManagerFactory.getDefaultSingleton(); final OwnCloudAccount ocAccount = new OwnCloudAccount(account, context); -- GitLab