From f307d7bb175742e9d29cb0e27c0c9d8f13eda7ce Mon Sep 17 00:00:00 2001 From: jubb Date: Tue, 16 Mar 2021 11:45:02 +1100 Subject: [PATCH 1/3] fix: add org.session and remove minify to release build --- app/build.gradle | 2 +- app/proguard/proguard.pro | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 96a83d186c..5818c41c1a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -235,7 +235,7 @@ android { buildTypes { release { - minifyEnabled true + minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard/proguard-dagger.pro', diff --git a/app/proguard/proguard.pro b/app/proguard/proguard.pro index 2634d86b94..863701970c 100644 --- a/app/proguard/proguard.pro +++ b/app/proguard/proguard.pro @@ -2,6 +2,7 @@ -keepattributes SourceFile,LineNumberTable -keep class org.whispersystems.** { *; } -keep class org.thoughtcrime.securesms.** { *; } +-keep class org.session.** { *; } -keepclassmembers class ** { public void onEvent*(**); } From 55eb963d10335d74fabd01d412dac91c24444d7a Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Tue, 16 Mar 2021 13:24:40 +1100 Subject: [PATCH 2/3] Update build number --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 5818c41c1a..45d5a18a68 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -157,7 +157,7 @@ dependencies { testImplementation 'org.robolectric:shadows-multidex:4.2' } -def canonicalVersionCode = 146 +def canonicalVersionCode = 147 def canonicalVersionName = "1.9.0" def postFixSize = 10 From 7e509a1cf01cb27dfaf516986d76e103cc16f0bb Mon Sep 17 00:00:00 2001 From: jubb Date: Tue, 16 Mar 2021 15:49:31 +1100 Subject: [PATCH 3/3] fix: pad the plaintext before encryption --- .../messaging/sending_receiving/MessageSender.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt index 39a0237000..4609a2b925 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt @@ -12,9 +12,6 @@ import org.session.libsession.messaging.messages.control.ClosedGroupControlMessa import org.session.libsession.messaging.messages.control.ConfigurationMessage import org.session.libsession.messaging.messages.control.ExpirationTimerUpdate import org.session.libsession.messaging.messages.visible.* -import org.session.libsession.messaging.sending_receiving.attachments.Attachment as SignalAttachment -import org.session.libsession.messaging.sending_receiving.linkpreview.LinkPreview as SignalLinkPreview -import org.session.libsession.messaging.sending_receiving.quotes.QuoteModel as SignalQuote import org.session.libsession.messaging.opengroups.OpenGroupAPI import org.session.libsession.messaging.opengroups.OpenGroupMessage import org.session.libsession.messaging.threads.Address @@ -24,11 +21,15 @@ import org.session.libsession.snode.SnodeAPI import org.session.libsession.snode.SnodeConfiguration import org.session.libsession.snode.SnodeMessage import org.session.libsession.utilities.SSKEnvironment +import org.session.libsignal.service.internal.push.PushTransportDetails import org.session.libsignal.service.internal.push.SignalServiceProtos import org.session.libsignal.service.loki.api.crypto.ProofOfWork import org.session.libsignal.service.loki.utilities.hexEncodedPublicKey import org.session.libsignal.utilities.Base64 import org.session.libsignal.utilities.logging.Log +import org.session.libsession.messaging.sending_receiving.attachments.Attachment as SignalAttachment +import org.session.libsession.messaging.sending_receiving.linkpreview.LinkPreview as SignalLinkPreview +import org.session.libsession.messaging.sending_receiving.quotes.QuoteModel as SignalQuote object MessageSender { @@ -118,7 +119,7 @@ object MessageSender { // Convert it to protobuf val proto = message.toProto() ?: throw Error.ProtoConversionFailed // Serialize the protobuf - val plaintext = proto.toByteArray() + val plaintext = PushTransportDetails.getPaddedMessageBody(proto.toByteArray()) // Encrypt the serialized protobuf val ciphertext: ByteArray when (destination) {