-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.clrdex.sh
executable file
·36 lines (33 loc) · 950 Bytes
/
init.clrdex.sh
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
#!/system/bin/sh
#
# Copyright 2012 Sony Ericsson Mobile Communications AB.
# Copyright (C) 2012 Sony Mobile Communications AB.
# All rights, including trade secret rights, reserved.
#
# Delete all files in the dalvik-cache to make sure there is enough
# space on the data partition when doing an upgrade.
# The dalvik-cache is only cleared if the $MARK file is not present.
# The name of the MARK file should be changed for each upgrade.
#
TAG="clrdex"
DST="/data/dalvik-cache"
#
# The MARK variable is the name of a file which if present disables clean
# up of dex files.
#
MARK="clear-done-ics"
check_file_exists()
{
/system/bin/log -t $TAG -p i "Checking $1 ..."
if `/system/bin/ls $1 > /dev/null`; then
return 0
else
return 1
fi
}
if ! check_file_exists $DST/$MARK ; then
/system/bin/log -t $TAG -p i "Clearing dalvik cache ..."
/system/bin/rm $DST/*
/system/bin/touch $DST/$MARK
/system/bin/chmod 0644 $DST/$MARK
fi