parent
326afc95ab
commit
4e63d61cd3
|
|
@ -143,10 +143,11 @@ fun AppManageBody(
|
||||||
items(
|
items(
|
||||||
items = viewModel.appList,
|
items = viewModel.appList,
|
||||||
key = { it.first.app.packageName }
|
key = { it.first.app.packageName }
|
||||||
) {
|
) { (appInfo, patchConfig) ->
|
||||||
val isRolling = it.second.useManager && it.second.lspConfig.VERSION_CODE >= Constants.MIN_ROLLING_VERSION_CODE
|
val isRolling = patchConfig.useManager && patchConfig.lspConfig.VERSION_CODE >= Constants.MIN_ROLLING_VERSION_CODE
|
||||||
val canUpdateLoader = !isRolling && it.second.lspConfig.VERSION_CODE < LSPConfig.instance.VERSION_CODE
|
val canUpdateLoader = !isRolling && (patchConfig.lspConfig.VERSION_CODE < LSPConfig.instance.VERSION_CODE || patchConfig.managerPackageName != BuildConfig.APPLICATION_ID)
|
||||||
var expanded by remember { mutableStateOf(false) }
|
var expanded by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
AnywhereDropdown(
|
AnywhereDropdown(
|
||||||
expanded = expanded,
|
expanded = expanded,
|
||||||
onDismissRequest = { expanded = false },
|
onDismissRequest = { expanded = false },
|
||||||
|
|
@ -154,21 +155,30 @@ fun AppManageBody(
|
||||||
onLongClick = { expanded = true },
|
onLongClick = { expanded = true },
|
||||||
surface = {
|
surface = {
|
||||||
AppItem(
|
AppItem(
|
||||||
icon = LSPPackageManager.getIcon(it.first),
|
icon = LSPPackageManager.getIcon(appInfo),
|
||||||
label = it.first.label,
|
label = appInfo.label,
|
||||||
packageName = it.first.app.packageName,
|
packageName = appInfo.app.packageName,
|
||||||
additionalContent = {
|
additionalContent = {
|
||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
|
val patchText = if (patchConfig.useManager) {
|
||||||
|
stringResource(R.string.patch_local)
|
||||||
|
} else {
|
||||||
|
stringResource(R.string.patch_integrated)
|
||||||
|
}
|
||||||
|
val patchColor = if (patchConfig.useManager) {
|
||||||
|
MaterialTheme.colorScheme.secondary
|
||||||
|
} else {
|
||||||
|
MaterialTheme.colorScheme.tertiary
|
||||||
|
}
|
||||||
|
val versionText = if (isRolling) {
|
||||||
|
stringResource(R.string.manage_rolling)
|
||||||
|
} else {
|
||||||
|
patchConfig.lspConfig.VERSION_CODE.toString()
|
||||||
|
}
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = buildAnnotatedString {
|
text = "$patchText $versionText",
|
||||||
val (text, color) =
|
color = patchColor,
|
||||||
if (it.second.useManager) stringResource(R.string.patch_local) to MaterialTheme.colorScheme.secondary
|
|
||||||
else stringResource(R.string.patch_integrated) to MaterialTheme.colorScheme.tertiary
|
|
||||||
append(AnnotatedString(text, SpanStyle(color = color)))
|
|
||||||
append(" ")
|
|
||||||
if (isRolling) append(stringResource(R.string.manage_rolling))
|
|
||||||
else append(it.second.lspConfig.VERSION_CODE.toString())
|
|
||||||
},
|
|
||||||
fontWeight = FontWeight.SemiBold,
|
fontWeight = FontWeight.SemiBold,
|
||||||
fontFamily = FontFamily.Serif,
|
fontFamily = FontFamily.Serif,
|
||||||
style = MaterialTheme.typography.bodySmall
|
style = MaterialTheme.typography.bodySmall
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ import java.util.concurrent.TimeoutException;
|
||||||
public class RemoteApplicationService implements ILSPApplicationService {
|
public class RemoteApplicationService implements ILSPApplicationService {
|
||||||
|
|
||||||
private static final String TAG = "NPatch";
|
private static final String TAG = "NPatch";
|
||||||
private static final String MODULE_SERVICE = Constants.MANAGER_PACKAGE_NAME + ".manager.ModuleService";
|
private static final String MODULE_SERVICE = "org.lsposed.lspatch.manager.ModuleService";
|
||||||
|
|
||||||
private volatile ILSPApplicationService service;
|
private volatile ILSPApplicationService service;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue