diff options
author | bigbiff bigbiff <bigbiff@teamw.in> | 2012-10-10 03:01:03 +0200 |
---|---|---|
committer | bigbiff bigbiff <bigbiff@teamw.in> | 2012-10-10 03:01:03 +0200 |
commit | a0f8a59aa10dbbeac965129c91cf1c693137d97e (patch) | |
tree | 28902a82dd78b48f3fb257fb82fb143f4a9ced66 /fixPermissions.hpp | |
parent | Add reboot system button after sideload, backup, and restore (diff) | |
download | android_bootable_recovery-a0f8a59aa10dbbeac965129c91cf1c693137d97e.tar android_bootable_recovery-a0f8a59aa10dbbeac965129c91cf1c693137d97e.tar.gz android_bootable_recovery-a0f8a59aa10dbbeac965129c91cf1c693137d97e.tar.bz2 android_bootable_recovery-a0f8a59aa10dbbeac965129c91cf1c693137d97e.tar.lz android_bootable_recovery-a0f8a59aa10dbbeac965129c91cf1c693137d97e.tar.xz android_bootable_recovery-a0f8a59aa10dbbeac965129c91cf1c693137d97e.tar.zst android_bootable_recovery-a0f8a59aa10dbbeac965129c91cf1c693137d97e.zip |
Diffstat (limited to '')
-rw-r--r-- | fixPermissions.hpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/fixPermissions.hpp b/fixPermissions.hpp new file mode 100644 index 000000000..45c04712c --- /dev/null +++ b/fixPermissions.hpp @@ -0,0 +1,46 @@ +#include <iostream> +#include <fstream> +#include <sstream> +#include <string> +#include <vector> +#include <string.h> +#include <libgen.h> +#include <unistd.h> +#include <sys/stat.h> +#include <dirent.h> +#include "gui/rapidxml.hpp" +#include "twrp-functions.hpp" + +using namespace std; + +class fixPermissions { + public: + int fixPerms(bool enable_debug, bool remove_data_for_missing_apps); + + private: + int pchown(std::string fn, int puid, int pgid); + int pchmod(std::string fn, string mode); + vector <string> listAllDirectories(std::string path); + vector <string> listAllFiles(std::string path); + int removeDir(const std::string path); + int getPackages(); + int fixSystemApps(); + int fixDataApps(); + int fixAllFiles(string directory, int gid, int uid, string file_perms); + int fixDataData(); + struct package { + string pkgName; + string codePath; + string appDir; + string app; + string dDir; + int gid; + int uid; + package *next; + }; + bool debug; + bool remove_data; + package* head; + package* temp; + string packageFile; +}; |