install-recovery.sh & applypatch
(2014-05-25 21:35:55)分类: Android |
2012-12-21 11:32
install-recovery.sh & applypatch
1.
1
2
3
|
service
/system/etc/install-recovery
.sh
class
oneshot
|
2.
1
2
3
|
service
/system/etc/install-recovery
.sh
class
oneshot
|
3.
4.
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
39
40
41
42
|
def
MakeRecoveryPatch(output_zip,
"""Generate
with
kernel,
should
script
patching
recovery_img
corresponding
common.LoadInfoDict()
Returns
executable.
"""
d
=
common.Difference(recovery_img,
_,
=
d.ComputePatch()
common.ZipWriteStr(output_zip,
"recovery/recovery-from-boot.p"
,
Item.Get(
"system/recovery-from-boot.p"
,
dir
=
False
)
boot_type,
=
common.GetTypeAndDevice(
"/boot"
,
recovery_type,
=
common.GetTypeAndDevice(
"/recovery"
,
sh
=
"""#!/system/bin/sh
if
log
applypatch
else
log
fi
"""
%
{
'boot_size'
:
'boot_sha1'
:
'recovery_size'
:
'recovery_sha1'
:
'boot_type'
:
'boot_device'
:
'recovery_type'
:
'recovery_device'
:
}
common.ZipWriteStr(output_zip,
"recovery/etc/install-recovery.sh"
,
return
Item.Get(
"system/etc/install-recovery.sh"
,
dir
=
False
)
|
5.
1
2
3
4
5
6
7
|
#!/system/bin/sh
if
!
-
c
3586808
:a1bdc75a0eaa8faf855807c3
log
-
t
"Installing
applypatch
3776935
:
6cbe8dfacd08ba5cfa39b97e
MTD:recovery
3586808
6cbe8dfacd08ba5cfa39b97e
:
/
system
/
recovery
-
from
-
boot.p
else
log
-
t
"Recovery
fi
|