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
+10 -2
View File
@@ -57,10 +57,18 @@ static bool remove_pattern(byte_data &data, int(*pattern_skip)(const char *)) {
return data.sz() != orig_sz;
}
bool patch_verity(byte_data &data) {
bool patch_verity(byte_data data) {
return remove_pattern(data, skip_verity_pattern);
}
bool patch_encryption(byte_data &data) {
void patch_verity(rust::Slice<uint8_t> data) {
patch_verity(byte_data{data.data(), data.size()});
}
bool patch_encryption(byte_data data) {
return remove_pattern(data, skip_encryption_pattern);
}
void patch_encryption(rust::Slice<uint8_t> data) {
patch_encryption(byte_data{data.data(), data.size()});
}