Skip to content

Commit f82f151

Browse files
committed
Update dependencies and migrate to Jetpack view binding
Kotlin upgrade was required due to some dependencies that uses OkHttp. This Kotlin upgrade required Gradle upgrade which required migration to Jetpack view binding. As we touched a lot of the UI code due to the migration, we now use as ID always snake case and not camel case and snake case mixed.
1 parent ab54805 commit f82f151

File tree

183 files changed

+1335
-1224
lines changed

Some content is hidden

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

183 files changed

+1335
-1224
lines changed

build.gradle

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
apply from: 'buildsystem/dependencies.gradle'
2-
apply plugin: "com.vanniktech.android.junit.jacoco"
32

43
buildscript {
5-
ext.kotlin_version = '1.7.20'
4+
ext.kotlin_version = '1.9.24'
65
repositories {
76
mavenCentral()
87
google()
98
}
109
dependencies {
11-
classpath 'com.android.tools.build:gradle:7.4.2'
12-
classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0'
13-
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.16.0'
10+
classpath 'com.android.tools.build:gradle:8.4.1'
11+
classpath 'org.greenrobot:greendao-gradle-plugin:3.3.1'
1412
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1513
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1"
1614
}

buildsystem/Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ RUN apt-get update -y && apt-get install -y apt-utils wget git unzip
1919
RUN apt-get update -y && apt-get install -y $(cat docker/dependencies.txt)
2020
RUN docker/print-versions.sh docker/dependencies.txt
2121

22-
ENV ANDROID_COMMAND_LINE_TOOLS_FILENAME commandlinetools-linux-9477386_latest.zip
23-
ENV ANDROID_API_LEVELS android-33
24-
ENV ANDROID_BUILD_TOOLS_VERSION 33.0.2
22+
ENV ANDROID_COMMAND_LINE_TOOLS_FILENAME commandlinetools-linux-10406996_latest.zip
23+
ENV ANDROID_API_LEVELS android-34
24+
ENV ANDROID_BUILD_TOOLS_VERSION 34.0.0
2525

2626
ENV ANDROID_HOME /usr/local/android-sdk-linux
2727
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/cmdline-tools/bin
@@ -35,6 +35,6 @@ RUN yes | sdkmanager --update --sdk_root="${ANDROID_HOME}"
3535
RUN yes | sdkmanager --sdk_root="${ANDROID_HOME}" "platforms;${ANDROID_API_LEVELS}" "build-tools;${ANDROID_BUILD_TOOLS_VERSION}"
3636

3737
RUN yes | sdkmanager --licenses --sdk_root="${ANDROID_HOME}"
38-
RUN update-java-alternatives -s java-1.11.0-openjdk-amd64
38+
RUN update-java-alternatives -s java-1.17.0-openjdk-amd64
3939

4040
RUN rm -rf ${ANDROID_HOME}/tools

buildsystem/dependencies.gradle

+7-7
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ allprojects {
3737
}
3838

3939
ext {
40-
androidBuildToolsVersion = "33.0.2"
40+
androidBuildToolsVersion = "34.0.0"
4141
androidMinSdkVersion = 26
42-
androidTargetSdkVersion = 33
43-
androidCompileSdkVersion = 33
42+
androidTargetSdkVersion = 34
43+
androidCompileSdkVersion = 34
4444

4545
// android and java libs
4646
androidVersion = '4.1.1.4'
@@ -62,9 +62,9 @@ ext {
6262

6363
daggerVersion = '2.51.1'
6464

65-
gsonVersion = '2.10.1'
65+
gsonVersion = '2.11.0'
6666

67-
okHttpVersion = '4.11.0'
67+
okHttpVersion = '4.12.0'
6868
okHttpDigestVersion = '3.1.0'
6969

7070
velocityVersion = '2.3'
@@ -93,7 +93,7 @@ ext {
9393
msgraphVersion = '5.47.0'
9494
msgraphAuthVersion = '4.0.5' // contains com.microsoft.identity:common lib which added opentelemetry in 9.0.0, do we need to fork another lib before updating to >=4.2.0 ???
9595

96-
minIoVersion = '8.5.2'
96+
minIoVersion = '8.5.10'
9797
pcloudVersion = '1.9.2-dev.0001'
9898
staxVersion = '1.2.0' // needed for minIO
9999
commonsCodecVersion = '1.17.0'
@@ -104,7 +104,7 @@ ext {
104104

105105
jUnitVersion = '5.10.2'
106106
assertJVersion = '1.7.1'
107-
mockitoVersion = '5.11.0'
107+
mockitoVersion = '5.12.0'
108108
mockitoKotlinVersion = '5.3.1'
109109
mockitoInlineVersion = '5.2.0'
110110
hamcrestVersion = '1.3'

buildsystem/docker/dependencies.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
openjdk-11-jdk=11.0.16+8-1
1+
openjdk-17-jdk=17.0.11+9-1

buildsystem/docker/sources.list

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# From https://github.com/signalapp/Signal-Android
22

33
#deb http://snapshot.debian.org/archive/debian-security/20220816T110409Z/ bullseye/updates main
4-
deb http://snapshot.debian.org/archive/debian/20220816T041409Z/ unstable main
4+
deb http://snapshot.debian.org/archive/debian/20240522T144944Z/ unstable main

data/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ android {
2020
}
2121

2222
compileOptions {
23-
sourceCompatibility JavaVersion.VERSION_1_8
24-
targetCompatibility JavaVersion.VERSION_1_8
23+
sourceCompatibility JavaVersion.VERSION_17
24+
targetCompatibility JavaVersion.VERSION_17
2525

2626
coreLibraryDesugaringEnabled true
2727
}

data/src/test/java/org/cryptomator/data/cloud/crypto/MasterkeyCryptoCloudProviderTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ internal class MasterkeyCryptoCloudProviderTest {
5757
private val masterkeyV7 =
5858
"{ \"version\": 7, \"scryptSalt\": \"AAAAAAAAAAA=\", \"scryptCostParam\": 32768, \"scryptBlockSize\": 8, \"primaryMasterKey\": \"D2kc+xBoAcVY+M7s74YBEy6l7ga2+Nz+HS5o0TQY3JMW1uQ5jTlLIQ==\", \"hmacMasterKey\": \"D2kc+xBoAcVY+M7s74YBEy6l7ga2+Nz+HS5o0TQY3JMW1uQ5jTlLIQ==\", \"versionMac\": \"cn2sAK6l9p1/w9deJVUuW3h7br056mpv5srvALiYw+g=\"}"
5959
private val vaultConfig =
60-
"eyJraWQiOiJtYXN0ZXJrZXlmaWxlOm1hc3RlcmtleS5jcnlwdG9tYXRvciIsImFsZyI6IkhTMjU2In0.eyJmb3JtYXQiOjgsInNob3J0ZW5pbmdUaHJlc2hvbGQiOjIyMCwiY2lwaGVyQ29tYm8iOiJTSVZfR0NNIn0.-tDU6GyH7Iv-LAOnFdhpxei2Qyd7DLbx4hfY9Wywc_Y"
60+
"eyJraWQiOiJtYXN0ZXJrZXlmaWxlOm1hc3RlcmtleS5jcnlwdG9tYXRvciIsImFsZyI6IkhTMjU2IiwidHlwIjoiSldUIn0.eyJqdGkiOiIiLCJmb3JtYXQiOjgsImNpcGhlckNvbWJvIjoiU0lWX0dDTSIsInNob3J0ZW5pbmdUaHJlc2hvbGQiOjIyMH0.HHMkCqK-kFv_TXAhrzgp8vuPhws_2NswhaAHB9hkKBs"
6161

6262
private var context: Context = mock()
6363
private var cloud: Cloud = mock()

domain/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ android {
1919
}
2020

2121
compileOptions {
22-
sourceCompatibility JavaVersion.VERSION_1_8
23-
targetCompatibility JavaVersion.VERSION_1_8
22+
sourceCompatibility JavaVersion.VERSION_17
23+
targetCompatibility JavaVersion.VERSION_17
2424

2525
coreLibraryDesugaringEnabled true
2626
}

domain/src/main/java/org/cryptomator/domain/usecases/DoLicenseCheck.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.auth0.jwt.JWT;
44
import com.auth0.jwt.algorithms.Algorithm;
5+
import com.auth0.jwt.exceptions.JWTDecodeException;
56
import com.auth0.jwt.exceptions.SignatureVerificationException;
67
import com.auth0.jwt.interfaces.DecodedJWT;
78
import com.auth0.jwt.interfaces.JWTVerifier;
@@ -49,7 +50,7 @@ public LicenseCheck execute() throws BackendException {
4950
JWTVerifier verifier = JWT.require(algorithm).build();
5051
DecodedJWT jwt = verifier.verify(license);
5152
return jwt::getSubject;
52-
} catch (SignatureVerificationException | FatalBackendException e) {
53+
} catch (SignatureVerificationException | JWTDecodeException | FatalBackendException e) {
5354
if (e instanceof SignatureVerificationException && isDesktopSupporterCertificate(license)) {
5455
throw new DesktopSupporterCertificateException(license);
5556
}

generator-api/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
apply plugin: 'java'
22

33
//noinspection GroovyUnusedAssignment
4-
sourceCompatibility = 1.8
4+
sourceCompatibility = 17
55
//noinspection GroovyUnusedAssignment
6-
targetCompatibility = 1.8
6+
targetCompatibility = 17
77

88
dependencies {
99
def dependencies = rootProject.ext.dependencies

generator-api/src/main/java/org/cryptomator/generator/Activity.java

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
@Target(TYPE)
1111
public @interface Activity {
1212

13-
int layout() default -1;
14-
1513
boolean secure() default true;
1614

1715
}

generator-api/src/main/java/org/cryptomator/generator/Dialog.java

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
@Target(TYPE)
1111
public @interface Dialog {
1212

13-
int value();
14-
1513
boolean secure() default true;
1614

1715
}

generator-api/src/main/java/org/cryptomator/generator/Fragment.java

-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,4 @@
1010
@Target(TYPE)
1111
public @interface Fragment {
1212

13-
int value();
14-
1513
}

generator/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
apply plugin: 'java'
22

33
//noinspection GroovyUnusedAssignment
4-
sourceCompatibility = 1.8
4+
sourceCompatibility = 17
55
//noinspection GroovyUnusedAssignment
6-
targetCompatibility = 1.8
6+
targetCompatibility = 17
77

88
repositories {
99
mavenCentral()

generator/src/main/java/org/cryptomator/generator/ActivityProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import javax.tools.JavaFileObject;
1919

2020
@SupportedAnnotationTypes("org.cryptomator.generator.Activity")
21-
@SupportedSourceVersion(SourceVersion.RELEASE_8)
21+
@SupportedSourceVersion(SourceVersion.RELEASE_17)
2222
public class ActivityProcessor extends BaseProcessor {
2323

2424
@Override

generator/src/main/java/org/cryptomator/generator/CallbackProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import javax.tools.JavaFileObject;
2323

2424
@SupportedAnnotationTypes("org.cryptomator.generator.Callback")
25-
@SupportedSourceVersion(SourceVersion.RELEASE_8)
25+
@SupportedSourceVersion(SourceVersion.RELEASE_17)
2626
public class CallbackProcessor extends BaseProcessor {
2727

2828
@Override

generator/src/main/java/org/cryptomator/generator/FragmentProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import javax.tools.JavaFileObject;
1919

2020
@SupportedAnnotationTypes("org.cryptomator.generator.Fragment")
21-
@SupportedSourceVersion(SourceVersion.RELEASE_8)
21+
@SupportedSourceVersion(SourceVersion.RELEASE_17)
2222
public class FragmentProcessor extends BaseProcessor {
2323

2424
@Override

generator/src/main/java/org/cryptomator/generator/InstanceStateProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import javax.tools.JavaFileObject;
2020

2121
@SupportedAnnotationTypes("org.cryptomator.generator.InstanceState")
22-
@SupportedSourceVersion(SourceVersion.RELEASE_8)
22+
@SupportedSourceVersion(SourceVersion.RELEASE_17)
2323
public class InstanceStateProcessor extends BaseProcessor {
2424

2525
@Override

generator/src/main/java/org/cryptomator/generator/IntentProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import javax.tools.JavaFileObject;
2323

2424
@SupportedAnnotationTypes("org.cryptomator.generator.Intent")
25-
@SupportedSourceVersion(SourceVersion.RELEASE_8)
25+
@SupportedSourceVersion(SourceVersion.RELEASE_17)
2626
public class IntentProcessor extends BaseProcessor {
2727

2828
@Override

generator/src/main/java/org/cryptomator/generator/UseCaseProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import javax.tools.JavaFileObject;
1616

1717
@SupportedAnnotationTypes("org.cryptomator.generator.UseCase")
18-
@SupportedSourceVersion(SourceVersion.RELEASE_8)
18+
@SupportedSourceVersion(SourceVersion.RELEASE_17)
1919
public class UseCaseProcessor extends BaseProcessor {
2020

2121
@Override

gradle.properties

+3
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ android.useAndroidX=true
33
android.enableJetifier=true
44
android.jetifier.ignorelist=jackson-core,fastdoubleparser
55
kapt.incremental.apt=false
6+
android.defaults.buildfeatures.buildconfig=true
7+
android.nonTransitiveRClass=false
8+
android.nonFinalResIds=false

gradle/wrapper/gradle-wrapper.jar

-17.7 KB
Binary file not shown.
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

+17-12
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
87-
88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
9088

9189
# Use the maximum available, or set MAX_FD != -1 to use that value.
9290
MAX_FD=maximum
@@ -133,26 +131,29 @@ location of your Java installation."
133131
fi
134132
else
135133
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134+
if ! command -v java >/dev/null 2>&1
135+
then
136+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137137
138138
Please set the JAVA_HOME variable in your environment to match the
139139
location of your Java installation."
140+
fi
140141
fi
141142

142143
# Increase the maximum file descriptors if we can.
143144
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144145
case $MAX_FD in #(
145146
max*)
146147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
148149
MAX_FD=$( ulimit -H -n ) ||
149150
warn "Could not query maximum file descriptor limit"
150151
esac
151152
case $MAX_FD in #(
152153
'' | soft) :;; #(
153154
*)
154155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
156157
ulimit -n "$MAX_FD" ||
157158
warn "Could not set maximum file descriptor limit to $MAX_FD"
158159
esac
@@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
197198
done
198199
fi
199200

200-
# Collect all arguments for the java command;
201-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202-
# shell script including quotes and variable substitutions, so put them in
203-
# double quotes to make sure that they get re-expanded; and
204-
# * put everything else in single quotes, so that it's not re-expanded.
201+
202+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204+
205+
# Collect all arguments for the java command:
206+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207+
# and any embedded shellness will be escaped.
208+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209+
# treated as '${Hostname}' itself on the command line.
205210

206211
set -- \
207212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

gradlew.bat

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
4343
%JAVA_EXE% -version >NUL 2>&1
4444
if %ERRORLEVEL% equ 0 goto execute
4545

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5151

5252
goto fail
5353

@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5757

5858
if exist "%JAVA_EXE%" goto execute
5959

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6565

6666
goto fail
6767

0 commit comments

Comments
 (0)