2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 05:37:43 +00:00

Revert "Switch desugaring lib to desugar_jdk_libs_nio"

This reverts commit 7efb1f81b5d2cf988a2450b95edc3517b52e51b5.

For some weird reason, mina-sshd works fine without desugaring NIO on
Android 5 but fails with `java.lang.NoClassDefFoundError: Failed resolution
of: Ljava/nio/channels/AsynchronousChannelGroup;` before reverting this
This commit is contained in:
Albert Vaca Cintora 2023-04-05 18:28:42 +02:00
parent 711065a8e6
commit 98ffff5844
2 changed files with 11 additions and 9 deletions

View File

@ -136,7 +136,7 @@ ext {
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.3'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.2'
implementation 'androidx.media:media:1.6.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
@ -155,7 +155,7 @@ dependencies {
implementation 'com.jaredrummler:android-device-names:1.1.9' //To get a human-friendly device name
implementation 'org.apache.sshd:sshd-core:0.14.0'
implementation 'org.apache.mina:mina-core:2.0.19' // Desugar does not backport AsynchronousSocketChannel.
implementation 'org.apache.mina:mina-core:2.0.19' //For some reason, makes sshd-core:0.14.0 work without NIO, which isn't available until Android 8 (api 26)
//implementation('com.github.bright:slf4android:0.1.6') { transitive = true } // For org.apache.sshd debugging
implementation 'org.bouncycastle:bcpkix-jdk15on:1.70' //For SSL certificate generation

View File

@ -165,13 +165,15 @@ public class CompositeReceiveFileJob extends BackgroundJob<Device, Void> {
publishFile(fileDocument, 0);
}
if (currentNetworkPacket.has("lastModified")) {
try {
long lastModified = currentNetworkPacket.getLong("lastModified");
Files.setLastModifiedTime(Paths.get(fileDocument.getUri().getPath()), FileTime.fromMillis(lastModified));
} catch (Exception e) {
Log.e("SharePlugin", "Can't set date on file");
e.printStackTrace();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (currentNetworkPacket.has("lastModified")) {
try {
long lastModified = currentNetworkPacket.getLong("lastModified");
Files.setLastModifiedTime(Paths.get(fileDocument.getUri().getPath()), FileTime.fromMillis(lastModified));
} catch (Exception e) {
Log.e("SharePlugin", "Can't set date on file");
e.printStackTrace();
}
}
}