diff options
Diffstat (limited to 'partitionmanager.cpp')
-rwxr-xr-x[-rw-r--r--] | partitionmanager.cpp | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/partitionmanager.cpp b/partitionmanager.cpp index 45460d1dc..b8a95ff26 100644..100755 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -1343,9 +1343,14 @@ int TWPartitionManager::Wipe_Dalvik_Cache(void) { return false; dir.push_back("/data/dalvik-cache"); - if (Mount_By_Path("/cache", false)) { - dir.push_back("/cache/dalvik-cache"); - dir.push_back("/cache/dc"); + + std::string cacheDir = TWFunc::get_cache_dir(); + if (cacheDir == NON_AB_CACHE_DIR) { + if (!PartitionManager.Mount_By_Path(NON_AB_CACHE_DIR, false)) { + LOGINFO("Unable to mount %s for wiping cache.\n", NON_AB_CACHE_DIR); + } + dir.push_back(cacheDir + "dalvik-cache"); + dir.push_back(cacheDir + "/dc"); } TWPartition* sdext = Find_Partition_By_Path("/sd-ext"); @@ -1357,14 +1362,24 @@ int TWPartitionManager::Wipe_Dalvik_Cache(void) { } } - gui_msg("wiping_dalvik=Wiping Dalvik Cache Directories..."); + if (cacheDir == NON_AB_CACHE_DIR) { + gui_msg("wiping_cache_dalvik=Wiping Dalvik Cache Directories..."); + } else { + gui_msg("wiping_dalvik=Wiping Dalvik Directory..."); + } for (unsigned i = 0; i < dir.size(); ++i) { if (stat(dir.at(i).c_str(), &st) == 0) { TWFunc::removeDir(dir.at(i), false); gui_msg(Msg("cleaned=Cleaned: {1}...")(dir.at(i))); } } - gui_msg("dalvik_done=-- Dalvik Cache Directories Wipe Complete!"); + + if (cacheDir == NON_AB_CACHE_DIR) { + gui_msg("cache_dalvik_done=-- Dalvik Cache Directories Wipe Complete!"); + } else { + gui_msg("dalvik_done=-- Dalvik Directory Wipe Complete!"); + } + return true; } @@ -2194,10 +2209,12 @@ void TWPartitionManager::Output_Storage_Fstab(void) { std::vector<TWPartition*>::iterator iter; char storage_partition[255]; string Temp; - FILE *fp = fopen("/cache/recovery/storage.fstab", "w"); + + std::string storageFstab = TWFunc::get_cache_dir() + "recovery/storage.fstab"; + FILE *fp = fopen(storageFstab.c_str(), "w"); if (fp == NULL) { - gui_msg(Msg(msg::kError, "unable_to_open=Unable to open '{1}'.")("/cache/recovery/storage.fstab")); + gui_msg(Msg(msg::kError, "unable_to_open=Unable to open '{1}'.")(storageFstab)); return; } |