mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-29 13:17:43 +00:00
Hopefully fixed crash in Android 8.1
This commit is contained in:
parent
55a0ad657e
commit
f5254e504d
@ -253,7 +253,9 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
//Handshake is blocking, so do it on another thread and free this thread to keep receiving new connection
|
//Handshake is blocking, so do it on another thread and free this thread to keep receiving new connection
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
|
synchronized (this) {
|
||||||
sslsocket.startHandshake();
|
sslsocket.startHandshake();
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("KDE/LanLinkProvider", "Handshake failed with " + identityPacket.getString("deviceName"));
|
Log.e("KDE/LanLinkProvider", "Handshake failed with " + identityPacket.getString("deviceName"));
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -286,7 +288,7 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
* @param connectionOrigin which side started this connection
|
* @param connectionOrigin which side started this connection
|
||||||
* @throws IOException if an exception is thrown by {@link LanLink#reset(Socket, LanLink.ConnectionStarted)}
|
* @throws IOException if an exception is thrown by {@link LanLink#reset(Socket, LanLink.ConnectionStarted)}
|
||||||
*/
|
*/
|
||||||
private synchronized void addLink(final NetworkPacket identityPacket, Socket socket, LanLink.ConnectionStarted connectionOrigin) throws IOException {
|
private void addLink(final NetworkPacket identityPacket, Socket socket, LanLink.ConnectionStarted connectionOrigin) throws IOException {
|
||||||
|
|
||||||
String deviceId = identityPacket.getString("deviceId");
|
String deviceId = identityPacket.getString("deviceId");
|
||||||
LanLink currentLink = visibleComputers.get(deviceId);
|
LanLink currentLink = visibleComputers.get(deviceId);
|
||||||
|
@ -42,6 +42,7 @@ import org.spongycastle.operator.jcajce.JcaContentSignerBuilder;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
|
import java.net.SocketException;
|
||||||
import java.security.KeyStore;
|
import java.security.KeyStore;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.security.PrivateKey;
|
import java.security.PrivateKey;
|
||||||
@ -201,7 +202,7 @@ public class SslHelper {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void configureSslSocket(SSLSocket socket, boolean isDeviceTrusted, boolean isClient) {
|
public static void configureSslSocket(SSLSocket socket, boolean isDeviceTrusted, boolean isClient) throws SocketException {
|
||||||
|
|
||||||
socket.setEnabledProtocols(new String[]{"TLSv1"}); //Newer TLS versions are only supported on API 16+
|
socket.setEnabledProtocols(new String[]{"TLSv1"}); //Newer TLS versions are only supported on API 16+
|
||||||
|
|
||||||
@ -223,6 +224,8 @@ public class SslHelper {
|
|||||||
}
|
}
|
||||||
socket.setEnabledCipherSuites(supportedCiphers.toArray(new String[supportedCiphers.size()]));
|
socket.setEnabledCipherSuites(supportedCiphers.toArray(new String[supportedCiphers.size()]));
|
||||||
|
|
||||||
|
socket.setSoTimeout(1000);
|
||||||
|
|
||||||
if (isClient) {
|
if (isClient) {
|
||||||
socket.setUseClientMode(true);
|
socket.setUseClientMode(true);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user