From f493a790befb2910125a23880d5a84e9065edde0 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Mon, 1 Jun 2020 16:38:28 +1000 Subject: [PATCH 01/11] Potentially fix message reception issue --- .../securesms/loki/protocol/LokiSessionResetImplementation.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/loki/protocol/LokiSessionResetImplementation.kt b/src/org/thoughtcrime/securesms/loki/protocol/LokiSessionResetImplementation.kt index 2a33dda63f..067a25b27c 100644 --- a/src/org/thoughtcrime/securesms/loki/protocol/LokiSessionResetImplementation.kt +++ b/src/org/thoughtcrime/securesms/loki/protocol/LokiSessionResetImplementation.kt @@ -26,8 +26,8 @@ class LokiSessionResetImplementation(private val context: Context) : LokiSession } override fun validatePreKeySignalMessage(sender: String, message: PreKeySignalMessage) { - val preKeyRecord = DatabaseFactory.getLokiPreKeyRecordDatabase(context).getPreKeyRecord(sender) - check(preKeyRecord != null) { "Received a background message from a user without an associated pre key record." } + val preKeyRecord = DatabaseFactory.getLokiPreKeyRecordDatabase(context).getPreKeyRecord(sender) ?: return + // TODO: Checking that the pre key record isn't null is causing issues when it shouldn't check(preKeyRecord.id == (message.preKeyId ?: -1)) { "Received a background message from an unknown source." } } } \ No newline at end of file From edd20dd83c1620451cc39fd75bdac1c0a53ad5d3 Mon Sep 17 00:00:00 2001 From: Haafingar Date: Wed, 3 Jun 2020 13:06:03 +1000 Subject: [PATCH 02/11] increase quality parameter --- src/org/thoughtcrime/securesms/util/BitmapUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/util/BitmapUtil.java b/src/org/thoughtcrime/securesms/util/BitmapUtil.java index 4423405d73..a0997414a5 100644 --- a/src/org/thoughtcrime/securesms/util/BitmapUtil.java +++ b/src/org/thoughtcrime/securesms/util/BitmapUtil.java @@ -255,7 +255,7 @@ public class BitmapUtil { public static InputStream toCompressedJpeg(Bitmap bitmap) { ByteArrayOutputStream thumbnailBytes = new ByteArrayOutputStream(); - bitmap.compress(CompressFormat.JPEG, 85, thumbnailBytes); + bitmap.compress(CompressFormat.JPEG, 95, thumbnailBytes); return new ByteArrayInputStream(thumbnailBytes.toByteArray()); } From 63941bc96a958cd94f8f2d4ed6a10d9c4345c2ff Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Thu, 4 Jun 2020 18:24:01 +1000 Subject: [PATCH 03/11] Update build number --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a9709b8d36..56d15ee827 100644 --- a/build.gradle +++ b/build.gradle @@ -192,7 +192,7 @@ dependencies { implementation "com.opencsv:opencsv:$opencsv_version" } -def canonicalVersionCode = 53 +def canonicalVersionCode = 54 def canonicalVersionName = "1.2.1" def postFixSize = 10 From 9c086df6bb9b0611bcedc2e4a213b5989af46e68 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Thu, 4 Jun 2020 21:36:22 +1000 Subject: [PATCH 04/11] Fix Gradle issue --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index 56d15ee827..3b26c9221a 100644 --- a/build.gradle +++ b/build.gradle @@ -73,6 +73,7 @@ configurations.all { exclude group: "org.whispersystems", module: "signal-protocol-android" exclude group: "org.signal", module: "signal-metadata-java" exclude group: "org.signal", module: "signal-metadata-android" + exclude module: "commons-logging" } dependencies { From 58c6e1ce1e71150848ec62614ceb0c2d6b7a9a10 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Fri, 5 Jun 2020 16:10:16 +1000 Subject: [PATCH 05/11] Also increase MAX_COMPRESSION_QUALITY --- src/org/thoughtcrime/securesms/util/BitmapUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/util/BitmapUtil.java b/src/org/thoughtcrime/securesms/util/BitmapUtil.java index a0997414a5..90a51d9720 100644 --- a/src/org/thoughtcrime/securesms/util/BitmapUtil.java +++ b/src/org/thoughtcrime/securesms/util/BitmapUtil.java @@ -40,7 +40,7 @@ public class BitmapUtil { private static final String TAG = BitmapUtil.class.getSimpleName(); - private static final int MAX_COMPRESSION_QUALITY = 90; + private static final int MAX_COMPRESSION_QUALITY = 95; private static final int MIN_COMPRESSION_QUALITY = 45; private static final int MAX_COMPRESSION_ATTEMPTS = 5; private static final int MIN_COMPRESSION_QUALITY_DECREASE = 5; From 02ceef278c4bbe98d6e641b9464c7894481de151 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Tue, 9 Jun 2020 09:04:28 +1000 Subject: [PATCH 06/11] Make PN mode screen scroll --- res/layout-sw400dp/activity_pn_mode.xml | 186 ++++++++++++----------- res/layout/activity_pn_mode.xml | 190 ++++++++++++------------ 2 files changed, 186 insertions(+), 190 deletions(-) diff --git a/res/layout-sw400dp/activity_pn_mode.xml b/res/layout-sw400dp/activity_pn_mode.xml index 8edc9267df..e2e5433453 100644 --- a/res/layout-sw400dp/activity_pn_mode.xml +++ b/res/layout-sw400dp/activity_pn_mode.xml @@ -1,116 +1,114 @@ - - - - - - - + android:layout_height="match_parent"> + android:background="@drawable/default_session_background" + android:orientation="vertical"> + + + android:text="@string/activity_pn_mode_explanation" /> - + android:layout_marginLeft="@dimen/very_large_spacing" + android:layout_marginTop="20dp" + android:layout_marginRight="@dimen/very_large_spacing" + android:padding="12dp" + android:orientation="vertical" + android:background="@drawable/pn_option_background"> - + + + + + + + + + android:layout_marginLeft="@dimen/very_large_spacing" + android:layout_marginTop="@dimen/small_spacing" + android:layout_marginRight="@dimen/very_large_spacing" + android:padding="12dp" + android:orientation="vertical" + android:background="@drawable/pn_option_background"> + + + + + + + +