-
Notifications
You must be signed in to change notification settings - Fork 2
/
releasetools.py
executable file
·38 lines (35 loc) · 1.48 KB
/
releasetools.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import common
import edify_generator
import os
import re
def AddAssertions(info):
edify = info.script
for i in xrange(len(edify.script)):
if ");" in edify.script[i] and ("ro.product.device" in edify.script[i] or "ro.build.product" in edify.script[i]):
edify.script[i] = edify.script[i].replace(");", ' || getprop("ro.product.device") == "enterprise_U950" || getprop("ro.build.product") == "enterprise_U950");')
return
def FullOTA_InstallEnd(info):
try:
input_blob = info.input_zip.read("RADIO/blob")
common.ZipWriteStr(info.output_zip, "blob", input_blob)
info.script.AppendExtra('nv_copy_blob_file("blob", "/staging");')
info.script.AppendExtra('symlink("su", "/system/bin/su");')
except KeyError:
print "no blob in target_files; skipping install"
AddAssertions(info)
def IncrementalOTA_InstallEnd(info):
try:
target_blob = info.target_zip.read("RADIO/blob")
info.script.AppendExtra('symlink("su", "/system/bin/su");')
try:
source_blob = info.source_zip.read("RADIO/blob")
except KeyError:
source_blob = None
if target_blob == source_blob:
print "blob unchanged; skipping"
else:
common.ZipWriteStr(info.output_zip, "blob", target_blob)
info.script.AppendExtra('nv_copy_blob_file("blob", "/staging");')
except KeyError:
print "no blob in target_files; skipping install"
AddAssertions(info)