Skip to content

Commit 214baf4

Browse files
committed
Apollo: Release source code for 52.3
1 parent 86048fe commit 214baf4

File tree

378 files changed

+14635
-22559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

378 files changed

+14635
-22559
lines changed

android/CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,50 @@ follow [https://changelog.md/](https://changelog.md/) guidelines.
66

77
## [Unreleased]
88

9+
## [52.3] - 2024-10-08
10+
11+
### ADDED
12+
13+
- Several background notification processing reliability improvements
14+
15+
### FIXED
16+
17+
- Fixed cancel payment dialog copy.
18+
- Fixed low occurrence crash when tapping delete wallet.
19+
- Fixed low occurrence crash when entering a payment detail from a notification or recent apps
20+
- Fixed mempool space tx link destination (after mempool.space changed url destination)
21+
- Released certain resources (like SQLite cursors) that weren't being released to avoid leaks.
22+
- Fixed countDownTimer lifecycle issue (not being cancelled) in newop (send) screen
23+
24+
### CHANGED
25+
26+
- Upgrade Firebase to get SDK to get Release Monitoring feature.
27+
- Upgrade Firebase dependencies using BOM (Bill Of Materials). firebase-bom:32.6.0
28+
- Upgrade Firebase Messaging as part of firebase-bom:32.6.0
29+
- Upgrade Firebase Crashlytics as part of firebase-bom:32.6.0
30+
- Upgrade Firebase Analytics as part of firebase-bom:32.6.0
31+
- Update Go version to 1.22.1
32+
- Update Kotlin version to 1.8.20
33+
- Upgrade Dagger to 2.52
34+
- Upgrade SQDelight to 1.5.5
35+
- Upgrade libwallet dependencies (like btcd)
36+
- Removed secp256k1-zkp C code from lib wallet. Replaced it with the native Go version.
37+
- Refactored and enhanced musig code in libwallet
38+
- Enhanced debugging and tracing metadata for ANRs troubleshooting
39+
- Avoid unnecessary writes to Android Keystore
40+
- Avoid double write/delete to Android Keystore in logouts
41+
- Reduce Butterknife usage (in slow effort to migrate Butterknife to ViewBinding)
42+
- Simplified and cleaned libwallet build scripts
43+
- Avoid needless requests when creating a new wallet
44+
- Refactored (cleaned up) delete wallet logic
45+
- Removed Stetho library (long time unused)
46+
- Kotlinized all the repositories, part of an effort to delay access to shared prefs (lazy access).
47+
- Introduced MockK for mocking kotlin classes, fields and properties.
48+
- Upgrade AndroidX Navigation lib version to 2.7.7
49+
- Upgrade AndroidX WorkManager lib version to 2.9.0
50+
- Upgrade Android lifecycle aware components libs to 2.6.2
51+
- Removed no longer needed *-ktx dependencies
52+
953
## [52.2] - 2024-09-23
1054

1155
### FIXED

android/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM --platform=linux/amd64 openjdk:17-jdk-buster@sha256:9217da81dcff19e60861791
33
ENV NDK_VERSION 22.0.7026061
44
ENV ANDROID_PLATFORM_VERSION 28
55
ENV ANDROID_BUILD_TOOLS_VERSION 28.0.3
6-
ENV GO_VERSION 1.21.11
6+
ENV GO_VERSION 1.22.1
77

88
RUN apt-get update \
99
&& apt-get install --yes --no-install-recommends \

android/apollo/build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ apply from: "${project.rootDir}/linters/pmd/check-android.gradle"
2121
//apply from: "${project.rootDir}/linters/findbugs/check-android.gradle"
2222

2323
android {
24+
namespace "io.muun.apollo.lib"
25+
2426
compileSdk 34
2527

2628
defaultConfig {
@@ -70,7 +72,8 @@ ext {
7072
// TODO this currently needs to match common's retrofit version. We should refactor to avoid
7173
// this discipline on our part. We probably need to extract it to a constant in top-level gradle
7274
version_retrofit = '2.5.0'
73-
version_workmanager = '2.7.1'
75+
version_workmanager = '2.9.0' // Next version upgrade requires bump minSdk to 21
76+
version_mockk = '1.13.7' // Latest version targeting kotlin 1.8.20
7477
}
7578

7679

@@ -105,7 +108,7 @@ dependencies {
105108

106109
// Firebase:
107110
// Import the Firebase BoM
108-
api platform('com.google.firebase:firebase-bom:32.1.1')
111+
api platform('com.google.firebase:firebase-bom:32.6.0')
109112
// When using the BoM, you don't specify versions in Firebase library dependencies
110113

111114
// Push Notifications:
@@ -119,16 +122,11 @@ dependencies {
119122
// WorkManager: (see https://github.com/muun/muun/issues/5895)
120123
// Guide: https://developer.android.com/topic/libraries/architecture/workmanager/migrating-fb
121124
api "androidx.work:work-runtime:$version_workmanager" // api as needs to be init at app.OnCreate
122-
api "androidx.work:work-runtime-ktx:$version_workmanager" // Kotlin extensions
123-
124-
api 'com.facebook.stetho:stetho:1.5.0'
125-
api 'com.facebook.stetho:stetho-okhttp3:1.5.0'
126-
api 'com.facebook.stetho:stetho-timber:1.5.0@aar'
127125

128126
// Storage:
129127
implementation 'com.squareup.sqlbrite3:sqlbrite:3.2.0'
130-
implementation "com.squareup.sqldelight:android-driver:1.5.3"
131-
implementation "com.squareup.sqldelight:rxjava2-extensions:1.5.3"
128+
implementation "com.squareup.sqldelight:android-driver:1.5.5"
129+
implementation "com.squareup.sqldelight:rxjava2-extensions:1.5.5"
132130

133131
// Networking:
134132
implementation "com.squareup.retrofit2:retrofit:$version_retrofit"
@@ -162,6 +160,8 @@ dependencies {
162160
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0"
163161
testImplementation 'org.assertj:assertj-core:3.8.0'
164162
testImplementation 'junit:junit:4.12'
163+
testImplementation "io.mockk:mockk:$version_mockk"
164+
165165
// Can't use Jake Wharton's threeten lib for test. For more info see:
166166
// https://github.com/JakeWharton/ThreeTenABP/issues/47
167167
testImplementation 'org.threeten:threetenbp:1.6.8'

android/apollo/src/main/java/io/muun/apollo/data/db/base/BaseDao.java

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@
2727
public abstract class BaseDao<ModelT extends PersistentModel> {
2828

2929
protected final String tableName;
30+
3031
protected BriteDatabase briteDb;
32+
3133
protected SupportSQLiteDatabase db;
34+
3235
protected Database delightDb;
36+
3337
protected Scheduler scheduler;
3438

3539
/**
@@ -49,10 +53,13 @@ public void setDb(BriteDatabase briteDatabase, Database delightDb, final Schedul
4953
this.delightDb = delightDb;
5054
this.scheduler = scheduler;
5155

52-
Preconditions.checkState(
53-
briteDatabase.query("SELECT COUNT(*) FROM " + tableName).getCount() == 1,
54-
"expected table " + tableName + " to exist"
55-
);
56+
57+
try (Cursor cursor = briteDatabase.query("SELECT COUNT(*) FROM " + tableName)) {
58+
Preconditions.checkState(
59+
cursor.getCount() == 1,
60+
"expected table " + tableName + " to exist"
61+
);
62+
}
5663
}
5764

5865
/**
@@ -182,9 +189,11 @@ public Observable<ModelT> store(@Nonnull ModelT element) {
182189

183190
// FIXME: This is a racy operation. If another thread inserts any row, the id
184191
// won't match.
185-
final Cursor query = briteDb.query("SELECT last_insert_rowid();");
186-
Preconditions.checkState(query.moveToFirst());
187-
final long insertedId = query.getLong(0);
192+
final long insertedId;
193+
try (Cursor query = briteDb.query("SELECT last_insert_rowid();")) {
194+
Preconditions.checkState(query.moveToFirst());
195+
insertedId = query.getLong(0);
196+
}
188197
if (insertedId < 0) {
189198
throw new RuntimeException("Error while inserting new value in the db");
190199
}

android/apollo/src/main/java/io/muun/apollo/data/db/base/HoustonIdDao.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,20 @@ public Observable<ModelT> store(@NonNull ModelT element) {
3030
return super.store(element);
3131
}
3232

33-
final Cursor cursor = briteDb.query(
34-
"select id from " + tableName + " where hid = ?",
35-
String.valueOf(element.getHid())
36-
);
37-
38-
if (cursor.getCount() == 0) {
39-
return super.store(element);
40-
}
41-
42-
if (cursor.getCount() == 1) {
43-
cursor.moveToFirst();
44-
element.setId(cursor.getLong(cursor.getColumnIndex("id")));
45-
return super.store(element);
33+
final String id = String.valueOf(element.getHid());
34+
try (Cursor cursor = briteDb.query(
35+
"select id from " + tableName + " where hid = ?", id
36+
)) {
37+
38+
if (cursor.getCount() == 0) {
39+
return super.store(element);
40+
}
41+
42+
if (cursor.getCount() == 1) {
43+
cursor.moveToFirst();
44+
element.setId(cursor.getLong(cursor.getColumnIndex("id")));
45+
return super.store(element);
46+
}
4647
}
4748

4849
return Observable.error(

android/apollo/src/main/java/io/muun/apollo/data/di/DataComponent.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import io.muun.apollo.data.async.gcm.GcmMessageListenerService;
66
import io.muun.apollo.data.async.tasks.MuunWorkerFactory;
77
import io.muun.apollo.data.async.tasks.TaskScheduler;
8+
import io.muun.apollo.data.db.DaoManager;
89
import io.muun.apollo.data.db.contact.ContactDao;
910
import io.muun.apollo.data.db.operation.OperationDao;
1011
import io.muun.apollo.data.db.public_profile.PublicProfileDao;
@@ -110,4 +111,6 @@ public interface DataComponent extends ActionComponent {
110111
NotificationService notificationService();
111112

112113
Analytics analytics();
114+
115+
DaoManager daoManager();
113116
}

android/apollo/src/main/java/io/muun/apollo/data/external/Gen.kt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import io.muun.apollo.domain.model.IncomingSwap
1010
import io.muun.apollo.domain.model.IncomingSwapHtlc
1111
import io.muun.apollo.domain.model.NextTransactionSize
1212
import io.muun.apollo.domain.model.Operation
13-
import io.muun.apollo.domain.model.PaymentRequest
1413
import io.muun.apollo.domain.model.PublicProfile
1514
import io.muun.apollo.domain.model.SubmarineSwap
1615
import io.muun.apollo.domain.model.SubmarineSwapBestRouteFees
@@ -44,7 +43,6 @@ import org.javamoney.moneta.Money
4443
import org.threeten.bp.ZonedDateTime
4544
import javax.money.CurrencyUnit
4645
import javax.money.Monetary
47-
import javax.money.MonetaryAmount
4846
import kotlin.random.Random
4947

5048
object Gen {
@@ -250,7 +248,9 @@ object Gen {
250248
pair.second,
251249
transactionHash() + ":0",
252250
UtxoStatus.CONFIRMED,
253-
pair.second
251+
pair.second,
252+
"m/schema:1'/recovery:1'",
253+
1
254254
)
255255

256256
/**
@@ -269,6 +269,14 @@ object Gen {
269269
fun nextTransactionSize(vararg entries: SizeForAmount, expectedDebtInSat: Long = 0) =
270270
NextTransactionSize(sizeProgression(*entries), 1, expectedDebtInSat)
271271

272+
/**
273+
* Get a FeeBumpFunctions vector
274+
*/
275+
fun feeBumpFunctions() =
276+
listOf(
277+
"QsgAAAAAAAAAAAAAf4AAAD+AAABAAAAA", // [[100, 0, 0], [+Inf, 1, 2]]
278+
"f4AAAD+AAAAAAAAA" // [[+Inf, 1, 0]]]
279+
)
272280
/**
273281
* Get a Transaction Hash.
274282
*/

android/apollo/src/main/java/io/muun/apollo/data/external/Globals.kt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,6 @@ abstract class Globals {
6060
*/
6161
abstract val deviceManufacturer: String
6262

63-
/**
64-
* Get the fingerprint of the device where app is running.
65-
*/
66-
abstract val fingerprint: String
67-
68-
/**
69-
* Get the hardware name of the device where app is running.
70-
*/
71-
abstract val hardware: String
72-
73-
/**
74-
* Get the bootloader name of the device where app is running.
75-
*/
76-
abstract val bootloader: String
77-
7863
/**
7964
* Get the bitcoin network specs/parameters of the network this build is using.
8065
*/

android/apollo/src/main/java/io/muun/apollo/data/logging/Crashlytics.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ object Crashlytics {
110110
}
111111

112112
analyticsProvider?.report(
113-
AnalyticsEvent.E_CRASHLYTICS_ERROR(
114-
report.error.javaClass.simpleName + ":" + report.error.localizedMessage
115-
)
113+
AnalyticsEvent.E_CRASHLYTICS_ERROR(report)
116114
)
117115

118116
crashlytics?.recordException(report.error)

0 commit comments

Comments
 (0)