diff --git a/app/build.gradle b/app/build.gradle index 6f9170611..1444df859 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -288,8 +288,10 @@ dependencies { implementation "com.dropbox.core:dropbox-core-sdk:5.4.6" -// implementation "com.github.yat-labs:yat-lib-android:0.1.42" - implementation project(":yatlib") + // It's recommended to use the latest version of the library from the JitPack repository, + // but you can also use a locally build version of the library by using the ":yatlib" module and `yat-lib-debug-snapshot.aar` file with your build + implementation "com.github.tari-project:yat-lib-android:0.4.1" +// implementation project(":yatlib") // custom libraries region // flex layout diff --git a/app/src/main/java/com/tari/android/wallet/ui/common/CommonFragment.kt b/app/src/main/java/com/tari/android/wallet/ui/common/CommonFragment.kt index 49faba329..47a3ab559 100644 --- a/app/src/main/java/com/tari/android/wallet/ui/common/CommonFragment.kt +++ b/app/src/main/java/com/tari/android/wallet/ui/common/CommonFragment.kt @@ -16,6 +16,7 @@ import androidx.activity.result.contract.ActivityResultContracts import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import androidx.viewbinding.ViewBinding +import com.tari.android.wallet.BuildConfig import com.tari.android.wallet.R import com.tari.android.wallet.di.DiContainer import com.tari.android.wallet.extension.observe diff --git a/app/src/main/java/com/tari/android/wallet/ui/fragment/biometrics/ChangeBiometricsFragment.kt b/app/src/main/java/com/tari/android/wallet/ui/fragment/biometrics/ChangeBiometricsFragment.kt index e39fa7441..76355cc6e 100644 --- a/app/src/main/java/com/tari/android/wallet/ui/fragment/biometrics/ChangeBiometricsFragment.kt +++ b/app/src/main/java/com/tari/android/wallet/ui/fragment/biometrics/ChangeBiometricsFragment.kt @@ -14,7 +14,7 @@ import com.tari.android.wallet.extension.observe import com.tari.android.wallet.infrastructure.security.biometric.BiometricAuthenticationException import com.tari.android.wallet.ui.common.CommonFragment import com.tari.android.wallet.ui.extension.string -import com.tari.android.wallet.util.TariBuild.MOCKED +import com.tari.android.wallet.util.DebugConfig import kotlinx.coroutines.launch class ChangeBiometricsFragment : CommonFragment() { @@ -45,7 +45,7 @@ class ChangeBiometricsFragment : CommonFragment() { private fun setupBottomNavigation() { enableNavigationView(ui.homeImageView) - ui.viewPager.adapter = if (TariBuild.isChat) HomeChatAdapter(supportFragmentManager, this.lifecycle) + ui.viewPager.adapter = if (DebugConfig.isChatEnabled) HomeChatAdapter(supportFragmentManager, this.lifecycle) else HomeStoreAdapter(supportFragmentManager, this.lifecycle) ui.viewPager.isUserInputEnabled = false ui.viewPager.offscreenPageLimit = 3 @@ -277,12 +277,12 @@ class HomeActivity : CommonActivity() { ui.viewPager.setCurrentItem(INDEX_HOME, NO_SMOOTH_SCROLL) enableNavigationView(ui.homeImageView) } - ui.storeImageView.setImageResource(if (TariBuild.isChat) R.drawable.vector_home_book else R.drawable.vector_ttl_store_icon) + ui.storeImageView.setImageResource(if (DebugConfig.isChatEnabled) R.drawable.vector_home_book else R.drawable.vector_ttl_store_icon) ui.storeView.setOnClickListener { ui.viewPager.setCurrentItem(INDEX_CONTACT_BOOK, NO_SMOOTH_SCROLL) enableNavigationView(ui.storeImageView) } - ui.chatImageView.setImageResource(if (TariBuild.isChat) R.drawable.vector_home_chat else R.drawable.vector_home_book) + ui.chatImageView.setImageResource(if (DebugConfig.isChatEnabled) R.drawable.vector_home_chat else R.drawable.vector_home_book) ui.chatView.setOnClickListener { ui.viewPager.setCurrentItem(INDEX_CHAT, NO_SMOOTH_SCROLL) enableNavigationView(ui.chatImageView) diff --git a/app/src/main/java/com/tari/android/wallet/ui/fragment/send/addAmount/AddAmountFragment.kt b/app/src/main/java/com/tari/android/wallet/ui/fragment/send/addAmount/AddAmountFragment.kt index 56c9dfd39..77dc17b4e 100644 --- a/app/src/main/java/com/tari/android/wallet/ui/fragment/send/addAmount/AddAmountFragment.kt +++ b/app/src/main/java/com/tari/android/wallet/ui/fragment/send/addAmount/AddAmountFragment.kt @@ -228,13 +228,13 @@ class AddAmountFragment : CommonFragment balanceInfo.availableBalance && !TariBuild.MOCKED) { + if (amount > balanceInfo.availableBalance && !DebugConfig.mockedDataEnabled) { lifecycleScope.launch(Dispatchers.Main) { actualBalanceExceeded() } } else { lifecycleScope.launch(Dispatchers.Main) { - if (fee > amount && !TariBuild.MOCKED) { + if (fee > amount && !DebugConfig.mockedDataEnabled) { val args = ErrorDialogArgs( string(error_fee_more_than_amount_title), string(error_fee_more_than_amount_description) @@ -292,7 +292,7 @@ class AddAmountFragment : CommonFragment availableBalance) { + if (!DebugConfig.mockedDataEnabled && (keyboardController.currentAmount + viewModel.selectedFeeData?.calculatedFee!!) > availableBalance) { showErrorState() } else { showSuccessState() diff --git a/app/src/main/java/com/tari/android/wallet/ui/fragment/send/finalize/YatFinalizeSendTxActivity.kt b/app/src/main/java/com/tari/android/wallet/ui/fragment/send/finalize/YatFinalizeSendTxActivity.kt index fa01a234a..7285a921f 100644 --- a/app/src/main/java/com/tari/android/wallet/ui/fragment/send/finalize/YatFinalizeSendTxActivity.kt +++ b/app/src/main/java/com/tari/android/wallet/ui/fragment/send/finalize/YatFinalizeSendTxActivity.kt @@ -4,6 +4,7 @@ import android.os.Bundle import androidx.activity.viewModels import androidx.lifecycle.lifecycleScope import com.google.gson.Gson +import com.orhanobut.logger.Logger import com.tari.android.wallet.extension.observe import com.tari.android.wallet.extension.observeOnLoad import com.tari.android.wallet.ui.fragment.send.common.TransactionData @@ -17,18 +18,27 @@ class YatFinalizeSendTxActivity : YatLibOutcomingTransactionActivity() { val viewModel: FinalizeSendTxViewModel by viewModels() + private val logger + get() = Logger.t(YatFinalizeSendTxActivity::class.simpleName) + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - val gson = intent.getStringExtra(FinalizeSendTxViewModel.transactionDataKey)!! - val entity = Gson().fromJson(gson, TransactionData::class.java) - - viewModel.transactionData = entity + intent.getStringExtra(FinalizeSendTxViewModel.transactionDataKey) + ?.let { Gson().fromJson(it, TransactionData::class.java) } + ?.let { entity -> + viewModel.transactionData = entity - subscribeOnUI() - launchObserver() + subscribeOnUI() + launchObserver() + } ?: run { + logger.e("Transaction data is null. Finishing activity.") + finish() + return + } } + private fun subscribeOnUI() = with(viewModel) { observe(txFailureReason) { setTransactionState(TransactionState.Failed) } @@ -52,6 +62,6 @@ class YatFinalizeSendTxActivity : YatLibOutcomingTransactionActivity() { super.onStop() viewModel.sentTxId.value?.let { viewModel.tariNavigator.onSendTxSuccessful(true, it) } - viewModel.txFailureReason.value?.let {viewModel.tariNavigator.onSendTxFailure(true, it) } + viewModel.txFailureReason.value?.let { viewModel.tariNavigator.onSendTxFailure(true, it) } } } \ No newline at end of file diff --git a/app/src/main/java/com/tari/android/wallet/ui/fragment/settings/backup/verifySeedPhrase/SeedPhrase.kt b/app/src/main/java/com/tari/android/wallet/ui/fragment/settings/backup/verifySeedPhrase/SeedPhrase.kt index 8b96c8eb8..a4968c77a 100644 --- a/app/src/main/java/com/tari/android/wallet/ui/fragment/settings/backup/verifySeedPhrase/SeedPhrase.kt +++ b/app/src/main/java/com/tari/android/wallet/ui/fragment/settings/backup/verifySeedPhrase/SeedPhrase.kt @@ -1,12 +1,12 @@ package com.tari.android.wallet.ui.fragment.settings.backup.verifySeedPhrase -import com.tari.android.wallet.util.TariBuild +import com.tari.android.wallet.util.DebugConfig class SeedPhrase(private val seedWords: List) : Iterable { val length get() = seedWords.size - private fun sorted(): SeedPhrase = SeedPhrase(if (TariBuild.MOCKED) seedWords else seedWords.sorted()) + private fun sorted(): SeedPhrase = SeedPhrase(if (DebugConfig.mockedDataEnabled) seedWords else seedWords.sorted()) fun consistsOf(result: List): Boolean = seedWords == result diff --git a/app/src/main/java/com/tari/android/wallet/ui/fragment/tx/TransactionRepository.kt b/app/src/main/java/com/tari/android/wallet/ui/fragment/tx/TransactionRepository.kt index b8f702d90..760d850df 100644 --- a/app/src/main/java/com/tari/android/wallet/ui/fragment/tx/TransactionRepository.kt +++ b/app/src/main/java/com/tari/android/wallet/ui/fragment/tx/TransactionRepository.kt @@ -29,8 +29,8 @@ import com.tari.android.wallet.ui.common.recyclerView.CommonViewHolderItem import com.tari.android.wallet.ui.common.recyclerView.items.TitleViewHolderItem import com.tari.android.wallet.ui.fragment.contact_book.data.ContactsRepository import com.tari.android.wallet.ui.fragment.tx.adapter.TransactionItem -import com.tari.android.wallet.util.TariBuild -import com.tari.android.wallet.util.TariBuild.MOCKED +import com.tari.android.wallet.util.DebugConfig +import com.tari.android.wallet.util.MockDataStub import io.reactivex.BackpressureStrategy import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -173,7 +173,7 @@ class TransactionRepository @Inject constructor() : CommonViewModel() { }) } - if (MOCKED) { + if (DebugConfig.mockedDataEnabled) { val title = TitleViewHolderItem("Mocked Transactions", true) val messageGiphy = " https://giphy.com/embed/5885nYOgBHdCw" @@ -187,7 +187,7 @@ class TransactionRepository @Inject constructor() : CommonViewModel() { message = messageGiphy timestamp = BigInteger.valueOf(System.currentTimeMillis()) id = BigInteger.valueOf(1) - tariContact = TariContact(TariBuild.moched_zero_contact, "test1") + tariContact = TariContact(MockDataStub.WALLET_ADDRESS_ZERO, "test1") }, contactsRepository.ffiBridge.getContactForTx(CompletedTx()), 0, @@ -203,7 +203,7 @@ class TransactionRepository @Inject constructor() : CommonViewModel() { timestamp = BigInteger.valueOf(System.currentTimeMillis()) id = BigInteger.valueOf(1) message = messageGiphy - tariContact = TariContact(TariBuild.moched_zero_contact, "test2") + tariContact = TariContact(MockDataStub.WALLET_ADDRESS_ZERO, "test2") } val item2 = TransactionItem( tx2, @@ -221,7 +221,7 @@ class TransactionRepository @Inject constructor() : CommonViewModel() { fee = MicroTari(BigInteger.valueOf(1000)) timestamp = BigInteger.valueOf(System.currentTimeMillis()) id = BigInteger.valueOf(1) - tariContact = TariContact(TariBuild.mocked_wallet_address, "test3") + tariContact = TariContact(MockDataStub.WALLET_ADDRESS, "test3") } val item3 = TransactionItem( diff --git a/app/src/main/java/com/tari/android/wallet/ui/fragment/utxos/list/UtxosListViewModel.kt b/app/src/main/java/com/tari/android/wallet/ui/fragment/utxos/list/UtxosListViewModel.kt index 5b10da750..a1d04999f 100644 --- a/app/src/main/java/com/tari/android/wallet/ui/fragment/utxos/list/UtxosListViewModel.kt +++ b/app/src/main/java/com/tari/android/wallet/ui/fragment/utxos/list/UtxosListViewModel.kt @@ -28,7 +28,7 @@ import com.tari.android.wallet.ui.fragment.utxos.list.module.DetailItemModule import com.tari.android.wallet.ui.fragment.utxos.list.module.ListItemModule import com.tari.android.wallet.ui.fragment.utxos.list.module.UtxoAmountModule import com.tari.android.wallet.ui.fragment.utxos.list.module.UtxoSplitModule -import com.tari.android.wallet.util.TariBuild +import com.tari.android.wallet.util.DebugConfig import java.math.BigInteger import kotlin.random.Random @@ -165,7 +165,7 @@ class UtxosListViewModel : CommonViewModel() { wallet.getAllUtxos(error) }.itemsList.map { UtxosViewHolderItem(it) }.filter { it.isShowingStatus }.toMutableList() - if (TariBuild.MOCKED && allItems.isEmpty()) { + if (DebugConfig.mockedDataEnabled && allItems.isEmpty()) { for (i in 0 until 20) { allItems.add(0, UtxosViewHolderItem(TariUtxo().apply { value = MicroTari(BigInteger.valueOf(Random.nextLong(1, 100000) * 10000)) diff --git a/app/src/main/java/com/tari/android/wallet/util/BuildUtil.kt b/app/src/main/java/com/tari/android/wallet/util/BuildUtil.kt deleted file mode 100644 index fa82651b8..000000000 --- a/app/src/main/java/com/tari/android/wallet/util/BuildUtil.kt +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright 2020 The Tari Project - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the - * following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.tari.android.wallet.util - -import com.tari.android.wallet.BuildConfig -import com.tari.android.wallet.model.TariWalletAddress - -object TariBuild { - - private val _mockedTurned = true - val MOCKED = _mockedTurned && BuildConfig.BUILD_TYPE == "debug" - - val mocked_emojiId = - "\uD83C\uDFB9\uD83C\uDFA4\uD83C\uDF20\uD83C\uDFAA\uD83D\uDC16\uD83C\uDF5A\uD83D\uDE08\uD83C\uDF73\uD83C\uDFED\uD83D\uDC2F\uD83D\uDC29\uD83D\uDC33\uD83D\uDC2D\uD83D\uDC35\uD83D\uDC11\uD83C\uDF4E\uD83D\uDE02\uD83C\uDFB3\uD83C\uDF34\uD83C\uDF6D\uD83D\uDC0D\uD83C\uDF1F\uD83D\uDCBC\uD83C\uDFB9\uD83D\uDC3A\uD83D\uDC79\uD83C\uDF77\uD83D\uDC3B\uD83D\uDEAB\uD83D\uDE92\uD83D\uDCB3\uD83C\uDFAE\uD83D\uDD2A" - val mocked_hex = "5A4A0A4F7427E33469858088838A721FE1560C316F09C55A8EA6388FFBF1C152DA" - - val mocked_zero_emojiId = (0..25).map { "\uD83C\uDF00" }.joinToString("") - val mocked_zero_hex = TariWalletAddress.zero66Hex - - val mocked_wallet_address -// get() = TariWalletAddress(mocked_hex, mocked_emojiId) - get() = TariWalletAddress( - "C05575BE00EF016A209B1F493D9027B0E330F3E25FE89BBE6FA66D966EE5B6356", - "\uD83C\uDF34\uD83C\uDF0D\uD83C\uDFB5\uD83C\uDFBA\uD83D\uDDFD\uD83C\uDF37\uD83D\uDE91\uD83C\uDF45\uD83D\uDC60\uD83C\uDF1F\uD83D\uDC8C\uD83D\uDE97\uD83D\uDC40\uD83D\uDD29\uD83C\uDF08\uD83D\uDC1D\uD83C\uDF37\uD83C\uDF70\uD83C\uDF38\uD83C\uDF81\uD83C\uDF55\uD83D\uDEBF\uD83D\uDC34\uD83D\uDCA6\uD83D\uDE0E\uD83D\uDEAA\uD83C\uDFE0\uD83D\uDD29\uD83C\uDFE0\uD83D\uDE82\uD83C\uDFBA\uD83C\uDFC6\uD83C\uDFB3") - - val moched_zero_contact - get() = TariWalletAddress(mocked_zero_hex, mocked_zero_emojiId) - - val isChat = false -} \ No newline at end of file diff --git a/app/src/main/java/com/tari/android/wallet/util/BuildUtil.kt.orig b/app/src/main/java/com/tari/android/wallet/util/DebugConfig.kt similarity index 51% rename from app/src/main/java/com/tari/android/wallet/util/BuildUtil.kt.orig rename to app/src/main/java/com/tari/android/wallet/util/DebugConfig.kt index a873fd5c1..9e1655dd3 100644 --- a/app/src/main/java/com/tari/android/wallet/util/BuildUtil.kt.orig +++ b/app/src/main/java/com/tari/android/wallet/util/DebugConfig.kt @@ -34,31 +34,37 @@ package com.tari.android.wallet.util import com.tari.android.wallet.BuildConfig import com.tari.android.wallet.model.TariWalletAddress +import yat.android.lib.YatIntegration -object TariBuild { +/** + * Constants used for developing and debugging. + */ +object DebugConfig { + + private const val _mockedTurned = false + val mockedDataEnabled = _mockedTurned && isDebug() // TODO split this flag to multiple different types of mocked data - private val _mockedTurned = true - val MOCKED = _mockedTurned && BuildConfig.BUILD_TYPE == "debug" + val isChatEnabled = false - val mocked_emojiId = - "\uD83C\uDFB9\uD83C\uDFA4\uD83C\uDF20\uD83C\uDFAA\uD83D\uDC16\uD83C\uDF5A\uD83D\uDE08\uD83C\uDF73\uD83C\uDFED\uD83D\uDC2F\uD83D\uDC29\uD83D\uDC33\uD83D\uDC2D\uD83D\uDC35\uD83D\uDC11\uD83C\uDF4E\uD83D\uDE02\uD83C\uDFB3\uD83C\uDF34\uD83C\uDF6D\uD83D\uDC0D\uD83C\uDF1F\uD83D\uDCBC\uD83C\uDFB9\uD83D\uDC3A\uD83D\uDC79\uD83C\uDF77\uD83D\uDC3B\uD83D\uDEAB\uD83D\uDE92\uD83D\uDCB3\uD83C\uDFAE\uD83D\uDD2A" -<<<<<<< HEAD - val mocked_hex = "5A4A0A4F7427E33469858088838A721FE1560C316F09C55A8EA6388FFBF1C152DA" + private const val _useYatSandbox = false + val yatEnvironment = if (_useYatSandbox && isDebug()) YatEnvironment.SANDBOX else YatEnvironment.PRODUCTION - val mocked_zero_emojiId = (0..25).map { "\uD83C\uDF00" }.joinToString("") - val mocked_zero_hex = TariWalletAddress.zero66Hex + private fun isDebug() = BuildConfig.BUILD_TYPE == "debug" +} - val mocked_wallet_address - get() = TariWalletAddress(mocked_hex, mocked_emojiId) +object MockDataStub { + private const val EMOJI_ID = + "\uD83C\uDF34\uD83C\uDF0D\uD83C\uDFB5\uD83C\uDFBA\uD83D\uDDFD\uD83C\uDF37\uD83D\uDE91\uD83C\uDF45\uD83D\uDC60\uD83C\uDF1F\uD83D\uDC8C\uD83D\uDE97\uD83D\uDC40\uD83D\uDD29\uD83C\uDF08\uD83D\uDC1D\uD83C\uDF37\uD83C\uDF70\uD83C\uDF38\uD83C\uDF81\uD83C\uDF55\uD83D\uDEBF\uD83D\uDC34\uD83D\uDCA6\uD83D\uDE0E\uD83D\uDEAA\uD83C\uDFE0\uD83D\uDD29\uD83C\uDFE0\uD83D\uDE82\uD83C\uDFBA\uD83C\uDFC6\uD83C\uDFB3" + private const val HEX = "C05575BE00EF016A209B1F493D9027B0E330F3E25FE89BBE6FA66D966EE5B6356" - val moched_zero_contact - get() = TariWalletAddress(mocked_zero_hex, mocked_zero_emojiId) + private val EMOJI_ID_ZERO = (0..25).map { "\uD83C\uDF00" }.joinToString("") + private const val HEX_ZERO = TariWalletAddress.zero66Hex - val isChat = false -======= - val moched_hex = "5A4A0A4F7427E33469858088838A721FE1560C316F09C55A8EA6388FFBF1C152DA" + val WALLET_ADDRESS = TariWalletAddress(hexString = HEX, emojiId = EMOJI_ID) + val WALLET_ADDRESS_ZERO = TariWalletAddress(HEX_ZERO, EMOJI_ID_ZERO) +} - val mocked_wallet_address - get() = TariWalletAddress(moched_hex, mocked_emojiId) ->>>>>>> cb06ea1bc7c0b86add6505cb8e8235be91f6dd50 +object YatEnvironment { + val SANDBOX = YatIntegration.Environment("https://a.yat.fyi/", "https://yat.fyi/") + val PRODUCTION = YatIntegration.Environment("https://a.y.at/", "https://y.at/") } \ No newline at end of file diff --git a/app/src/main/java/com/tari/android/wallet/yat/YatAdapter.kt b/app/src/main/java/com/tari/android/wallet/yat/YatAdapter.kt index ebafbc166..3b258badd 100644 --- a/app/src/main/java/com/tari/android/wallet/yat/YatAdapter.kt +++ b/app/src/main/java/com/tari/android/wallet/yat/YatAdapter.kt @@ -13,6 +13,7 @@ import com.tari.android.wallet.data.sharedPrefs.network.NetworkRepository import com.tari.android.wallet.ui.fragment.send.common.TransactionData import com.tari.android.wallet.ui.fragment.send.finalize.FinalizeSendTxViewModel import com.tari.android.wallet.ui.fragment.send.finalize.YatFinalizeSendTxActivity +import com.tari.android.wallet.util.DebugConfig import yat.android.data.YatRecord import yat.android.data.YatRecordType import yat.android.lib.YatConfiguration @@ -32,8 +33,18 @@ class YatAdapter( get() = Logger.t(YatAdapter::class.simpleName) fun initYat(application: Application) { - val config = YatConfiguration(BuildConfig.YAT_ORGANIZATION_RETURN_URL, BuildConfig.YAT_ORGANIZATION_NAME, BuildConfig.YAT_ORGANIZATION_KEY) - YatIntegration.setup(application, config, YatIntegration.ColorMode.LIGHT, this, environment = YatIntegration.Environment.Production) + val config = YatConfiguration( + appReturnLink = BuildConfig.YAT_ORGANIZATION_RETURN_URL, + organizationName = BuildConfig.YAT_ORGANIZATION_NAME, + organizationKey = BuildConfig.YAT_ORGANIZATION_KEY, + ) + YatIntegration.setup( + context = application, + config = config, + colorMode = YatIntegration.ColorMode.LIGHT, + delegate = this, + environment = DebugConfig.yatEnvironment, + ) } fun searchTariYats(query: String): PaymentAddressResponse? = diff --git a/build.gradle b/build.gradle index 47a87db1c..7300f1f3c 100644 --- a/build.gradle +++ b/build.gradle @@ -32,17 +32,6 @@ plugins { id "de.undercouch.download" version "4.1.0" } -allprojects { - repositories { - // for yat - google() - mavenCentral() - maven { url "https://jitpack.io" } - maven { url "https://giphy.bintray.com/giphy-sdk" } - maven { url "https://raw.githubusercontent.com/guardianproject/gpmaven/master" } - } -} - tasks.register('clean', Delete) { delete rootProject.buildDir } diff --git a/settings.gradle b/settings.gradle index dce872de3..a6d705726 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,13 @@ include ':app', ':yatlib' rootProject.name='Tari Wallet' + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + maven { url "https://giphy.bintray.com/giphy-sdk" } + maven { url "https://raw.githubusercontent.com/guardianproject/gpmaven/master" } + maven { url "https://jitpack.io" } + } +} diff --git a/yatlib/build.gradle b/yatlib/build.gradle index ba2553622..0003b7dbc 100644 --- a/yatlib/build.gradle +++ b/yatlib/build.gradle @@ -1,2 +1,2 @@ configurations.maybeCreate("default") -artifacts.add("default", file('yat-lib-release.aar')) \ No newline at end of file +artifacts.add("default", file('yat-lib-development-snapshot.aar')) \ No newline at end of file diff --git a/yatlib/yat-lib-development-snapshot.aar b/yatlib/yat-lib-development-snapshot.aar new file mode 100644 index 000000000..91390dab4 Binary files /dev/null and b/yatlib/yat-lib-development-snapshot.aar differ diff --git a/yatlib/yat-lib-release.aar b/yatlib/yat-lib-release.aar deleted file mode 100644 index c5766f6c2..000000000 Binary files a/yatlib/yat-lib-release.aar and /dev/null differ