-
Notifications
You must be signed in to change notification settings - Fork 1
/
prerm
36 lines (34 loc) · 1.55 KB
/
prerm
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
#!/bin/sh
ID=com.wordpress.touchcontrol.touchvol
APP_PATH=/media/cryptofs/apps/usr/palm/applications/$ID
#remount root using technique that won't cause the random remounting error
if [ -z "$IPKG_OFFLINE_ROOT" ]; then
/usr/sbin/rootfs_open -w
fi
#remove dbus service file
/bin/rm -f /var/palm/ls2/services/prv/$ID*
/bin/rm -f /var/palm/ls2/services/pub/$ID*
#stop upstart script
/sbin/stop $ID
#remove upstart script
/bin/rm -f /var/palm/event.d/$ID
#stop any app instances
count=$(/usr/bin/luna-send -f -n 1 palm://com.palm.applicationManager/running {} | /bin/grep -c com.wordpress.touchcontrol.touchvol)
for c in `seq 1 $count`
do
i=$(/usr/bin/luna-send -f -n 1 palm://com.palm.applicationManager/running {} | /bin/grep -A 1 com.wordpress.touchcontrol.touchvol | sed -n '2p' | cut -d: -f2 | tr -d '"'| tr -d ' ')
/usr/bin/luna-send -n 1 palm://com.palm.applicationManager/close '{"processId":"'$i'"}'
done
#remove luna patch - should be safe to run remove even if not installed
/bin/sh $APP_PATH/scripts/rem-lunapatch.sh
#remove state file since it wasn't put there by installer
/bin/rm -f $APP_PATH/scripts/amixer-restore.state
#remove launchpoints as they won't be good once app is removed
if [ "$(ls -A /var/luna/launchpoints/)" ]; then
rm -f `grep -l '\"id\": \"com.wordpress.touchcontrol.touchvol\"' /var/luna/launchpoints/*`
fi
# restore default alsa ucm
/bin/cp -f /usr/share/alsa/ucm/msm-audio/msm_media_case.touchvol-backup /usr/share/alsa/ucm/msm-audio/msm_media_case
# delete backup ucm
/bin/rm -f /usr/share/alsa/ucm/msm-audio/msm_media_case.touchvol-backup
exit 0