2021-11-24 23:33:33 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2021-11-25 09:30:06 +00:00
|
|
|
BRANCHES=(balance budget latency throughput)
|
2021-12-09 04:12:01 +00:00
|
|
|
SCRIPT_PARENT_PATH="system/bin"
|
|
|
|
SCRIPT_NAME="ktweak"
|
|
|
|
SCRIPT_PATH="$SCRIPT_PARENT_PATH/$SCRIPT_NAME"
|
2021-11-24 23:33:33 +00:00
|
|
|
|
2021-12-09 04:12:01 +00:00
|
|
|
mkdir -p "$SCRIPT_PARENT_PATH"
|
2021-11-25 09:30:06 +00:00
|
|
|
rm -rf KTweak-MM*.zip
|
|
|
|
|
|
|
|
for branch in ${BRANCHES[@]}
|
|
|
|
do
|
|
|
|
echo " * Building $branch..."
|
|
|
|
TIMESTAMP="$(date +%F_%M-%H-%S)"
|
|
|
|
HASH="$(git rev-parse HEAD)"
|
|
|
|
ZIP="KTweak-MM-${branch}_${TIMESTAMP}_${HASH}.zip"
|
|
|
|
|
2021-12-09 04:12:01 +00:00
|
|
|
echo " * Checking out script..."
|
|
|
|
git checkout "$branch" -- "$SCRIPT_NAME"
|
2021-11-25 09:30:06 +00:00
|
|
|
|
2021-12-09 04:12:01 +00:00
|
|
|
echo " * Patching for Android..."
|
|
|
|
sed -i 's|!/usr/bin/env bash|!/system/bin/sh|g' "$SCRIPT_PATH"
|
|
|
|
|
|
|
|
echo " * Setting executable permissions..."
|
|
|
|
chmod +x "$SCRIPT_PATH"
|
2021-11-25 09:30:06 +00:00
|
|
|
done
|