Files
android_bootable_recovery/twrpApex.hpp
T
bigbiff ad58e1bfae repack: move sbin to /system ramdisk and update repacking
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
2020-09-08 10:08:33 -04:00

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