manager: fix native jni calls and minor change to strings

This commit is contained in:
rifsxd
2025-02-23 22:42:30 +06:00
parent 15371bb1d6
commit c1273d35f4
4 changed files with 5 additions and 3 deletions

View File

@@ -298,11 +298,11 @@ Java_com_rifsxd_ksunext_Natives_uidShouldUmount(JNIEnv *env, jobject thiz, jint
}
extern "C"
JNIEXPORT jboolean JNICALL
Java_me_weishu_kernelsu_Natives_isSuEnabled(JNIEnv *env, jobject thiz) {
Java_com_rifsxd_ksunext_Natives_isSuEnabled(JNIEnv *env, jobject thiz) {
return is_su_enabled();
}
extern "C"
JNIEXPORT jboolean JNICALL
Java_me_weishu_kernelsu_Natives_setSuEnabled(JNIEnv *env, jobject thiz, jboolean enabled) {
Java_com_rifsxd_ksunext_Natives_setSuEnabled(JNIEnv *env, jobject thiz, jboolean enabled) {
return set_su_enabled(enabled);
}

View File

@@ -179,6 +179,7 @@ fun SettingScreen(navigator: DestinationsNavigator) {
title = stringResource(id = R.string.settings_disable_su),
summary = stringResource(id = R.string.settings_disable_su_summary),
checked = isSuDisabled,
enabled = !isSuDisabled // we can't re-enable su if it's disabled.
) { checked ->
val shouldEnable = !checked
if (Natives.setSuEnabled(shouldEnable)) {

View File

@@ -186,6 +186,7 @@
<string name="selected_lkm">选择的 LKM%s</string>
<string name="save_log">保存日志</string>
<string name="log_saved">日志已保存</string>
<string name="send_log">分享日志</string>
<string name="settings_disable_su">关闭 su 兼容</string>
<string name="settings_disable_su_summary">临时禁止任何应用通过 su 命令获取 root 权限(已运行的 root 进程不受影响)</string>
</resources>

View File

@@ -189,5 +189,5 @@
<string name="log_saved">Logs saved</string>
<string name="send_log">Share logs</string>
<string name="settings_disable_su">Disable su compatibility</string>
<string name="settings_disable_su_summary">Temporarily disable any applications from obtaining root privileges via the su command (existing root processes will not be affected).</string>
<string name="settings_disable_su_summary">Temporarily disable any applications from obtaining root privileges via the su command (existing root processes will not be affected).</string>
</resources>