Fix unable to get SHA1 value issue
This commit is contained in:
parent
25c289ad3e
commit
ce87591c62
@ -68,8 +68,8 @@ int main(int argc, char *argv[]) {
|
|||||||
mmap_ro(argv[2], (unsigned char **) &buf, &size);
|
mmap_ro(argv[2], (unsigned char **) &buf, &size);
|
||||||
SHA1(sha1, buf, size);
|
SHA1(sha1, buf, size);
|
||||||
for (int i = 0; i < 20; ++i)
|
for (int i = 0; i < 20; ++i)
|
||||||
fprintf(stderr, "%02x", sha1[i]);
|
printf("%02x", sha1[i]);
|
||||||
fprintf(stderr, "\n");
|
printf("\n");
|
||||||
munmap(buf, size);
|
munmap(buf, size);
|
||||||
} else if (argc > 2 && strcmp(argv[1], "--unpack") == 0) {
|
} else if (argc > 2 && strcmp(argv[1], "--unpack") == 0) {
|
||||||
unpack(argv[2]);
|
unpack(argv[2]);
|
||||||
|
@ -147,7 +147,7 @@ case $? in
|
|||||||
0 ) # Stock boot
|
0 ) # Stock boot
|
||||||
ui_print_wrap "- Stock boot image detected!"
|
ui_print_wrap "- Stock boot image detected!"
|
||||||
ui_print_wrap "- Backing up stock boot image"
|
ui_print_wrap "- Backing up stock boot image"
|
||||||
SHA1=`./magiskboot --sha1 "$BOOTIMAGE" | tail -n 1`
|
SHA1=`./magiskboot --sha1 "$BOOTIMAGE" 2>/dev/null`
|
||||||
STOCKDUMP=stock_boot_${SHA1}.img
|
STOCKDUMP=stock_boot_${SHA1}.img
|
||||||
dd if="$BOOTIMAGE" of=$STOCKDUMP
|
dd if="$BOOTIMAGE" of=$STOCKDUMP
|
||||||
./magiskboot --compress $STOCKDUMP
|
./magiskboot --compress $STOCKDUMP
|
||||||
|
@ -152,7 +152,7 @@ ui_print "- Found Boot Image: $BOOTIMAGE"
|
|||||||
|
|
||||||
# Update our previous backup to new format if exists
|
# Update our previous backup to new format if exists
|
||||||
if [ -f /data/stock_boot.img ]; then
|
if [ -f /data/stock_boot.img ]; then
|
||||||
SHA1=`$MAGISKBIN/magiskboot --sha1 /data/stock_boot.img | tail -n 1`
|
SHA1=`$MAGISKBIN/magiskboot --sha1 /data/stock_boot.img 2>/dev/null`
|
||||||
STOCKDUMP=/data/stock_boot_${SHA1}.img
|
STOCKDUMP=/data/stock_boot_${SHA1}.img
|
||||||
mv /data/stock_boot.img $STOCKDUMP
|
mv /data/stock_boot.img $STOCKDUMP
|
||||||
$MAGISKBIN/magiskboot --compress $STOCKDUMP
|
$MAGISKBIN/magiskboot --compress $STOCKDUMP
|
||||||
|
@ -84,7 +84,7 @@ esac
|
|||||||
|
|
||||||
# Update our previous backup to new format if exists
|
# Update our previous backup to new format if exists
|
||||||
if [ -f /data/stock_boot.img ]; then
|
if [ -f /data/stock_boot.img ]; then
|
||||||
SHA1=`./magiskboot --sha1 /data/stock_boot.img | tail -n 1`
|
SHA1=`./magiskboot --sha1 /data/stock_boot.img 2>/dev/null`
|
||||||
STOCKDUMP=/data/stock_boot_${SHA1}.img
|
STOCKDUMP=/data/stock_boot_${SHA1}.img
|
||||||
mv /data/stock_boot.img $STOCKDUMP
|
mv /data/stock_boot.img $STOCKDUMP
|
||||||
./magiskboot --compress $STOCKDUMP
|
./magiskboot --compress $STOCKDUMP
|
||||||
|
Loading…
Reference in New Issue
Block a user