This repository was archived by the owner on Sep 12, 2025. It is now read-only.

Description
Apologies for any inconvenience. I'm curious about why we prefer to perform a check and use the SHA1 of a CPIO file instead of simply calculating the SHA1 of the partition itself?
|
if (ramdisk.exists()) { |
|
when (Shell.cmd("$magiskboot cpio ramdisk.cpio test").exec().code) { |
|
0 -> _sha1 = Shell.cmd("$magiskboot sha1 $boot").exec().out.firstOrNull() |
|
1 -> _sha1 = Shell.cmd("$magiskboot cpio ramdisk.cpio sha1").exec().out.firstOrNull() |
|
else -> log(context, "Invalid ramdisk in boot.img", shouldThrow = true) |
|
} |
|
} else if (kernel.exists()) { |
|
_sha1 = Shell.cmd("$magiskboot sha1 $boot").exec().out.firstOrNull() |
|
} else { |
|
log(context, "Invalid boot.img, no ramdisk or kernel found", shouldThrow = true) |
|
} |