瀏覽代碼

Merge pull request #1204 from nextcloud/dependabot/gradle/com.gitlab.bitfireAT-dav4jvm-2.1.2

Bump dav4jvm from f2078bc846 to 2.1.2
Andy Scherzinger 4 年之前
父節點
當前提交
742218d499

+ 2 - 2
app/build.gradle

@@ -156,7 +156,7 @@ ext {
     butterknifeVersion = "10.2.3"
     butterknifeVersion = "10.2.3"
     coilKtVersion = "1.2.1"
     coilKtVersion = "1.2.1"
     daggerVersion = "2.35.1"
     daggerVersion = "2.35.1"
-    okhttpVersion = "3.14.2"
+    okhttpVersion = "4.9.1"
     materialDialogsVersion = "3.3.0"
     materialDialogsVersion = "3.3.0"
     parcelerVersion = "1.1.13"
     parcelerVersion = "1.1.13"
     powermockVersion = "2.0.9"
     powermockVersion = "2.0.9"
@@ -184,7 +184,7 @@ dependencies {
     implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
     implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
     androidTestImplementation "androidx.work:work-testing:${workVersion}"
     androidTestImplementation "androidx.work:work-testing:${workVersion}"
     implementation 'com.google.android:flexbox:2.0.1'
     implementation 'com.google.android:flexbox:2.0.1'
-    implementation ('com.gitlab.bitfireAT:dav4jvm:f2078bc846', {
+    implementation ('com.gitlab.bitfireAT:dav4jvm:2.1.2', {
         exclude group: 'org.ogce', module: 'xpp3'	// Android comes with its own XmlPullParser
         exclude group: 'org.ogce', module: 'xpp3'	// Android comes with its own XmlPullParser
     })
     })
     ktlint "com.pinterest:ktlint:0.41.0"
     ktlint "com.pinterest:ktlint:0.41.0"

+ 6 - 6
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/BrowserFile.java

@@ -36,12 +36,12 @@ import org.parceler.Parcel;
 import java.io.File;
 import java.io.File;
 import java.util.List;
 import java.util.List;
 
 
-import at.bitfire.dav4android.Property;
-import at.bitfire.dav4android.Response;
-import at.bitfire.dav4android.property.DisplayName;
-import at.bitfire.dav4android.property.GetContentType;
-import at.bitfire.dav4android.property.GetLastModified;
-import at.bitfire.dav4android.property.ResourceType;
+import at.bitfire.dav4jvm.Property;
+import at.bitfire.dav4jvm.Response;
+import at.bitfire.dav4jvm.property.DisplayName;
+import at.bitfire.dav4jvm.property.GetContentType;
+import at.bitfire.dav4jvm.property.GetLastModified;
+import at.bitfire.dav4jvm.property.ResourceType;
 
 
 @JsonObject
 @JsonObject
 @Parcel
 @Parcel

+ 1 - 1
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/DavResponse.java

@@ -20,7 +20,7 @@
 
 
 package com.nextcloud.talk.components.filebrowser.models;
 package com.nextcloud.talk.components.filebrowser.models;
 
 
-import at.bitfire.dav4android.Response;
+import at.bitfire.dav4jvm.Response;
 
 
 public class DavResponse {
 public class DavResponse {
     public Response response;
     public Response response;

+ 3 - 3
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCEncrypted.java

@@ -32,9 +32,9 @@ import org.xmlpull.v1.XmlPullParserException;
 
 
 import java.io.IOException;
 import java.io.IOException;
 
 
-import at.bitfire.dav4android.Property;
-import at.bitfire.dav4android.PropertyFactory;
-import at.bitfire.dav4android.XmlUtils;
+import at.bitfire.dav4jvm.Property;
+import at.bitfire.dav4jvm.PropertyFactory;
+import at.bitfire.dav4jvm.XmlUtils;
 
 
 public class NCEncrypted implements Property {
 public class NCEncrypted implements Property {
     public static final Name NAME = new Name(DavUtils.NC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_IS_ENCRYPTED);
     public static final Name NAME = new Name(DavUtils.NC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_IS_ENCRYPTED);

+ 3 - 3
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCPermission.java

@@ -34,9 +34,9 @@ import org.xmlpull.v1.XmlPullParserException;
 
 
 import java.io.IOException;
 import java.io.IOException;
 
 
-import at.bitfire.dav4android.Property;
-import at.bitfire.dav4android.PropertyFactory;
-import at.bitfire.dav4android.XmlUtils;
+import at.bitfire.dav4jvm.Property;
+import at.bitfire.dav4jvm.PropertyFactory;
+import at.bitfire.dav4jvm.XmlUtils;
 
 
 public class NCPermission implements Property {
 public class NCPermission implements Property {
     public static final Name NAME = new Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_PERMISSIONS);
     public static final Name NAME = new Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_PERMISSIONS);

+ 3 - 3
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCPreview.java

@@ -32,9 +32,9 @@ import org.xmlpull.v1.XmlPullParserException;
 
 
 import java.io.IOException;
 import java.io.IOException;
 
 
-import at.bitfire.dav4android.Property;
-import at.bitfire.dav4android.PropertyFactory;
-import at.bitfire.dav4android.XmlUtils;
+import at.bitfire.dav4jvm.Property;
+import at.bitfire.dav4jvm.PropertyFactory;
+import at.bitfire.dav4jvm.XmlUtils;
 
 
 public class NCPreview implements Property {
 public class NCPreview implements Property {
     public static final Property.Name NAME = new Property.Name(DavUtils.NC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_HAS_PREVIEW);
     public static final Property.Name NAME = new Property.Name(DavUtils.NC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_HAS_PREVIEW);

+ 3 - 3
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCFavorite.java

@@ -32,9 +32,9 @@ import org.xmlpull.v1.XmlPullParserException;
 
 
 import java.io.IOException;
 import java.io.IOException;
 
 
-import at.bitfire.dav4android.Property;
-import at.bitfire.dav4android.PropertyFactory;
-import at.bitfire.dav4android.XmlUtils;
+import at.bitfire.dav4jvm.Property;
+import at.bitfire.dav4jvm.PropertyFactory;
+import at.bitfire.dav4jvm.XmlUtils;
 
 
 public class OCFavorite implements Property {
 public class OCFavorite implements Property {
     public static final Property.Name NAME = new Property.Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_FAVORITE);
     public static final Property.Name NAME = new Property.Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_FAVORITE);

+ 3 - 3
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCId.java

@@ -32,9 +32,9 @@ import org.xmlpull.v1.XmlPullParserException;
 
 
 import java.io.IOException;
 import java.io.IOException;
 
 
-import at.bitfire.dav4android.Property;
-import at.bitfire.dav4android.PropertyFactory;
-import at.bitfire.dav4android.XmlUtils;
+import at.bitfire.dav4jvm.Property;
+import at.bitfire.dav4jvm.PropertyFactory;
+import at.bitfire.dav4jvm.XmlUtils;
 
 
 public class OCId implements Property {
 public class OCId implements Property {
     public static final Name NAME = new Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_REMOTE_ID);
     public static final Name NAME = new Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_REMOTE_ID);

+ 3 - 3
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCSize.java

@@ -32,9 +32,9 @@ import org.xmlpull.v1.XmlPullParserException;
 
 
 import java.io.IOException;
 import java.io.IOException;
 
 
-import at.bitfire.dav4android.Property;
-import at.bitfire.dav4android.PropertyFactory;
-import at.bitfire.dav4android.XmlUtils;
+import at.bitfire.dav4jvm.Property;
+import at.bitfire.dav4jvm.PropertyFactory;
+import at.bitfire.dav4jvm.XmlUtils;
 
 
 public class OCSize implements Property {
 public class OCSize implements Property {
     public static final Property.Name NAME = new Property.Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_SIZE);
     public static final Property.Name NAME = new Property.Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_SIZE);

+ 17 - 5
app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/DavUtils.java

@@ -20,11 +20,12 @@
 
 
 package com.nextcloud.talk.components.filebrowser.webdav;
 package com.nextcloud.talk.components.filebrowser.webdav;
 
 
-import at.bitfire.dav4android.Property;
-import at.bitfire.dav4android.PropertyFactory;
-import at.bitfire.dav4android.PropertyRegistry;
-import at.bitfire.dav4android.property.*;
-import com.nextcloud.talk.components.filebrowser.models.properties.*;
+import com.nextcloud.talk.components.filebrowser.models.properties.NCEncrypted;
+import com.nextcloud.talk.components.filebrowser.models.properties.NCPermission;
+import com.nextcloud.talk.components.filebrowser.models.properties.NCPreview;
+import com.nextcloud.talk.components.filebrowser.models.properties.OCFavorite;
+import com.nextcloud.talk.components.filebrowser.models.properties.OCId;
+import com.nextcloud.talk.components.filebrowser.models.properties.OCSize;
 
 
 import java.lang.reflect.Field;
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.ArrayList;
@@ -32,6 +33,17 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
+import at.bitfire.dav4jvm.Property;
+import at.bitfire.dav4jvm.PropertyFactory;
+import at.bitfire.dav4jvm.PropertyRegistry;
+import at.bitfire.dav4jvm.property.CreationDate;
+import at.bitfire.dav4jvm.property.DisplayName;
+import at.bitfire.dav4jvm.property.GetContentLength;
+import at.bitfire.dav4jvm.property.GetContentType;
+import at.bitfire.dav4jvm.property.GetETag;
+import at.bitfire.dav4jvm.property.GetLastModified;
+import at.bitfire.dav4jvm.property.ResourceType;
+
 public class DavUtils {
 public class DavUtils {
     public static final String OC_NAMESPACE = "http://owncloud.org/ns";
     public static final String OC_NAMESPACE = "http://owncloud.org/ns";
     public static final String NC_NAMESPACE = "http://nextcloud.org/ns";
     public static final String NC_NAMESPACE = "http://nextcloud.org/ns";

+ 8 - 7
app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/ReadFilesystemOperation.java

@@ -20,23 +20,24 @@
 
 
 package com.nextcloud.talk.components.filebrowser.webdav;
 package com.nextcloud.talk.components.filebrowser.webdav;
 
 
-import at.bitfire.dav4android.DavResource;
-import at.bitfire.dav4android.Response;
-import at.bitfire.dav4android.exception.DavException;
 import com.nextcloud.talk.components.filebrowser.models.BrowserFile;
 import com.nextcloud.talk.components.filebrowser.models.BrowserFile;
 import com.nextcloud.talk.components.filebrowser.models.DavResponse;
 import com.nextcloud.talk.components.filebrowser.models.DavResponse;
 import com.nextcloud.talk.dagger.modules.RestModule;
 import com.nextcloud.talk.dagger.modules.RestModule;
 import com.nextcloud.talk.models.database.UserEntity;
 import com.nextcloud.talk.models.database.UserEntity;
 import com.nextcloud.talk.utils.ApiUtils;
 import com.nextcloud.talk.utils.ApiUtils;
-import kotlin.Unit;
-import kotlin.jvm.functions.Function2;
-import okhttp3.HttpUrl;
-import okhttp3.OkHttpClient;
 
 
 import java.io.IOException;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
+import at.bitfire.dav4jvm.DavResource;
+import at.bitfire.dav4jvm.Response;
+import at.bitfire.dav4jvm.exception.DavException;
+import kotlin.Unit;
+import kotlin.jvm.functions.Function2;
+import okhttp3.HttpUrl;
+import okhttp3.OkHttpClient;
+
 public class ReadFilesystemOperation {
 public class ReadFilesystemOperation {
     private final OkHttpClient okHttpClient;
     private final OkHttpClient okHttpClient;
     private final String url;
     private final String url;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt

@@ -1267,7 +1267,7 @@ class ChatController(args: Bundle) :
         val xChatLastCommonRead = response.headers().get("X-Chat-Last-Common-Read")?.let {
         val xChatLastCommonRead = response.headers().get("X-Chat-Last-Common-Read")?.let {
             Integer.parseInt(it)
             Integer.parseInt(it)
         }
         }
-        if (response.headers().size() > 0 && !TextUtils.isEmpty(xChatLastGivenHeader)) {
+        if (response.headers().size > 0 && !TextUtils.isEmpty(xChatLastGivenHeader)) {
 
 
             val header = Integer.parseInt(xChatLastGivenHeader!!)
             val header = Integer.parseInt(xChatLastGivenHeader!!)
             if (header > 0) {
             if (header > 0) {

+ 3 - 3
app/src/main/java/com/nextcloud/talk/jobs/ContactAddressBookWorker.kt

@@ -54,8 +54,8 @@ import io.reactivex.Observer
 import io.reactivex.android.schedulers.AndroidSchedulers
 import io.reactivex.android.schedulers.AndroidSchedulers
 import io.reactivex.disposables.Disposable
 import io.reactivex.disposables.Disposable
 import io.reactivex.schedulers.Schedulers
 import io.reactivex.schedulers.Schedulers
-import okhttp3.MediaType
-import okhttp3.RequestBody
+import okhttp3.MediaType.Companion.toMediaTypeOrNull
+import okhttp3.RequestBody.Companion.toRequestBody
 import javax.inject.Inject
 import javax.inject.Inject
 
 
 @AutoInjector(NextcloudTalkApplication::class)
 @AutoInjector(NextcloudTalkApplication::class)
@@ -122,7 +122,7 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
             ncApi.searchContactsByPhoneNumber(
             ncApi.searchContactsByPhoneNumber(
                 ApiUtils.getCredentials(currentUser.username, currentUser.token),
                 ApiUtils.getCredentials(currentUser.username, currentUser.token),
                 ApiUtils.getUrlForSearchByNumber(currentUser.baseUrl),
                 ApiUtils.getUrlForSearchByNumber(currentUser.baseUrl),
-                RequestBody.create(MediaType.parse("application/json"), json)
+                json.toRequestBody("application/json".toMediaTypeOrNull())
             )
             )
                 .subscribeOn(Schedulers.io())
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .observeOn(AndroidSchedulers.mainThread())

+ 2 - 2
app/src/main/java/com/nextcloud/talk/jobs/UploadAndShareFilesWorker.kt

@@ -44,7 +44,7 @@ import io.reactivex.Observer
 import io.reactivex.android.schedulers.AndroidSchedulers
 import io.reactivex.android.schedulers.AndroidSchedulers
 import io.reactivex.disposables.Disposable
 import io.reactivex.disposables.Disposable
 import io.reactivex.schedulers.Schedulers
 import io.reactivex.schedulers.Schedulers
-import okhttp3.MediaType
+import okhttp3.MediaType.Companion.toMediaTypeOrNull
 import okhttp3.RequestBody
 import okhttp3.RequestBody
 import retrofit2.Response
 import retrofit2.Response
 import java.io.File
 import java.io.File
@@ -103,7 +103,7 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
             val input: InputStream = context.contentResolver.openInputStream(sourcefileUri)!!
             val input: InputStream = context.contentResolver.openInputStream(sourcefileUri)!!
             val buf = ByteArray(input.available())
             val buf = ByteArray(input.available())
             while (input.read(buf) != -1);
             while (input.read(buf) != -1);
-            requestBody = RequestBody.create(MediaType.parse("application/octet-stream"), buf)
+            requestBody = RequestBody.create("application/octet-stream".toMediaTypeOrNull(), buf)
         } catch (e: Exception) {
         } catch (e: Exception) {
             Log.e(javaClass.simpleName, "failed to create RequestBody for $sourcefileUri", e)
             Log.e(javaClass.simpleName, "failed to create RequestBody for $sourcefileUri", e)
         }
         }