Skip to content

Commit b544519

Browse files
authored
Merge pull request #176 from muun/55.3-release-branch
Apollo: Release source code for 55.3 (1503)
2 parents fcc89e5 + e6b8243 commit b544519

175 files changed

Lines changed: 7016 additions & 3923 deletions

File tree

Some content is hidden

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

‎BUILD.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
### Requirements
44

55
* [OpenJDK](https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=hotspot) >= 8
6-
* [Golang](https://golang.org/dl/) >= 1.16
7-
* [Android NDK](https://developer.android.com/ndk/downloads) >= 21
6+
* [Golang](https://golang.org/dl/) = 1.24.x
7+
* [Android NDK](https://developer.android.com/ndk/downloads) >= 22
88
* [Docker](https://docs.docker.com/engine/install/) >= 28
99

1010
### Instructions
@@ -28,7 +28,7 @@
2828

2929
### Instructions
3030

31-
1. Ensure Docker has at least 5 GB of RAM and run:
31+
1. Ensure Docker has at least 16 GB of RAM, 60 GB of free space on disk and run:
3232
```shell
3333
mkdir -p apk
3434
DOCKER_BUILDKIT=1 docker build -f android/Dockerfile -o apk .
@@ -49,7 +49,7 @@
4949
adb pull $(adb shell pm path io.muun.apollo | grep "/base.apk" | sed 's/^package://') apollo-play.apk
5050
```
5151
2. Checkout the commit that corresponds to the version of the app you want to verify.
52-
3. Ensure Docker has at least 5 GB of RAM and run:
52+
3. Ensure Docker has at least 16 GB of RAM, 60 GB of free space on disk and run:
5353
```shell
5454
tools/verify-apollo.sh <path-to-verify.apk>
5555
```

‎android/CHANGELOG.md‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,22 @@ follow [https://changelog.md/](https://changelog.md/) guidelines.
66

77
## [Unreleased]
88

9-
## [55.1] - 2025-09-23
9+
## [55.3] - 2025-10-08
10+
11+
### CHANGED
12+
13+
- Bump `targetSDK` to 35
14+
- Replace ButterKnife with ViewBinding in various screens
15+
- Migrate ApolloApplication to Kotlin
16+
- Migrate Dagger @Component to Kotlin
17+
- Migrate Dagger @Module to Kotlin
18+
- Update go version to 1.24 to support 16kb pages
19+
20+
### ADDED
21+
22+
- 16kb page support
23+
24+
## [55.2] - 2025-09-23
1025

1126
### FIXED
1227

‎android/Dockerfile‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
# VERY IMPORTANT!!!
2+
# This file is used by build-release.yml (https://github.com/muun/apollo/blob/eedb679b9a5b7af2c617cc794c8dcf53eb1b4321/.github/workflows/build-release.yml).
3+
# Any change made here will affect how the APK is built in the OSS repository (github action)
4+
# and will impact the reproducible build verification.
5+
16
FROM --platform=linux/amd64 openjdk:17-jdk-slim@sha256:aaa3b3cb27e3e520b8f116863d0580c438ed55ecfa0bc126b41f68c3f62f9774 AS muun_android_builder
27

38
ENV NDK_VERSION 22.0.7026061
49
ENV ANDROID_PLATFORM_VERSION 28
510
ENV ANDROID_BUILD_TOOLS_VERSION 28.0.3
6-
ENV GO_VERSION 1.22.1
11+
ENV GO_VERSION 1.24.7
712

813
RUN apt-get update \
914
&& apt-get install --yes --no-install-recommends \

‎android/apolloui/build.gradle‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ android {
9797
defaultConfig {
9898
applicationId "io.muun.apollo"
9999
minSdk 19
100-
targetSdk 34
101-
versionCode 1502
102-
versionName "55.2"
100+
targetSdk 35
101+
versionCode 1503
102+
versionName "55.3"
103103

104104
// Needed to make sure these classes are available in the main DEX file for API 19
105105
// See: https://spin.atomicobject.com/2018/07/16/support-kitkat-multidex/
@@ -455,7 +455,8 @@ dependencies {
455455
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.1"
456456

457457
// Detect root devices (for error reports metadata and fraud control)
458-
implementation 'com.scottyab:rootbeer-lib:0.1.0'
458+
// TODO: go back to `com.scottyab:rootbeer-lib:x.x.x` after dropping API 19 support
459+
implementation 'com.github.muun:rootbeer:0.1.0'
459460

460461
// Google Play Integrity
461462
implementation 'com.google.android.play:integrity:1.1.0'
@@ -481,16 +482,17 @@ dependencies {
481482
kapt "com.google.dagger:dagger-compiler:$global_version_dagger"
482483

483484
// Android support:
484-
implementation 'androidx.appcompat:appcompat:1.4.2'
485-
implementation 'com.google.android.material:material:1.2.1'
485+
implementation 'androidx.appcompat:appcompat:1.6.1'
486+
implementation 'com.google.android.material:material:1.6.1'
486487
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
487488
implementation 'androidx.recyclerview:recyclerview:1.0.0'
488489
implementation 'androidx.annotation:annotation:1.0.0'
489490
implementation 'androidx.preference:preference:1.0.0'
490491
def emojiVersion = "1.1.0" // We need targetSdkVersion 32 to bump
491492
implementation "androidx.emoji2:emoji2:$emojiVersion"
493+
implementation "androidx.activity:activity:1.8.2"
492494

493-
// Remove gridrlayout-v7 once we drop minSDK version 19
495+
// Remove gridlayout-v7 once we drop minSDK version 19
494496
implementation 'androidx.gridlayout:gridlayout:1.0.0'
495497
implementation 'androidx.multidex:multidex:2.0.0'
496498
// We need to specify versions for customtabs and cardview because some dependencies use them

‎android/apolloui/src/main/java/io/muun/apollo/data/afs/ActivityManagerInfoProvider.kt‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@ class ActivityManagerInfoProvider(context: Context) {
1212
private val activityManager: ActivityManager =
1313
context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
1414

15-
val appImportance: Int
16-
get() {
17-
val appProcessInfo = ActivityManager.RunningAppProcessInfo()
18-
// ActivityManager#getMyMemoryState() method populates the appProcessInfo
19-
// instance with relevant details about the current state of the application's memory
20-
ActivityManager.getMyMemoryState(appProcessInfo)
21-
return appProcessInfo.importance
22-
}
23-
2415
/**
2516
* Returns true if this is a low-RAM device. Exactly whether a device is low-RAM is ultimately
2617
* up to the device configuration, but currently it generally means something with 1GB or less
@@ -62,11 +53,6 @@ class ActivityManagerInfoProvider(context: Context) {
6253
}
6354
}
6455

65-
val isUserAMonkey: Boolean
66-
get() {
67-
return ActivityManager.isUserAMonkey()
68-
}
69-
7056
val isLowMemoryKillReportSupported: Boolean
7157
get() {
7258
return if (OS.supportsLowMemoryKillReport()) {

‎android/apolloui/src/main/java/io/muun/apollo/data/afs/BackgroundExecutionMetricsProvider.kt‎

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,10 @@ class BackgroundExecutionMetricsProvider @Inject constructor(
1212
BackgroundExecutionMetrics(
1313
metricsProvider.currentTimeMillis,
1414
metricsProvider.batteryLevel,
15-
metricsProvider.maxBatteryLevel,
16-
metricsProvider.batteryHealth,
17-
metricsProvider.batteryDischargePrediction,
1815
metricsProvider.batteryStatus,
1916
metricsProvider.totalInternalStorageInBytes,
20-
metricsProvider.freeInternalStorageInBytes,
21-
metricsProvider.freeExternalStorageInBytes.toTypedArray(),
2217
metricsProvider.totalExternalStorageInBytes.toTypedArray(),
2318
metricsProvider.totalRamInBytes,
24-
metricsProvider.freeRamInBytes,
2519
metricsProvider.dataState,
2620
metricsProvider.simStates.toTypedArray(),
2721
metricsProvider.currentNetworkTransport,
@@ -34,8 +28,6 @@ class BackgroundExecutionMetricsProvider @Inject constructor(
3428
metricsProvider.simRegion,
3529
metricsProvider.appDatadir,
3630
metricsProvider.vpnState,
37-
metricsProvider.appImportance,
38-
metricsProvider.displayMetrics,
3931
metricsProvider.usbConnected,
4032
metricsProvider.usbPersistConfig,
4133
metricsProvider.bridgeEnabled,
@@ -47,16 +39,11 @@ class BackgroundExecutionMetricsProvider @Inject constructor(
4739
metricsProvider.autoDateTime,
4840
metricsProvider.autoTimeZone,
4941
metricsProvider.timeZoneId,
50-
metricsProvider.dateFormat,
5142
metricsProvider.regionCode,
52-
metricsProvider.calendarIdentifier,
5343
metricsProvider.androidMobileRxTraffic,
54-
metricsProvider.simOperatorId,
55-
metricsProvider.mobileNetworkId,
5644
metricsProvider.mobileRoaming,
5745
metricsProvider.mobileDataStatus,
5846
metricsProvider.mobileRadioType,
59-
metricsProvider.mobileDataActivity,
6047
metricsProvider.networkLink,
6148
metricsProvider.hasNfcFeature,
6249
metricsProvider.hasNfcAdapter,
@@ -66,24 +53,20 @@ class BackgroundExecutionMetricsProvider @Inject constructor(
6653
metricsProvider.isDeviceFoldable,
6754
metricsProvider.isBackgroundRestricted,
6855
metricsProvider.latestBackgroundTimes,
69-
metricsProvider.telephonyNetworkRegionList
56+
metricsProvider.internalLevel.let { "${it.first};${it.second}" },
57+
metricsProvider.batteryRemainState,
58+
metricsProvider.isCharging
7059
)
7160

7261
@Suppress("ArrayInDataClass")
7362
@Serializable
7463
data class BackgroundExecutionMetrics(
7564
private val epochInMilliseconds: Long,
7665
private val batteryLevel: Int,
77-
private val maxBatteryLevel: Int,
78-
private val batteryHealth: String,
79-
private val batteryDischargePrediction: Long?,
8066
private val batteryState: String,
8167
private val totalInternalStorage: Long,
82-
private val freeInternalStorage: Long,
83-
private val freeExternalStorage: Array<Long>,
8468
private val totalExternalStorage: Array<Long>,
8569
private val totalRamStorage: Long,
86-
private val freeRamStorage: Long,
8770
private val dataState: String,
8871
private val simStates: Array<String>,
8972
private val networkTransport: String,
@@ -96,8 +79,6 @@ class BackgroundExecutionMetricsProvider @Inject constructor(
9679
private val simRegion: String,
9780
private val appDataDir: String,
9881
private val vpnState: Int,
99-
private val appImportance: Int,
100-
private val displayMetrics: ResourcesInfoProvider.DisplayMetricsInfo,
10182
private val usbConnected: Int,
10283
private val usbPersistConfig: String,
10384
private val bridgeEnabled: Int,
@@ -109,16 +90,11 @@ class BackgroundExecutionMetricsProvider @Inject constructor(
10990
private val autoDateTime: Int,
11091
private val autoTimeZone: Int,
11192
private val timeZoneId: String,
112-
private val androidDateFormat: String,
11393
private val regionCode: String,
114-
private val androidCalendarIdentifier: String,
11594
private val androidMobileRxTraffic: Long,
116-
private val androidSimOperatorId: String,
117-
private val androidMobileOperatorId: String,
11895
private val androidMobileRoaming: Boolean,
11996
private val androidMobileDataStatus: Int,
12097
private val androidMobileRadioType: Int,
121-
private val androidMobileDataActivity: Int,
12298
private val androidNetworkLink: ConnectivityInfoProvider.NetworkLink?,
12399
private val androidHasNfcFeature: Boolean,
124100
private val androidHasNfcAdapter: Boolean,
@@ -128,6 +104,8 @@ class BackgroundExecutionMetricsProvider @Inject constructor(
128104
private val androidFoldableDevice: Boolean?,
129105
private val isBackgroundRestricted: Boolean,
130106
private val bkgTimes: List<BackgroundEvent>,
131-
private val telephonyNetworkRegionList: List<String>,
107+
private val internalLevel: String,
108+
private val batteryRemainState: String,
109+
private val isCharging: Boolean?
132110
)
133111
}

‎android/apolloui/src/main/java/io/muun/apollo/data/afs/BatteryInfoProvider.kt‎

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
11
package io.muun.apollo.data.afs
22

33
import android.content.Context
4-
import android.content.Context.POWER_SERVICE
54
import android.content.Intent
65
import android.content.IntentFilter
76
import android.os.BatteryManager
87
import android.os.PowerManager
98
import io.muun.apollo.data.os.OS
109

11-
private const val UNSUPPORTED = -1
12-
private const val UNKNOWN = -2
13-
1410
class BatteryInfoProvider(private val context: Context) {
1511

1612
private val powerManager: PowerManager by lazy {
17-
context.getSystemService(POWER_SERVICE) as PowerManager
13+
context.getSystemService(Context.POWER_SERVICE) as PowerManager
1814
}
1915

20-
/**
21-
* Returns the device battery health, which will be a string constant representing the general
22-
* health of this device. Note: Android docs do not explain what these values exactly mean.
23-
*/
24-
val batteryHealth: String
25-
get() = getBatteryHealthText(getBatteryProperty(BatteryManager.EXTRA_HEALTH))
16+
private val batteryManager: BatteryManager by lazy {
17+
context.getSystemService(Context.BATTERY_SERVICE) as BatteryManager
18+
}
2619

2720
/**
2821
* Returns the device battery status, which will be a string constant with one of the following
@@ -36,16 +29,28 @@ class BatteryInfoProvider(private val context: Context) {
3629
val batteryStatus: String
3730
get() = getBatteryStatusText(getBatteryProperty(BatteryManager.EXTRA_STATUS))
3831

39-
/**
40-
* (Android only and Android 12+ only) Returns the current battery life remaining estimate,
41-
* expressed in nanoseconds. Will be UNKNOWN (-2) if the device is powered, charging, or an error
42-
* was encountered. For pre Android 12 devices it will be UNSUPPORTED (-1).
43-
*/
44-
val batteryDischargePrediction: Long
45-
get() = if (OS.supportsBatteryDischargePrediction()) {
46-
powerManager.batteryDischargePrediction?.toNanos() ?: UNKNOWN.toLong()
32+
val isCharging: Boolean?
33+
get() = if (OS.supportsBatteryManagerIsCharging()) {
34+
batteryManager.isCharging
4735
} else {
48-
UNSUPPORTED.toLong()
36+
null
37+
}
38+
39+
val batteryRemainState: String
40+
get() {
41+
if (!OS.supportsBatteryDischargePrediction()) {
42+
return Constants.UNKNOWN
43+
}
44+
val prediction = powerManager.batteryDischargePrediction?.toNanos()
45+
if (prediction == null) {
46+
return "CHARGING"
47+
}
48+
49+
return when {
50+
prediction < 0 -> "NEGATIVE"
51+
prediction.toInt() == 0 -> "ZERO"
52+
else -> "POSITIVE"
53+
}
4954
}
5055

5156
/**
@@ -54,12 +59,6 @@ class BatteryInfoProvider(private val context: Context) {
5459
val batteryLevel: Int
5560
get() = getBatteryProperty(BatteryManager.EXTRA_LEVEL)
5661

57-
/**
58-
* Returns an integer representing the maximum battery level.
59-
*/
60-
val maxBatteryLevel: Int
61-
get() = getBatteryProperty(BatteryManager.EXTRA_SCALE)
62-
6362
private fun getBatteryIntent(): Intent? =
6463
IntentFilter(Intent.ACTION_BATTERY_CHANGED)
6564
.let { intentFilter ->
@@ -69,19 +68,6 @@ class BatteryInfoProvider(private val context: Context) {
6968
private fun getBatteryProperty(propertyName: String) =
7069
getBatteryIntent()?.getIntExtra(propertyName, -1) ?: -1
7170

72-
private fun getBatteryHealthText(batteryHealth: Int): String {
73-
return when (batteryHealth) {
74-
BatteryManager.BATTERY_HEALTH_COLD -> "COLD"
75-
BatteryManager.BATTERY_HEALTH_UNSPECIFIED_FAILURE -> "UNSPECIFIED_FAILURE"
76-
BatteryManager.BATTERY_HEALTH_OVER_VOLTAGE -> "OVER_VOLTAGE"
77-
BatteryManager.BATTERY_HEALTH_DEAD -> "DEAD"
78-
BatteryManager.BATTERY_HEALTH_OVERHEAT -> "OVERHEAT"
79-
BatteryManager.BATTERY_HEALTH_GOOD -> "GOOD"
80-
BatteryManager.BATTERY_HEALTH_UNKNOWN -> "UNKNOWN"
81-
else -> "UNREADABLE"
82-
}
83-
}
84-
8571
/**
8672
* Translate Android's BatteryManager battery status int constants into one of our domain
8773
* values. Note that Android docs don't really explain what these values mean.

‎android/apolloui/src/main/java/io/muun/apollo/data/afs/BuildInfo.kt‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ import kotlinx.serialization.Serializable
55
@Serializable
66
data class BuildInfo(
77
val abis: List<String>,
8-
val fingerprint: String,
9-
val hardware: String,
108
val bootloader: String,
119
val manufacturer: String,
1210
val brand: String,
13-
val display: String,
14-
val time: Long,
1511
val host: String,
1612
val type: String,
1713
val radioVersion: String?,
1814
val securityPatch: String,
19-
val baseOs: String,
15+
// These fields are null on older app versions
16+
val model: String?,
17+
val product: String?,
18+
val release: String?
2019
)

0 commit comments

Comments
 (0)