mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 09:58:08 +00:00
fix: use Apache MINA as IO Service of SSHD Core to fix issues when Android SDK < 26 (Android 8.0)
NIO2 is the default IO Service of SSHD Core. But when Android SDK < 26, NIO2 doesn't exists. So we have to use Apache MINA as IO Service to fix this issue.
This commit is contained in:
parent
aaa750bbc6
commit
cd8237d773
@ -295,6 +295,7 @@ dependencies {
|
|||||||
implementation(libs.apache.sshd.core)
|
implementation(libs.apache.sshd.core)
|
||||||
implementation(libs.apache.sshd.sftp)
|
implementation(libs.apache.sshd.sftp)
|
||||||
implementation(libs.apache.sshd.scp)
|
implementation(libs.apache.sshd.scp)
|
||||||
|
implementation(libs.apache.sshd.mina)
|
||||||
implementation(libs.apache.mina.core) //For some reason, makes sshd-core:0.14.0 work without NIO, which isn't available until Android 8 (api 26)
|
implementation(libs.apache.mina.core) //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
|
||||||
|
@ -76,6 +76,7 @@ apache-mina-core = { module = "org.apache.mina:mina-core", version.ref = "minaCo
|
|||||||
apache-sshd-core = { module = "org.apache.sshd:sshd-core", version.ref = "sshdCore" }
|
apache-sshd-core = { module = "org.apache.sshd:sshd-core", version.ref = "sshdCore" }
|
||||||
apache-sshd-sftp = { module = "org.apache.sshd:sshd-sftp", version.ref = "sshdCore" }
|
apache-sshd-sftp = { module = "org.apache.sshd:sshd-sftp", version.ref = "sshdCore" }
|
||||||
apache-sshd-scp = { module = "org.apache.sshd:sshd-scp", version.ref = "sshdCore" }
|
apache-sshd-scp = { module = "org.apache.sshd:sshd-scp", version.ref = "sshdCore" }
|
||||||
|
apache-sshd-mina = { module = "org.apache.sshd:sshd-mina", version.ref = "sshdCore" }
|
||||||
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockitoCore" }
|
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockitoCore" }
|
||||||
reactive-streams = { module = "org.reactivestreams:reactive-streams", version.ref = "reactiveStreams" }
|
reactive-streams = { module = "org.reactivestreams:reactive-streams", version.ref = "reactiveStreams" }
|
||||||
rxjava = { module = "io.reactivex.rxjava2:rxjava", version.ref = "rxjava" }
|
rxjava = { module = "io.reactivex.rxjava2:rxjava", version.ref = "rxjava" }
|
||||||
|
@ -189,6 +189,10 @@ internal class SimpleSftpServer {
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
System.setProperty(SECURITY_PROVIDER_REGISTRARS, "") // disable BouncyCastle
|
System.setProperty(SECURITY_PROVIDER_REGISTRARS, "") // disable BouncyCastle
|
||||||
|
System.setProperty(
|
||||||
|
"org.apache.sshd.common.io.IoServiceFactoryFactory",
|
||||||
|
"org.apache.sshd.mina.MinaServiceFactoryFactory"
|
||||||
|
) // Use MINA instead NIO2 due to compatibility issues
|
||||||
PathUtils.setUserHomeFolderResolver { Path.of("/") } // TODO: Remove it when SSHD Core is fixed
|
PathUtils.setUserHomeFolderResolver { Path.of("/") } // TODO: Remove it when SSHD Core is fixed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user