Skip to content

Commit

Permalink
fixup! initramfs: integrate magiskinit64
Browse files Browse the repository at this point in the history
Generate RANDOMSEED.

Signed-off-by: Denis Efremov <efremov@linux.com>
  • Loading branch information
evdenis committed Apr 26, 2023
1 parent 90bd6d4 commit 49227b4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 10 additions & 1 deletion cruelbuild
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ from sys import argv, stdout, stderr
import re
import json
import atexit
import secrets
from copy import deepcopy
from datetime import datetime, timedelta
from subprocess import CalledProcessError, Popen, run, DEVNULL, PIPE
Expand Down Expand Up @@ -612,7 +613,15 @@ def update_magisk(version):
if version:
cmd.append(version)
run(cmd, check=True)
with open('usr/magisk/magisk_version', 'r') as fh:
with open('usr/magisk/backup_magisk', 'wt') as fh:
print(f"""
KEEPVERITY=true
KEEPFORCEENCRYPT=true
RECOVERYMODE=false
PREINITDEVICE=userdata
RANDOMSEED=0x{secrets.token_hex(8)}
""".strip(), file=fh)
with open('usr/magisk/magisk_version', 'rt') as fh:
print('Magisk Version: ' + fh.readline())

def switch_toolchain(compiler):
Expand Down
1 change: 1 addition & 0 deletions usr/magisk/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
magiskinit
magiskinit64
magisk_version
backup_magisk
3 changes: 0 additions & 3 deletions usr/magisk/backup_magisk

This file was deleted.

0 comments on commit 49227b4

Please sign in to comment.