mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-25 08:37:39 +00:00
Read SHA1 from overlay ramdisk
This commit is contained in:
parent
590e7f7724
commit
b805b96e16
@ -390,7 +390,8 @@ static void cpio_stocksha1(struct vector *v) {
|
|||||||
cpio_entry *f;
|
cpio_entry *f;
|
||||||
char sha1[41];
|
char sha1[41];
|
||||||
vec_for_each(v, f) {
|
vec_for_each(v, f) {
|
||||||
if (strcmp(f->filename, "init.magisk.rc") == 0) {
|
if (strcmp(f->filename, "init.magisk.rc") == 0
|
||||||
|
|| strcmp(f->filename, "overlay/init.magisk.rc") == 0) {
|
||||||
for (char *pos = f->data; pos < f->data + f->filesize; pos = strchr(pos + 1, '\n') + 1) {
|
for (char *pos = f->data; pos < f->data + f->filesize; pos = strchr(pos + 1, '\n') + 1) {
|
||||||
if (memcmp(pos, "# STOCKSHA1=", 12) == 0) {
|
if (memcmp(pos, "# STOCKSHA1=", 12) == 0) {
|
||||||
pos += 12;
|
pos += 12;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user