From 4d248945077bcbd1b0eefaf68ae278e4214f00c3 Mon Sep 17 00:00:00 2001 From: SteveJosephh21 Date: Mon, 27 May 2024 12:27:51 +0530 Subject: [PATCH] Updated version 2.5.1 --- app/build.gradle | 10 +- app/playMainNet/release/output-metadata.json | 24 +-- app/src/main/assets/changeLog.json | 8 + .../contactshare/ContactModelMapper.java | 169 ------------------ .../conversation/v2/ConversationFragmentV2.kt | 140 ++++++++------- .../v2/menus/ConversationMenuHelper.kt | 151 ++++------------ .../securesms/service/WebRtcCallService.kt | 39 ++-- .../securesms/util/RestoreHeight.java | 2 + .../securesms/webrtc/CallManager.kt | 50 +----- .../webrtc/WebRtcCallServiceReceivers.kt | 5 +- app/src/main/res/layout/fragment_home.xml | 2 +- 11 files changed, 170 insertions(+), 430 deletions(-) delete mode 100644 app/src/main/java/com/thoughtcrimes/securesms/contactshare/ContactModelMapper.java diff --git a/app/build.gradle b/app/build.gradle index 1fbdc685..af54ff12 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ apply from: 'buildGradle/dependencies.gradle' configurations.all { exclude module: "commons-logging" } -def canonicalVersionCode = 44 -def canonicalVersionName = "2.5.0" +def canonicalVersionCode = 46 +def canonicalVersionName = "2.5.1" //First Release Date 17-06-2022 //Version Code 15 Version Name 1.0.0 @@ -104,6 +104,12 @@ def canonicalVersionName = "2.5.0" //30th Release Data 22-03-2024 //Version code 44 Version Name 2.5.0 +//31th Internal Test Release Data 22-03-2024 +//Version code 45 Version Name 2.5.0 + +//32 Internal Test Release Data 27-05-2024 +//Version code 46 Version Name 2.5.1 + def postFixSize = 10 def abiPostFix = ['armeabi-v7a' : 1, 'arm64-v8a' : 2, diff --git a/app/playMainNet/release/output-metadata.json b/app/playMainNet/release/output-metadata.json index a17e2c5c..cc4c8e90 100644 --- a/app/playMainNet/release/output-metadata.json +++ b/app/playMainNet/release/output-metadata.json @@ -11,9 +11,9 @@ "type": "UNIVERSAL", "filters": [], "attributes": [], - "versionCode": 43, - "versionName": "2.5.0", - "outputFile": "Bchat-2.5.0-universal.apk" + "versionCode": 46, + "versionName": "2.5.1", + "outputFile": "Bchat-2.5.1-universal.apk" }, { "type": "ONE_OF_MANY", @@ -24,9 +24,9 @@ } ], "attributes": [], - "versionCode": 43, - "versionName": "2.5.0", - "outputFile": "Bchat-2.5.0-armeabi-v7a.apk" + "versionCode": 46, + "versionName": "2.5.1", + "outputFile": "Bchat-2.5.1-armeabi-v7a.apk" }, { "type": "ONE_OF_MANY", @@ -37,9 +37,9 @@ } ], "attributes": [], - "versionCode": 43, - "versionName": "2.5.0", - "outputFile": "Bchat-2.5.0-x86_64.apk" + "versionCode": 46, + "versionName": "2.5.1", + "outputFile": "Bchat-2.5.1-x86_64.apk" }, { "type": "ONE_OF_MANY", @@ -50,9 +50,9 @@ } ], "attributes": [], - "versionCode": 43, - "versionName": "2.5.0", - "outputFile": "Bchat-2.5.0-arm64-v8a.apk" + "versionCode": 46, + "versionName": "2.5.1", + "outputFile": "Bchat-2.5.1-arm64-v8a.apk" } ], "elementType": "File" diff --git a/app/src/main/assets/changeLog.json b/app/src/main/assets/changeLog.json index c8b69b79..d39fa760 100644 --- a/app/src/main/assets/changeLog.json +++ b/app/src/main/assets/changeLog.json @@ -363,6 +363,14 @@ "description":"- Minor Bug fixes" } ] + }, + { + "title": "2.5.1", + "descriptions": [ + { + "description":"- Updated call functionalities to adhere with google play's developer guidelines" + } + ] } ] } \ No newline at end of file diff --git a/app/src/main/java/com/thoughtcrimes/securesms/contactshare/ContactModelMapper.java b/app/src/main/java/com/thoughtcrimes/securesms/contactshare/ContactModelMapper.java deleted file mode 100644 index 4c7d1377..00000000 --- a/app/src/main/java/com/thoughtcrimes/securesms/contactshare/ContactModelMapper.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.thoughtcrimes.securesms.contactshare; - -import androidx.annotation.NonNull; - -import com.beldex.libbchat.messaging.sending_receiving.attachments.Attachment; -import com.beldex.libbchat.messaging.sending_receiving.attachments.PointerAttachment; -import com.beldex.libsignal.utilities.guava.Optional; -import com.beldex.libsignal.messages.SharedContact; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import com.beldex.libbchat.utilities.Contact; -import static com.beldex.libbchat.utilities.Contact.*; - -public class ContactModelMapper { - - public static SharedContact.Builder localToRemoteBuilder(@NonNull Contact contact) { - List phoneNumbers = new ArrayList<>(contact.getPhoneNumbers().size()); - List emails = new ArrayList<>(contact.getEmails().size()); - List postalAddresses = new ArrayList<>(contact.getPostalAddresses().size()); - - for (Phone phone : contact.getPhoneNumbers()) { - phoneNumbers.add(new SharedContact.Phone.Builder().setValue(phone.getNumber()) - .setType(localToRemoteType(phone.getType())) - .setLabel(phone.getLabel()) - .build()); - } - - for (Email email : contact.getEmails()) { - emails.add(new SharedContact.Email.Builder().setValue(email.getEmail()) - .setType(localToRemoteType(email.getType())) - .setLabel(email.getLabel()) - .build()); - } - - for (PostalAddress postalAddress : contact.getPostalAddresses()) { - postalAddresses.add(new SharedContact.PostalAddress.Builder().setType(localToRemoteType(postalAddress.getType())) - .setLabel(postalAddress.getLabel()) - .setStreet(postalAddress.getStreet()) - .setPobox(postalAddress.getPoBox()) - .setNeighborhood(postalAddress.getNeighborhood()) - .setCity(postalAddress.getCity()) - .setRegion(postalAddress.getRegion()) - .setPostcode(postalAddress.getPostalCode()) - .setCountry(postalAddress.getCountry()) - .build()); - } - - SharedContact.Name name = new SharedContact.Name.Builder().setDisplay(contact.getName().getDisplayName()) - .setGiven(contact.getName().getGivenName()) - .setFamily(contact.getName().getFamilyName()) - .setPrefix(contact.getName().getPrefix()) - .setSuffix(contact.getName().getSuffix()) - .setMiddle(contact.getName().getMiddleName()) - .build(); - - return new SharedContact.Builder().setName(name) - .withOrganization(contact.getOrganization()) - .withPhones(phoneNumbers) - .withEmails(emails) - .withAddresses(postalAddresses); - } - - public static Contact remoteToLocal(@NonNull SharedContact sharedContact) { - Name name = new Name(sharedContact.getName().getDisplay().orNull(), - sharedContact.getName().getGiven().orNull(), - sharedContact.getName().getFamily().orNull(), - sharedContact.getName().getPrefix().orNull(), - sharedContact.getName().getSuffix().orNull(), - sharedContact.getName().getMiddle().orNull()); - - List phoneNumbers = new LinkedList<>(); - if (sharedContact.getPhone().isPresent()) { - for (SharedContact.Phone phone : sharedContact.getPhone().get()) { - phoneNumbers.add(new Phone(phone.getValue(), - remoteToLocalType(phone.getType()), - phone.getLabel().orNull())); - } - } - - List emails = new LinkedList<>(); - if (sharedContact.getEmail().isPresent()) { - for (SharedContact.Email email : sharedContact.getEmail().get()) { - emails.add(new Email(email.getValue(), - remoteToLocalType(email.getType()), - email.getLabel().orNull())); - } - } - - List postalAddresses = new LinkedList<>(); - if (sharedContact.getAddress().isPresent()) { - for (SharedContact.PostalAddress postalAddress : sharedContact.getAddress().get()) { - postalAddresses.add(new PostalAddress(remoteToLocalType(postalAddress.getType()), - postalAddress.getLabel().orNull(), - postalAddress.getStreet().orNull(), - postalAddress.getPobox().orNull(), - postalAddress.getNeighborhood().orNull(), - postalAddress.getCity().orNull(), - postalAddress.getRegion().orNull(), - postalAddress.getPostcode().orNull(), - postalAddress.getCountry().orNull())); - } - } - - Avatar avatar = null; - if (sharedContact.getAvatar().isPresent()) { - Attachment attachment = PointerAttachment.forPointer(Optional.of(sharedContact.getAvatar().get().getAttachment().asPointer())).get(); - boolean isProfile = sharedContact.getAvatar().get().isProfile(); - - avatar = new Avatar(null, attachment, isProfile); - } - - return new Contact(name, sharedContact.getOrganization().orNull(), phoneNumbers, emails, postalAddresses, avatar); - } - - private static Phone.Type remoteToLocalType(SharedContact.Phone.Type type) { - switch (type) { - case HOME: return Phone.Type.HOME; - case MOBILE: return Phone.Type.MOBILE; - case WORK: return Phone.Type.WORK; - default: return Phone.Type.CUSTOM; - } - } - - private static Email.Type remoteToLocalType(SharedContact.Email.Type type) { - switch (type) { - case HOME: return Email.Type.HOME; - case MOBILE: return Email.Type.MOBILE; - case WORK: return Email.Type.WORK; - default: return Email.Type.CUSTOM; - } - } - - private static PostalAddress.Type remoteToLocalType(SharedContact.PostalAddress.Type type) { - switch (type) { - case HOME: return PostalAddress.Type.HOME; - case WORK: return PostalAddress.Type.WORK; - default: return PostalAddress.Type.CUSTOM; - } - } - - private static SharedContact.Phone.Type localToRemoteType(Phone.Type type) { - switch (type) { - case HOME: return SharedContact.Phone.Type.HOME; - case MOBILE: return SharedContact.Phone.Type.MOBILE; - case WORK: return SharedContact.Phone.Type.WORK; - default: return SharedContact.Phone.Type.CUSTOM; - } - } - - private static SharedContact.Email.Type localToRemoteType(Email.Type type) { - switch (type) { - case HOME: return SharedContact.Email.Type.HOME; - case MOBILE: return SharedContact.Email.Type.MOBILE; - case WORK: return SharedContact.Email.Type.WORK; - default: return SharedContact.Email.Type.CUSTOM; - } - } - - private static SharedContact.PostalAddress.Type localToRemoteType(PostalAddress.Type type) { - switch (type) { - case HOME: return SharedContact.PostalAddress.Type.HOME; - case WORK: return SharedContact.PostalAddress.Type.WORK; - default: return SharedContact.PostalAddress.Type.CUSTOM; - } - } -} diff --git a/app/src/main/java/com/thoughtcrimes/securesms/conversation/v2/ConversationFragmentV2.kt b/app/src/main/java/com/thoughtcrimes/securesms/conversation/v2/ConversationFragmentV2.kt index 2009d7f6..4fb2ec89 100644 --- a/app/src/main/java/com/thoughtcrimes/securesms/conversation/v2/ConversationFragmentV2.kt +++ b/app/src/main/java/com/thoughtcrimes/securesms/conversation/v2/ConversationFragmentV2.kt @@ -32,6 +32,7 @@ import android.text.SpannableStringBuilder import android.text.Spanned import android.text.TextUtils import android.text.style.ForegroundColorSpan +import android.util.Log import android.util.Pair import android.util.TypedValue import android.view.ActionMode @@ -224,7 +225,7 @@ class ConversationFragmentV2 : Fragment(), InputBarDelegate, )[LinkPreviewViewModel::class.java] } -// var threadId: Long? = -1L + // var threadId: Long? = -1L @Inject lateinit var threadDb: ThreadDatabase @@ -240,7 +241,7 @@ class ConversationFragmentV2 : Fragment(), InputBarDelegate, } private fun callViewModel():Recipient?{ - val viewModels: ConversationViewModel by viewModels { + val viewModels: ConversationViewModel by viewModels { var threadId = requireArguments().getLong(THREAD_ID,-1L) if (threadId == -1L) { requireArguments().parcelable
(ADDRESS)?.let { address -> @@ -936,8 +937,8 @@ class ConversationFragmentV2 : Fragment(), InputBarDelegate, val recipient = viewModel.recipient.value ?: return if (recipient.isBlocked) { BlockedDialog(recipient).show( - requireActivity().supportFragmentManager, - "Blocked Dialog" + requireActivity().supportFragmentManager, + "Blocked Dialog" ) return } @@ -1107,8 +1108,8 @@ class ConversationFragmentV2 : Fragment(), InputBarDelegate, val recipient = viewModel.recipient.value ?: return if (recipient.isBlocked) { BlockedDialog(recipient).show( - requireActivity().supportFragmentManager, - "Blocked Dialog" + requireActivity().supportFragmentManager, + "Blocked Dialog" ) return } @@ -1118,8 +1119,8 @@ class ConversationFragmentV2 : Fragment(), InputBarDelegate, this.activity?.window?.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) audioRecorder.startRecording() stopAudioHandler.postDelayed( - stopVoiceMessageRecordingTask, - 300000 + stopVoiceMessageRecordingTask, + 300000 ) // Limit voice messages to 5 minute each } else { Permissions.with(this) @@ -1260,34 +1261,34 @@ class ConversationFragmentV2 : Fragment(), InputBarDelegate, override fun inChatBDXOptions() { try { - val dialog = android.app.AlertDialog.Builder(requireActivity()) - val inflater = layoutInflater - val dialogView = inflater.inflate(R.layout.pay_as_you_chat, null) - dialog.setView(dialogView) - - val okButton = dialogView.findViewById