Skip to content
Browse files

Build: Switch to Magisk as the built in root [2/2]

Pretty much identical to DirtyUnicorns/android_build@2871a7b

Modified and updated for TWRP 3.0.3-x by @nathanchance

Change-Id: Ic0cc0b6e96723a87298edb5cded9f6ef93c05b9d
Signed-off-by: Nathan Chancellor <>
  • Loading branch information
LorDClockaN authored and Miccia94 committed Feb 6, 2017
1 parent 1d2522f commit 2b25066e4ee953ee9d5c4825c1d4b6b156c450dd
Showing with 13 additions and 0 deletions.
  1. +5 −0 tools/releasetools/
  2. +8 −0 tools/releasetools/
@@ -173,6 +173,11 @@ def ValidateSignatures(self, command):
def RunPersist(self, command):
self.script.append(('run_program("/tmp/install/bin/", "%s");' % command))

def FlashMagisk(self):
self.script.append('package_extract_dir("magisk", "/tmp/magisk");')
self.script.append('run_program("/sbin/busybox", "unzip", "/tmp/magisk/", "META-INF/com/google/android/*", "-d", "/tmp/magisk");')
self.script.append('run_program("/sbin/sh", "/tmp/magisk/META-INF/com/google/android/update-binary", "dummy", "1", "/tmp/magisk/");')

def ShowProgress(self, frac, dur):
"""Update the progress bar, advancing it over 'frac' over the next
'dur' seconds. 'dur' may be zero to advance it via SetProgress
@@ -800,6 +800,14 @@ def output_sink(fn, data):
script.ShowProgress(0.05, 5)
script.WriteRawImage("/boot", "boot.img")

if block_based:
script.Print(" ")
script.Print("Flashing Magisk...")
script.Print(" ")
common.ZipWriteStr(output_zip, "magisk/",
script.Print(" ")
script.ShowProgress(0.2, 10)

0 comments on commit 2b25066

Please sign in to comment.