diff options
-rw-r--r-- | build.gradle | 11 | ||||
-rw-r--r-- | settings.gradle | 6 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/http/HttpConnection.java | 21 | ||||
-rw-r--r-- | src/main/res/layout/activity_contact_details.xml | 3 |
4 files changed, 19 insertions, 22 deletions
diff --git a/build.gradle b/build.gradle index fd5805e8..a37b92c4 100644 --- a/build.gradle +++ b/build.gradle @@ -28,13 +28,12 @@ repositories { } dependencies { - compile project(':libs/minidns') - compile project(':libs/openpgp-api-lib') - compile project(':libs/MemorizingTrustManager') + compile project(':libs:minidns') + compile project(':libs:openpgp-api-lib') + compile project(':libs:MemorizingTrustManager') compile 'com.android.support:support-v13:19.1.0' compile 'org.bouncycastle:bcprov-jdk15on:1.50' compile 'net.java:otr4j:0.21' - compile fileTree(dir: 'libs', include: ['*.jar']) } android { @@ -80,10 +79,6 @@ android { } buildTypes { - release { - runProguard true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' - } applicationVariants.all { variant -> def fileName = variant.packageApplication.outputFile.name.replace(".apk", "-" + defaultConfig.versionName + ".apk") diff --git a/settings.gradle b/settings.gradle index 45b0e9e0..5a34181a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,5 @@ -include ':libs/MemorizingTrustManager' -include ':libs/minidns' -include ':libs/openpgp-api-lib' +include ':libs:MemorizingTrustManager' +include ':libs:minidns' +include ':libs:openpgp-api-lib' rootProject.name = 'Conversations' diff --git a/src/main/java/eu/siacs/conversations/http/HttpConnection.java b/src/main/java/eu/siacs/conversations/http/HttpConnection.java index 0810e167..24eb5ed3 100644 --- a/src/main/java/eu/siacs/conversations/http/HttpConnection.java +++ b/src/main/java/eu/siacs/conversations/http/HttpConnection.java @@ -1,5 +1,11 @@ package eu.siacs.conversations.http; +import android.content.Intent; +import android.graphics.BitmapFactory; +import android.net.Uri; + +import org.apache.http.conn.ssl.StrictHostnameVerifier; + import java.io.BufferedInputStream; import java.io.IOException; import java.io.OutputStream; @@ -15,12 +21,6 @@ import javax.net.ssl.SSLContext; import javax.net.ssl.SSLHandshakeException; import javax.net.ssl.X509TrustManager; -import org.apache.http.conn.ssl.StrictHostnameVerifier; - -import android.content.Intent; -import android.graphics.BitmapFactory; -import android.net.Uri; - import eu.siacs.conversations.entities.Downloadable; import eu.siacs.conversations.entities.DownloadableFile; import eu.siacs.conversations.entities.Message; @@ -74,7 +74,7 @@ public class HttpConnection implements Downloadable { if (reference != null && reference.length() == 96) { this.file.setKey(CryptoHelper.hexToBytes(reference)); } - + if (this.message.getEncryption() == Message.ENCRYPTION_OTR && this.file.getKey() == null) { this.message.setEncryption(Message.ENCRYPTION_NONE); @@ -113,7 +113,7 @@ public class HttpConnection implements Downloadable { } private void setupTrustManager(HttpsURLConnection connection, - boolean interactive) { + boolean interactive) { X509TrustManager trustManager; HostnameVerifier hostnameVerifier; if (interactive) { @@ -131,7 +131,7 @@ public class HttpConnection implements Downloadable { } try { SSLContext sc = SSLContext.getInstance("TLS"); - sc.init(null, new X509TrustManager[] { trustManager }, + sc.init(null, new X509TrustManager[]{trustManager}, mXmppConnectionService.getRNG()); connection.setSSLSocketFactory(sc.getSocketFactory()); connection.setHostnameVerifier(hostnameVerifier); @@ -230,6 +230,9 @@ public class HttpConnection implements Downloadable { BufferedInputStream is = new BufferedInputStream( connection.getInputStream()); OutputStream os = file.createOutputStream(); + if (os == null) { + throw new IOException(); + } int count = -1; byte[] buffer = new byte[1024]; while ((count = is.read(buffer)) != -1) { diff --git a/src/main/res/layout/activity_contact_details.xml b/src/main/res/layout/activity_contact_details.xml index f7cb2198..2b94e6f6 100644 --- a/src/main/res/layout/activity_contact_details.xml +++ b/src/main/res/layout/activity_contact_details.xml @@ -63,7 +63,6 @@ android:id="@+id/details_lastseen" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:singleLine="true" android:textColor="@color/secondarytext" android:textSize="?attr/TextSizeBody" /> </LinearLayout> @@ -111,4 +110,4 @@ </LinearLayout> </LinearLayout> -</ScrollView>
\ No newline at end of file +</ScrollView> |