ad58e1bfae
for android-10 This will support updating the ramdisk to a different compression format and co-exist with magisk. We are also cleaning up and removing non android-10 api makefile actions. We are also moving twrp repacking to its own class. We check the new ramdisk format and if it's different we have magisk compress using the new ramdisk format. Change-Id: I770030aae7797e75817178b2f0fccd9f39dc23af
37 lines
729 B
C++
Executable File
37 lines
729 B
C++
Executable File
|
|
#ifndef TWRPAPEX_HPP
|
|
#define TWRPAPEX_HPP
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <filesystem>
|
|
|
|
#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 <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/"
|
|
|
|
class twrpApex {
|
|
public:
|
|
bool loadApexImages();
|
|
|
|
private:
|
|
std::string unzipImage(std::string file);
|
|
bool createLoopBackDevices(size_t count);
|
|
bool loadApexImage(std::string fileToMount, size_t loop_device_number);
|
|
};
|
|
#endif
|