diff --git a/AndroidManifest.xml b/AndroidManifest.xml index bf56ee68..0da70ba4 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -33,7 +33,6 @@ android:icon="@drawable/icon" android:label="KDE Connect" android:theme="@style/KdeConnectTheme" - android:name="android.support.multidex.MultiDexApplication" > -user", the architecture can be arm, x86, mips -4. Run "cd external/conscrypt" -5. Run "mma -j8" -6. conscrypt.jar can be found at $OUT_DIR/target/common/obj/JAVA_LIBRARIES/ conscrypt_unbundled_intermediates/javalib.jar -7. For arm, libconscrypt_jni.so will be at $OUT_DIR/target/product/generic/obj/lib/libconscrypt_jni.so -For x86, libconscrypt_jni.so will be at $OUT_DIR/target/product/generic_x86/obj/lib/libconscrypt_jni.so -For mips, libconscrypt_jni.so will be at $OUT_DIR/target/product/generic_mips/obj/lib/libconscrypt_jni.so -Put these libraries under lib//libconscrypt_jni.so, and compress lib directory as jar archive. - diff --git a/libs/conscrypt_jni.jar b/libs/conscrypt_jni.jar deleted file mode 100644 index 0770464f..00000000 Binary files a/libs/conscrypt_jni.jar and /dev/null differ diff --git a/libs/netty-all.jar b/libs/netty-all.jar new file mode 100644 index 00000000..42484bac Binary files /dev/null and b/libs/netty-all.jar differ diff --git a/proguard-rules.pro b/proguard-rules.pro index f97fb0fb..5a0ad26d 100644 --- a/proguard-rules.pro +++ b/proguard-rules.pro @@ -27,7 +27,6 @@ -dontwarn org.bouncycastle.** -dontwarn org.slf4j.** -dontwarn io.netty.** --dontwarn org.conscrypt.** -dontwarn org.spongycastle.** -keepattributes SourceFile,LineNumberTable diff --git a/src/org/kde/kdeconnect/BackgroundService.java b/src/org/kde/kdeconnect/BackgroundService.java index 76add408..75afa8cc 100644 --- a/src/org/kde/kdeconnect/BackgroundService.java +++ b/src/org/kde/kdeconnect/BackgroundService.java @@ -30,7 +30,6 @@ import android.os.IBinder; import android.preference.PreferenceManager; import android.util.Log; -import org.conscrypt.OpenSSLProvider; import org.kde.kdeconnect.Backends.BaseLink; import org.kde.kdeconnect.Backends.BaseLinkProvider; import org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider; @@ -38,7 +37,6 @@ import org.kde.kdeconnect.Helpers.SecurityHelpers.RsaHelper; import org.kde.kdeconnect.Helpers.SecurityHelpers.SslHelper; import org.kde.kdeconnect.UserInterface.MainSettingsActivity; -import java.security.Security; import java.util.ArrayList; import java.util.HashMap; import java.util.Set; @@ -200,12 +198,6 @@ public class BackgroundService extends Service { public void onCreate() { super.onCreate(); - try { - Security.insertProviderAt(new OpenSSLProvider("KDEConnect SSL Provider"), 1); - } catch (Exception e) { - Log.e("KDE/BackgroundService", "Cannot add security provider"); - } - // Register screen on listener IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON); registerReceiver(new KdeConnectBroadcastReceiver(), filter); diff --git a/src/org/kde/kdeconnect/Helpers/DeviceHelper.java b/src/org/kde/kdeconnect/Helpers/DeviceHelper.java index 409ccb44..09d391b0 100644 --- a/src/org/kde/kdeconnect/Helpers/DeviceHelper.java +++ b/src/org/kde/kdeconnect/Helpers/DeviceHelper.java @@ -230,9 +230,9 @@ public class DeviceHelper { humanReadableNames.put("MOTWX435KT","Motorola Triumph"); humanReadableNames.put("N3","Star NO.1 N3"); humanReadableNames.put("N860","ZTE Warp N860"); - humanReadableNames.put("NEXUS\ 4","Nexus 4"); - humanReadableNames.put("NEXUS\ 5","Nexus 5"); - humanReadableNames.put("NEXUS\ 6","Nexus 6"); + humanReadableNames.put("NEXUS_4","Nexus 4"); + humanReadableNames.put("NEXUS_5","Nexus 5"); + humanReadableNames.put("NEXUS_6","Nexus 6"); humanReadableNames.put("Nexus_10","Google Nexus 10"); humanReadableNames.put("Nexus_4","Google Nexus 4"); humanReadableNames.put("Nexus_7","Asus Nexus 7"); diff --git a/src/org/kde/kdeconnect/Helpers/SecurityHelpers/SslHelper.java b/src/org/kde/kdeconnect/Helpers/SecurityHelpers/SslHelper.java index b741d502..c2e41132 100644 --- a/src/org/kde/kdeconnect/Helpers/SecurityHelpers/SslHelper.java +++ b/src/org/kde/kdeconnect/Helpers/SecurityHelpers/SslHelper.java @@ -27,8 +27,6 @@ import android.provider.Settings; import android.util.Base64; import android.util.Log; -import org.kde.kdeconnect.UserInterface.MainActivity; -import org.kde.kdeconnect.UserInterface.MainSettingsActivity; import org.spongycastle.asn1.x500.X500NameBuilder; import org.spongycastle.asn1.x500.style.BCStyle; import org.spongycastle.cert.X509CertificateHolder; @@ -53,7 +51,6 @@ import java.util.Formatter; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLEngine; -import javax.net.ssl.SSLException; import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.X509TrustManager; @@ -147,7 +144,7 @@ public class SslHelper { keyStore.setKeyEntry("key", privateKey, "".toCharArray(), new java.security.cert.Certificate[]{certificate}); // Set certificate if device trusted if (remoteDeviceCertificate != null){ - keyStore.setCertificateEntry("remoteCertificate", remoteDeviceCertificate); + keyStore.setCertificateEntry(deviceId, remoteDeviceCertificate); } // Setup key manager factory @@ -176,7 +173,7 @@ public class SslHelper { } }; - SSLContext tlsContext = SSLContext.getInstance("TLSv1.2"); + SSLContext tlsContext = SSLContext.getInstance("TLS"); if (isDeviceTrusted) { tlsContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), new SecureRandom()); }else {