diff --git a/app/build.gradle b/app/build.gradle index e5ebe0cd8e..20b4e38520 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,8 +62,8 @@ dependencies { implementation 'com.google.zxing:android-integration:3.1.0' implementation 'com.squareup.dagger:dagger:1.2.2' 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' - compileOnly 'com.squareup.dagger:dagger-compiler:1.2.2' 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') { @@ -147,8 +147,8 @@ def abiPostFix = ['armeabi-v7a' : 1, 'universal' : 5] android { - compileSdkVersion androidCompileSdkVersion - buildToolsVersion androidBuildToolsVersion + compileSdkVersion 30 + buildToolsVersion '29.0.3' useLibrary 'org.apache.http.legacy' dexOptions { @@ -190,7 +190,7 @@ android { minSdkVersion androidMinSdkVersion targetSdkVersion androidCompileSdkVersion - multiDexEnabled true // Even though we're running API 21+, this is still needed for release builds + multiDexEnabled = true // Even though we're running API 21+, this is still needed for release builds vectorDrawables.useSupportLibrary = true project.ext.set("archivesBaseName", "session") diff --git a/app/src/main/java/org/thoughtcrime/securesms/audio/AudioRecorder.java b/app/src/main/java/org/thoughtcrime/securesms/audio/AudioRecorder.java index 4d081b1926..a5d72c4f5a 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/audio/AudioRecorder.java +++ b/app/src/main/java/org/thoughtcrime/securesms/audio/AudioRecorder.java @@ -11,10 +11,11 @@ import android.util.Pair; import org.thoughtcrime.securesms.providers.BlobProvider; import org.thoughtcrime.securesms.util.MediaUtil; + import org.session.libsession.utilities.ThreadUtil; -import org.thoughtcrime.securesms.util.Util; -import org.thoughtcrime.securesms.util.concurrent.ListenableFuture; -import org.thoughtcrime.securesms.util.concurrent.SettableFuture; +import org.session.libsession.utilities.Util; +import org.session.libsession.utilities.concurrent.ListenableFuture; +import org.session.libsession.utilities.concurrent.SettableFuture; import java.io.IOException; import java.util.concurrent.ExecutorService; diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/AlbumThumbnailView.java b/app/src/main/java/org/thoughtcrime/securesms/components/AlbumThumbnailView.java index 6b0b35bc8d..0a4e61697f 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/AlbumThumbnailView.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/AlbumThumbnailView.java @@ -15,7 +15,7 @@ import org.thoughtcrime.securesms.mms.GlideRequests; import org.thoughtcrime.securesms.mms.Slide; import org.thoughtcrime.securesms.mms.SlideClickListener; import org.thoughtcrime.securesms.mms.SlidesClickedListener; -import org.thoughtcrime.securesms.util.views.Stub; +import org.session.libsession.utilities.views.Stub; import java.util.List; diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/GlideBitmapListeningTarget.java b/app/src/main/java/org/thoughtcrime/securesms/components/GlideBitmapListeningTarget.java index 26d70112b6..acb267e203 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/GlideBitmapListeningTarget.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/GlideBitmapListeningTarget.java @@ -8,7 +8,7 @@ import android.widget.ImageView; import com.bumptech.glide.request.target.BitmapImageViewTarget; -import org.thoughtcrime.securesms.util.concurrent.SettableFuture; +import org.session.libsession.utilities.concurrent.SettableFuture; public class GlideBitmapListeningTarget extends BitmapImageViewTarget { diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/GlideDrawableListeningTarget.java b/app/src/main/java/org/thoughtcrime/securesms/components/GlideDrawableListeningTarget.java index f6ede07f7e..9a2c594230 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/GlideDrawableListeningTarget.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/GlideDrawableListeningTarget.java @@ -7,7 +7,7 @@ import android.widget.ImageView; import com.bumptech.glide.request.target.DrawableImageViewTarget; -import org.thoughtcrime.securesms.util.concurrent.SettableFuture; +import org.session.libsession.utilities.concurrent.SettableFuture; public class GlideDrawableListeningTarget extends DrawableImageViewTarget { diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/InputPanel.java b/app/src/main/java/org/thoughtcrime/securesms/components/InputPanel.java index 957b8cd833..8924be0614 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/InputPanel.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/InputPanel.java @@ -34,17 +34,17 @@ import org.thoughtcrime.securesms.loki.utilities.MentionUtilities; import org.thoughtcrime.securesms.mms.GlideApp; import org.thoughtcrime.securesms.mms.GlideRequests; import org.thoughtcrime.securesms.mms.SlideDeck; -import org.session.libsession.messaging.threads.recipients.Recipient; -import org.thoughtcrime.securesms.util.TextSecurePreferences; -import org.thoughtcrime.securesms.util.Util; -import org.thoughtcrime.securesms.util.concurrent.AssertedSuccessListener; -import org.thoughtcrime.securesms.util.concurrent.ListenableFuture; -import org.thoughtcrime.securesms.util.concurrent.SettableFuture; -import org.session.libsignal.libsignal.util.guava.Optional; import org.session.libsession.messaging.sending_receiving.linkpreview.LinkPreview; import org.session.libsession.messaging.sending_receiving.quotes.QuoteModel; +import org.session.libsession.messaging.threads.recipients.Recipient; +import org.session.libsession.utilities.TextSecurePreferences; +import org.session.libsession.utilities.Util; import org.session.libsession.utilities.ViewUtil; +import org.session.libsession.utilities.concurrent.AssertedSuccessListener; +import org.session.libsession.utilities.concurrent.ListenableFuture; +import org.session.libsession.utilities.concurrent.SettableFuture; +import org.session.libsignal.libsignal.util.guava.Optional; import java.util.List; import java.util.concurrent.TimeUnit; diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/MediaView.java b/app/src/main/java/org/thoughtcrime/securesms/components/MediaView.java index d1ab0a2627..149b3817da 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/MediaView.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/MediaView.java @@ -15,9 +15,10 @@ import android.widget.FrameLayout; import network.loki.messenger.R; import org.thoughtcrime.securesms.mms.GlideRequests; import org.thoughtcrime.securesms.mms.VideoSlide; -import org.thoughtcrime.securesms.util.views.Stub; import org.thoughtcrime.securesms.video.VideoPlayer; +import org.session.libsession.utilities.views.Stub; + import java.io.IOException; public class MediaView extends FrameLayout { diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActivity.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActivity.java index 88bfbabb19..0c56bbe1bf 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActivity.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActivity.java @@ -183,7 +183,6 @@ import org.thoughtcrime.securesms.sms.OutgoingEncryptedMessage; import org.thoughtcrime.securesms.sms.OutgoingEndSessionMessage; import org.thoughtcrime.securesms.sms.OutgoingTextMessage; import org.thoughtcrime.securesms.stickers.StickerKeyboardProvider; -import org.thoughtcrime.securesms.stickers.StickerLocator; import org.thoughtcrime.securesms.stickers.StickerManagementActivity; import org.thoughtcrime.securesms.stickers.StickerPackInstallEvent; import org.thoughtcrime.securesms.stickers.StickerSearchRepository; @@ -192,20 +191,21 @@ import org.thoughtcrime.securesms.util.DateUtils; import org.thoughtcrime.securesms.util.MediaUtil; import org.thoughtcrime.securesms.util.PushCharacterCalculator; import org.thoughtcrime.securesms.util.ServiceUtil; -import org.thoughtcrime.securesms.util.concurrent.AssertedSuccessListener; -import org.thoughtcrime.securesms.util.concurrent.ListenableFuture; -import org.thoughtcrime.securesms.util.concurrent.SettableFuture; import org.session.libsession.messaging.sending_receiving.contacts.Contact; import org.session.libsession.messaging.sending_receiving.linkpreview.LinkPreview; import org.session.libsession.messaging.sending_receiving.quotes.QuoteModel; +import org.session.libsession.messaging.sending_receiving.attachments.StickerLocator; import org.session.libsession.messaging.threads.GroupRecord; import org.session.libsession.utilities.ExpirationUtil; import org.session.libsession.utilities.Util; import org.session.libsession.utilities.views.Stub; import org.session.libsession.utilities.ViewUtil; -import org.thoughtcrime.securesms.util.TextSecurePreferences; -import org.thoughtcrime.securesms.util.TextSecurePreferences.MediaKeyboardMode; +import org.session.libsession.utilities.concurrent.AssertedSuccessListener; +import org.session.libsession.utilities.concurrent.ListenableFuture; +import org.session.libsession.utilities.concurrent.SettableFuture; +import org.session.libsession.utilities.TextSecurePreferences; +import org.session.libsession.utilities.TextSecurePreferences.MediaKeyboardMode; import java.io.IOException; import java.text.SimpleDateFormat; diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationFragment.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationFragment.java index 10ab9d8da8..d69c998e73 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationFragment.java @@ -86,21 +86,21 @@ import org.thoughtcrime.securesms.profiles.UnknownSenderView; import org.session.libsession.messaging.threads.recipients.Recipient; import org.thoughtcrime.securesms.sms.MessageSender; import org.thoughtcrime.securesms.sms.OutgoingTextMessage; -import org.thoughtcrime.securesms.stickers.StickerLocator; import org.thoughtcrime.securesms.stickers.StickerPackPreviewActivity; import org.thoughtcrime.securesms.util.CommunicationActions; import org.thoughtcrime.securesms.util.SaveAttachmentTask; import org.thoughtcrime.securesms.util.StickyHeaderDecoration; -import org.thoughtcrime.securesms.util.concurrent.SimpleTask; import org.thoughtcrime.securesms.util.task.ProgressDialogAsyncTask; import org.session.libsignal.libsignal.util.guava.Optional; import org.session.libsignal.service.loki.api.opengroups.PublicChat; import org.session.libsignal.service.loki.api.opengroups.PublicChatAPI; import org.session.libsession.messaging.sending_receiving.linkpreview.LinkPreview; +import org.session.libsession.messaging.sending_receiving.attachments.StickerLocator; import org.session.libsession.utilities.TextSecurePreferences; import org.session.libsession.utilities.Util; import org.session.libsession.utilities.ViewUtil; +import org.session.libsession.utilities.concurrent.SimpleTask; import java.io.IOException; import java.io.InputStream; diff --git a/app/src/main/java/org/thoughtcrime/securesms/logging/PersistentLogger.java b/app/src/main/java/org/thoughtcrime/securesms/logging/PersistentLogger.java index 17b541a990..df814c8391 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/logging/PersistentLogger.java +++ b/app/src/main/java/org/thoughtcrime/securesms/logging/PersistentLogger.java @@ -5,8 +5,9 @@ import androidx.annotation.AnyThread; import androidx.annotation.WorkerThread; import org.thoughtcrime.securesms.database.NoExternalStorageException; -import org.thoughtcrime.securesms.util.concurrent.ListenableFuture; -import org.thoughtcrime.securesms.util.concurrent.SettableFuture; + +import org.session.libsession.utilities.concurrent.ListenableFuture; +import org.session.libsession.utilities.concurrent.SettableFuture; import java.io.ByteArrayOutputStream; import java.io.File; diff --git a/app/src/main/java/org/thoughtcrime/securesms/mediasend/MediaSendFragment.java b/app/src/main/java/org/thoughtcrime/securesms/mediasend/MediaSendFragment.java index bb7160f31f..505af715b8 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/mediasend/MediaSendFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/mediasend/MediaSendFragment.java @@ -47,13 +47,13 @@ import org.thoughtcrime.securesms.util.CharacterCalculator.CharacterState; import org.thoughtcrime.securesms.util.MediaUtil; import org.thoughtcrime.securesms.util.PushCharacterCalculator; import org.thoughtcrime.securesms.util.Stopwatch; -import org.thoughtcrime.securesms.util.concurrent.ListenableFuture; -import org.thoughtcrime.securesms.util.concurrent.SettableFuture; import org.session.libsignal.libsignal.util.guava.Optional; import org.session.libsession.utilities.TextSecurePreferences; import org.session.libsession.utilities.Util; import org.session.libsession.utilities.views.Stub; +import org.session.libsession.utilities.concurrent.ListenableFuture; +import org.session.libsession.utilities.concurrent.SettableFuture; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/app/src/main/java/org/thoughtcrime/securesms/util/Util.java b/app/src/main/java/org/thoughtcrime/securesms/util/Util.java index f5bc2f5481..160537fae7 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/util/Util.java +++ b/app/src/main/java/org/thoughtcrime/securesms/util/Util.java @@ -40,6 +40,9 @@ import android.text.style.StyleSpan; import com.google.android.mms.pdu_alt.EncodedStringValue; +import org.session.libsession.utilities.Base64; +import org.session.libsession.utilities.LinkedBlockingLifoQueue; +import org.session.libsession.utilities.TextSecurePreferences; import org.thoughtcrime.securesms.components.ComposeText; import org.session.libsession.messaging.threads.Address; import org.thoughtcrime.securesms.logging.Log; diff --git a/libsession/build.gradle b/libsession/build.gradle index e20997fdc0..2337d8adab 100644 --- a/libsession/build.gradle +++ b/libsession/build.gradle @@ -1,12 +1,11 @@ plugins { id 'com.android.library' id 'kotlin-android' - id "org.jetbrains.kotlin.kapt" } android { compileSdkVersion 30 - buildToolsVersion "30.0.1" + buildToolsVersion '29.0.3' defaultConfig { minSdkVersion 21 diff --git a/libsession/src/main/java/org/session/libsession/utilities/TextSecurePreferences.kt b/libsession/src/main/java/org/session/libsession/utilities/TextSecurePreferences.kt index 500c0b62f4..58117a5f7b 100644 --- a/libsession/src/main/java/org/session/libsession/utilities/TextSecurePreferences.kt +++ b/libsession/src/main/java/org/session/libsession/utilities/TextSecurePreferences.kt @@ -963,6 +963,7 @@ object TextSecurePreferences { return getStringPreference(context, THREAD_TRIM_LENGTH, "500")!!.toInt() } + @JvmStatic fun isSystemEmojiPreferred(context: Context): Boolean { return getBooleanPreference(context, SYSTEM_EMOJI_PREF, false) } diff --git a/libsession/src/main/java/org/session/libsession/utilities/Util.kt b/libsession/src/main/java/org/session/libsession/utilities/Util.kt index ac58c1871e..fc23e1d82a 100644 --- a/libsession/src/main/java/org/session/libsession/utilities/Util.kt +++ b/libsession/src/main/java/org/session/libsession/utilities/Util.kt @@ -269,4 +269,9 @@ object Util { return "" } + @JvmStatic + fun isEmpty(collection: Collection<*>?): Boolean { + return collection == null || collection.isEmpty() + } + } \ No newline at end of file diff --git a/libsignal/build.gradle b/libsignal/build.gradle index a2dfc97f9e..e87d4b6a15 100644 --- a/libsignal/build.gradle +++ b/libsignal/build.gradle @@ -19,8 +19,8 @@ configurations.all { } android { - compileSdkVersion androidCompileSdkVersion - buildToolsVersion androidBuildToolsVersion + compileSdkVersion 30 + buildToolsVersion '29.0.3' defaultConfig { minSdkVersion androidMinSdkVersion