Allow toggling unmount setting for all apps (#2450)
Some checks failed
Build Manager / build-lkm (push) Waiting to run
Build Manager / build-ksud (macos-latest, aarch64-apple-darwin) (push) Blocked by required conditions
Build Manager / build-ksud (macos-latest, x86_64-apple-darwin) (push) Blocked by required conditions
Build Manager / build-ksud (ubuntu-latest, aarch64-linux-android) (push) Blocked by required conditions
Build Manager / build-ksud (ubuntu-latest, aarch64-unknown-linux-musl) (push) Blocked by required conditions
Build Manager / build-ksud (ubuntu-latest, x86_64-linux-android) (push) Blocked by required conditions
Build Manager / build-ksud (ubuntu-latest, x86_64-pc-windows-gnu) (push) Blocked by required conditions
Build Manager / build-ksud (ubuntu-latest, x86_64-unknown-linux-musl) (push) Blocked by required conditions
Build Manager / build-manager (push) Blocked by required conditions
Build Kernel - Android 12 / build-kernel (2024-05, 209) (push) Has been cancelled
Build Kernel - Android 12 / build-kernel (2024-08, 218) (push) Has been cancelled
Build Kernel - Android 12 / build-kernel (2024-11, 226) (push) Has been cancelled
Build Kernel - Android 12 / check-build-kernel (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-05, 148, 5.15) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-05, 209, 5.10) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-06, 210, 5.10) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-07, 149, 5.15) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-07, 214, 5.10) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-08, 151, 5.15) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-08, 218, 5.10) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-09, 153, 5.15) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-11, 167, 5.15) (push) Has been cancelled
Build Kernel - Android 13 / build-kernel (2024-11, 223, 5.10) (push) Has been cancelled
Build Kernel - Android 13 / check-build-kernel (2024-11, 167, 5.15) (push) Has been cancelled
Build Kernel - Android 13 / check-build-kernel (2024-11, 223, 5.10) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-05, 148, 5.15) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-05, 75, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-06, 149, 5.15) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-06, 78, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-07, 153, 5.15) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-07, 84, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-08, 158, 5.15) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-08, 90, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-09, 164, 5.15) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-09, 93, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-10, 99, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-11, 112, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-11, 167, 5.15) (push) Has been cancelled
Build Kernel - Android 14 / build-kernel (2024-12, 115, 6.1) (push) Has been cancelled
Build Kernel - Android 14 / check-build-kernel (2024-11, 167, 5.15) (push) Has been cancelled
Build Kernel - Android 14 / check-build-kernel (2024-12, 115, 6.1) (push) Has been cancelled
Build Kernel - Android 15 / build-kernel (2024-08, 30, 6.6) (push) Has been cancelled
Build Kernel - Android 15 / build-kernel (2024-09, 46, 6.6) (push) Has been cancelled
Build Kernel - Android 15 / build-kernel (2024-10, 50, 6.6) (push) Has been cancelled
Build Kernel - Android 15 / build-kernel (2024-11, 56, 6.6) (push) Has been cancelled
Build Kernel - Android 15 / build-kernel (2024-12, 57, 6.6) (push) Has been cancelled
Build Kernel - Android 15 / check-build-kernel (2024-12, 57, 6.6) (push) Has been cancelled
Build Kernel - ChromeOS ARCVM / Build ChromeOS ARCVM kernel (arm64, build.config.gki.aarch64, arm64_arcvm_defconfig, Image) (push) Has been cancelled
Build Kernel - ChromeOS ARCVM / Build ChromeOS ARCVM kernel (x86_64, build.config.gki.x86_64, x86_64_arcvm_defconfig, bzImage) (push) Has been cancelled
Build Kernel - AVD / build-kernel (aarch64, android-15-avd_aarch64.xml, android-15-avd_aarch64) (push) Has been cancelled
Build Kernel - AVD / build-kernel (x86_64, android-14-avd_x86_64.xml, android-14-avd_x86_64) (push) Has been cancelled
Build Kernel - AVD / build-kernel (x86_64, android-15-avd_x86_64.xml, android-15-avd_x86_64) (push) Has been cancelled
Build Kernel - WSA / build (arm64, 5.15.104.1) (push) Has been cancelled
Build Kernel - WSA / build (arm64, 5.15.104.2) (push) Has been cancelled
Build Kernel - WSA / build (arm64, 5.15.104.3) (push) Has been cancelled
Build Kernel - WSA / build (arm64, 5.15.104.4) (push) Has been cancelled
Build Kernel - WSA / build (arm64, 5.15.94.2) (push) Has been cancelled
Build Kernel - WSA / build (x86_64, 5.15.104.1) (push) Has been cancelled
Build Kernel - WSA / build (x86_64, 5.15.104.2) (push) Has been cancelled
Build Kernel - WSA / build (x86_64, 5.15.104.3) (push) Has been cancelled
Build Kernel - WSA / build (x86_64, 5.15.104.4) (push) Has been cancelled
Build Kernel - WSA / build (x86_64, 5.15.94.2) (push) Has been cancelled
Build Kernel - WSA / check_build (arm64) (push) Has been cancelled
Build Kernel - WSA / check_build (x86_64) (push) Has been cancelled
Build Kernel - Android 12 / upload-artifacts (push) Has been cancelled
Build Kernel - Android 13 / upload-artifacts (push) Has been cancelled
Build Kernel - Android 14 / upload-artifacts (push) Has been cancelled
Build Kernel - Android 15 / upload-artifacts (push) Has been cancelled

