mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-17 16:38:28 +00:00
Minor code changes
This commit is contained in:
parent
f7d3d1eeaf
commit
b27b9c1d18
@ -146,28 +146,27 @@ void reboot() {
|
|||||||
|
|
||||||
static bool check_data() {
|
static bool check_data() {
|
||||||
bool mnt = false;
|
bool mnt = false;
|
||||||
bool data = false;
|
file_readline("/proc/mounts", [&](string_view s) {
|
||||||
file_readline("/proc/mounts", [&](string_view s) -> bool {
|
if (str_contains(s, " /data ") && !str_contains(s, "tmpfs")) {
|
||||||
if (str_contains(s, " /data ") && !str_contains(s, "tmpfs"))
|
|
||||||
mnt = true;
|
mnt = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
if (mnt) {
|
if (!mnt)
|
||||||
auto crypto = getprop("ro.crypto.state");
|
return false;
|
||||||
if (!crypto.empty()) {
|
auto crypto = getprop("ro.crypto.state");
|
||||||
if (crypto == "unencrypted") {
|
if (!crypto.empty()) {
|
||||||
// Unencrypted, we can directly access data
|
if (crypto == "unencrypted") {
|
||||||
data = true;
|
// Unencrypted, we can directly access data
|
||||||
} else {
|
return true;
|
||||||
// Encrypted, check whether vold is started
|
|
||||||
data = !getprop("init.svc.vold").empty();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// ro.crypto.state is not set, assume it's unencrypted
|
// Encrypted, check whether vold is started
|
||||||
data = true;
|
return !getprop("init.svc.vold").empty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return data;
|
// ro.crypto.state is not set, assume it's unencrypted
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void unlock_blocks() {
|
void unlock_blocks() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user