Skip to content

feat: Unused code clean-up #1326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ android {

getByName("debug") {
isJniDebuggable = true
buildConfigField("String", "GIPHY_KEY", "\"${secretProperties["giphy.key"]}\"")
}

getByName("release") {
buildConfigField("String", "GIPHY_KEY", "\"${secretProperties["giphy.key"]}\"")
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
Expand All @@ -90,12 +88,12 @@ android {
productFlavors {
create("regular") {
dimension = "privacy-mode"
buildConfigField("String", "NOTIFICATIONS_API_KEY", "\"${loadSecretProps()["service.notifications.api_key"]}\"") // todo use new API KEY
buildConfigField("String", "NOTIFICATIONS_API_KEY", "\"${loadSecretProps()["service.notifications.api_key"]}\"")
proguardFile("regular-proguard-rules.pro")
}
create("privacy") {
dimension = "privacy-mode"
buildConfigField("String", "NOTIFICATIONS_API_KEY", "\"${loadSecretProps()["service.notifications.api_key"]}\"")// todo use new API KEY
buildConfigField("String", "NOTIFICATIONS_API_KEY", "\"${loadSecretProps()["service.notifications.api_key"]}\"")
}
}

Expand Down Expand Up @@ -235,6 +233,7 @@ dependencies {
implementation(Dependencies.AndroidX.legacySupport)
implementation(Dependencies.AndroidX.recyclerview)
implementation(Dependencies.AndroidX.viewpager2)
implementation(Dependencies.AndroidX.material)
implementation(Dependencies.AndroidX.activityKtx)
implementation(Dependencies.AndroidX.fragmentKtx)
implementation(Dependencies.AndroidX.Lifecycle.extensions)
Expand All @@ -248,17 +247,12 @@ dependencies {
implementation(Dependencies.AndroidX.Compose.uiTooling)
implementation(Dependencies.AndroidX.Compose.uiToolingPreview)
implementation(Dependencies.AndroidX.Compose.activity)
implementation(Dependencies.AndroidX.Compose.webView)

implementation(Dependencies.Coroutines.android)
implementation(Dependencies.Coroutines.core)
implementation(Dependencies.Coroutines.rx2)

implementation(Dependencies.flexbox)

implementation(Dependencies.glide)
ksp(Dependencies.glideCompiler)

implementation(Dependencies.dagger)
ksp(Dependencies.daggerCompiler)

Expand Down Expand Up @@ -301,7 +295,6 @@ dependencies {
// sentry - crash analytics
implementation(Dependencies.Sentry.sentryAndroid)

implementation(Dependencies.rxandroid)
implementation(Dependencies.rxjava)

// spring animation
Expand All @@ -320,10 +313,6 @@ dependencies {

implementation(Dependencies.blessedAndroid)

implementation(Dependencies.giphySdkUi) {
exclude(group = "com.android.support")
}

implementation(Dependencies.itext7Core)

implementation(Dependencies.keyboardVisibilityEvent)
Expand Down
8 changes: 0 additions & 8 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@

-keep enum com.tari.android.wallet.application.Network { *; }

-keep class com.tari.android.wallet.ui.common.giphy.api.dto.SearchGIFResponse { *; }
-keep class com.tari.android.wallet.ui.common.giphy.api.dto.SearchGIFsResponse { *; }
-keep class com.tari.android.wallet.ui.common.giphy.api.dto.Data { *; }
-keep class com.tari.android.wallet.ui.common.giphy.api.dto.Meta { *; }
-keep class com.tari.android.wallet.ui.common.giphy.api.dto.Images { *; }
-keep class com.tari.android.wallet.ui.common.giphy.api.dto.ImageVariant { *; }
-keep class com.tari.android.wallet.ui.common.giphy.api.dto.Original { *; }

-keep class **Fragment** { *; }
-keep class **ViewModel** { *; }

Expand Down
1 change: 0 additions & 1 deletion app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ add_library(
jniSeedWords.cpp
jniEmojiSet.cpp
jniTransactionSendStatus.cpp
jniCovenant.cpp
jniOutputFeatures.cpp
jniTariFeePerGramStats.cpp
jniTariFeePerGramStat.cpp
Expand Down
63 changes: 0 additions & 63 deletions app/src/main/cpp/jniCovenant.cpp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import com.tari.android.wallet.di.ApplicationScope
import com.tari.android.wallet.di.DiContainer
import com.tari.android.wallet.infrastructure.logging.LoggerAdapter
import com.tari.android.wallet.notification.NotificationHelper
import com.tari.android.wallet.ui.common.giphy.GiphyAdapter
import com.tari.android.wallet.util.DebugConfig
import io.sentry.android.core.SentryAndroid
import kotlinx.coroutines.CoroutineScope
Expand Down Expand Up @@ -78,9 +77,6 @@ class TariWalletApplication : Application() {
@Inject
lateinit var yatAdapter: YatAdapter

@Inject
lateinit var giphyAdapter: GiphyAdapter

@Inject
@ApplicationScope
lateinit var applicationScope: CoroutineScope
Expand Down Expand Up @@ -135,8 +131,6 @@ class TariWalletApplication : Application() {

yatAdapter.initYat(this)

giphyAdapter.init()

loggerAdapter.init()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.orhanobut.logger.Logger
import com.tari.android.wallet.BuildConfig
import com.tari.android.wallet.R
import com.tari.android.wallet.data.sharedPrefs.CorePrefRepository
import com.tari.android.wallet.data.sharedPrefs.network.NetworkPrefRepository
import com.tari.android.wallet.data.sharedPrefs.yat.YatPrefRepository
import com.tari.android.wallet.model.EmojiId
import com.tari.android.wallet.ui.screen.send.common.TransactionData
Expand All @@ -30,7 +29,6 @@ import javax.inject.Singleton
@Singleton
class YatAdapter @Inject constructor(
private val yatSharedRepository: YatPrefRepository,
private val networkRepository: NetworkPrefRepository,
private val commonRepository: CorePrefRepository
) : YatIntegration.Delegate {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
package com.tari.android.wallet.application.walletManager

import com.orhanobut.logger.Logger
import com.tari.android.wallet.BuildConfig
import com.tari.android.wallet.application.AppStateHandler
import com.tari.android.wallet.application.baseNodes.BaseNodesManager
import com.tari.android.wallet.application.walletManager.WalletCallbacks.Companion.MAIN_WALLET_CONTEXT_ID
Expand All @@ -57,7 +56,6 @@ import com.tari.android.wallet.ffi.FFITariTransportConfig
import com.tari.android.wallet.ffi.FFITariWalletAddress
import com.tari.android.wallet.ffi.FFIWallet
import com.tari.android.wallet.ffi.HexString
import com.tari.android.wallet.ffi.LogFileObserver
import com.tari.android.wallet.ffi.NetAddressString
import com.tari.android.wallet.ffi.runWithDestroy
import com.tari.android.wallet.model.MicroTari
Expand Down Expand Up @@ -138,7 +136,6 @@ class WalletManager @Inject constructor(
private val _txSentConfirmations = MutableStateFlow(emptyList<TxSendResult>())
val txSentConfirmations = _txSentConfirmations.asStateFlow()

private var logFileObserver: LogFileObserver? = null
private val logger
get() = Logger.t(WalletManager::class.simpleName)

Expand Down Expand Up @@ -230,8 +227,6 @@ class WalletManager @Inject constructor(
walletCallbacks = walletCallbacks,
)

startLogFileObserver()

if (DebugConfig.selectBaseNodeEnabled) {
baseNodesManager.refreshBaseNodeList(wallet)
if (baseNodesManager.currentBaseNode == null) {
Expand Down Expand Up @@ -282,17 +277,6 @@ class WalletManager @Inject constructor(
)
}

/**
* Starts the log file observer only in debug mode.
* Will skip if the app is in release config.
*/
private fun startLogFileObserver() {
if (BuildConfig.DEBUG) {
logFileObserver = LogFileObserver(walletConfig.getWalletLogFilePath())
logFileObserver?.startWatching()
}
}

/**
* Stores wallet's Base58 address and emoji id into the shared prefs
* for future convenience.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 10 additions & 1 deletion app/src/main/java/com/tari/android/wallet/data/tx/TxDto.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@ import com.tari.android.wallet.model.tx.Tx
data class TxDto(
val tx: Tx,
val contact: ContactDto?,
)
) {
fun contains(searchQuery: String): Boolean = this.tx.tariContact.walletAddress.fullEmojiId.contains(searchQuery, ignoreCase = true)
|| this.tx.tariContact.walletAddress.fullBase58.contains(searchQuery, ignoreCase = true)
|| this.tx.tariContact.alias.contains(searchQuery, ignoreCase = true)
|| this.tx.message.contains(searchQuery, ignoreCase = true)
|| this.tx.paymentId.contains(searchQuery, ignoreCase = true)
|| this.tx.amount.formattedTariValue.contains(searchQuery, ignoreCase = true)
|| this.tx.amount.formattedValue.contains(searchQuery, ignoreCase = true)
|| this.contact?.contactInfo?.getAlias()?.contains(searchQuery, ignoreCase = true) == true
}
Loading