-
-
Notifications
You must be signed in to change notification settings - Fork 110
/
push.sh
42 lines (36 loc) · 909 Bytes
/
push.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
#!/usr/bin/env sh
# Push and Install Zip
# Copyright 2022-2024, VR25
# License: GPLv3+
#
# usage: $0 [k] [adb device]
# k is for KaiOS
id=$(sed -n "s/^id=//p" module.prop)
version="$(sed -n 1p changelog.md | sed 's/[*()]//g')"
versionCode=${version#* }
version=${version% *}
zip=${id}_${version}_$versionCode
zip=$(echo _builds/$zip/$zip*zip)
dest=/sdcard/Download/acc.zip
[ ".${1-}" != .k ] || {
dest=/data/usbmsc_mnt/acc.zip
shift
}
one=${1-}
_adb() {
if [ -n "${one-}" ]; then
adb -s $one "$@"
else
adb "$@"
fi
}
if _adb shell su -c "which apd >/dev/null"; then
install="apd module install $dest"
elif _adb shell su -c "which ksud >/dev/null"; then
install="ksud module install $dest"
elif _adb shell su -c "which magisk >/dev/null"; then
install="magisk --install-module $dest"
else
install=
fi
[ -z "$install" ] || _adb push $zip $dest && _adb shell su -c "$install" || :