From 9c754053b07a724bdd98d039f34899d6a49115b7 Mon Sep 17 00:00:00 2001 From: bigbiff bigbiff Date: Wed, 9 Jan 2013 09:09:08 -0500 Subject: Add libtar to TWRP instead of using busybox tar Add proper mkdosfs tool Add fuse to TWRP Add experimental exfat-fuse to TWRP Convert all system() functions to use new Exec_Cmd function --- fixPermissions.cpp | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) (limited to 'fixPermissions.cpp') diff --git a/fixPermissions.cpp b/fixPermissions.cpp index 801e27374..16a3f33f2 100644 --- a/fixPermissions.cpp +++ b/fixPermissions.cpp @@ -220,44 +220,6 @@ int fixPermissions::pchmod(string fn, string mode) { return 0; } -int fixPermissions::removeDir(const string path) { - DIR *d = opendir(path.c_str()); - int r = 0; - string new_path; - - if (d == NULL) { - LOGE("Error opening '%s'\n", path.c_str()); - return -1; - } - - if (d) { - struct dirent *p; - while (!r && (p = readdir(d))) { - if (!strcmp(p->d_name, ".") || !strcmp(p->d_name, "..")) - continue; - - new_path = path + "/"; - new_path.append(p->d_name); - if (p->d_type == DT_DIR) { - r = removeDir(new_path); - if (!r) - LOGI("Unable to removeDir '%s'\n", new_path.c_str()); - } else { - r = unlink(new_path.c_str()); - if (!r) - LOGI("Unable to unlink '%s'\n", new_path.c_str()); - } - } - closedir(d); - } - if (!r) - r = rmdir(path.c_str()); - if (!r) - LOGI("Unable to rmdir '%s'\n", path.c_str()); - - return r; -} - int fixPermissions::fixSystemApps() { temp = head; while (temp != NULL) { @@ -279,7 +241,7 @@ int fixPermissions::fixSystemApps() { if (remove_data && TWFunc::Path_Exists(temp->dDir) && temp->appDir.size() >= 9 && temp->appDir.substr(0, 9) != "/mnt/asec") { if (debug) LOGI("Looking at '%s', removing data dir: '%s', appDir: '%s'", temp->codePath.c_str(), temp->dDir.c_str(), temp->appDir.c_str()); - if (removeDir(temp->dDir) != 0) { + if (TWFunc::removeDir(temp->dDir, false) != 0) { LOGI("Unable to removeDir '%s'\n", temp->dDir.c_str()); return -1; } @@ -325,7 +287,7 @@ int fixPermissions::fixDataApps() { if (remove_data && TWFunc::Path_Exists(temp->dDir) && temp->appDir.size() >= 9 && temp->appDir.substr(0, 9) != "/mnt/asec") { if (debug) LOGI("Looking at '%s', removing data dir: '%s', appDir: '%s'", temp->codePath.c_str(), temp->dDir.c_str(), temp->appDir.c_str()); - if (removeDir(temp->dDir) != 0) { + if (TWFunc::removeDir(temp->dDir, false) != 0) { LOGI("Unable to removeDir '%s'\n", temp->dDir.c_str()); return -1; } -- cgit v1.2.3