-
Notifications
You must be signed in to change notification settings - Fork 8
/
mtk-su.sh
57 lines (52 loc) · 1009 Bytes
/
mtk-su.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
#!/data/data/com.termux/files/usr/bin/bash
base="https://raw.githubusercontent.com/mrmazakblu/Root-Backup-Helper/master"
clone="https://github.com/mrmazakblu/Root-Backup-Helper.git"
set_var()
{
curl $base/VERSION.md > VERSION.md
{ read latest; read xda; read version; } < VERSION.md
{ read curent; } < mtk-su/VERSION.md
cdir="$PWD"
arch="$(uname -m)"
if [ $arch = aarch64 ]
then
arch="arm64"
else
arch="arm"
fi
}
instal()
{
[ -d mtk-su ] && rm -rf mtk-su
mkdir mtk-su
mkdir mtk-su/$version
curl $base/VERSION.md > mtk-su/VERSION.md
curl -Lkso $version.zip $xda
unzip -d mtk-su/$version $version.zip
cd mtk-su
cd "$version"
cd "$arch"
chmod +x mtk-su
cd ..
cd ..
cd ..
}
run()
{
curl $base/dd-backup-maker.sh > maker.sh
chmod +x maker.sh
FILES="dd-backup.sh dd-backup-boot-recovery.sh partitions.txt"
for F in $FILES; do
rm -f $F
touch $F
done
(./mtk-su/$version/$arch/mtk-su -c ./maker.sh)
}
set_var
if [ "$latest" = "$curent" ]
then
run
else
instal
run
fi