From d599baf186a9a8b1e7e047975ce46f8934fe0616 Mon Sep 17 00:00:00 2001 From: Kerry Washington Date: Fri, 29 Mar 2024 02:40:33 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20[Techdebt]=20Update=20l?= =?UTF-8?q?oafwallet=20core=20163=20(#165)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Finally fixed the PN dep error caused by Firebase - Added more analytics for the push notifications - Simple clean up refactoring Signed-off-by: kcw-grunt Added the AdvertID into the BreadApp singleton Signed-off-by: kcw-grunt * Added access and location of the key file - addess access object, JSON object, method to read and operate - updated gitignore Signed-off-by: kcw-grunt * updated the latest commit Signed-off-by: kcw-grunt * DO NOT SQUASH - bugfix: com.breadwallet.tools.manager.BRSharedPrefs.getIso Biggest bug in when the user has ru as the as a default language https://console.firebase.google.com/project/litewallet-beta/crashlytics/app/android:com.loafwallet/issues/78150fde415a8e4c174f19e2ff2e0988?time=1703682751000:1706274751000&sessionEventKey=65B37C4E00DC00016CE457C04AD2C024_1906783813838484053 - Testing to set to RU for ru Signed-off-by: kcw-grunt * cleanup after locating bug Signed-off-by: kcw-grunt --------- Signed-off-by: kcw-grunt --- app/src/main/java/com/breadwallet/BreadApp.java | 4 ++++ .../com/breadwallet/tools/manager/BRSharedPrefs.java | 12 ++++++++---- .../main/java/com/platform/tools/KVStoreManager.java | 3 +++ app/src/main/jni/loafwallet-core | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/breadwallet/BreadApp.java b/app/src/main/java/com/breadwallet/BreadApp.java index 356d6b7cc..d9befa5de 100644 --- a/app/src/main/java/com/breadwallet/BreadApp.java +++ b/app/src/main/java/com/breadwallet/BreadApp.java @@ -3,6 +3,7 @@ import android.app.Activity; import android.app.Application; import android.content.Context; +import android.content.SharedPreferences; import android.graphics.Point; import android.hardware.fingerprint.FingerprintManager; import android.os.Bundle; @@ -28,9 +29,12 @@ import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; +import java.text.DateFormat; import java.util.ArrayList; +import java.util.Currency; import java.util.Date; import java.util.List; +import java.util.Locale; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.atomic.AtomicInteger; diff --git a/app/src/main/java/com/breadwallet/tools/manager/BRSharedPrefs.java b/app/src/main/java/com/breadwallet/tools/manager/BRSharedPrefs.java index 58e148933..dd37d766e 100644 --- a/app/src/main/java/com/breadwallet/tools/manager/BRSharedPrefs.java +++ b/app/src/main/java/com/breadwallet/tools/manager/BRSharedPrefs.java @@ -43,15 +43,19 @@ public static String getIso(Context context) { SharedPreferences settingsToGet = context.getSharedPreferences(BRConstants.PREFS_NAME, 0); String defIso; + String defaultLanguage = Locale.getDefault().getLanguage(); + try { - defIso = Currency.getInstance(Locale.getDefault()).getCurrencyCode(); + if (defaultLanguage == "ru") { + defIso = Currency.getInstance(new Locale("ru", "RU")).getCurrencyCode(); + } + else { + defIso = Currency.getInstance(Locale.getDefault()).getCurrencyCode(); + } } catch (IllegalArgumentException e) { Timber.e(e); - ///This is always going to be a Litewallet problem - // Inspired by: https://stackoverflow.com/questions/26376439/locale-getdefault-returns-unsuported-invalid-locale-for-currency-getinstance defIso = Currency.getInstance(new Locale("en", "US")).getCurrencyCode(); } - return settingsToGet.getString(BRConstants.CURRENT_CURRENCY, defIso); } diff --git a/app/src/main/java/com/platform/tools/KVStoreManager.java b/app/src/main/java/com/platform/tools/KVStoreManager.java index 8deca2a37..61866336f 100644 --- a/app/src/main/java/com/platform/tools/KVStoreManager.java +++ b/app/src/main/java/com/platform/tools/KVStoreManager.java @@ -48,6 +48,9 @@ public TxMetaData getTxMetaData(Context app, byte[] txHash) { RemoteKVStore remoteKVStore = RemoteKVStore.getInstance(APIClient.getInstance(app)); ReplicatedKVStore kvStore = ReplicatedKVStore.getInstance(app, remoteKVStore); long ver = kvStore.localVersion(key).version; + Timber.d("timber: remoteKVStore: %s",remoteKVStore.toString()); + Timber.d("timber: ReplicatedKVStore: %s",kvStore.toString()); + Timber.d("timber: ver: %s",ver); CompletionObject obj = kvStore.get(key, ver); diff --git a/app/src/main/jni/loafwallet-core b/app/src/main/jni/loafwallet-core index 1a15ac045..45105ddba 160000 --- a/app/src/main/jni/loafwallet-core +++ b/app/src/main/jni/loafwallet-core @@ -1 +1 @@ -Subproject commit 1a15ac045ab96330afbf59be99b7d6d2e8712542 +Subproject commit 45105ddbaad9dd1beca87136483d80b0c870e494