2019-02-25 04:09:34 +00:00
|
|
|
#pragma once
|
2017-02-27 21:37:47 +00:00
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2019-03-08 02:32:01 +00:00
|
|
|
#define HEADER_FILE "header"
|
2017-04-28 13:48:38 +00:00
|
|
|
#define KERNEL_FILE "kernel"
|
|
|
|
#define RAMDISK_FILE "ramdisk.cpio"
|
|
|
|
#define SECOND_FILE "second"
|
2017-10-07 14:08:10 +00:00
|
|
|
#define EXTRA_FILE "extra"
|
2019-03-13 20:51:22 +00:00
|
|
|
#define KER_DTB_FILE "kernel_dtb"
|
2018-10-20 03:10:47 +00:00
|
|
|
#define RECV_DTBO_FILE "recovery_dtbo"
|
2019-03-13 20:51:22 +00:00
|
|
|
#define DTB_FILE "dtb"
|
2017-04-28 13:48:38 +00:00
|
|
|
#define NEW_BOOT "new-boot.img"
|
2017-03-04 17:50:36 +00:00
|
|
|
|
2019-03-08 02:32:01 +00:00
|
|
|
int unpack(const char *image, bool hdr = false);
|
2019-06-07 18:56:20 +00:00
|
|
|
void repack(const char* orig_image, const char* out_image, bool force_nocomp = false);
|
2019-06-08 12:29:30 +00:00
|
|
|
int hexpatch(const char *image, const char *from, const char *to);
|
2017-12-20 19:36:18 +00:00
|
|
|
int cpio_commands(int argc, char *argv[]);
|
2019-09-20 07:53:58 +00:00
|
|
|
int dtb_commands(int argc, char *argv[]);
|
2017-02-27 21:37:47 +00:00
|
|
|
|
2019-09-26 07:14:56 +00:00
|
|
|
char *patch_verity(const void *buf, uint32_t &size, bool inplace = false);
|
|
|
|
void patch_encryption(void *&buf, uint32_t &size);
|
2019-09-22 08:17:15 +00:00
|
|
|
bool check_env(const char *name);
|