2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 06:05:12 +00:00

Revert "Switch desugaring lib to desugar_jdk_libs_nio"

This reverts commit 7efb1f81b5.

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 { 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.media:media:1.6.0'
implementation 'androidx.appcompat:appcompat:1.6.1' 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 '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.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('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 implementation 'org.bouncycastle:bcpkix-jdk15on:1.70' //For SSL certificate generation

View File

@@ -165,6 +165,7 @@ public class CompositeReceiveFileJob extends BackgroundJob<Device, Void> {
publishFile(fileDocument, 0); publishFile(fileDocument, 0);
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (currentNetworkPacket.has("lastModified")) { if (currentNetworkPacket.has("lastModified")) {
try { try {
long lastModified = currentNetworkPacket.getLong("lastModified"); long lastModified = currentNetworkPacket.getLong("lastModified");
@@ -174,6 +175,7 @@ public class CompositeReceiveFileJob extends BackgroundJob<Device, Void> {
e.printStackTrace(); e.printStackTrace();
} }
} }
}
boolean listIsEmpty; boolean listIsEmpty;