This fixes https://github.com/tiann/KernelSU/issues/2416.
This commit is contained in:
Wang Han 2025-02-18 11:07:52 +08:00 committed by GitHub
parent de291151f1
commit eeffecbd1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 7 deletions

View File

@ -153,11 +153,6 @@ static bool profile_valid(struct app_profile *profile)
return false;
}
if (forbid_system_uid(profile->current_uid)) {
pr_err("uid lower than 2000 is unsupported: %d\n", profile->current_uid);
return false;
}
if (profile->version < KSU_APP_PROFILE_VER) {
pr_info("Unsupported profile version: %d\n", profile->version);
return false;

View File

@ -95,6 +95,7 @@ fun AppProfileScreen(
val scope = rememberCoroutineScope()
val failToUpdateAppProfile = stringResource(R.string.failed_to_update_app_profile).format(appInfo.label)
val failToUpdateSepolicy = stringResource(R.string.failed_to_update_sepolicy).format(appInfo.label)
val suNotAllowed = stringResource(R.string.su_not_allowed).format(appInfo.label)
val packageName = appInfo.packageName
val initialProfile = Natives.getAppProfile(packageName, appInfo.uid)
@ -143,8 +144,13 @@ fun AppProfileScreen(
},
onProfileChange = {
scope.launch {
if (it.allowSu && !it.rootUseDefault && it.rules.isNotEmpty()) {
if (!setSepolicy(profile.name, it.rules)) {
if (it.allowSu) {
// sync with allowlist.c - forbid_system_uid
if (appInfo.uid < 2000 && appInfo.uid != 1000) {
snackBarHost.showSnackbar(suNotAllowed)
return@launch
}
if (!it.rootUseDefault && it.rules.isNotEmpty() && !setSepolicy(profile.name, it.rules)) {
snackBarHost.showSnackbar(failToUpdateSepolicy)
return@launch
}

View File

@ -81,6 +81,7 @@
<string name="force_stop_app">强制停止</string>
<string name="restart_app">重新启动</string>
<string name="failed_to_update_sepolicy">为:%s 更新翻译失败</string>
<string name="su_not_allowed">不允许授予:%s 超级用户权限</string>
<string name="module_changelog">更新日志</string>
<string name="settings_profile_template">App Profile 模版</string>
<string name="settings_profile_template_summary">管理本地和在线的 App Profile 模版</string>

View File

@ -83,6 +83,7 @@
<string name="force_stop_app">Force stop</string>
<string name="restart_app">Restart</string>
<string name="failed_to_update_sepolicy">Failed to update SELinux rules for %s</string>
<string name="su_not_allowed">Granting superuser to %s is not allowed</string>
<string name="module_changelog">Changelog</string>
<string name="settings_profile_template">App Profile Template</string>
<string name="settings_profile_template_summary">Manage local and online template of App Profile</string>