From 2f2b303e725e05ef8b3a3743ebfdc90b62c02136 Mon Sep 17 00:00:00 2001 From: weishu Date: Mon, 5 Jun 2023 10:10:16 +0800 Subject: [PATCH] manager: Fix set profile failed. --- manager/app/src/main/cpp/jni.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manager/app/src/main/cpp/jni.cc b/manager/app/src/main/cpp/jni.cc index 2d2fef7e..1be6e4cc 100644 --- a/manager/app/src/main/cpp/jni.cc +++ b/manager/app/src/main/cpp/jni.cc @@ -143,6 +143,9 @@ Java_me_weishu_kernelsu_Natives_getAppProfile(JNIEnv *env, jobject, jstring pkg, auto nonRootUseDefaultField = env->GetFieldID(cls, "nonRootUseDefault", "Z"); auto umountModulesField = env->GetFieldID(cls, "umountModules", "Z"); + env->SetObjectField(obj, keyField, env->NewStringUTF(profile.key)); + env->SetIntField(obj, currentUidField, profile.current_uid); + if (useDefaultProfile) { // no profile found, so just use default profile: // don't allow root and use default profile! @@ -163,9 +166,6 @@ Java_me_weishu_kernelsu_Natives_getAppProfile(JNIEnv *env, jobject, jstring pkg, return obj; } - env->SetObjectField(obj, keyField, env->NewStringUTF(profile.key)); - env->SetIntField(obj, currentUidField, profile.current_uid); - auto allowSu = profile.allow_su; if (allowSu) {