diff --git a/README.md b/README.md index d281988..a02560b 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,27 @@ # M3K WoA Helper > [!WARNING] -> We're not responsible for bricked devices, missing recovery partitions, dead microSD cards, dead cats or dogs, nuclear wars or you getting fired because you flash UEFI, provision modems or dump sensors from this app. +> We're not responsible for bricked devices, missing recovery partitions, dead microSD cards, dead +cats or dogs, nuclear wars or you getting fired because you flash UEFI, provision modems or dump +sensors from this app. ## Project status Read requirements carefully. #### Features + - [x] Backup Android Boot - [x] Mount/Unmount Windows partition ```to view/modify Windows files from android``` -- [x] Flash UEFI ```to use the UEFI flashing feature, you need to place the UEFI image to /sdcard/UEFI``` +- [x] Flash + UEFI ```to use the UEFI flashing feature, you need to place the UEFI image to /sdcard/UEFI``` - [x] Provisioning Modem - [x] Provisioning Sensors -- [x] Quick Boot to Windows ```to use the Quick Boot feature, you need to place the UEFI image to /sdcard/UEFI``` +- [x] Quick Boot to + Windows ```to use the Quick Boot feature, you need to place the UEFI image to /sdcard/UEFI``` ## Supported devices + • [Poco X3 Pro](https://github.com/woa-vayu/Port-Windows-11-POCO-X3-Pro/) • [Xiaomi Pad 5](https://github.com/erdilS/Port-Windows-11-Xiaomi-Pad-5) @@ -24,14 +30,16 @@ Read requirements carefully. • Xiaomi Mi 9 - ## Requirements +
Requirements • Android 10 and up -• Any ROM with ntfs-3g support or [ntfs-3g module](https://github.com/woa-vayu/Port-Windows-11-POCO-X3-Pro/releases/ntfsdroid) installed. +• Any ROM with ntfs-3g support +or [ntfs-3g module](https://github.com/woa-vayu/Port-Windows-11-POCO-X3-Pro/releases/ntfsdroid) +installed. • Rooted device diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d2eff1f..a8dadc8 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -18,7 +18,7 @@ android { minSdk = 29 targetSdk = 34 versionCode = 8 - versionName = "1.3.5.2" + versionName = "1.3.6" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6464c90..311124d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -39,5 +39,17 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/rxuglr/m3kwoahelper/qstiles/MountTile.kt b/app/src/main/java/com/rxuglr/m3kwoahelper/qstiles/MountTile.kt deleted file mode 100644 index ba94a0d..0000000 --- a/app/src/main/java/com/rxuglr/m3kwoahelper/qstiles/MountTile.kt +++ /dev/null @@ -1,2 +0,0 @@ -package com.rxuglr.m3kwoahelper.qstiles - diff --git a/app/src/main/java/com/rxuglr/m3kwoahelper/qstiles/QuickBootTile.kt b/app/src/main/java/com/rxuglr/m3kwoahelper/qstiles/QuickSettingsTiles.kt similarity index 67% rename from app/src/main/java/com/rxuglr/m3kwoahelper/qstiles/QuickBootTile.kt rename to app/src/main/java/com/rxuglr/m3kwoahelper/qstiles/QuickSettingsTiles.kt index 78c5b96..a604d84 100644 --- a/app/src/main/java/com/rxuglr/m3kwoahelper/qstiles/QuickBootTile.kt +++ b/app/src/main/java/com/rxuglr/m3kwoahelper/qstiles/QuickSettingsTiles.kt @@ -4,40 +4,45 @@ import android.service.quicksettings.Tile.STATE_ACTIVE import android.service.quicksettings.Tile.STATE_UNAVAILABLE import android.service.quicksettings.TileService import com.rxuglr.m3kwoahelper.R +import com.rxuglr.m3kwoahelper.util.Commands.mountstatus +import com.rxuglr.m3kwoahelper.util.Commands.mountwin import com.rxuglr.m3kwoahelper.util.Commands.quickboot +import com.rxuglr.m3kwoahelper.util.Commands.umountwin import com.rxuglr.m3kwoahelper.util.Variables.UEFIList import com.rxuglr.m3kwoahelper.woahApp -class QuickBootTile : TileService() { +class MountTile : TileService() { // PoC - override fun onTileAdded() { - super.onTileAdded() - if (UEFIList.contains(99)) { - qsTile.state = STATE_UNAVAILABLE - qsTile.subtitle = woahApp.getString( - R.string.uefi_not_found_title + override fun onStartListening() { + super.onStartListening() + if (mountstatus()) { + qsTile.state = STATE_ACTIVE + qsTile.label = woahApp.getString( + R.string.mnt_question ) - qsTile.updateTile() } else { - qsTile.state = STATE_ACTIVE; qsTile.subtitle = "" + qsTile.state = STATE_ACTIVE + qsTile.label = woahApp.getString( + R.string.umnt_question + ) } } - override fun onStartListening() { - super.onStartListening() - if (UEFIList.contains(99)) { - qsTile.state = STATE_UNAVAILABLE - qsTile.subtitle = woahApp.getString( - R.string.uefi_not_found_title - ) - qsTile.updateTile() + override fun onClick() { + super.onClick() + if (mountstatus()) { + mountwin() } else { - qsTile.state = STATE_ACTIVE; qsTile.subtitle = "" + umountwin() } } - override fun onStopListening() { - super.onStopListening() +} + +class QuickBootTile : TileService() { + + override fun onStartListening() { + super.onStartListening() if (UEFIList.contains(99)) { qsTile.state = STATE_UNAVAILABLE qsTile.subtitle = woahApp.getString( diff --git a/app/src/main/java/com/rxuglr/m3kwoahelper/ui/MainActivity.kt b/app/src/main/java/com/rxuglr/m3kwoahelper/ui/MainActivity.kt index f0e8cf2..06cde7e 100644 --- a/app/src/main/java/com/rxuglr/m3kwoahelper/ui/MainActivity.kt +++ b/app/src/main/java/com/rxuglr/m3kwoahelper/ui/MainActivity.kt @@ -22,22 +22,10 @@ import androidx.compose.foundation.layout.width import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Home -import androidx.compose.material.icons.filled.Settings -import androidx.compose.material.icons.filled.Warning -import androidx.compose.material3.AlertDialog -import androidx.compose.material3.AssistChip -import androidx.compose.material3.Card -import androidx.compose.material3.CardDefaults -import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.Icon -import androidx.compose.material3.IconButton -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Scaffold -import androidx.compose.material3.Text -import androidx.compose.material3.TopAppBar -import androidx.compose.material3.TopAppBarDefaults -import androidx.compose.material3.surfaceColorAtElevation +import androidx.compose.material.icons.outlined.Warning +import androidx.compose.material.icons.outlined.Home +import androidx.compose.material.icons.outlined.Settings +import androidx.compose.material3.* import androidx.compose.runtime.Composable import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -88,7 +76,7 @@ class MainActivity : ComponentActivity() { AlertDialog( icon = { Icon( - imageVector = Icons.Filled.Warning, + imageVector = Icons.Outlined.Warning, contentDescription = null, tint = MaterialTheme.colorScheme.primary ) @@ -143,44 +131,44 @@ class MainActivity : ComponentActivity() { // ) }, actions = { - if (home.value) { - IconButton(onClick = { - navController.navigate("settings") { - navController.graph.startDestinationRoute?.let { route -> - popUpTo(route) { - saveState = true - } - } - launchSingleTop = true - restoreState = true - } - }) { - Icon( - imageVector = Icons.Filled.Settings, - contentDescription = null, - tint = MaterialTheme.colorScheme.primary - ) - } - } - if (!home.value) { - IconButton(onClick = { - navController.navigate("main") { - navController.graph.startDestinationRoute?.let { route -> - popUpTo(route) { - saveState = true - } - } - launchSingleTop = true - restoreState = true - } - }) { - Icon( - imageVector = Icons.Filled.Home, - contentDescription = null, - tint = MaterialTheme.colorScheme.primary - ) - } - } + // if (home.value) { + // IconButton(onClick = { + // navController.navigate("settings") { + // navController.graph.startDestinationRoute?.let { route -> + // popUpTo(route) { + // saveState = true + // } + // } + // launchSingleTop = true + // restoreState = true + // } + // }) { + // Icon( + // imageVector = Icons.Outlined.Settings, + // contentDescription = null, + // tint = MaterialTheme.colorScheme.primary + // ) + // } + // } + // if (!home.value) { + // IconButton(onClick = { + // navController.navigate("main") { + // navController.graph.startDestinationRoute?.let { route -> + // popUpTo(route) { + // saveState = true + // } + // } + // launchSingleTop = true + // restoreState = true + // } + // }) { + // Icon( + // imageVector = Icons.Outlined.Home, + // contentDescription = null, + // tint = MaterialTheme.colorScheme.primary + // ) + // } + // } }, colors = TopAppBarDefaults.topAppBarColors( containerColor = MaterialTheme.colorScheme.surfaceColorAtElevation(12.dp), @@ -215,212 +203,6 @@ class MainActivity : ComponentActivity() { @Composable fun SettingsScreen() { Scaffold { - Column( - verticalArrangement = Arrangement.spacedBy(10.dp), - modifier = Modifier - .padding(vertical = 10.dp) - .padding(horizontal = 10.dp) - ) { - Card( - colors = CardDefaults.cardColors( - containerColor = MaterialTheme.colorScheme.surfaceColorAtElevation(12.dp) - ), - ) { - Text( - modifier = Modifier - .fillMaxWidth() - .padding(top = 5.dp), - text = "M3K Windows on Android Helper", - fontWeight = FontWeight.Bold, - textAlign = TextAlign.Center, - ) - Spacer(modifier = Modifier.size(3.dp)) - Text( - modifier = Modifier - .fillMaxWidth() - .padding(bottom = 5.dp), - text = "Version: 1.3.5.2", - textAlign = TextAlign.Center - ) - } - Card( - colors = CardDefaults.cardColors( - containerColor = MaterialTheme.colorScheme.surfaceColorAtElevation(12.dp) - ) - ) { - Text( - modifier = Modifier - .padding(top = 5.dp) - .fillMaxWidth(), - text = "Original WOA Helper", - fontWeight = FontWeight.Bold, - textAlign = TextAlign.Center - ) - Spacer(modifier = Modifier.size(3.dp)) - Card( - modifier = Modifier - .padding(bottom = 5.dp) - .align(Alignment.CenterHorizontally), - colors = CardDefaults.cardColors( - containerColor = MaterialTheme.colorScheme.surfaceColorAtElevation( - 12.dp - ) - ) - ) { - Column { - Text( - modifier = Modifier - .fillMaxWidth() - .padding(start = 10.dp), - text = "Made by", - textAlign = TextAlign.Center, - ) - Row( - Modifier - .align(Alignment.CenterHorizontally), - horizontalArrangement = Arrangement.spacedBy(5.dp) - ) { - Text( - modifier = Modifier - .align(Alignment.CenterVertically), - text = "KuatoDEV" - ) - Card { - Image( - modifier = Modifier.size(35.dp), - painter = painterResource(id = R.drawable.kuato), - contentDescription = null - ) - } - } - Spacer(modifier = Modifier.size(5.dp)) - Row( - Modifier - .align(Alignment.CenterHorizontally), - horizontalArrangement = Arrangement.spacedBy(5.dp) - ) { - Text( - modifier = Modifier.align(Alignment.CenterVertically), - text = "halal-beef" - ) - Card { - Image( - modifier = Modifier.size(35.dp), - painter = painterResource(id = R.drawable.halal_beef), - contentDescription = null - ) - } - } - Spacer(modifier = Modifier.size(5.dp)) - Row( - Modifier - .align(Alignment.CenterHorizontally), - horizontalArrangement = Arrangement.spacedBy(5.dp) - ) { - Text( - modifier = Modifier.align(Alignment.CenterVertically), - text = "mobxprjkt" - ) - Card { - Image( - modifier = Modifier.size(35.dp), - painter = painterResource(id = R.drawable.mobxprjkt), - contentDescription = null - ) - } - } - Spacer(modifier = Modifier.size(5.dp)) - Row( - Modifier - .align(Alignment.CenterHorizontally), - horizontalArrangement = Arrangement.spacedBy(5.dp) - ) { - Text( - modifier = Modifier.align(Alignment.CenterVertically), - text = "Nabil ABA" - ) - Card { - Image( - modifier = Modifier.size(35.dp), - painter = painterResource(id = R.drawable.nabil_aba), - contentDescription = null - ) - } - } - Spacer(modifier = Modifier.size(5.dp)) - Row( - Modifier - .align(Alignment.CenterHorizontally), - horizontalArrangement = Arrangement.spacedBy(5.dp) - ) { - Text( - modifier = Modifier.align(Alignment.CenterVertically), - text = "Otang45 " - ) - Card { - Image( - modifier = Modifier.size(35.dp), - painter = painterResource(id = R.drawable.otang45), - contentDescription = null - ) - } - } - } - } - } - Card( - colors = CardDefaults.cardColors( - containerColor = MaterialTheme.colorScheme.surfaceColorAtElevation(12.dp) - ) - ) { - Text( - modifier = Modifier - .padding(top = 5.dp) - .fillMaxWidth(), - text = "M3K WOA Helper", - fontWeight = FontWeight.Bold, - textAlign = TextAlign.Center - ) - Card( - modifier = Modifier - .padding(bottom = 5.dp) - .align(Alignment.CenterHorizontally), - colors = CardDefaults.cardColors( - containerColor = MaterialTheme.colorScheme.surfaceColorAtElevation( - 12.dp - ) - ) - ) { - Column { - Text( - modifier = Modifier - .fillMaxWidth() - .padding(start = 10.dp), - text = "Made by", - textAlign = TextAlign.Center, - ) - Row( - Modifier - .align(Alignment.CenterHorizontally), - horizontalArrangement = Arrangement.spacedBy(5.dp) - ) { - Text( - modifier = Modifier - .align(Alignment.CenterVertically), - text = "rxuglr " - ) - Card { - Image( - modifier = Modifier.size(35.dp), - painter = painterResource(id = R.drawable.rxuglr), - contentDescription = null - ) - } - } - } - } - } - } } } @@ -441,7 +223,9 @@ class MainActivity : ComponentActivity() { AlertDialog( icon = { Icon( - imageVector = Icons.Filled.Warning, + modifier = Modifier + .size(40.dp), + imageVector = Icons.Outlined.Warning, contentDescription = null, tint = MaterialTheme.colorScheme.primary ) @@ -506,23 +290,25 @@ class MainActivity : ComponentActivity() { ) { Buttons.BackupButton() Buttons.MountButton() - if (!NoModem.contains(Codename)) { - if (!checksensors()) { - Buttons.Button( - R.string.dump_modemAsensors_title, - R.string.dump_modemAsensors_subtitle, - R.string.dump_modemAsensors_question, - { dumpmodem(); dumpsensors() }, - R.drawable.ic_modem - ) - } else { - Buttons.Button( - R.string.dump_modem_title, - R.string.dump_modem_subtitle, - R.string.dump_modem_question, - { dumpmodem() }, - R.drawable.ic_modem - ) + when { + !NoModem.value -> { + if (!checksensors()) { + Buttons.Button( + R.string.dump_modemAsensors_title, + R.string.dump_modemAsensors_subtitle, + R.string.dump_modemAsensors_question, + { dumpmodem(); dumpsensors() }, + R.drawable.ic_modem + ) + } else { + Buttons.Button( + R.string.dump_modem_title, + R.string.dump_modem_subtitle, + R.string.dump_modem_question, + { dumpmodem() }, + R.drawable.ic_modem + ) + } } } Buttons.UEFIButton() @@ -542,23 +328,25 @@ class MainActivity : ComponentActivity() { } Buttons.BackupButton() Buttons.MountButton() - if (!NoModem.contains(Codename)) { - if (!checksensors()) { - Buttons.Button( - R.string.dump_modemAsensors_title, - R.string.dump_modemAsensors_subtitle, - R.string.dump_modemAsensors_question, - { dumpmodem(); dumpsensors() }, - R.drawable.ic_modem - ) - } else { - Buttons.Button( - R.string.dump_modem_title, - R.string.dump_modem_subtitle, - R.string.dump_modem_question, - { dumpmodem() }, - R.drawable.ic_modem - ) + when { + !NoModem.value -> { + if (!checksensors()) { + Buttons.Button( + R.string.dump_modemAsensors_title, + R.string.dump_modemAsensors_subtitle, + R.string.dump_modemAsensors_question, + { dumpmodem(); dumpsensors() }, + R.drawable.ic_modem + ) + } else { + Buttons.Button( + R.string.dump_modem_title, + R.string.dump_modem_subtitle, + R.string.dump_modem_question, + { dumpmodem() }, + R.drawable.ic_modem + ) + } } } Buttons.UEFIButton() diff --git a/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/Buttons.kt b/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/Buttons.kt index ea3f716..5b0ec3e 100644 --- a/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/Buttons.kt +++ b/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/Buttons.kt @@ -8,14 +8,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width -import androidx.compose.material3.AlertDialog -import androidx.compose.material3.AssistChip -import androidx.compose.material3.ElevatedCard -import androidx.compose.material3.CardDefaults -import androidx.compose.material3.Icon -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text -import androidx.compose.material3.surfaceColorAtElevation +import androidx.compose.material3.* import androidx.compose.runtime.Composable import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -137,7 +130,7 @@ object Buttons { when { showBackupSpinner.value -> { PopupDialogs.SpinnerDialog( - icon = painterResource(id = R.drawable.ic_disk), + icon = painterResource(id = R.drawable.ic_backup), title = R.string.please_wait, showDialog = showBackupSpinner.value, fontSize = FontSize, @@ -150,7 +143,7 @@ object Buttons { AlertDialog( icon = { Icon( - painter = painterResource(id = R.drawable.ic_disk), + painter = painterResource(id = R.drawable.ic_backup), contentDescription = null, tint = MaterialTheme.colorScheme.primary, modifier = Modifier.size(40.dp) @@ -245,7 +238,7 @@ object Buttons { Icon( modifier = Modifier .size(40.dp), - painter = painterResource(id = R.drawable.ic_disk), + painter = painterResource(id = R.drawable.ic_backup), contentDescription = null, tint = MaterialTheme.colorScheme.primary ) @@ -283,7 +276,7 @@ object Buttons { showMountDialog.value -> { if (mountstatus()) { PopupDialogs.Dialog( - icon = painterResource(id = R.drawable.ic_windows), + icon = painterResource(id = R.drawable.ic_folder_open), title = null, description = LocalContext.current.getString(R.string.mnt_question), showDialog = showMountDialog.value, @@ -295,7 +288,7 @@ object Buttons { ) } else { PopupDialogs.Dialog( - painterResource(id = R.drawable.ic_windows), + painterResource(id = R.drawable.ic_folder), null, LocalContext.current.getString(R.string.umnt_question), showMountDialog.value, @@ -317,7 +310,13 @@ object Buttons { Icon( modifier = Modifier .size(40.dp), - painter = painterResource(id = R.drawable.ic_windows), + painter = painterResource( + id = if (mountstatus()) { + R.drawable.ic_folder_open + } else { + R.drawable.ic_folder + } + ), contentDescription = null, tint = MaterialTheme.colorScheme.primary ) diff --git a/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/Cards.kt b/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/Cards.kt index fb253cd..afdaa1a 100644 --- a/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/Cards.kt +++ b/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/Cards.kt @@ -11,16 +11,9 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.automirrored.filled.Message -import androidx.compose.material.icons.filled.Book -import androidx.compose.material3.AssistChip -import androidx.compose.material3.AssistChipDefaults -import androidx.compose.material3.CardDefaults -import androidx.compose.material3.ElevatedCard -import androidx.compose.material3.Icon -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text -import androidx.compose.material3.surfaceColorAtElevation +import androidx.compose.material.icons.automirrored.outlined.Message +import androidx.compose.material.icons.outlined.Book +import androidx.compose.material3.* import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -114,39 +107,39 @@ object Cards { Modifier.align(Alignment.CenterHorizontally), horizontalArrangement = Arrangement.spacedBy(5.dp) ) { - if ((Codename != "cepheus") && (Name != "Unknown")) { - AssistChip( - leadingIcon = { - Icon( - Icons.Filled.Book, - contentDescription = null, - Modifier.size(AssistChipDefaults.IconSize), - tint = MaterialTheme.colorScheme.primary - ) - }, - onClick = { - localUriHandler.openUri( - when (Codename) { - Codenames[0], Codenames[1] -> "https://github.com/woa-vayu/Port-Windows-11-Poco-X3-pro" - Codenames[2] -> "https://github.com/erdilS/Port-Windows-11-Xiaomi-Pad-5" - Codenames[3], Codenames[4], Codenames[6] -> "https://github.com/graphiks/woa-raphael" - else -> "" - } - ) - }, - label = { - Text( - LocalContext.current.getString(R.string.guide), - fontWeight = FontWeight.Bold, - ) - } - ) - } if (Name != "Unknown") { + if (Codename != "cepheus") { + AssistChip( + leadingIcon = { + Icon( + Icons.Outlined.Book, + contentDescription = null, + Modifier.size(AssistChipDefaults.IconSize), + tint = MaterialTheme.colorScheme.primary + ) + }, + onClick = { + localUriHandler.openUri( + when (Codename) { + Codenames[0], Codenames[1] -> "https://github.com/woa-vayu/Port-Windows-11-Poco-X3-pro" + Codenames[2] -> "https://github.com/erdilS/Port-Windows-11-Xiaomi-Pad-5" + Codenames[3], Codenames[4], Codenames[6] -> "https://github.com/graphiks/woa-raphael" + else -> "" + } + ) + }, + label = { + Text( + LocalContext.current.getString(R.string.guide), + fontWeight = FontWeight.Bold, + ) + } + ) + } AssistChip( leadingIcon = { Icon( - Icons.AutoMirrored.Filled.Message, + Icons.AutoMirrored.Outlined.Message, contentDescription = null, Modifier.size(AssistChipDefaults.IconSize), tint = MaterialTheme.colorScheme.primary @@ -175,4 +168,4 @@ object Cards { } } } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/Images.kt b/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/Images.kt index b42210a..7c87bba 100644 --- a/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/Images.kt +++ b/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/Images.kt @@ -32,10 +32,10 @@ object Images { Codenames[0], Codenames[1] -> R.drawable.vayu Codenames[2] -> R.drawable.nabu Codenames[3], Codenames[4] -> R.drawable.raphael - else -> R.drawable.nabu + else -> R.drawable.ic_device_unknown } ), - contentDescription = null + contentDescription = null, ) } } \ No newline at end of file diff --git a/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/PopupDialogs.kt b/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/PopupDialogs.kt index 38f4868..a08b430 100644 --- a/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/PopupDialogs.kt +++ b/app/src/main/java/com/rxuglr/m3kwoahelper/ui/templates/PopupDialogs.kt @@ -5,12 +5,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width -import androidx.compose.material3.Icon -import androidx.compose.material3.AlertDialog -import androidx.compose.material3.AssistChip -import androidx.compose.material3.CircularProgressIndicator -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text +import androidx.compose.material3.* import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier diff --git a/app/src/main/java/com/rxuglr/m3kwoahelper/util/Commands.kt b/app/src/main/java/com/rxuglr/m3kwoahelper/util/Commands.kt index 4f07578..e5ab508 100644 --- a/app/src/main/java/com/rxuglr/m3kwoahelper/util/Commands.kt +++ b/app/src/main/java/com/rxuglr/m3kwoahelper/util/Commands.kt @@ -69,8 +69,8 @@ object Commands { fun dumpmodem() { mountwin() - ShellUtils.fastCmd("dd if=/dev/block/bootdevice/by-name/modemst1 of=/sdcard/windows/Windows/System32/DriverStore/FileRepository/qcremotefs8150.inf_arm64_04af705613ed2d36/bootmodem_fs1") - ShellUtils.fastCmd("dd if=/dev/block/bootdevice/by-name/modemst2 of=/sdcard/windows/Windows/System32/DriverStore/FileRepository/qcremotefs8150.inf_arm64_04af705613ed2d36/bootmodem_fs2") + ShellUtils.fastCmd("dd if=/dev/block/bootdevice/by-name/modemst1 of=$(find /sdcard/windows/Windows/System32/DriverStore/FileRepository/qcremotefs8150.inf_arm64_* -type f | grep fs1)") + ShellUtils.fastCmd("dd if=/dev/block/bootdevice/by-name/modemst2 of=$(find /sdcard/windows/Windows/System32/DriverStore/FileRepository/qcremotefs8150.inf_arm64_* -type f | grep fs2)") umountwin() } @@ -113,7 +113,7 @@ object Commands { } fun quickboot(type: Int) { - if (!NoModem.contains(Codename)) { + if (!NoModem.value) { dumpmodem() } flashuefi(type) diff --git a/app/src/main/java/com/rxuglr/m3kwoahelper/util/Variables.kt b/app/src/main/java/com/rxuglr/m3kwoahelper/util/Variables.kt index 5b5ac35..32af1b7 100644 --- a/app/src/main/java/com/rxuglr/m3kwoahelper/util/Variables.kt +++ b/app/src/main/java/com/rxuglr/m3kwoahelper/util/Variables.kt @@ -15,7 +15,7 @@ object Variables { // static vars val Codenames: Array = arrayOf("vayu", "bhima", "nabu", "raphael", "raphaelin", "cepheus", "raphaels") - val NoModem: Array = arrayOf("nabu") + private val NoModemS: Array = arrayOf("nabu") val Sensors: Array = arrayOf(Codenames[3], Codenames[4], Codenames[5], Codenames[6]) // device info @@ -25,10 +25,11 @@ object Variables { String.format("%S", ShellUtils.fastCmd("getprop ro.boot.slot_suffix")).drop(1) val Codename: String = Build.DEVICE val Unsupported: MutableState = mutableStateOf(false) + val NoModem: MutableState = mutableStateOf(false) // dynamic vars var BootIsPresent: Boolean = false - var WindowsIsPresent : Boolean = false + var WindowsIsPresent: Boolean = false var UEFIList: Array = arrayOf(0) var FontSize: TextUnit = 15.sp var PaddingValue: Dp = 10.dp @@ -44,6 +45,9 @@ object Variables { Codenames[6] -> "Redmi K20 Pro Premium" else -> "Unknown" }.toString() + if (NoModemS.contains(Codename)) { + NoModem.value = true + } if ((Name == "Unknown")) { Unsupported.value = true } diff --git a/app/src/main/res/drawable/halal_beef.webp b/app/src/main/res/drawable/halal_beef.webp deleted file mode 100644 index d3d48e2..0000000 Binary files a/app/src/main/res/drawable/halal_beef.webp and /dev/null differ diff --git a/app/src/main/res/drawable/ic_backup.xml b/app/src/main/res/drawable/ic_backup.xml new file mode 100644 index 0000000..d776b47 --- /dev/null +++ b/app/src/main/res/drawable/ic_backup.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable/ic_device_unknown.xml b/app/src/main/res/drawable/ic_device_unknown.xml new file mode 100644 index 0000000..8d776ed --- /dev/null +++ b/app/src/main/res/drawable/ic_device_unknown.xml @@ -0,0 +1,12 @@ + + + diff --git a/app/src/main/res/drawable/ic_disk.xml b/app/src/main/res/drawable/ic_disk.xml deleted file mode 100644 index 9718818..0000000 --- a/app/src/main/res/drawable/ic_disk.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_folder.xml b/app/src/main/res/drawable/ic_folder.xml new file mode 100644 index 0000000..7b2d154 --- /dev/null +++ b/app/src/main/res/drawable/ic_folder.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_folder_open.xml b/app/src/main/res/drawable/ic_folder_open.xml new file mode 100644 index 0000000..4d15eb2 --- /dev/null +++ b/app/src/main/res/drawable/ic_folder_open.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_modem.xml b/app/src/main/res/drawable/ic_modem.xml index 17cb145..93567a2 100644 --- a/app/src/main/res/drawable/ic_modem.xml +++ b/app/src/main/res/drawable/ic_modem.xml @@ -1,12 +1,10 @@ - - + android:viewportWidth="960" + android:viewportHeight="960" + android:tint="?attr/colorControlNormal"> + android:fillColor="@android:color/white" + android:pathData="M280,760L360,760L360,680L280,680L280,760ZM280,600L360,600L360,440L280,440L280,600ZM440,760L520,760L520,600L440,600L440,760ZM440,520L520,520L520,440L440,440L440,520ZM600,760L680,760L680,680L600,680L600,760ZM600,600L680,600L680,440L600,440L600,600ZM240,880Q207,880 183.5,856.5Q160,833 160,800L160,320L400,80L720,80Q753,80 776.5,103.5Q800,127 800,160L800,800Q800,833 776.5,856.5Q753,880 720,880L240,880ZM240,800L720,800Q720,800 720,800Q720,800 720,800L720,160Q720,160 720,160Q720,160 720,160L434,160L240,354L240,800Q240,800 240,800Q240,800 240,800ZM240,800Q240,800 240,800Q240,800 240,800L240,800L434,800L720,800Q720,800 720,800Q720,800 720,800L720,800Q720,800 720,800Q720,800 720,800L240,800Z" /> \ No newline at end of file diff --git a/app/src/main/res/drawable/kuato.jpg b/app/src/main/res/drawable/kuato.jpg deleted file mode 100644 index 20cfd58..0000000 Binary files a/app/src/main/res/drawable/kuato.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/mobxprjkt.jpg b/app/src/main/res/drawable/mobxprjkt.jpg deleted file mode 100644 index e598712..0000000 Binary files a/app/src/main/res/drawable/mobxprjkt.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/nabil_aba.webp b/app/src/main/res/drawable/nabil_aba.webp deleted file mode 100644 index 0b03f47..0000000 Binary files a/app/src/main/res/drawable/nabil_aba.webp and /dev/null differ diff --git a/app/src/main/res/drawable/otang45.webp b/app/src/main/res/drawable/otang45.webp deleted file mode 100644 index 2c7c7ad..0000000 Binary files a/app/src/main/res/drawable/otang45.webp and /dev/null differ diff --git a/app/src/main/res/drawable/rxuglr.webp b/app/src/main/res/drawable/rxuglr.webp deleted file mode 100644 index 8a98afa..0000000 Binary files a/app/src/main/res/drawable/rxuglr.webp and /dev/null differ diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 88b48c1..fc2650b 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -1,5 +1,5 @@ - +