From 99e6382f2ebd40ce2c9dff6c941c251ed4bb95c6 Mon Sep 17 00:00:00 2001 From: Harris Date: Wed, 19 May 2021 15:12:35 +1000 Subject: [PATCH] refactor: use lazysodium version on maven central instead of bintray (no longer available) --- app/build.gradle | 5 ++--- .../securesms/loki/activities/RegisterActivity.kt | 4 ++-- build.gradle | 10 ++-------- libsession/build.gradle | 3 ++- .../libsession/messaging/messages/visible/Quote.kt | 6 +++--- .../messaging/messages/visible/VisibleMessage.kt | 4 ++-- .../messaging/sending_receiving/MessageDecrypter.kt | 10 +++++----- .../messaging/sending_receiving/MessageEncrypter.kt | 12 +++++------- .../session/libsession/utilities/KeyPairUtilities.kt | 12 ++++++------ 9 files changed, 29 insertions(+), 37 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9ffa66e9f7..8d1ef1be21 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -75,7 +75,6 @@ dependencies { annotationProcessor 'com.squareup.dagger:dagger-compiler:1.2.2' kapt 'com.squareup.dagger:dagger-compiler:1.2.2' implementation 'mobi.upod:time-duration-picker:1.1.3' - implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1' implementation 'com.google.zxing:core:3.2.1' implementation ('com.davemorrissey.labs:subsampling-scale-image-view:3.6.0') { exclude group: 'com.android.support', module: 'support-annotations' @@ -106,8 +105,8 @@ dependencies { implementation project(":libsession") implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.1" implementation "org.whispersystems:curve25519-java:$curve25519Version" - implementation "com.goterl.lazycode:lazysodium-android:4.2.0@aar" - implementation "net.java.dev.jna:jna:5.5.0@aar" + implementation 'com.goterl:lazysodium-android:5.0.2@aar' + implementation "net.java.dev.jna:jna:5.8.0@aar" implementation "com.google.protobuf:protobuf-java:$protobufVersion" implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion" implementation "com.squareup.okhttp3:okhttp:$okhttpVersion" diff --git a/app/src/main/java/org/thoughtcrime/securesms/loki/activities/RegisterActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/loki/activities/RegisterActivity.kt index d84c1bc975..c9e5bd83cc 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/loki/activities/RegisterActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/loki/activities/RegisterActivity.kt @@ -15,15 +15,15 @@ import android.text.style.ClickableSpan import android.text.style.StyleSpan import android.view.View import android.widget.Toast -import com.goterl.lazycode.lazysodium.utils.KeyPair +import com.goterl.lazysodium.utils.KeyPair import kotlinx.android.synthetic.main.activity_register.* import network.loki.messenger.R +import org.session.libsession.utilities.KeyPairUtilities import org.session.libsession.utilities.TextSecurePreferences import org.session.libsignal.crypto.ecc.ECKeyPair import org.session.libsignal.utilities.KeyHelper import org.session.libsignal.utilities.hexEncodedPublicKey import org.thoughtcrime.securesms.BaseActionBarActivity -import org.session.libsession.utilities.KeyPairUtilities import org.thoughtcrime.securesms.loki.utilities.push import org.thoughtcrime.securesms.loki.utilities.setUpActionBarSessionLogo import java.util.* diff --git a/build.gradle b/build.gradle index 4da296022d..3343145c60 100644 --- a/build.gradle +++ b/build.gradle @@ -40,15 +40,9 @@ allprojects { } } maven { - url 'https://dl.bintray.com/amulyakhare/maven' + url "https://repo1.maven.org/maven2/com/goterl/lazysodium-android" content { - includeGroupByRegex "com\\.amulyakhare.*" - } - } - maven { - url "https://dl.bintray.com/terl/lazysodium-maven" - content { - includeGroupByRegex "com\\.goterl\\.lazycode.*" + includeGroupByRegex "com\\.goterl.*" } } jcenter() diff --git a/libsession/build.gradle b/libsession/build.gradle index 1855723bc7..bc78036b1e 100644 --- a/libsession/build.gradle +++ b/libsession/build.gradle @@ -14,7 +14,8 @@ android { dependencies { implementation project(":libsignal") - implementation "com.goterl.lazycode:lazysodium-android:4.2.0@aar" + implementation 'com.goterl:lazysodium-android:5.0.2@aar' + implementation "net.java.dev.jna:jna:5.8.0@aar" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" implementation 'androidx.core:core-ktx:1.3.2' implementation 'androidx.appcompat:appcompat:1.2.0' diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/visible/Quote.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/visible/Quote.kt index 21b9200d64..291658190a 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/visible/Quote.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/visible/Quote.kt @@ -1,11 +1,11 @@ package org.session.libsession.messaging.messages.visible -import com.goterl.lazycode.lazysodium.BuildConfig +import com.goterl.lazysodium.BuildConfig import org.session.libsession.messaging.MessagingModuleConfiguration import org.session.libsession.messaging.sending_receiving.attachments.DatabaseAttachment -import org.session.libsession.messaging.sending_receiving.quotes.QuoteModel as SignalQuote -import org.session.libsignal.utilities.Log import org.session.libsignal.protos.SignalServiceProtos +import org.session.libsignal.utilities.Log +import org.session.libsession.messaging.sending_receiving.quotes.QuoteModel as SignalQuote class Quote() { var timestamp: Long? = 0 diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/visible/VisibleMessage.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/visible/VisibleMessage.kt index 6fde15d673..f188716303 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/visible/VisibleMessage.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/visible/VisibleMessage.kt @@ -1,12 +1,12 @@ package org.session.libsession.messaging.messages.visible -import com.goterl.lazycode.lazysodium.BuildConfig +import com.goterl.lazysodium.BuildConfig import org.session.libsession.messaging.MessagingModuleConfiguration import org.session.libsession.messaging.messages.Message import org.session.libsession.messaging.sending_receiving.attachments.DatabaseAttachment import org.session.libsession.utilities.Address -import org.session.libsession.utilities.recipients.Recipient import org.session.libsession.utilities.GroupUtil +import org.session.libsession.utilities.recipients.Recipient import org.session.libsignal.protos.SignalServiceProtos import org.session.libsignal.utilities.Log import org.session.libsession.messaging.sending_receiving.attachments.Attachment as SignalAttachment diff --git a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageDecrypter.kt b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageDecrypter.kt index b946ec3398..da9d080aed 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageDecrypter.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageDecrypter.kt @@ -1,15 +1,15 @@ package org.session.libsession.messaging.sending_receiving import android.util.Log -import com.goterl.lazycode.lazysodium.LazySodiumAndroid -import com.goterl.lazycode.lazysodium.SodiumAndroid -import com.goterl.lazycode.lazysodium.interfaces.Box -import com.goterl.lazycode.lazysodium.interfaces.Sign +import com.goterl.lazysodium.LazySodiumAndroid +import com.goterl.lazysodium.SodiumAndroid +import com.goterl.lazysodium.interfaces.Box +import com.goterl.lazysodium.interfaces.Sign import org.session.libsignal.crypto.ecc.ECKeyPair +import org.session.libsignal.utilities.Hex import org.session.libsignal.utilities.hexEncodedPublicKey import org.session.libsignal.utilities.removing05PrefixIfNeeded import org.session.libsignal.utilities.toHexString -import org.session.libsignal.utilities.Hex object MessageDecrypter { diff --git a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageEncrypter.kt b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageEncrypter.kt index b9c2fc66be..ef91eae598 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageEncrypter.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageEncrypter.kt @@ -1,17 +1,15 @@ package org.session.libsession.messaging.sending_receiving -import com.goterl.lazycode.lazysodium.LazySodiumAndroid -import com.goterl.lazycode.lazysodium.SodiumAndroid -import com.goterl.lazycode.lazysodium.interfaces.Box -import com.goterl.lazycode.lazysodium.interfaces.Sign - +import com.goterl.lazysodium.LazySodiumAndroid +import com.goterl.lazysodium.SodiumAndroid +import com.goterl.lazysodium.interfaces.Box +import com.goterl.lazysodium.interfaces.Sign import org.session.libsession.messaging.MessagingModuleConfiguration import org.session.libsession.messaging.sending_receiving.MessageSender.Error import org.session.libsession.utilities.KeyPairUtilities - -import org.session.libsignal.utilities.removing05PrefixIfNeeded import org.session.libsignal.utilities.Hex import org.session.libsignal.utilities.Log +import org.session.libsignal.utilities.removing05PrefixIfNeeded object MessageEncrypter { diff --git a/libsession/src/main/java/org/session/libsession/utilities/KeyPairUtilities.kt b/libsession/src/main/java/org/session/libsession/utilities/KeyPairUtilities.kt index 3f0152d7b0..dfefaa2f12 100644 --- a/libsession/src/main/java/org/session/libsession/utilities/KeyPairUtilities.kt +++ b/libsession/src/main/java/org/session/libsession/utilities/KeyPairUtilities.kt @@ -1,15 +1,15 @@ package org.session.libsession.utilities import android.content.Context -import com.goterl.lazycode.lazysodium.LazySodiumAndroid -import com.goterl.lazycode.lazysodium.SodiumAndroid -import com.goterl.lazycode.lazysodium.utils.Key -import com.goterl.lazycode.lazysodium.utils.KeyPair -import org.session.libsignal.utilities.Base64 -import org.session.libsignal.utilities.Hex +import com.goterl.lazysodium.LazySodiumAndroid +import com.goterl.lazysodium.SodiumAndroid +import com.goterl.lazysodium.utils.Key +import com.goterl.lazysodium.utils.KeyPair import org.session.libsignal.crypto.ecc.DjbECPrivateKey import org.session.libsignal.crypto.ecc.DjbECPublicKey import org.session.libsignal.crypto.ecc.ECKeyPair +import org.session.libsignal.utilities.Base64 +import org.session.libsignal.utilities.Hex object KeyPairUtilities {