diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserDetailScreen.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserDetailScreen.kt index 126138386..9d2ccc456 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserDetailScreen.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserDetailScreen.kt @@ -110,11 +110,19 @@ fun SuperuserDetailScreen( text = item.title, style = MiuixTheme.textStyles.headline2, ) - Text( - text = item.packageName, - style = MiuixTheme.textStyles.body2, - color = MiuixTheme.colorScheme.onSurfaceVariantSummary - ) + Row( + verticalAlignment = Alignment.CenterVertically + ) { + Text( + text = item.packageName, + style = MiuixTheme.textStyles.body2, + color = MiuixTheme.colorScheme.onSurfaceVariantSummary + ) + if (item.isSharedUid) { + Spacer(Modifier.width(6.dp)) + SharedUidBadge() + } + } Text( text = "UID: ${item.policy.uid}", style = MiuixTheme.textStyles.body2, diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserScreen.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserScreen.kt index 3671a912a..bd10976ca 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserScreen.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserScreen.kt @@ -19,6 +19,7 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue @@ -28,6 +29,7 @@ import androidx.compose.ui.draw.alpha import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp import com.topjohnwu.magisk.ui.navigation.LocalNavigator import com.topjohnwu.magisk.ui.navigation.Route import com.topjohnwu.magisk.ui.util.rememberDrawablePainter @@ -141,11 +143,19 @@ private fun PolicyCard( text = item.title, style = MiuixTheme.textStyles.body1, ) - Text( - text = item.packageName, - style = MiuixTheme.textStyles.body2, - color = MiuixTheme.colorScheme.onSurfaceVariantSummary - ) + Row( + verticalAlignment = Alignment.CenterVertically + ) { + Text( + text = item.packageName, + style = MiuixTheme.textStyles.body2, + color = MiuixTheme.colorScheme.onSurfaceVariantSummary + ) + if (item.isSharedUid) { + Spacer(Modifier.width(6.dp)) + SharedUidBadge() + } + } } } @@ -171,3 +181,16 @@ private fun PolicyCard( } } } + +@Composable +internal fun SharedUidBadge(modifier: Modifier = Modifier) { + Text( + text = "SharedUID", + color = MiuixTheme.colorScheme.onPrimary, + fontSize = 10.sp, + maxLines = 1, + modifier = modifier + .background(MiuixTheme.colorScheme.primary, RoundedCornerShape(6.dp)) + .padding(horizontal = 6.dp, vertical = 2.dp) + ) +} diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt index 718901077..f62a31c15 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt @@ -36,7 +36,7 @@ class PolicyItem( val icon: Drawable, val appName: String, ) { - val title get() = if (isSharedUid) "[SharedUID] $appName" else appName + val title get() = appName val showSlider = Config.suRestrict || policy.policy == SuPolicy.RESTRICT var isExpanded by mutableStateOf(false)