From c8387e04aae6556a4093495c27841b82552e149d Mon Sep 17 00:00:00 2001 From: Syuugo Date: Fri, 19 Jul 2024 03:20:06 +0900 Subject: [PATCH] reboot Signed-off-by: Syuugo --- mali_shrinker_mmap32.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mali_shrinker_mmap32.c b/mali_shrinker_mmap32.c index 3fe5c14..78d5e60 100644 --- a/mali_shrinker_mmap32.c +++ b/mali_shrinker_mmap32.c @@ -877,21 +877,24 @@ int main() { system("dd if=/dev/block/by-name/frp of=/data/local/tmp/frp"); FILE *frp = fopen("/data/local/tmp/frp", "r+b"); if (frp == NULL) { - perror("Couldn't read cloned FRP."); - return 1; + err(1, "Couldn't read cloned FRP."); } if (fseek(frp, 524288 - 1, SEEK_SET) != 0) { - perror("Error seeking to the last byte."); fclose(frp); - return 1; + err(1, "Error seeking to the last byte."); } if (fputc(0x01, frp) == EOF) { - perror("Failed to fix byte. (7FFF8:0x01)"); fclose(frp); - return 1; + err(1, "Failed to fix byte. (7FFF8:0x01)"); } fclose(frp); system("dd if=/data/local/tmp/frp of=/dev/block/by-name/frp"); + system("rm -f /data/local/tmp/frp"); + printf("Rebooting to bootloader...\n"); + sleep(2); + system("reboot bootloader"); + printf("Run the following command:"); + printf("fastboot flashing unlock\n"); break; } }