redo fix permissions in c++ for faster changes

This commit is contained in:
bigbiff bigbiff
2012-10-09 21:01:03 -04:00
parent a3f81542fb
commit a0f8a59aa1
5 changed files with 602 additions and 1 deletions
+18 -1
View File
@@ -38,6 +38,7 @@
#include "partitions.hpp"
#include "data.hpp"
#include "twrp-functions.hpp"
#include "fixPermissions.hpp"
#ifdef TW_INCLUDE_CRYPTO
#ifdef TW_INCLUDE_JB_CRYPTO
@@ -1553,6 +1554,22 @@ int TWPartitionManager::Decrypt_Device(string Password) {
return 1;
}
int TWPartitionManager::Fix_Permissions(void) {
int result = 0;
if (!Mount_By_Path("/data", true))
return false;
if (!Mount_By_Path("/system", true))
return false;
Mount_By_Path("/sd-ext", false);
fixPermissions perms;
result = perms.fixPerms(true, false);
ui_print("Done.\n\n");
return result;
}
//partial kangbang from system/vold
#ifndef CUSTOM_LUN_FILE
#define CUSTOM_LUN_FILE "/sys/devices/platform/usb_mass_storage/lun%d/file"
@@ -1827,4 +1844,4 @@ int TWPartitionManager::Partition_SDCard(void) {
Update_System_Details();
ui_print("Partitioning complete.\n");
return true;
}
}