forked from linusyang92/mipay-extract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·45 lines (38 loc) · 1.21 KB
/
deploy.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
#!/bin/bash
declare -a urls=(
# Rom URLs
'http://bigota.d.miui.com/9.6.20/miui_VIOLET_9.6.20_52aa4c2f4b_9.0.zip'
)
EU_VER=V10.3.1.0.ODECNXM
declare -a eu_urls=(
# EU Rom URLs
'https://jaist.dl.sourceforge.net/project/xiaomi-eu-multilang-miui-roms/xiaomi.eu/MIUI-WEEKLY-RELEASES/9.6.20/xiaomi.eu_multi_HMNote7Pro_9.6.20_v10-9.zip'
)
command -v dirname >/dev/null 2>&1 && cd "$(dirname "$0")"
if [[ "$1" == "rom" ]]; then
set -e
base_dir=/sdcard/TWRP
[ -z "$2" ] && VER="$EU_VER" || VER=$2
[ -d "$base_dir" ] || base_dir=.
aria2c_opts="--check-certificate=false --file-allocation=trunc -s10 -x10 -j10 -c"
aria2c="aria2c $aria2c_opts -d $base_dir/$VER"
for i in "${eu_urls[@]}"
do
$aria2c ${i//$EU_VER/$VER}
done
base_url="https://github.com/linusyang92/mipay-extract/releases/download/$VER"
$aria2c $base_url/eufix-MiMix2-$VER.zip
$aria2c $base_url/mipay-MIMIX2-$VER.zip
$aria2c $base_url/eufix-appvault-MIMIX2-$VER.zip
exit 0
fi
for i in "${urls[@]}"
do
bash extract.sh --appvault "$i" || exit 1
done
[[ "$1" == "keep" ]] || rm -rf miui-*/ miui_*.zip
for i in "${eu_urls[@]}"
do
bash cleaner-fix.sh --webview --clock --trafficfix "$i" || exit 1
done
exit 0