manager: display the same UID as a group

Co-authored-by: YuKongA <70465933+YuKongA@users.noreply.github.com>
Co-authored-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com>
This commit is contained in:
ShirkNeko
2025-11-15 23:44:38 +08:00
parent 35b02e3c73
commit 684a5d1ccd
6 changed files with 626 additions and 735 deletions

View File

@@ -6,6 +6,7 @@
#include <android/log.h>
#include <string.h>
#include <linux/capability.h>
#include <pwd.h>
NativeBridgeNP(getVersion, jint) {
uint32_t version = get_version();
@@ -318,6 +319,14 @@ NativeBridge(setEnhancedSecurityEnabled, jboolean, jboolean enabled) {
return set_enhanced_security_enabled(enabled);
}
NativeBridge(getUserName, jstring, jint uid) {
struct passwd *pw = getpwuid((uid_t) uid);
if (pw && pw->pw_name && pw->pw_name[0] != '\0') {
return GetEnvironment()->NewStringUTF(env, pw->pw_name);
}
return NULL;
}
// Check if KPM is enabled
NativeBridgeNP(isKPMEnabled, jboolean) {
return is_KPM_enable();