We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb8e3bc commit 9a64eaaCopy full SHA for 9a64eaa
manager/app/src/main/cpp/ksu.cc
@@ -50,12 +50,13 @@ bool become_manager(const char* pkg) {
50
}
51
52
// cache the result to avoid unnecessary syscall
53
-static bool is_lkm;
54
-int get_version() {
+static bool is_lkm = false;
+
55
+int get_version(void) {
56
int32_t version = -1;
- int32_t lkm = 0;
57
- ksuctl(CMD_GET_VERSION, &version, &lkm);
58
- if (!is_lkm && lkm != 0) {
+ int32_t flags = 0;
+ ksuctl(CMD_GET_VERSION, &version, &flags);
59
+ if (!is_lkm && (flags & 0x1)) {
60
is_lkm = true;
61
62
return version;
@@ -96,4 +97,4 @@ bool is_su_enabled() {
96
97
// if ksuctl failed, we assume su is enabled, and it cannot be disabled.
98
ksuctl(CMD_IS_SU_ENABLED, &enabled, nullptr);
99
return enabled;
-}
100
+}
0 commit comments