mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 13:47:41 +00:00
Removed conscrypt
Fixed issue in netty, currently use custom build netty Removed multi dex
This commit is contained in:
parent
7c9d6630d0
commit
50fcea2cd9
@ -33,7 +33,6 @@
|
|||||||
android:icon="@drawable/icon"
|
android:icon="@drawable/icon"
|
||||||
android:label="KDE Connect"
|
android:label="KDE Connect"
|
||||||
android:theme="@style/KdeConnectTheme"
|
android:theme="@style/KdeConnectTheme"
|
||||||
android:name="android.support.multidex.MultiDexApplication"
|
|
||||||
>
|
>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
|
@ -18,7 +18,6 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 9
|
minSdkVersion 9
|
||||||
targetSdkVersion 22
|
targetSdkVersion 22
|
||||||
multiDexEnabled true
|
|
||||||
}
|
}
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
@ -53,17 +52,16 @@ dependencies {
|
|||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
compile 'com.android.support:multidex:1.0.0'
|
|
||||||
compile 'com.android.support:support-v4:22.2.0'
|
compile 'com.android.support:support-v4:22.2.0'
|
||||||
compile 'com.android.support:appcompat-v7:22.2.0'
|
compile 'com.android.support:appcompat-v7:22.2.0'
|
||||||
compile 'com.madgag.spongycastle:pkix:1.52.0.0'
|
compile 'com.madgag.spongycastle:pkix:1.52.0.0'
|
||||||
compile 'org.apache.sshd:sshd-core:0.8.0'
|
compile 'org.apache.sshd:sshd-core:0.8.0'
|
||||||
compile 'org.bouncycastle:bcprov-jdk16:1.46'
|
compile 'org.bouncycastle:bcprov-jdk16:1.46'
|
||||||
compile 'io.netty:netty-all:4.0.29.Final'
|
// compile 'io.netty:netty-all:4.0.29.Final' // We use a custom build netty in libs directory due to ssl related bug
|
||||||
compile fileTree(dir: 'libs', include: '*.jar')
|
// compile fileTree(include: '*.jar', dir: 'libs')
|
||||||
|
|
||||||
androidTestCompile 'org.mockito:mockito-core:1.10.19'
|
androidTestCompile 'org.mockito:mockito-core:1.10.19'
|
||||||
// Because mockito has some problems with dex environment
|
// Because mockito has some problems with dex environment
|
||||||
androidTestCompile 'com.google.dexmaker:dexmaker:1.1'
|
androidTestCompile 'com.google.dexmaker:dexmaker:1.1'
|
||||||
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.1'
|
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.1'
|
||||||
|
compile files('libs/netty-handler.jar')
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
@ -1,26 +0,0 @@
|
|||||||
Conscrypt
|
|
||||||
|
|
||||||
https://conscrypt.org/
|
|
||||||
|
|
||||||
Conscrypt is a Java Security Provider that uses OpenSSL. Since Android uses it internally too, but that is not updated. These libraries are built directly form AOSP source on 28-Jun-2015.
|
|
||||||
|
|
||||||
The source for conscrypt is availble at https://android.googlesource.com/platform/external/conscrypt
|
|
||||||
|
|
||||||
The structure of two jar files used here is as follows :
|
|
||||||
conscrypt.jar is the Java library for OpenSSL Provider.
|
|
||||||
conscrypt_jni.jar is shared library for JNI for OpenSSL Provider, packed into a jar.
|
|
||||||
|
|
||||||
To update these libraries, they can be diretly built from AOSP with build type as "user"
|
|
||||||
|
|
||||||
To build this library, follow these steps :
|
|
||||||
1. Download the AOSP source,proceed as mentioned on aosp site.
|
|
||||||
2. Run ". build/envsetup.sh", from source root
|
|
||||||
3. Run "lunch aosp_<architecture>-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/<architecture>/libconscrypt_jni.so, and compress lib directory as jar archive.
|
|
||||||
|
|
Binary file not shown.
BIN
libs/netty-all.jar
Normal file
BIN
libs/netty-all.jar
Normal file
Binary file not shown.
1
proguard-rules.pro
vendored
1
proguard-rules.pro
vendored
@ -27,7 +27,6 @@
|
|||||||
-dontwarn org.bouncycastle.**
|
-dontwarn org.bouncycastle.**
|
||||||
-dontwarn org.slf4j.**
|
-dontwarn org.slf4j.**
|
||||||
-dontwarn io.netty.**
|
-dontwarn io.netty.**
|
||||||
-dontwarn org.conscrypt.**
|
|
||||||
-dontwarn org.spongycastle.**
|
-dontwarn org.spongycastle.**
|
||||||
|
|
||||||
-keepattributes SourceFile,LineNumberTable
|
-keepattributes SourceFile,LineNumberTable
|
||||||
|
@ -30,7 +30,6 @@ import android.os.IBinder;
|
|||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.conscrypt.OpenSSLProvider;
|
|
||||||
import org.kde.kdeconnect.Backends.BaseLink;
|
import org.kde.kdeconnect.Backends.BaseLink;
|
||||||
import org.kde.kdeconnect.Backends.BaseLinkProvider;
|
import org.kde.kdeconnect.Backends.BaseLinkProvider;
|
||||||
import org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider;
|
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.Helpers.SecurityHelpers.SslHelper;
|
||||||
import org.kde.kdeconnect.UserInterface.MainSettingsActivity;
|
import org.kde.kdeconnect.UserInterface.MainSettingsActivity;
|
||||||
|
|
||||||
import java.security.Security;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -200,12 +198,6 @@ public class BackgroundService extends Service {
|
|||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.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
|
// Register screen on listener
|
||||||
IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);
|
IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);
|
||||||
registerReceiver(new KdeConnectBroadcastReceiver(), filter);
|
registerReceiver(new KdeConnectBroadcastReceiver(), filter);
|
||||||
|
@ -230,9 +230,9 @@ public class DeviceHelper {
|
|||||||
humanReadableNames.put("MOTWX435KT","Motorola Triumph");
|
humanReadableNames.put("MOTWX435KT","Motorola Triumph");
|
||||||
humanReadableNames.put("N3","Star NO.1 N3");
|
humanReadableNames.put("N3","Star NO.1 N3");
|
||||||
humanReadableNames.put("N860","ZTE Warp N860");
|
humanReadableNames.put("N860","ZTE Warp N860");
|
||||||
humanReadableNames.put("NEXUS\ 4","Nexus 4");
|
humanReadableNames.put("NEXUS_4","Nexus 4");
|
||||||
humanReadableNames.put("NEXUS\ 5","Nexus 5");
|
humanReadableNames.put("NEXUS_5","Nexus 5");
|
||||||
humanReadableNames.put("NEXUS\ 6","Nexus 6");
|
humanReadableNames.put("NEXUS_6","Nexus 6");
|
||||||
humanReadableNames.put("Nexus_10","Google Nexus 10");
|
humanReadableNames.put("Nexus_10","Google Nexus 10");
|
||||||
humanReadableNames.put("Nexus_4","Google Nexus 4");
|
humanReadableNames.put("Nexus_4","Google Nexus 4");
|
||||||
humanReadableNames.put("Nexus_7","Asus Nexus 7");
|
humanReadableNames.put("Nexus_7","Asus Nexus 7");
|
||||||
|
@ -27,8 +27,6 @@ import android.provider.Settings;
|
|||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
import android.util.Log;
|
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.X500NameBuilder;
|
||||||
import org.spongycastle.asn1.x500.style.BCStyle;
|
import org.spongycastle.asn1.x500.style.BCStyle;
|
||||||
import org.spongycastle.cert.X509CertificateHolder;
|
import org.spongycastle.cert.X509CertificateHolder;
|
||||||
@ -53,7 +51,6 @@ import java.util.Formatter;
|
|||||||
import javax.net.ssl.KeyManagerFactory;
|
import javax.net.ssl.KeyManagerFactory;
|
||||||
import javax.net.ssl.SSLContext;
|
import javax.net.ssl.SSLContext;
|
||||||
import javax.net.ssl.SSLEngine;
|
import javax.net.ssl.SSLEngine;
|
||||||
import javax.net.ssl.SSLException;
|
|
||||||
import javax.net.ssl.TrustManager;
|
import javax.net.ssl.TrustManager;
|
||||||
import javax.net.ssl.TrustManagerFactory;
|
import javax.net.ssl.TrustManagerFactory;
|
||||||
import javax.net.ssl.X509TrustManager;
|
import javax.net.ssl.X509TrustManager;
|
||||||
@ -147,7 +144,7 @@ public class SslHelper {
|
|||||||
keyStore.setKeyEntry("key", privateKey, "".toCharArray(), new java.security.cert.Certificate[]{certificate});
|
keyStore.setKeyEntry("key", privateKey, "".toCharArray(), new java.security.cert.Certificate[]{certificate});
|
||||||
// Set certificate if device trusted
|
// Set certificate if device trusted
|
||||||
if (remoteDeviceCertificate != null){
|
if (remoteDeviceCertificate != null){
|
||||||
keyStore.setCertificateEntry("remoteCertificate", remoteDeviceCertificate);
|
keyStore.setCertificateEntry(deviceId, remoteDeviceCertificate);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup key manager factory
|
// Setup key manager factory
|
||||||
@ -176,7 +173,7 @@ public class SslHelper {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
SSLContext tlsContext = SSLContext.getInstance("TLSv1.2");
|
SSLContext tlsContext = SSLContext.getInstance("TLS");
|
||||||
if (isDeviceTrusted) {
|
if (isDeviceTrusted) {
|
||||||
tlsContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), new SecureRandom());
|
tlsContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), new SecureRandom());
|
||||||
}else {
|
}else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user