forked from koreader/kpvbooklet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.ffs
executable file
·52 lines (41 loc) · 1.18 KB
/
uninstall.ffs
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
43
44
45
46
47
48
49
50
51
#!/bin/sh
OTA=com.lab126.blanket.ota
progress()
{
lipc-send-event $OTA otaSplashProgress -i $1
local x=48
local y=11
eips 0 $y " ";
eips $((($x - $(expr length "$2")) / 2)) $y "$2"
sleep 3
}
fail()
{
lipc-send-event $OTA otaSplashError -s "${1}"
sleep 10
exit 1;
}
VERSION=`cut -d ' ' -f 2 /etc/prettyversion.txt`
[ "$VERSION" \< "5.1.2" ] && fail "Unsupported firmware version" "$VERSION"
progress 10 "Mounting r/w"
mntroot rw || fail "Unable to mount r/w"
progress 20 "Removing KPVBooklet.jar"
[ -f /opt/amazon/ebook/booklet/KPVBooklet.jar ] && rm /opt/amazon/ebook/booklet/KPVBooklet.jar
if [ "$VERSION" == "5.1.2" ]; then
progress 30 "Removing extractors"
dest_dir="/etc/kdb/system/daemon/scanner/extractors/"
cd $dest_dir
for dir in *; do
if [ $dir -ge 20 ]; then
rm -rf $dir
fi
done
fi
progress 50 "Restoring appreg.db"
[ -f /var/local/appreg.db.bak ] && rm -f /var/local/appreg.db.bak
sqlite3 /var/local/appreg.db < mimes.uninstall.sql
progress 70 "Removing KUAL Extension"
rm -rf /mnt/us/extensions/kpvbooklet
progress 80 "Mounting ro"
mntroot ro || fail "Unable to mount ro"
progress 100 "Uninstallation complete."