manager: add support for setting default non root profile.
This commit is contained in:
@@ -87,6 +87,8 @@ Java_me_weishu_kernelsu_Natives_getAppProfile(JNIEnv *env, jobject, jstring pkg,
|
||||
env->ReleaseStringUTFChars(pkg, cpkg);
|
||||
|
||||
app_profile profile = {};
|
||||
profile.version = KSU_APP_PROFILE_VER;
|
||||
|
||||
strcpy(profile.key, key);
|
||||
profile.current_uid = uid;
|
||||
|
||||
@@ -197,8 +199,9 @@ Java_me_weishu_kernelsu_Natives_setAppProfile(JNIEnv *env, jobject clazz, jobjec
|
||||
auto umountModules = env->GetBooleanField(profile, umountModulesField);
|
||||
|
||||
app_profile p = {};
|
||||
strcpy(p.key, p_key);
|
||||
p.version = KSU_APP_PROFILE_VER;
|
||||
|
||||
strcpy(p.key, p_key);
|
||||
p.allow_su = allowSu;
|
||||
p.current_uid = currentUid;
|
||||
|
||||
|
||||
@@ -9,14 +9,11 @@ bool become_manager(const char *);
|
||||
|
||||
int get_version();
|
||||
|
||||
bool allow_su(int uid, bool allow);
|
||||
|
||||
bool get_allow_list(int *uids, int *size);
|
||||
|
||||
bool get_deny_list(int *uids, int *size);
|
||||
|
||||
bool is_safe_mode();
|
||||
|
||||
#define KSU_APP_PROFILE_VER 1
|
||||
#define KSU_MAX_PACKAGE_NAME 256
|
||||
// NGROUPS_MAX for Linux is 65535 generally, but we only supports 32 groups.
|
||||
#define KSU_MAX_GROUPS 32
|
||||
@@ -26,6 +23,8 @@ using p_key_t = char[KSU_MAX_PACKAGE_NAME];
|
||||
|
||||
struct app_profile {
|
||||
|
||||
int32_t version;
|
||||
|
||||
// this is usually the package of the app, but can be other value for special apps
|
||||
p_key_t key;
|
||||
int32_t current_uid;
|
||||
|
||||
Reference in New Issue
Block a user