Skip to content

Commit

Permalink
Merge pull request #48 from Beldex-Coin/feature-bns-integration
Browse files Browse the repository at this point in the history
Release version 2.5.0
  • Loading branch information
snowman-45 authored Mar 26, 2024
2 parents c748363 + 06da115 commit 2558b2f
Show file tree
Hide file tree
Showing 51 changed files with 211 additions and 89 deletions.
26 changes: 19 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ apply from: 'buildGradle/dependencies.gradle'
configurations.all {
exclude module: "commons-logging"
}
def canonicalVersionCode = 41
def canonicalVersionName = "2.4.0"
def canonicalVersionCode = 44
def canonicalVersionName = "2.5.0"

//First Release Date 17-06-2022
//Version Code 15 Version Name 1.0.0
Expand Down Expand Up @@ -95,6 +95,15 @@ def canonicalVersionName = "2.4.0"
//Twenty-seventh Release Data 22-02-2024
//Version code 41 Version Name 2.4.0

//Twenty-eight Internal Test Release Data 05-03-2024
//Version code 42 Version Name 2.4.1

//Twenty-ninth Test Release Data 22-03-2024
//Version code 43 Version Name 2.5.0

//30th Release Data 22-03-2024
//Version code 44 Version Name 2.5.0

def postFixSize = 10
def abiPostFix = ['armeabi-v7a' : 1,
'arm64-v8a' : 2,
Expand All @@ -105,12 +114,12 @@ android {
useLibrary 'org.apache.http.legacy'

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
freeCompilerArgs += [
"-Xjvm-default=all",
]
Expand Down Expand Up @@ -138,7 +147,7 @@ android {
minSdkVersion androidMinimumSdkVersion
compileSdk androidCompileSdkVersion
targetSdkVersion androidTargetSdkVersion
buildToolsVersion '30.0.3'
buildToolsVersion '34.0.0'

multiDexEnabled = true

Expand Down Expand Up @@ -243,6 +252,7 @@ android {
dataBinding true
viewBinding true
compose true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.1"
Expand All @@ -259,6 +269,8 @@ android {
baseline file('lint-baseline.xml')
}
namespace 'io.beldex.bchat'
buildToolsVersion '34.0.0'
compileSdk 34
}

static def getLastCommitTimestamp() {
Expand All @@ -278,4 +290,4 @@ def autoResConfig() {
.findAll { matcher -> matcher.find() }
.collect { matcher -> matcher.group(1) }
.sort()
}
}
4 changes: 2 additions & 2 deletions app/buildGradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dependencies {
implementation 'com.codewaves.stickyheadergrid:stickyheadergrid:0.9.4'
implementation 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3-S2'
implementation 'androidx.sqlite:sqlite-ktx:2.2.0'
implementation 'net.zetetic:sqlcipher-android:4.5.2@aar'
implementation 'net.zetetic:sqlcipher-android:4.5.4@aar'
implementation ('com.googlecode.ez-vcard:ez-vcard:0.9.11') {
exclude group: 'com.fasterxml.jackson.core'
exclude group: 'org.freemarker'
Expand All @@ -83,7 +83,7 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxJsonVersion"
implementation "org.whispersystems:curve25519-java:$curve25519Version"
implementation 'com.goterl:lazysodium-android:5.0.2@aar'
implementation "net.java.dev.jna:jna:5.8.0@aar"
implementation "net.java.dev.jna:jna:5.12.1@aar"
implementation "com.google.protobuf:protobuf-java:$protobufVersion"
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
implementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
Expand Down
30 changes: 15 additions & 15 deletions app/playMainNet/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,48 @@
"type": "UNIVERSAL",
"filters": [],
"attributes": [],
"versionCode": 41,
"versionName": "2.4.0",
"outputFile": "Bchat-2.4.0-universal.apk"
"versionCode": 43,
"versionName": "2.5.0",
"outputFile": "Bchat-2.5.0-universal.apk"
},
{
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"value": "x86_64"
"value": "armeabi-v7a"
}
],
"attributes": [],
"versionCode": 41,
"versionName": "2.4.0",
"outputFile": "Bchat-2.4.0-x86_64.apk"
"versionCode": 43,
"versionName": "2.5.0",
"outputFile": "Bchat-2.5.0-armeabi-v7a.apk"
},
{
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"value": "arm64-v8a"
"value": "x86_64"
}
],
"attributes": [],
"versionCode": 41,
"versionName": "2.4.0",
"outputFile": "Bchat-2.4.0-arm64-v8a.apk"
"versionCode": 43,
"versionName": "2.5.0",
"outputFile": "Bchat-2.5.0-x86_64.apk"
},
{
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"value": "armeabi-v7a"
"value": "arm64-v8a"
}
],
"attributes": [],
"versionCode": 41,
"versionName": "2.4.0",
"outputFile": "Bchat-2.4.0-armeabi-v7a.apk"
"versionCode": 43,
"versionName": "2.5.0",
"outputFile": "Bchat-2.5.0-arm64-v8a.apk"
}
],
"elementType": "File"
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"/>
<uses-permission android:name="io.beldex.bchat.ACCESS_BCHAT_SECRETS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
Expand Down Expand Up @@ -523,12 +525,14 @@
</service>
<service
android:name="com.thoughtcrimes.securesms.service.WebRtcCallService"
android:foregroundServiceType="microphone"
android:enabled="true"
android:exported="false" />
<service
android:name="com.thoughtcrimes.securesms.service.KeyCachingService"
android:enabled="true"
android:exported="false" />
android:exported="false" android:foregroundServiceType="specialUse">
</service>
<service
android:name="com.thoughtcrimes.securesms.service.DirectShareService"
android:exported="true"
Expand Down Expand Up @@ -707,6 +711,7 @@
android:name="com.thoughtcrimes.securesms.wallet.service.WalletService"
android:description="@string/service_description"
android:exported="false"
android:foregroundServiceType="specialUse"
android:label="BChat Wallet Service" />
</application>

