Refactor magiskboot cpio

This commit is contained in:
LoveSy
2023-06-09 21:43:26 +08:00
committed by John Wu
parent c1038ac6f9
commit b8cb9cd84d
13 changed files with 881 additions and 567 deletions
+9 -3
View File
@@ -21,7 +21,13 @@ int hexpatch(const char *file, std::string_view from, std::string_view to);
int cpio_commands(int argc, char *argv[]);
int dtb_commands(int argc, char *argv[]);
bool patch_verity(byte_data &data);
bool patch_encryption(byte_data &data);
bool patch_verity(byte_data data);
void patch_verity(rust::Slice<uint8_t> data);
bool patch_encryption(byte_data data);
void patch_encryption(rust::Slice<uint8_t> data);
bool check_env(const char *name);
inline bool check_env(const char *name) {
using namespace std::string_view_literals;
const char *val = getenv(name);
return val != nullptr && val == "true"sv;
}