Skip to content

Commit ef884e0

Browse files
author
Dmitry Tretyakov
committed
Update TrackingRequestBody for OkHTTP compatibilly
1 parent ec4cad5 commit ef884e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+143
-138
lines changed

app/build.gradle

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ def getGitHubCommit = {
88
def hashOutput = new ByteArrayOutputStream()
99
def changeOutput = new ByteArrayOutputStream()
1010
def gitVersionName
11-
exec {
11+
tasks.register('getHashOutput', Exec) {
1212
commandLine 'git', 'rev-list', '--max-count=1', 'HEAD'
1313
standardOutput = hashOutput
1414
}
15-
exec {
15+
tasks.register('getChangeOutput', Exec) {
1616
commandLine 'git', 'diff-index', '--shortstat', 'HEAD'
1717
standardOutput = changeOutput
1818
}
@@ -31,7 +31,7 @@ def getGitHubCommit = {
3131
}
3232

3333
android {
34-
compileSdk 36
34+
compileSdk = 36
3535
defaultConfig {
3636
applicationId "uk.openvk.android.refresh"
3737
minSdk 21
@@ -95,28 +95,31 @@ android {
9595

9696
dependencies {
9797
implementation 'androidx.appcompat:appcompat:1.7.1'
98-
implementation 'com.google.android.material:material:1.13.0'
98+
//noinspection GradleDependency
99+
implementation 'com.google.android.material:material:1.9.0'
99100
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
100101
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.2.0'
101102
implementation 'androidx.core:core-splashscreen:1.2.0'
102103
implementation 'androidx.annotation:annotation:1.9.1'
103-
implementation 'androidx.compose.material:material:1.10.2'
104-
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
104+
//noinspection GradleDependency
105+
implementation 'androidx.compose.material:material:1.9.0'
106+
implementation 'com.squareup.okhttp3:okhttp:5.3.2'
105107
implementation 'org.droidparts:droidparts:3.2.5'
106-
implementation 'com.github.bumptech.glide:glide:4.12.0'
107-
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.10.0'
108-
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.10.0'
108+
implementation 'com.github.bumptech.glide:glide:5.0.5'
109+
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.0'
110+
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.0'
109111
implementation 'androidx.navigation:navigation-fragment:2.9.7'
110112
implementation 'androidx.navigation:navigation-ui:2.9.7'
111113
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
112114
implementation "androidx.fragment:fragment:1.8.9"
113115
implementation "androidx.preference:preference:1.2.1"
114-
annotationProcessor ('com.github.bumptech.glide:compiler:4.12.0')
116+
annotationProcessor ('com.github.bumptech.glide:compiler:5.0.5')
115117
implementation 'com.github.KieronQuinn:MonetCompat:0.4.1'
116118
implementation 'androidx.palette:palette:1.0.0'
117-
implementation 'org.videolan.android:libvlc-all:3.3.13'
118-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.22"
119-
implementation "androidx.emoji2:emoji2:1.6.0"
119+
implementation 'org.videolan.android:libvlc-all:3.6.5'
120+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.2.0"
121+
//noinspection GradleDependency
122+
implementation "androidx.emoji2:emoji2:1.4.0"
120123
//noinspection GradleDependency
121124
implementation 'com.github.mancj:MaterialSearchBar:0.8.5'
122125
implementation 'com.github.luizgrp:SectionedRecyclerViewAdapter:v3.2.0'

app/src/main/java/uk/openvk/android/refresh/api/OpenVKAPI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import uk.openvk.android.refresh.api.wrappers.UploadManager;
2323

2424
/**
25-
* Copyleft © 2022, 2023 OpenVK Team
26-
* Copyleft © 2022, 2023 Dmitry Tretyakov (aka. Tinelix)
25+
* Copyleft © 2022, 2023, 2026 OpenVK Team
26+
* Copyleft © 2022, 2023, 2026 Dmitry Tretyakov (aka. Tinelix)
2727
*
2828
* This program is free software: you can redistribute it and/or modify it under the terms of
2929
* the GNU Affero General Public License as published by the Free Software Foundation, either

app/src/main/java/uk/openvk/android/refresh/api/TrackingRequestBody.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package uk.openvk.android.refresh.api;
22

3+
import androidx.annotation.NonNull;
4+
35
import java.io.File;
46
import java.io.IOException;
57

68
import okhttp3.MediaType;
79
import okhttp3.RequestBody;
8-
import okhttp3.internal.Util;
910
import okio.Buffer;
1011
import okio.BufferedSink;
1112
import okio.ForwardingSink;
@@ -14,8 +15,8 @@
1415
import okio.Source;
1516

1617
/**
17-
* Copyleft © 2022, 2023 OpenVK Team
18-
* Copyleft © 2022, 2023 Dmitry Tretyakov (aka. Tinelix)
18+
* Copyleft © 2022, 2023, 2026 OpenVK Team
19+
* Copyleft © 2022, 2023, 2026 Dmitry Tretyakov (aka. Tinelix)
1920
*
2021
* This program is free software: you can redistribute it and/or modify it under the terms of
2122
* the GNU Affero General Public License as published by the Free Software Foundation, either
@@ -56,20 +57,21 @@ public long contentLength() {
5657
}
5758

5859
@Override
59-
public void writeTo(BufferedSink sink) throws IOException {
60+
public void writeTo(@NonNull BufferedSink bufferedSink) throws IOException {
61+
Buffer buffer = bufferedSink.getBuffer();
6062
Source source = null;
6163
try {
6264
source = Okio.source(file);
6365
long total = 0;
6466
long read;
6567

66-
while ((read = source.read(sink.buffer(), SEGMENT_SIZE)) != -1) {
68+
while ((read = buffer.read((Buffer) source, SEGMENT_SIZE)) != -1) {
6769
total += read;
68-
sink.flush();
70+
buffer.flush();
6971
this.mListener.onLoad(total, contentLength());
7072
}
71-
} finally {
72-
Util.closeQuietly(source);
73+
} catch (Exception ignored) {
74+
7375
}
7476
}
7577

@@ -79,7 +81,7 @@ public CountingSink(Sink delegate) {
7981
super(delegate);
8082
}
8183
@Override
82-
public void write(Buffer source, long byteCount) throws IOException {
84+
public void write(@NonNull Buffer source, long byteCount) throws IOException {
8385
super.write(source, byteCount);
8486
bytesWritten += byteCount;
8587
mListener.onLoad(bytesWritten, byteCount);

app/src/main/java/uk/openvk/android/refresh/api/attachments/Attachment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package uk.openvk.android.refresh.api.attachments;
22

3-
/** Copyleft © 2022, 2023 OpenVK Team
4-
* Copyleft © 2022, 2023 Dmitry Tretyakov (aka. Tinelix)
3+
/** Copyleft © 2022, 2023, 2026 OpenVK Team
4+
* Copyleft © 2022, 2023, 2026 Dmitry Tretyakov (aka. Tinelix)
55
*
66
* This program is free software: you can redistribute it and/or modify it under the terms of
77
* the GNU Affero General Public License as published by the Free Software Foundation, either

app/src/main/java/uk/openvk/android/refresh/api/attachments/CommonAttachment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package uk.openvk.android.refresh.api.attachments;
22

3-
/** Copyleft © 2022, 2023 OpenVK Team
4-
* Copyleft © 2022, 2023 Dmitry Tretyakov (aka. Tinelix)
3+
/** Copyleft © 2022, 2023, 2026 OpenVK Team
4+
* Copyleft © 2022, 2023, 2026 Dmitry Tretyakov (aka. Tinelix)
55
*
66
* This program is free software: you can redistribute it and/or modify it under the terms of
77
* the GNU Affero General Public License as published by the Free Software Foundation, either

app/src/main/java/uk/openvk/android/refresh/api/attachments/PhotoAttachment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import android.os.Parcel;
55
import android.os.Parcelable;
66

7-
/** Copyleft © 2022, 2023 OpenVK Team
8-
* Copyleft © 2022, 2023 Dmitry Tretyakov (aka. Tinelix)
7+
/** Copyleft © 2022, 2023, 2026 OpenVK Team
8+
* Copyleft © 2022, 2023, 2026 Dmitry Tretyakov (aka. Tinelix)
99
*
1010
* This program is free software: you can redistribute it and/or modify it under the terms of
1111
* the GNU Affero General Public License as published by the Free Software Foundation, either

app/src/main/java/uk/openvk/android/refresh/api/attachments/PollAttachment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import uk.openvk.android.refresh.api.entities.PollAnswer;
66
import uk.openvk.android.refresh.api.wrappers.OvkAPIWrapper;
77

8-
/** Copyleft © 2022, 2023 OpenVK Team
9-
* Copyleft © 2022, 2023 Dmitry Tretyakov (aka. Tinelix)
8+
/** Copyleft © 2022, 2023, 2026 OpenVK Team
9+
* Copyleft © 2022, 2023, 2026 Dmitry Tretyakov (aka. Tinelix)
1010
*
1111
* This program is free software: you can redistribute it and/or modify it under the terms of
1212
* the GNU Affero General Public License as published by the Free Software Foundation, either

app/src/main/java/uk/openvk/android/refresh/api/attachments/VideoAttachment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
import uk.openvk.android.refresh.api.entities.VideoFiles;
88

9-
/** Copyleft © 2022, 2023 OpenVK Team
10-
* Copyleft © 2022, 2023 Dmitry Tretyakov (aka. Tinelix)
9+
/** Copyleft © 2022, 2023, 2026 OpenVK Team
10+
* Copyleft © 2022, 2023, 2026 Dmitry Tretyakov (aka. Tinelix)
1111
*
1212
* This program is free software: you can redistribute it and/or modify it under the terms of
1313
* the GNU Affero General Public License as published by the Free Software Foundation, either

app/src/main/java/uk/openvk/android/refresh/api/counters/AccountCounters.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import android.os.Parcel;
44
import android.os.Parcelable;
55

6-
/** Copyleft © 2022, 2023 OpenVK Team
7-
* Copyleft © 2022, 2023 Dmitry Tretyakov (aka. Tinelix)
6+
/** Copyleft © 2022, 2023, 2026 OpenVK Team
7+
* Copyleft © 2022, 2023, 2026 Dmitry Tretyakov (aka. Tinelix)
88
*
99
* This program is free software: you can redistribute it and/or modify it under the terms of
1010
* the GNU Affero General Public License as published by the Free Software Foundation, either

app/src/main/java/uk/openvk/android/refresh/api/counters/PostCounters.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import android.os.Parcel;
44
import android.os.Parcelable;
55

6-
/** Copyleft © 2022, 2023 OpenVK Team
7-
* Copyleft © 2022, 2023 Dmitry Tretyakov (aka. Tinelix)
6+
/** Copyleft © 2022, 2023, 2026 OpenVK Team
7+
* Copyleft © 2022, 2023, 2026 Dmitry Tretyakov (aka. Tinelix)
88
*
99
* This program is free software: you can redistribute it and/or modify it under the terms of
1010
* the GNU Affero General Public License as published by the Free Software Foundation, either

0 commit comments

Comments
 (0)