Support extract boot image from payload.bin

This commit is contained in:
LoveSy
2022-12-13 11:33:16 +08:00
committed by John Wu
parent b136aba1e2
commit 7bf2e3875f
8 changed files with 5152 additions and 0 deletions

View File

@ -4,6 +4,8 @@
#include "magiskboot.hpp"
#include "compress.hpp"
#include "boot-rs.cpp"
using namespace std;
static void print_formats() {
@ -46,6 +48,9 @@ Supported actions:
If env variable PATCHVBMETAFLAG is set to true, all disable flags in
the boot image's vbmeta header will be set.
extract <payload.bin> <outbootimg>
Extract the boot image from payload.bin to <outbootimg>.
hexpatch <file> <hexpattern1> <hexpattern2>
Search <hexpattern1> in <file>, and replace it with <hexpattern2>
@ -201,6 +206,8 @@ int main(int argc, char *argv[]) {
} else if (argc > 3 && action == "dtb") {
if (dtb_commands(argc - 2, argv + 2))
usage(argv[0]);
} else if (argc > 3 && action == "extract") {
return rust::extract_boot_from_payload(argv[2], argv[3]) ? 0 : 1;
} else {
usage(argv[0]);
}