-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·52 lines (43 loc) · 1.96 KB
/
build.sh
File metadata and controls
executable file
·52 lines (43 loc) · 1.96 KB
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
#!/bin/bash
# Set up colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
DEFAULT='\033[0m'
# Dependency check
REQUIRED_CMDS=("aapt2" "java" "zip")
MISSING_CMDS=()
for cmd in "${REQUIRED_CMDS[@]}"; do
if ! command -v "$cmd" &> /dev/null; then
MISSING_CMDS+=("$cmd")
fi
done
# If there are missing commands, list them all and exit
if [ ${#MISSING_CMDS[@]} -ne 0 ]; then
echo -e "${RED}ERROR${DEFAULT} - The following required commands were not found:"
for missing in "${MISSING_CMDS[@]}"; do
echo " - $missing"
done
echo "Please install the missing tools and ensure they are in your PATH."
exit 1
fi
# Clean up previous build artifacts
rm -f *.flata *.apk* *.zip
# Build RetroidFrameworksOverlay.apk
echo -e "${YELLOW}Building RetroidFrameworksOverlay...${DEFAULT}"
aapt2 compile -v --dir RetroidFrameworksOverlay/res/ -o RetroidFrameworksOverlay.flata
aapt2 link -v --no-resource-removal -I utils/android-33.jar --manifest RetroidFrameworksOverlay/AndroidManifest.xml -o RetroidFrameworksOverlay.apk RetroidFrameworksOverlay.flata
java -jar utils/uber-apk-signer.jar -a RetroidFrameworksOverlay.apk
cp RetroidFrameworksOverlay-aligned-debugSigned.apk magisk/system/product/overlay/RetroidFrameworksOverlay.apk
# Build RetroidSettingsOverlay.apk
echo -e "${YELLOW}Building RetroidSettingsOverlay...${DEFAULT}"
aapt2 compile -v --dir RetroidSettingsOverlay/res/ -o RetroidSettingsOverlay.flata
aapt2 link -v --no-resource-removal -I utils/android-33.jar --manifest RetroidSettingsOverlay/AndroidManifest.xml -o RetroidSettingsOverlay.apk RetroidSettingsOverlay.flata
java -jar utils/uber-apk-signer.jar -a RetroidSettingsOverlay.apk
cp RetroidSettingsOverlay-aligned-debugSigned.apk magisk/system/product/overlay/RetroidSettingsOverlay.apk
# Create the Magisk module zip
echo -e "${YELLOW}Packaging Magisk module...${DEFAULT}"
cd magisk
zip -r ../Retroid-UI-Improvements.zip * -x=*.gitkeep
cd ..
echo -e "${GREEN}Build successful!${DEFAULT}"