Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: tests

steps:
- name: gplay
image: ghcr.io/nextcloud/continuous-integration-androidandroidbase:5
image: ghcr.io/nextcloud/continuous-integration-androidbase:3
environment:
LOG_USERNAME:
from_secret: LOG_USERNAME
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.2.0'
classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.7.5'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.4"
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
android.nonFinalResIds=false
android.nonTransitiveRClass=false
android.useAndroidX=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Mar 10 15:14:55 CET 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
2 changes: 1 addition & 1 deletion jitpack.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
jdk: openjdk11
jdk: openjdk17
14 changes: 11 additions & 3 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,14 @@ android {

compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

publishing {
singleVariant('release') {
withSourcesJar()
}
}

productFlavors { }
Expand Down Expand Up @@ -132,10 +138,12 @@ afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
components.getByName('release')

groupId = 'com.nextcloud.android.sso'
artifactId = 'master'

from components.release
}
}
}
Expand Down
19 changes: 2 additions & 17 deletions lib/src/main/java/com/nextcloud/android/sso/api/NextcloudAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,6 @@ public class NextcloudAPI implements AutoCloseable {

private static final String TAG = NextcloudAPI.class.getCanonicalName();

private static final Void NOTHING = getVoidInstance();

private static Void getVoidInstance() {
//noinspection unchecked
final Constructor<Void> constructor = (Constructor<Void>) Void.class.getDeclaredConstructors()[0];
constructor.setAccessible(true);
try {
return constructor.newInstance();
} catch (Exception e) {
throw new IllegalStateException("Should never happen, but did: unable to instantiate Void");
}
}

private final NetworkRequest networkRequest;
private Gson gson;

Expand Down Expand Up @@ -154,16 +141,14 @@ public <T> T convertStreamToTargetEntity(InputStream inputStream, Type targetEnt
result = gson.fromJson(targetReader, targetEntity);
if (result == null) {
if (targetEntity == Object.class) {
//noinspection unchecked
return (T) NOTHING;
return null;
} else {
throw new IllegalStateException("Could not instantiate \"" +
targetEntity.toString() + "\", because response was null.");
}
}
} else {
//noinspection unchecked
result = (T) NOTHING;
result = null;
}
}
return result;
Expand Down
7 changes: 3 additions & 4 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apply plugin: 'com.android.application'
android {
namespace 'com.nextcloud.android.sso.sample'

compileSdkVersion 33
buildToolsVersion "32.0.0"
compileSdk 33

defaultConfig {
applicationId "com.nextcloud.android.sso.sample"
Expand All @@ -24,8 +23,8 @@ android {
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

Expand Down