diff options
author | Ethan Yonker <dees_troy@teamw.in> | 2016-01-18 00:54:31 +0100 |
---|---|---|
committer | Dees Troy <dees_troy@teamw.in> | 2016-01-18 16:47:35 +0100 |
commit | 051f47601bc3c2fb28c164b146acb5f9dd31e095 (patch) | |
tree | 7f0446ad4115b1cdfa4b12da7cbd895a277cbb12 /twrp.cpp | |
parent | Make listbox translation work (diff) | |
download | android_bootable_recovery-051f47601bc3c2fb28c164b146acb5f9dd31e095.tar android_bootable_recovery-051f47601bc3c2fb28c164b146acb5f9dd31e095.tar.gz android_bootable_recovery-051f47601bc3c2fb28c164b146acb5f9dd31e095.tar.bz2 android_bootable_recovery-051f47601bc3c2fb28c164b146acb5f9dd31e095.tar.lz android_bootable_recovery-051f47601bc3c2fb28c164b146acb5f9dd31e095.tar.xz android_bootable_recovery-051f47601bc3c2fb28c164b146acb5f9dd31e095.tar.zst android_bootable_recovery-051f47601bc3c2fb28c164b146acb5f9dd31e095.zip |
Diffstat (limited to 'twrp.cpp')
-rw-r--r-- | twrp.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -368,7 +368,13 @@ int main(int argc, char **argv) { TWFunc::Disable_Stock_Recovery_Replace(); // Check for su to see if the device is rooted or not if (DataManager::GetIntValue("tw_mount_system_ro") == 0 && PartitionManager.Mount_By_Path("/system", false)) { - if (TWFunc::Path_Exists("/supersu/su") && TWFunc::Path_Exists("/system/bin") && !TWFunc::Path_Exists("/system/bin/su") && !TWFunc::Path_Exists("/system/xbin/su") && !TWFunc::Path_Exists("/system/bin/.ext/.su")) { + // read /system/build.prop to get sdk version and do not offer to root if running M or higher (sdk version 23 == M) + string sdkverstr = TWFunc::System_Property_Get("ro.build.version.sdk"); + int sdkver = 23; + if (!sdkverstr.empty()) { + sdkver = atoi(sdkverstr.c_str()); + } + if (TWFunc::Path_Exists("/supersu/su") && TWFunc::Path_Exists("/system/bin") && !TWFunc::Path_Exists("/system/bin/su") && !TWFunc::Path_Exists("/system/xbin/su") && !TWFunc::Path_Exists("/system/bin/.ext/.su") && sdkver < 23) { // Device doesn't have su installed DataManager::SetValue("tw_busy", 1); if (gui_startPage("installsu", 1, 1) != 0) { |