Expand Down
31 changes: 31 additions & 0 deletions app/src/main/assets/changeLog.json
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,37 @@
"description":"- Minor Bug fixes"
}
]
},
{
"title": "2.4.1",
"descriptions": [
{
"description":"- Minor Bug fixes"
}
]
},
{
"title": "2.5.0",
"descriptions": [
{
"description":"- Fixed message delay issue"
},
{
"description":"- Introduced BNS feature for starting new chat and sending funds"
},
{
"description":"- Fixed missing payment ID details for integrated address transaction"
},
{
"description":"- Added support for android version 14"
},
{
"description":"- Updated Node list"
},
{
"description":"- Minor Bug fixes"
}
]
}
]
}
3 changes: 1 addition & 2 deletions app/src/main/cpp/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1223,8 +1223,7 @@ jobject newTransactionInfo(JNIEnv *env, Wallet::TransactionInfo *info) {
"(IZZJJJLjava/lang/String;JLjava/lang/String;IIJLjava/lang/String;Ljava/util/List;Z)V");
jobject transfers = newTransferList(env, info);
jstring _hash = env->NewStringUTF(info->hash().c_str());
const char *paymentId = "-";
jstring _paymentId = env->NewStringUTF(paymentId);
jstring _paymentId = env->NewStringUTF(info->paymentId().c_str());
const char *label = "-";
jstring _label = env->NewStringUTF(label);
uint32_t subaddrIndex = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;

import com.beldex.libsignal.utilities.Log;
Expand Down Expand Up @@ -229,7 +230,13 @@ public void onReceive(Context context, Intent intent) {
};

IntentFilter filter = new IntentFilter(KeyCachingService.CLEAR_KEY_EVENT);
registerReceiver(clearKeyReceiver, filter, KeyCachingService.KEY_PERMISSION, null);
ContextCompat.registerReceiver(
this,
clearKeyReceiver, filter,
KeyCachingService.KEY_PERMISSION,
null,
ContextCompat.RECEIVER_NOT_EXPORTED
);
}

private void removeClearKeyReceiver(Context context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ import com.beldex.libbchat.messaging.sending_receiving.quotes.QuoteModel
import com.beldex.libbchat.mnode.MnodeAPI
import com.beldex.libbchat.utilities.Address
import com.beldex.libbchat.utilities.MediaTypes
import com.beldex.libbchat.utilities.SSKEnvironment
import com.beldex.libbchat.utilities.TextSecurePreferences
import com.beldex.libbchat.utilities.concurrent.SimpleTask
import com.beldex.libbchat.utilities.isScrolledToBottom
Expand Down Expand Up @@ -148,7 +149,6 @@ import com.thoughtcrimes.securesms.model.AsyncTaskCoroutine
import com.thoughtcrimes.securesms.model.PendingTransaction
import com.thoughtcrimes.securesms.model.Wallet
import com.thoughtcrimes.securesms.permissions.Permissions
import com.thoughtcrimes.securesms.preferences.ChatSettingsActivity
import com.thoughtcrimes.securesms.preferences.PrivacySettingsActivity
import com.thoughtcrimes.securesms.service.WebRtcCallService
import com.thoughtcrimes.securesms.util.ActivityDispatcher
Expand Down Expand Up @@ -399,6 +399,7 @@ class ConversationFragmentV2 : Fragment(), InputBarDelegate,
const val SCROLL_MESSAGE_ID = "scroll_message_id"
const val SCROLL_MESSAGE_AUTHOR = "scroll_message_author"
const val HEX_ENCODED_PUBLIC_KEY="hex_encode_public_key"
const val BNS_NAME ="bns_name"
//Shortcut launcher
const val SHORTCUT_LAUNCHER ="shortcut_launcher"
//SetDataAndType
Expand Down Expand Up @@ -454,6 +455,7 @@ class ConversationFragmentV2 : Fragment(), InputBarDelegate,
private var networkChangedReceiver: NetworkChangeReceiver? = null
private var isNetworkAvailable = true
private var callViewModel : CallViewModel? =null
private var bns_Name : String? = null


interface Listener {
Expand Down Expand Up @@ -1961,7 +1963,12 @@ class ConversationFragmentV2 : Fragment(), InputBarDelegate,
}

private fun setUpToolBar() {
val profileManager = SSKEnvironment.shared.profileManager
val recipient = viewModel.recipient.value ?: return
val bnsName = requireArguments().getString(BNS_NAME)
if (bnsName != null && adapter.cursor?.count == 0) {
profileManager.setName(requireContext(), recipient, bnsName)
}
binding.conversationTitleView.text = when {
recipient.isLocalNumber -> getString(R.string.note_to_self)
else -> recipient.toShortString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class AlbumThumbnailView : RelativeLayout {
private var slideSize: Int = 0


override fun dispatchDraw(canvas: Canvas?) {
override fun dispatchDraw(canvas: Canvas) {
super.dispatchDraw(canvas)
cornerMask.mask(canvas)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class ThumbnailProgressBar: View {
private val objectRect = Rect()
private val drawingRect = Rect()

override fun dispatchDraw(canvas: Canvas?) {
if (canvas == null) return
override fun dispatchDraw(canvas: Canvas) {

getDrawingRect(objectRect)
drawingRect.set(objectRect)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
@AllArgsConstructor
public enum DefaultNodes {
// Mainnet
BELDEX("explorer.beldex.io:19091"),
BELDEX1("mainnet.beldex.io:29095"),
BELDEX2("publicnode1.rpcnode.stream:29095"),
BELDEX3 ("publicnode2.rpcnode.stream:29095"),
BELDEX4 ("publicnode3.rpcnode.stream:29095"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ import io.beldex.bchat.BuildConfig

object NetworkNodes {
private val mainNetNodes = listOf(
"explorer.beldex.io:19091",
"publicnode1.rpcnode.stream:29095",
"publicnode2.rpcnode.stream:29095",
"publicnode3.rpcnode.stream:29095",
"publicnode4.rpcnode.stream:29095",
"mainnet.beldex.io:29095",
"publicnode5.rpcnode.stream:29095"
)
private val testNetModes = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class CreateNewPrivateChatActivity : PassphraseRequiredActionBarActivity() {
private fun createPrivateChatIfPossible(bnsNameOrPublicKey: String) {
if (PublicKeyValidation.isValid(bnsNameOrPublicKey)) {
Log.d("PublicKeyValidation", "OK")
createPrivateChat(bnsNameOrPublicKey)
createPrivateChat(bnsNameOrPublicKey,bnsNameOrPublicKey)
} else {
Log.d("PublicKeyValidation", "Cancel")

Expand All @@ -233,7 +233,7 @@ class CreateNewPrivateChatActivity : PassphraseRequiredActionBarActivity() {
Log.d("PublicKeyValidation", "successUi")
hideLoader()
Log.d("Beldex", "value of Bchat id for BNS name $hexEncodedPublicKey")
this.createPrivateChat(hexEncodedPublicKey)
this.createPrivateChat(hexEncodedPublicKey,bnsNameOrPublicKey)
}.failUi { exception ->
hideLoader()
var message = resources.getString(R.string.fragment_enter_public_key_error_message)
Expand All @@ -246,11 +246,12 @@ class CreateNewPrivateChatActivity : PassphraseRequiredActionBarActivity() {
}
}

private fun createPrivateChat(hexEncodedPublicKey: String) {
private fun createPrivateChat(hexEncodedPublicKey: String, bnsName: String) {
val recipient = Recipient.from(this, Address.fromSerialized(hexEncodedPublicKey), false)
val bundle = Bundle()
bundle.putParcelable(ConversationFragmentV2.URI,intent.data)
bundle.putString(ConversationFragmentV2.TYPE,intent.type)
bundle.putString(ConversationFragmentV2.BNS_NAME,bnsName)
val returnIntent = Intent()
returnIntent.putExtra(ConversationFragmentV2.ADDRESS, recipient.address)
//returnIntent.setDataAndType(intent.data, intent.type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,7 @@ class HomeFragment : BaseFragment(),ConversationClickListener,
extras.putLong(ConversationFragmentV2.THREAD_ID, result.data!!.getLongExtra(ConversationFragmentV2.THREAD_ID,-1))
extras.putParcelable(ConversationFragmentV2.URI,result.data!!.parcelable(ConversationFragmentV2.URI))
extras.putString(ConversationFragmentV2.TYPE,result.data!!.getStringExtra(ConversationFragmentV2.TYPE))
extras.putString(ConversationFragmentV2.BNS_NAME,result.data!!.getStringExtra(ConversationFragmentV2.BNS_NAME))
replaceFragment(ConversationFragmentV2(), null, extras)
}
}
Expand Down
Loading

0 comments on commit 2558b2f

Please sign in to comment.