mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-25 04:48:51 +00:00
Some code adjustments
This commit is contained in:
@@ -31,8 +31,9 @@ static int check_encryption_pattern(const char *s) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int patch_verity(void **buf, uint32_t *size, int patch) {
|
||||
int skip, src_size = *size, found = 0;
|
||||
bool patch_verity(void **buf, uint32_t *size, bool patch) {
|
||||
int skip, src_size = *size;
|
||||
bool found = false;
|
||||
char *src = (char *) *buf, *patched = patch ? (char *) xcalloc(src_size, 1) : nullptr;
|
||||
for (int read = 0, write = 0; read < src_size; ++read, ++write) {
|
||||
if ((skip = check_verity_pattern(src + read)) > 0) {
|
||||
@@ -43,7 +44,7 @@ int patch_verity(void **buf, uint32_t *size, int patch) {
|
||||
fprintf(stderr, "Found pattern [%.*s]\n", skip, src + read);
|
||||
}
|
||||
read += skip;
|
||||
found = 1;
|
||||
found = true;
|
||||
}
|
||||
if (patch)
|
||||
patched[write] = src[read];
|
||||
|
||||
Reference in New Issue
Block a user