File tree 4 files changed +17
-1
lines changed
android/app/src/main/kotlin/net/mullvad/mullvadvpn
4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ Line wrap the file at 100 chars. Th
52
52
- Fix pointless API access method rotations for concurrent requests.
53
53
- Fix daemon rotating logs on startup even if another daemon is already running.
54
54
55
+ #### Android
56
+ - Fix crash in Split Tunneling screen caused by apps provding icons bigger than 100MB.
57
+
55
58
### Security
56
59
#### Android
57
60
- Change from singleTask to singleInstance to fix Task Affinity Vulnerability in Android 8.
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import kotlinx.coroutines.Dispatchers
28
28
import kotlinx.coroutines.launch
29
29
import net.mullvad.mullvadvpn.R
30
30
import net.mullvad.mullvadvpn.compose.component.SpacedColumn
31
+ import net.mullvad.mullvadvpn.compose.util.isBelowMaxBitmapSize
31
32
import net.mullvad.mullvadvpn.lib.theme.AppTheme
32
33
import net.mullvad.mullvadvpn.lib.theme.Dimens
33
34
import net.mullvad.mullvadvpn.lib.theme.color.Alpha40
@@ -75,7 +76,9 @@ fun SplitTunnelingCell(
75
76
LaunchedEffect (packageName) {
76
77
launch(Dispatchers .IO ) {
77
78
val bitmap = onResolveIcon(packageName ? : " " )
78
- icon = bitmap?.asImageBitmap()
79
+ if (bitmap != null && bitmap.isBelowMaxBitmapSize()) {
80
+ icon = bitmap.asImageBitmap()
81
+ }
79
82
}
80
83
}
81
84
BaseCell (
Original file line number Diff line number Diff line change
1
+ package net.mullvad.mullvadvpn.compose.util
2
+
3
+ import android.graphics.Bitmap
4
+
5
+ private const val MAX_BITMAP_SIZE_BYTES = 100 * 1024 * 1024
6
+
7
+ fun Bitmap.isBelowMaxBitmapSize (): Boolean = byteCount < MAX_BITMAP_SIZE_BYTES
Original file line number Diff line number Diff line change @@ -13,4 +13,7 @@ fun PackageManager.getApplicationIconBitmapOrNull(packageName: String): Bitmap?
13
13
} catch (e: IllegalArgumentException ) {
14
14
// IllegalArgumentException is thrown if the application has an invalid icon
15
15
null
16
+ } catch (e: OutOfMemoryError ) {
17
+ // OutOfMemoryError is thrown if the icon is too large
18
+ null
16
19
}
You can’t perform that action at this time.
0 commit comments