diff options
author | Dees_Troy <dees_troy@teamw.in> | 2013-01-17 22:42:14 +0100 |
---|---|---|
committer | Dees_Troy <dees_troy@teamw.in> | 2013-01-17 22:44:57 +0100 |
commit | 1c1ac44eaa6e1e2a84e5da9c95b1d9387e0be1c8 (patch) | |
tree | 68d27903bd1811b3d8164e68a259331a118b1d6d /data.cpp | |
parent | Add sideload command for ORS (diff) | |
download | android_bootable_recovery-1c1ac44eaa6e1e2a84e5da9c95b1d9387e0be1c8.tar android_bootable_recovery-1c1ac44eaa6e1e2a84e5da9c95b1d9387e0be1c8.tar.gz android_bootable_recovery-1c1ac44eaa6e1e2a84e5da9c95b1d9387e0be1c8.tar.bz2 android_bootable_recovery-1c1ac44eaa6e1e2a84e5da9c95b1d9387e0be1c8.tar.lz android_bootable_recovery-1c1ac44eaa6e1e2a84e5da9c95b1d9387e0be1c8.tar.xz android_bootable_recovery-1c1ac44eaa6e1e2a84e5da9c95b1d9387e0be1c8.tar.zst android_bootable_recovery-1c1ac44eaa6e1e2a84e5da9c95b1d9387e0be1c8.zip |
Diffstat (limited to 'data.cpp')
-rw-r--r-- | data.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -831,15 +831,21 @@ int DataManager::GetMagicValue(const string varName, string& value) } void DataManager::Output_Version(void) { - string Path, Command; + string Path; char version[255]; - Path = DataManager::GetSettingsStoragePath(); - if (!PartitionManager.Mount_By_Path(Path, false)) { + if (!PartitionManager.Mount_By_Path("/cache", false)) { LOGI("Unable to mount '%s' to write version number.\n", Path.c_str()); return; } - Path += "/TWRP/.version"; + if (!TWFunc::Path_Exists("/cache/recovery/.")) { + LOGI("Recreating /cache/recovery folder.\n"); + if (mkdir("/cache/recovery", S_IRWXU | S_IRWXG | S_IWGRP | S_IXGRP) != 0) { + LOGE("DataManager::Output_Version -- Unable to make /cache/recovery\n"); + return; + } + } + Path = "/cache/recovery/.version"; if (TWFunc::Path_Exists(Path)) { unlink(Path.c_str()); } |