Skip to content

Commit

Permalink
🛠️ [Techdebt] Update loafwallet core 163 (#165)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

Added the AdvertID into the BreadApp singleton

Signed-off-by: kcw-grunt <[email protected]>

* 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 <[email protected]>

* updated the latest commit

Signed-off-by: kcw-grunt <[email protected]>

* 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 <[email protected]>

* cleanup after locating bug

Signed-off-by: kcw-grunt <[email protected]>

---------

Signed-off-by: kcw-grunt <[email protected]>
  • Loading branch information
kcw-grunt authored Mar 29, 2024
1 parent a0688d9 commit d599baf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions app/src/main/java/com/breadwallet/BreadApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/com/platform/tools/KVStoreManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/jni/loafwallet-core
Submodule loafwallet-core updated 4 files
+1 −2 BRKey.c
+34 −12 BRWallet.c
+4 −0 BRWallet.h
+0 −51 test.c

0 comments on commit d599baf

Please sign in to comment.