Commit ebdd6ec4 authored by topjohnwu's avatar topjohnwu

Fallback to getprop to get SDK_INT

Close #2274, close #2279
parent 05867603
......@@ -138,6 +138,14 @@ static void main_daemon() {
}
return true;
});
if (SDK_INT < 0) {
// In case some devices do not store this info in build.prop, fallback to getprop
auto sdk = getprop("ro.build.version.sdk");
if (!sdk.empty()) {
LOGI("* Device API level: %s\n", sdk.data());
SDK_INT = parse_int(sdk);
}
}
// Load config status
parse_prop_file(MAGISKTMP "/config", [](auto key, auto val) -> bool {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment