Skip to content

Instantly share code, notes, and snippets.

@darkspadez
Created February 27, 2014 04:05
Show Gist options
  • Save darkspadez/9244191 to your computer and use it in GitHub Desktop.
Save darkspadez/9244191 to your computer and use it in GitHub Desktop.
script.FormatPartition("/system")
script.Mount("/system")
script.Mount("/data")
script.UnpackPackageDir("system", "/system")
script.UnpackPackageDir("data", "/data")
script.Print("Symlinks and permissions...")
symlinks = CopySystemFiles(input_zip, output_zip)
script.MakeSymlinks(symlinks)
boot_img = common.GetBootableImage("boot.img", "boot.img",
OPTIONS.input_tmp, "BOOT")
#recovery_img = common.GetBootableImage("recovery.img", "recovery.img",
# OPTIONS.input_tmp, "RECOVERY")
#MakeRecoveryPatch(OPTIONS.input_tmp, output_zip, recovery_img, boot_img)
Item.GetMetadata(input_zip)
Item.Get("system").SetPermissions(script)
common.CheckSize(boot_img.data, "boot.img", OPTIONS.info_dict)
common.ZipWriteStr(output_zip, "boot.img", boot_img.data)
script.ShowProgress(0.2, 0)
if OPTIONS.backuptool:
script.ShowProgress(0.2, 10)
script.RunBackup("restore")
script.ShowProgress(0.2, 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment