blob: fb916753bdd0c549712bbd87a785f71552d49399 [file] [log] [blame]
bigbiff32cbabe2020-04-12 19:16:19 -04001
2#ifndef TWRPAPEX_HPP
3#define TWRPAPEX_HPP
4
5#include <string>
6#include <vector>
7#include <filesystem>
8
9#include <sys/types.h>
10#include <sys/stat.h>
11#include <sys/ioctl.h>
12#include <linux/loop.h>
13#include <sys/mount.h>
14#include <sys/sysmacros.h>
15#include <fcntl.h>
16#include <unistd.h>
17
18#include <ziparchive/zip_archive.h>
19#include "twcommon.h"
20
21
22#define APEX_DIR "/system_root/system/apex"
23#define APEX_PAYLOAD "apex_payload.img"
24#define LOOP_BLOCK_DEVICE_DIR "/dev/block/"
25
26class twrpApex {
27public:
28 bool loadApexImages();
29
30private:
31 std::string unzipImage(std::string file);
32 bool createLoopBackDevices(size_t count);
33 bool loadApexImage(std::string fileToMount, size_t loop_device_number);
34};
35#endif