From b5fab76bea98dff8d0825d16c3dd359397449e9a Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Thu, 28 Jan 2016 14:03:33 -0600 Subject: Replace fix permissions with fix contexts for emulated storage Fix permissions rarely fixed anything on more recent versions of Android and usually made things worse. Instead we will replace it with a more dumbed down option that should fix contexts on /data/media with a few improvements to ensure that contexts get fixed for multiple users and on adopted storage. Change-Id: If5523781936a0b04196e2ad871cae767ebae2583 --- fixPermissions.hpp | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 fixPermissions.hpp (limited to 'fixPermissions.hpp') diff --git a/fixPermissions.hpp b/fixPermissions.hpp deleted file mode 100644 index f61a9a172..000000000 --- a/fixPermissions.hpp +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "gui/rapidxml.hpp" -#include "twrp-functions.hpp" - -using namespace std; - -class fixPermissions { - public: - fixPermissions(); - ~fixPermissions(); - int fixPerms(bool enable_debug, bool remove_data_for_missing_apps); - int fixContexts(); - int fixDataInternalContexts(void); - - private: - int pchown(string fn, int puid, int pgid); - int pchmod(string fn, mode_t mode); - vector listAllDirectories(string path); - vector listAllFiles(string path); - void deletePackages(); - int getPackages(const string& packageFile); - int fixApps(); - int fixAllFiles(string directory, int uid, int gid, mode_t file_perms); - int fixDir(const string& dir, int diruid, int dirgid, mode_t dirmode, int fileuid, int filegid, mode_t filemode); - int fixDataData(string dataDir); - int restorecon(string entry, struct stat *sb); - int fixDataDataContexts(void); - int fixContextsRecursively(string path, int level); - - struct package { - string pkgName; - string codePath; - string appDir; - string dDir; - int gid; - int uid; - package *next; - }; - bool debug; - bool remove_data; - package* head; -}; -- cgit v1.2.3