-
Notifications
You must be signed in to change notification settings - Fork 4
/
verify.sh
72 lines (59 loc) · 2.19 KB
/
verify.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!sbin/sh
# parameters
# TEMP_DIR_NAME
OUTFD="/dev/null"
for FD in `ls /proc/$$/fd`; do
if readlink /proc/$$/fd/$FD | grep -q pipe; then
if ps | grep -v grep | grep -q " 3 $FD "; then
OUTFD=$FD
break
fi
fi
done
echo "ui_print " >> /proc/self/fd/$OUTFD;
echo "ui_print Verifying extras..." >> /proc/self/fd/$OUTFD;
# Removed in v2.0. This is now done by prep.sh
# mv /tmp/package-data /data/balti.migrate/package-data
res="$(cat /proc/cmdline | grep slot_suffix)";
if [ ! -e /system/app/MigrateHelper/MigrateHelper.apk ]; then
echo "ui_print " >> /proc/self/fd/$OUTFD;
echo "ui_print ------------!!!!!!!!!!------------" >> /proc/self/fd/$OUTFD;
echo "ui_print Helper not installed successfully!" >> /proc/self/fd/$OUTFD;
echo "ui_print Please report to the developer!! " >> /proc/self/fd/$OUTFD;
echo "ui_print " >> /proc/self/fd/$OUTFD;
echo "ui_print Deleting migrate cache..." >> /proc/self/fd/$OUTFD;
echo "ui_print ------------!!!!!!!!!!------------" >> /proc/self/fd/$OUTFD;
echo "ui_print " >> /proc/self/fd/$OUTFD;
#rm -rf /system/app/MigrateHelper
#rm -rf $1
unsuccessful_unpack=false
sleep 2s
else
unsuccessful_unpack=false
fi
if [ -e /tmp/extras-data ] && [ "$unsuccessful_unpack" = false ]
then
ed=/tmp/extras-data
while read -r line || [[ -n "$line" ]]; do
if [ ! -e $1/${line} ]; then
echo "ui_print $line was not unpacked" >> /proc/self/fd/$OUTFD;
fi
done < "$ed"
fi
ext_helper_apk=/sdcard/Android/data/balti.migratehelper/helper/MigrateHelper.apk
if [ -e ${ext_helper_apk} ]; then
echo "ui_print " >> /proc/self/fd/$OUTFD;
echo "ui_print **********************************" >> /proc/self/fd/$OUTFD;
echo "ui_print Helper apk is also present under:" >> /proc/self/fd/$OUTFD;
echo "ui_print ${ext_helper_apk}" >> /proc/self/fd/$OUTFD;
echo "ui_print Please install the app manually" >> /proc/self/fd/$OUTFD;
echo "ui_print if TWRP could not install it" >> /proc/self/fd/$OUTFD;
echo "ui_print **********************************" >> /proc/self/fd/$OUTFD;
sleep 2s
fi
if [ -n "$res" ]; then
umount /system
fi
if [ "$unsuccessful_unpack" = true ]; then
umount /data
fi