summaryrefslogtreecommitdiffstats
path: root/twrp-functions.hpp
diff options
context:
space:
mode:
authorbigbiff <bigbiff@teamw.in>2015-12-13 00:30:21 +0100
committerEthan Yonker <dees_troy@teamw.in>2016-08-01 05:20:18 +0200
commitce8f83c48d200106ff61ad530c863b15c16949d9 (patch)
tree2908e48dfb44eae96c49113a177108f3cbb714f2 /twrp-functions.hpp
parentBlack screen patch for some HiSilicon devices (FBIOPAN_DISPLAY) (diff)
downloadandroid_bootable_recovery-ce8f83c48d200106ff61ad530c863b15c16949d9.tar
android_bootable_recovery-ce8f83c48d200106ff61ad530c863b15c16949d9.tar.gz
android_bootable_recovery-ce8f83c48d200106ff61ad530c863b15c16949d9.tar.bz2
android_bootable_recovery-ce8f83c48d200106ff61ad530c863b15c16949d9.tar.lz
android_bootable_recovery-ce8f83c48d200106ff61ad530c863b15c16949d9.tar.xz
android_bootable_recovery-ce8f83c48d200106ff61ad530c863b15c16949d9.tar.zst
android_bootable_recovery-ce8f83c48d200106ff61ad530c863b15c16949d9.zip
Diffstat (limited to 'twrp-functions.hpp')
-rw-r--r--twrp-functions.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/twrp-functions.hpp b/twrp-functions.hpp
index 3f9b2ff5a..550c946f0 100644
--- a/twrp-functions.hpp
+++ b/twrp-functions.hpp
@@ -34,6 +34,13 @@ typedef enum
rb_download,
} RebootCommand;
+enum Archive_Type {
+ UNCOMPRESSED = 0,
+ COMPRESSED,
+ ENCRYPTED,
+ COMPRESSED_ENCRYPTED
+};
+
// Partition class
class TWFunc
{
@@ -46,7 +53,7 @@ public:
static int Exec_Cmd(const string& cmd); //execute a command
static int Wait_For_Child(pid_t pid, int *status, string Child_Name); // Waits for pid to exit and checks exit status
static bool Path_Exists(string Path); // Returns true if the path exists
- static int Get_File_Type(string fn); // Determines file type, 0 for unknown, 1 for gzip, 2 for OAES encrypted
+ static Archive_Type Get_File_Type(string fn); // Determines file type, 0 for unknown, 1 for gzip, 2 for OAES encrypted
static int Try_Decrypting_File(string fn, string password); // -1 for some error, 0 for failed to decrypt, 1 for decrypted, 3 for decrypted and found gzip format
static unsigned long Get_File_Size(const string& Path); // Returns the size of a file
static std::string Remove_Trailing_Slashes(const std::string& path, bool leaveLast = false); // Normalizes the path, e.g /data//media/ -> /data/media