b5a20a8d00
Change-Id: Ia120ed12f3ae551044907dfd1fd05444be78d18c
41 lines
886 B
C++
Executable File
41 lines
886 B
C++
Executable File
|
|
#ifndef TWRPAPEX_HPP
|
|
#define TWRPAPEX_HPP
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <filesystem>
|
|
#include <regex>
|
|
#include <sstream>
|
|
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <sys/ioctl.h>
|
|
#include <linux/loop.h>
|
|
#include <sys/mount.h>
|
|
#include <sys/sysmacros.h>
|
|
#include <fcntl.h>
|
|
#include <unistd.h>
|
|
#include <android-base/properties.h>
|
|
|
|
#include <ziparchive/zip_archive.h>
|
|
#include "twcommon.h"
|
|
|
|
#define APEX_DIR "/system_root/system/apex"
|
|
#define APEX_PAYLOAD "apex_payload.img"
|
|
#define LOOP_BLOCK_DEVICE_DIR "/dev/block/"
|
|
#define APEX_BASE "/apex/"
|
|
#define LOOP_CONTROL "/dev/loop-control"
|
|
|
|
class twrpApex {
|
|
public:
|
|
bool loadApexImages();
|
|
bool Unmount();
|
|
|
|
private:
|
|
std::string unzipImage(std::string file);
|
|
bool mountApexOnLoopbackDevices(std::vector<std::string> apexFiles);
|
|
bool loadApexImage(std::string fileToMount, size_t loop_device_number);
|
|
};
|
|
#endif
|