From b805b96e1681e6b32cda566871b275074e1e38fe Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 15 Sep 2017 18:03:56 +0800 Subject: [PATCH] Read SHA1 from overlay ramdisk --- jni/magiskboot/cpio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jni/magiskboot/cpio.c b/jni/magiskboot/cpio.c index a1f391911..8730d24fb 100644 --- a/jni/magiskboot/cpio.c +++ b/jni/magiskboot/cpio.c @@ -390,7 +390,8 @@ static void cpio_stocksha1(struct vector *v) { cpio_entry *f; char sha1[41]; 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) { if (memcmp(pos, "# STOCKSHA1=", 12) == 0) { pos += 12;