Skip to content
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

💣🐞[Hotbug fix] sharedprefs fb fix #19

Merged
merged 7 commits into from
May 4, 2022
Merged
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
11 changes: 6 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ android {
applicationId = 'com.loafwallet'
minSdkVersion 27
targetSdkVersion 31
versionCode 671
versionName "v2.5.0"
versionCode 673
versionName "v2.6.1"
multiDexEnabled true
archivesBaseName = "${versionName}(${versionCode})"

Expand Down Expand Up @@ -302,9 +302,10 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:4.3.1'

// Firebase
implementation 'com.google.firebase:firebase-analytics:20.1.0'
implementation 'com.google.firebase:firebase-crashlytics:18.2.8'
implementation 'com.google.firebase:firebase-crashlytics-ndk:18.2.8'
implementation platform('com.google.firebase:firebase-bom:29.3.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-crashlytics-ndk'

// Timber
implementation 'com.jakewharton.timber:timber:5.0.1'
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/breadwallet/BreadApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public void onCreate() {

boolean enableCrashlytics = true;
if (Utils.isEmulatorOrDebug(this)) {
// BRKeyStore.putFailCount(0, this);
enableCrashlytics = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ class FragmentSend : Fragment() {
comment
)
)
AnalyticsManager.logCustomEvent(BRConstants._20191105_DSL)
//AnalyticsManager.logCustomEvent(BRConstants._20191105_DSL)
BRSharedPrefs.incrementSendTransactionCount(context)
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,12 @@ public static JSONArray backupFetchRates(Activity activity) {
}

public static void updateFeePerKb(Context app) {
String jsonString = createGETRequestURL(app, "https://api.loafwallet.org/fee-per-kb");
if (jsonString == null || jsonString.isEmpty()) {
Timber.i("updateFeePerKb: failed to update fee, response string: %s", jsonString);
return;
}

//Operationally, it makes more sense to review the fees than rely on a server.
// Especially, when the missing server causes a major disconnect
// Using this hard code for a bi-yearly review. This matches the architecture in iOS
// KCW: May 3, 2022
String jsonString = "{'fee_per_kb': 10000, 'fee_per_kb_economy': 2500, 'fee_per_kb_luxury': 66746}";
try {
JSONObject obj = new JSONObject(jsonString);
// TODO: Refactor when mobile-api v0.4.0 is in prod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import android.app.TaskStackBuilder;
import android.content.Context;
import android.content.Intent;
import android.os.Build;

import androidx.core.app.NotificationCompat;

import com.breadwallet.presenter.activities.BreadActivity;
Expand All @@ -31,10 +33,12 @@ public static void sendNotification(Context ctx, int icon, String title, String
stackBuilder.addParentStack(BreadActivity.class);
// Adds the Intent that starts the Activity to the top of the stack
stackBuilder.addNextIntent(resultIntent);
int flags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ?
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE : PendingIntent.FLAG_UPDATE_CURRENT;
PendingIntent resultPendingIntent =
stackBuilder.getPendingIntent(
0,
PendingIntent.FLAG_UPDATE_CURRENT
flags
);
mBuilder.setContentIntent(resultPendingIntent);
NotificationManager mNotificationManager =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Build;

import com.breadwallet.presenter.activities.BreadActivity;
import com.breadwallet.tools.listeners.SyncReceiver;
Expand All @@ -29,10 +30,13 @@ private SyncManager() {
}

private void createAlarm(Context app, long time) {
//Add another flag
AlarmManager alarmManager = (AlarmManager) app.getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(app, SyncReceiver.class);
intent.setAction(SyncReceiver.SYNC_RECEIVER);//my custom string action name
PendingIntent pendingIntent = PendingIntent.getService(app, 1001, intent, PendingIntent.FLAG_UPDATE_CURRENT);
int flags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ?
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE : PendingIntent.FLAG_UPDATE_CURRENT;
PendingIntent pendingIntent = PendingIntent.getService(app, 1001, intent, flags);
alarmManager.setWindow(AlarmManager.RTC_WAKEUP, time, time + TimeUnit.MINUTES.toMillis(1), pendingIntent);//first start will start asap
}

Expand Down