A rootless Android app that boots Alpine Linux: run containers (Podman/Docker/LXC) and GUI desktop apps.
v1.1.2: fix wakelock race, Android 14+ crash, nav back handler, update check rate limit
ExTvd90b659c2562
diff --git a/app/build.gradle.kts b/app/build.gradle.ktsindex 72ebf1b..1262568 100644--- a/app/build.gradle.kts+++ b/app/build.gradle.kts@@ -25,8 +25,8 @@ android {applicationId = "com.excp.podroid"minSdk = 28targetSdk = 36- versionCode = 13- versionName = "1.1.1"+ versionCode = 14+ versionName = "1.1.2"buildConfigField("String", "QEMU_VERSION", "\"$podroidQemuVersion\"")testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"diff --git a/app/src/main/java/com/excp/podroid/MainActivity.kt b/app/src/main/java/com/excp/podroid/MainActivity.ktindex e703ae9..4c17d79 100644--- a/app/src/main/java/com/excp/podroid/MainActivity.kt+++ b/app/src/main/java/com/excp/podroid/MainActivity.kt@@ -6,8 +6,12 @@ import android.os.Bundleimport androidx.activity.ComponentActivityimport androidx.activity.compose.setContentimport androidx.activity.enableEdgeToEdge+import androidx.compose.foundation.layout.fillMaxSize+import androidx.compose.material3.MaterialTheme+import androidx.compose.material3.Surfaceimport androidx.compose.runtime.collectAsStateimport androidx.compose.runtime.getValue+import androidx.compose.ui.Modifierimport androidx.core.app.ActivityCompatimport androidx.core.content.ContextCompatimport com.excp.podroid.data.repository.SettingsRepository@@ -27,8 +31,18 @@ class MainActivity : ComponentActivity() {setContent {val darkTheme by settingsRepository.darkTheme.collectAsState(initial = true)PodroidTheme(darkTheme = darkTheme) {- PodroidNavGraph(settingsRepository = settingsRepository)+ Surface(+ modifier = Modifier.fillMaxSize(),+ color = MaterialTheme.colorScheme.background,+ ) {+ PodroidNavGraph(settingsRepository = settingsRepository)+ }}}}++ @Deprecated("Deprecated in Java")+ override fun onBackPressed() {+ super.onBackPressed()+ }}diff --git a/app/src/main/java/com/excp/podroid/data/repository/UpdateRepository.kt b/app/src/main/java/com/excp/podroid/data/repository/UpdateRepository.ktindex 69563a5..c7be87b 100644--- a/app/src/main/java/com/excp/podroid/data/repository/UpdateRepository.kt+++ b/app/src/main/java/com/excp/podroid/data/repository/UpdateRepository.kt@@ -2,6 +2,7 @@ package com.excp.podroid.data.repositoryimport android.content.Contextimport androidx.datastore.preferences.core.edit+import androidx.datastore.preferences.core.longPreferencesKeyimport androidx.datastore.preferences.core.stringPreferencesKeyimport dagger.hilt.android.qualifiers.ApplicationContextimport kotlinx.coroutines.Dispatchers@@ -22,9 +23,18 @@ class UpdateRepository @Inject constructor(@ApplicationContext private val context: Context,) {private val dismissedKey = stringPreferencesKey("dismissed_update_version")+ private val lastCheckKey = longPreferencesKey("update_check_timestamp")+ private val cacheValidityMs = 24 * 60 * 60 * 1000Lsuspend fun checkForUpdate(currentVersion: String): UpdateInfo? = withContext(Dispatchers.IO) {try {+ val now = System.currentTimeMillis()+ val lastCheck = context.dataStore.data.first()[lastCheckKey] ?: 0L++ if (now - lastCheck < cacheValidityMs) {+ return@withContext null+ }+val connection = URL("https://api.github.com/repos/ExTV/Podroid/releases/latest").openConnection() as java.net.HttpURLConnectionconnection.connectTimeout = 5000@@ -40,6 +50,8 @@ class UpdateRepository @Inject constructor(val tag = obj.getString("tag_name").trimStart('v')val url = obj.getString("html_url")+ context.dataStore.edit { it[lastCheckKey] = now }+if (isNewer(tag, currentVersion)) UpdateInfo(tag, url) else null} catch (_: Exception) {nulldiff --git a/app/src/main/java/com/excp/podroid/ui/navigation/NavGraph.kt b/app/src/main/java/com/excp/podroid/ui/navigation/NavGraph.ktindex 205537c..f60d580 100644--- a/app/src/main/java/com/excp/podroid/ui/navigation/NavGraph.kt+++ b/app/src/main/java/com/excp/podroid/ui/navigation/NavGraph.kt@@ -67,7 +67,10 @@ fun PodroidNavGraph(TerminalScreen(viewModel = terminalViewModel,onNavigateBack = {- if (!navController.popBackStack(Routes.HOME, inclusive = false)) {+ // Only pop if we're not already at HOME to avoid the warning+ if (navController.currentDestination?.route == Routes.TERMINAL) {+ navController.popBackStack()+ } else if (!navController.popBackStack(Routes.HOME, inclusive = false)) {navController.navigate(Routes.HOME) {popUpTo(0) { inclusive = true }}@@ -79,7 +82,9 @@ fun PodroidNavGraph(composable(Routes.SETTINGS) {SettingsScreen(onNavigateBack = {- if (!navController.popBackStack(Routes.HOME, inclusive = false)) {+ if (navController.currentDestination?.route == Routes.SETTINGS) {+ navController.popBackStack()+ } else if (!navController.popBackStack(Routes.HOME, inclusive = false)) {navController.navigate(Routes.HOME) {popUpTo(0) { inclusive = true }}diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xmlindex 07d5da9..ac304fe 100644--- a/app/src/main/res/drawable/ic_launcher_background.xml+++ b/app/src/main/res/drawable/ic_launcher_background.xml@@ -1,170 +1,3 @@<?xml version="1.0" encoding="utf-8"?>-<vector xmlns:android="http://schemas.android.com/apk/res/android"- android:width="108dp"- android:height="108dp"- android:viewportWidth="108"- android:viewportHeight="108">- <path- android:fillColor="#3DDC84"- android:pathData="M0,0h108v108h-108z" />- <path- android:fillColor="#00000000"- android:pathData="M9,0L9,108"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M19,0L19,108"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M29,0L29,108"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M39,0L39,108"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M49,0L49,108"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M59,0L59,108"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M69,0L69,108"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M79,0L79,108"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M89,0L89,108"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M99,0L99,108"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M0,9L108,9"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M0,19L108,19"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M0,29L108,29"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M0,39L108,39"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M0,49L108,49"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M0,59L108,59"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M0,69L108,69"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M0,79L108,79"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M0,89L108,89"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M0,99L108,99"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M19,29L89,29"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M19,39L89,39"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M19,49L89,49"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M19,59L89,59"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M19,69L89,69"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M19,79L89,79"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M29,19L29,89"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M39,19L39,89"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M49,19L49,89"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M59,19L59,89"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M69,19L69,89"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />- <path- android:fillColor="#00000000"- android:pathData="M79,19L79,89"- android:strokeWidth="0.8"- android:strokeColor="#33FFFFFF" />-</vector>+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"+ android:src="@mipmap/ic_launcher_background" />\ No newline at end of filediff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.pngnew file mode 100644index 0000000..6eac5f9Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differdiff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_background.png b/app/src/main/res/mipmap-hdpi/ic_launcher_background.pngnew file mode 100644index 0000000..9abae14Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_background.png differdiff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.pngnew file mode 100644index 0000000..792416dBinary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differdiff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png b/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.pngnew file mode 100644index 0000000..dd81d56Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png differdiff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.pngnew file mode 100644index 0000000..e9f001fBinary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differdiff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_background.png b/app/src/main/res/mipmap-mdpi/ic_launcher_background.pngnew file mode 100644index 0000000..dfd36a3Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_background.png differdiff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.pngnew file mode 100644index 0000000..318484cBinary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differdiff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png b/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.pngnew file mode 100644index 0000000..097d7caBinary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png differdiff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.pngnew file mode 100644index 0000000..558c5a3Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differdiff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_background.pngnew file mode 100644index 0000000..f265f79Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png differdiff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.pngnew file mode 100644index 0000000..501f3a9Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differdiff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.pngnew file mode 100644index 0000000..bd80ce3Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png differdiff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.pngnew file mode 100644index 0000000..8a747bfBinary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differdiff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.pngnew file mode 100644index 0000000..d8a40a7Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png differdiff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.pngnew file mode 100644index 0000000..bf4d42bBinary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differdiff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.pngnew file mode 100644index 0000000..9b50010Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png differdiff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.pngnew file mode 100644index 0000000..71a3e4dBinary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differdiff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.pngnew file mode 100644index 0000000..9213cceBinary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png differdiff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.pngnew file mode 100644index 0000000..e530722Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differdiff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.pngnew file mode 100644index 0000000..9388281Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png differ