diff --git a/app/build.gradle b/app/build.gradle index 08bb3f3..9075421 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,10 +8,10 @@ android { ndkVersion '17.2.4988734' defaultConfig { applicationId "net.mynero.wallet" - minSdkVersion 21 + minSdkVersion 22 targetSdkVersion 34 - versionCode 50700 - versionName "0.5.7 'Fluorine Fermi'" + versionCode 50800 + versionName "0.5.8 'Fluorine Fermi'" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { @@ -113,48 +113,27 @@ static def getId(name) { } dependencies { + // Android stuff implementation 'androidx.core:core-ktx:1.12.0' implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.3.2' - implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.preference:preference-ktx:1.2.1' - - implementation 'com.google.android.material:material:1.10.0' - implementation 'com.ncorti:slidetoact:0.9.0' - implementation 'com.journeyapps:zxing-android-embedded:4.3.0' - implementation "com.jakewharton.timber:timber:5.0.1" - - implementation fileTree(dir: 'libs/classes', include: ['*.jar']) - - implementation 'org.slf4j:slf4j-nop:1.7.36' implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2' implementation 'androidx.navigation:navigation-fragment-ktx:2.7.5' implementation 'androidx.navigation:navigation-ui-ktx:2.7.5' - implementation 'androidx.core:core-ktx:1.12.0' - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + + // Slide to Send tx sliders + implementation 'com.ncorti:slidetoact:0.9.0' + + // QR Code stuff + implementation 'com.journeyapps:zxing-android-embedded:4.3.0' // Tor def vTor = '4.8.6-0' def vKmpTor = '1.4.4' - - implementation 'io.samourai.code.wallet:android-tor-binary:0.4.7.12' implementation "io.matthewnelson.kotlin-components:kmp-tor:$vTor-$vKmpTor" - - //noinspection GradleDependency - testImplementation "junit:junit:4.13.2" - testImplementation "org.mockito:mockito-all:1.10.19" - testImplementation "com.squareup.okhttp3:mockwebserver:4.9.3" - testImplementation 'org.json:json:20230227' - testImplementation 'net.jodah:concurrentunit:0.4.6' -} - -//https://stackoverflow.com/questions/75274720/a-failure-occurred-while-executing-appcheckdebugduplicateclasses/75315276#75315276 -//Not sure why this is needed since Kotlin isn't used in this project... -configurations.implementation { - exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8' } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 55eefcb..ab78c94 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -12,7 +12,6 @@ = ArrayList() @@ -23,7 +23,7 @@ class Coins(private val handle: Long) { fun refresh() { val transactionInfos = refreshJ() - Timber.d("refresh size=%d", transactionInfos.size) + Log.d("Coins.kt", "refresh size=${transactionInfos.size}") all = transactionInfos } diff --git a/app/src/main/java/net/mynero/wallet/model/TransactionHistory.kt b/app/src/main/java/net/mynero/wallet/model/TransactionHistory.kt index 776c381..d600b34 100644 --- a/app/src/main/java/net/mynero/wallet/model/TransactionHistory.kt +++ b/app/src/main/java/net/mynero/wallet/model/TransactionHistory.kt @@ -15,7 +15,7 @@ */ package net.mynero.wallet.model -import timber.log.Timber +import android.util.Log class TransactionHistory(private val handle: Long, var accountIndex: Int) { var all: List = ArrayList() @@ -43,7 +43,7 @@ class TransactionHistory(private val handle: Long, var accountIndex: Int) { private fun refresh() { val transactionInfos = refreshJ() - Timber.d("refresh size=%d", transactionInfos.size) + Log.d("TransactionHistory.kt", "refresh size=${transactionInfos.size}") val iterator = transactionInfos.iterator() while (iterator.hasNext()) { val info = iterator.next() diff --git a/app/src/main/java/net/mynero/wallet/model/WalletManager.kt b/app/src/main/java/net/mynero/wallet/model/WalletManager.kt index 60f495d..59b5631 100644 --- a/app/src/main/java/net/mynero/wallet/model/WalletManager.kt +++ b/app/src/main/java/net/mynero/wallet/model/WalletManager.kt @@ -15,9 +15,9 @@ */ package net.mynero.wallet.model +import android.util.Log import net.mynero.wallet.data.Node import net.mynero.wallet.util.RestoreHeight -import timber.log.Timber import java.io.File import java.util.Calendar import java.util.Locale @@ -35,7 +35,7 @@ class WalletManager { private set private fun manageWallet(wallet: Wallet) { - Timber.d("Managing %s", wallet.name) + Log.d("WalletManager.kt", "Managing ${wallet.name}") this.wallet = wallet } @@ -43,7 +43,7 @@ class WalletManager { requireNotNull(wallet) { "Cannot unmanage null!" } checkNotNull(this.wallet) { "No wallet under management!" } check(this.wallet === wallet) { wallet.name + " not under management!" } - Timber.d("Unmanaging %s", wallet.name) + Log.d("WalletManager.kt", "Unmanaging ${wallet.name}") this.wallet = null } @@ -62,9 +62,9 @@ class WalletManager { if (restoreHeight != null) { wallet.setRestoreHeight(restoreHeight) } - Timber.d("Changed Restore Height from %d to %d", oldHeight, wallet.getRestoreHeight()) + Log.d("WalletManager.kt", "Changed Restore Height from $oldHeight to ${wallet.getRestoreHeight()}") wallet.setPassword(password) // this rewrites the keys file (which contains the restore height) - } else Timber.e(wallet.status.toString()) + } else Log.e("WalletManager.kt", wallet.status.toString()) return wallet } @@ -93,7 +93,7 @@ class WalletManager { manageWallet(wallet) if (wallet.status.isOk) { wallet.setPassword(password) // this rewrites the keys file (which contains the restore height) - } else Timber.e(wallet.status.toString()) + } else Log.e("WalletManager.kt", wallet.status.toString()) return wallet } @@ -235,27 +235,7 @@ class WalletManager { return queryWalletDeviceJ(keysFileName, password) >= 0 } - fun queryWalletDevice(keysFileName: String, password: String): Wallet.Device { - val device = queryWalletDeviceJ(keysFileName, password) - return Wallet.Device.values()[device + 1] // mapping is monero+1=android - } - private external fun queryWalletDeviceJ(keysFileName: String, password: String): Int - fun findWallets(path: File): List { - val wallets: MutableList = ArrayList() - Timber.d("Scanning: %s", path.absolutePath) - val found = - path.listFiles { _, filename -> filename.endsWith(".keys") } ?: return emptyList() - for (i in found.indices) { - val filename = found[i].name - val f = File( - found[i].parent, - filename.substring(0, filename.length - 5) - ) // 5 is length of ".keys"+1 - wallets.add(WalletInfo(f)) - } - return wallets - } // this should not be called on the main thread as it connects to the node (and takes a long time) fun setDaemon(node: Node?) { diff --git a/app/src/main/java/net/mynero/wallet/service/MoneroHandlerThread.kt b/app/src/main/java/net/mynero/wallet/service/MoneroHandlerThread.kt index e9b6918..39d40dd 100644 --- a/app/src/main/java/net/mynero/wallet/service/MoneroHandlerThread.kt +++ b/app/src/main/java/net/mynero/wallet/service/MoneroHandlerThread.kt @@ -16,6 +16,7 @@ */ package net.mynero.wallet.service +import android.util.Log import net.mynero.wallet.model.PendingTransaction import net.mynero.wallet.model.TransactionOutput import net.mynero.wallet.model.Wallet @@ -25,7 +26,6 @@ import net.mynero.wallet.model.Wallet.ConnectionStatus import net.mynero.wallet.model.WalletListener import net.mynero.wallet.model.WalletManager import net.mynero.wallet.util.Constants -import timber.log.Timber import java.security.SecureRandom /** @@ -93,7 +93,7 @@ class MoneroHandlerThread(name: String, val listener: Listener?, wallet: Wallet) if (heightDiff >= 2) { tryRestartConnection() } else { - Timber.d("refreshed() Synchronized") + Log.d("MoneroHandlerThread.kt", "refreshed() Synchronized") wallet.setSynchronized() wallet.store() refresh(true) @@ -103,7 +103,7 @@ class MoneroHandlerThread(name: String, val listener: Listener?, wallet: Wallet) } private fun tryRestartConnection() { - Timber.d("refreshed() Starting connection retry") + Log.d("MoneroHandlerThread.kt", "refreshed() Starting connection retry") listener?.onConnectionFail() wallet.init(0) wallet.startRefresh() diff --git a/app/src/main/java/net/mynero/wallet/util/Helper.kt b/app/src/main/java/net/mynero/wallet/util/Helper.kt index bea9260..ad54c03 100644 --- a/app/src/main/java/net/mynero/wallet/util/Helper.kt +++ b/app/src/main/java/net/mynero/wallet/util/Helper.kt @@ -29,16 +29,14 @@ import android.graphics.Canvas import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.VectorDrawable import android.os.Build +import android.util.Log import android.view.WindowManager import android.view.animation.Animation -import android.view.animation.AnimationUtils import android.view.inputmethod.InputMethodManager import android.widget.Toast import androidx.activity.result.ActivityResultLauncher import androidx.core.content.ContextCompat import net.mynero.wallet.R -import net.mynero.wallet.model.WalletManager -import timber.log.Timber import java.io.File import java.io.IOException import java.io.InputStreamReader @@ -69,12 +67,12 @@ object Helper { fun getStorage(context: Context, folderName: String?): File { val dir = File(context.filesDir, folderName) if (!dir.exists()) { - Timber.i("Creating %s", dir.absolutePath) + Log.i("Helper.kt", "Creating ${dir.absolutePath}") dir.mkdirs() // try to make it } if (!dir.isDirectory) { val msg = "Directory " + dir.absolutePath + " does not exist." - Timber.e(msg) + Log.e("Helper.kt",msg) throw IllegalStateException(msg) } return dir @@ -85,7 +83,7 @@ object Helper { if (context.checkSelfPermission(Manifest.permission.CAMERA) == PackageManager.PERMISSION_DENIED ) { - Timber.w("Permission denied for CAMERA - requesting it") + Log.w("Helper.kt", "Permission denied for CAMERA - requesting it") val permissions = arrayOf(Manifest.permission.CAMERA) context.requestPermissions( permissions, @@ -105,7 +103,7 @@ object Helper { if (context.checkSelfPermission(Manifest.permission.CAMERA) == PackageManager.PERMISSION_DENIED ) { - Timber.w("Permission denied for CAMERA - requesting it") + Log.w("Helper.kt", "Permission denied for CAMERA - requesting it") launcher.launch(Manifest.permission.CAMERA) false } else { @@ -119,7 +117,7 @@ object Helper { fun getWalletFile(context: Context, aWalletName: String?): File { val walletDir = getWalletRoot(context) val f = File(walletDir, aWalletName) - Timber.d("wallet=%s size= %d", f.absolutePath, f.length()) + Log.d("Helper.kt", "wallet=${f.absolutePath} size= ${f.length()}") return f } @@ -230,11 +228,11 @@ object Helper { } return sb.toString() } catch (ex: SocketTimeoutException) { - Timber.w("C %s", ex.localizedMessage) + Log.w("Helper.kt", "C ${ex.localizedMessage}") } catch (ex: MalformedURLException) { - Timber.e("A %s", ex.localizedMessage) + Log.e("Helper.kt","A ${ex.localizedMessage}") } catch (ex: IOException) { - Timber.e("B %s", ex.localizedMessage) + Log.e("Helper.kt","B ${ex.localizedMessage}") } finally { urlConnection?.disconnect() }