-
Notifications
You must be signed in to change notification settings - Fork 1
/
dist.sh
29 lines (22 loc) · 1008 Bytes
/
dist.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
#!/bin/bash
UPDATE_BINARY_URL="https://raw.githubusercontent.com/topjohnwu/Magisk/master/scripts/module_installer.sh"
mkdir -p ./module/META-INF/com/google/android
curl "${UPDATE_BINARY_URL}" > ./module/META-INF/com/google/android/update-binary
echo "#MAGISK" > ./module/META-INF/com/google/android/updater-script
VERSION=$(sed -ne "s/version=\(.*\)/\1/gp" ./module/module.prop)
NAME=$(sed -ne "s/id=\(.*\)/\1/gp" ./module/module.prop)
ZIP_FILENAME="${NAME}-${VERSION}.zip"
mkdir -p ./dist
rm -f ./dist/${ZIP_FILENAME}
(
cd ./module
zip ../dist/${ZIP_FILENAME} -r * -x ".*" "*/.*"
)
RELEASE_URL="https://github.com/Loukious/Custom-Certificate-Authorities/releases/download/${VERSION}/${ZIP_FILENAME}"
CHANGELOG_URL="https://raw.githubusercontent.com/Loukious/Custom-Certificate-Authorities/master/CHANGELOG.md"
echo "{
\"version\": \"${VERSION}\",
\"versionCode\": ${VERSION//[^0-9]/},
\"zipUrl\": \"${RELEASE_URL}\",
\"changelog\": \"${CHANGELOG_URL}\"
}" > ./dist/updateJson.json