-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathpatch.sh
More file actions
executable file
·651 lines (535 loc) · 19.6 KB
/
Copy pathpatch.sh
File metadata and controls
executable file
·651 lines (535 loc) · 19.6 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
#!/bin/bash
#
# GameHub Lite Patcher
# Applies patches to GameHub 5.1.0 APK to create GameHub Lite
#
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PATCHES_DIR="$SCRIPT_DIR/patches"
WORK_DIR="$SCRIPT_DIR/work"
OUTPUT_DIR="$SCRIPT_DIR/output"
# The patch set is generated against apktool 2.12.1 output. Apktool 3.x
# rewrites resource XML formatting enough that many existing hunks miss.
# I may or may not make this work eventually with apktool 3.x.
APKTOOL_REQUIRED_VERSION="${APKTOOL_REQUIRED_VERSION:-2.12.1}"
APKTOOL_JAR="${APKTOOL_JAR:-$SCRIPT_DIR/tools/apktool_${APKTOOL_REQUIRED_VERSION}.jar}"
# Keystore configuration (can be overridden via environment variables)
KEYSTORE="${KEYSTORE:-$SCRIPT_DIR/keystore/debug.keystore}"
KEYSTORE_PASS="${KEYSTORE_PASS:-android}"
KEY_ALIAS="${KEY_ALIAS:-androiddebugkey}"
# Release mode: set RELEASE=true to build all package variants
RELEASE="${RELEASE:-false}"
# Version for output filenames (extracted from apktool.yml or set manually)
VERSION="${VERSION:-}"
# Base package name used in patches
BASE_PACKAGE="gamehub.lite"
# Variant definitions as space-separated pairs: "name:package"
# Order matters for release builds
VARIANTS="base:gamehub.lite antutu:com.antutu.ABenchMark alt-antutu:com.antutu.benchmark.full ludashi:com.ludashi.aibench pubg:com.tencent.ig"
# Get package name for a variant
get_variant_package() {
local variant="$1"
for pair in $VARIANTS; do
local name="${pair%%:*}"
local package="${pair#*:}"
if [ "$name" = "$variant" ]; then
echo "$package"
return 0
fi
done
echo ""
}
# Source APK (can be overridden)
SOURCE_APK="${1:-$SCRIPT_DIR/apk/GameHub-5.1.0.apk}"
OUTPUT_APK="$OUTPUT_DIR/GameHub-Lite.apk"
print_step() {
echo -e "${BLUE}==>${NC} $1"
}
print_success() {
echo -e "${GREEN}[OK]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARN]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
run_apktool() {
if [ -f "$APKTOOL_JAR" ]; then
java -jar "$APKTOOL_JAR" "$@"
else
apktool "$@"
fi
}
get_apktool_version() {
run_apktool --version 2>/dev/null | head -1 | tr -d '\r'
}
# Extract version from apktool.yml after decompilation
extract_version() {
if [ -z "$VERSION" ] && [ -f "$WORK_DIR/decompiled/apktool.yml" ]; then
# Format is " versionName: 5.1.0" or " versionName: '5.1.0'"
VERSION=$(grep "versionName:" "$WORK_DIR/decompiled/apktool.yml" | head -1 | awk -F': ' '{print $2}' | tr -d "'" | tr -d ' ')
fi
# Default fallback
VERSION="${VERSION:-5.1.0}"
print_success "Version: $VERSION"
}
# Replace package name in AndroidManifest.xml for a variant
replace_package_name() {
local target_package="$1"
local manifest="$WORK_DIR/decompiled/AndroidManifest.xml"
if [ "$target_package" = "$BASE_PACKAGE" ]; then
return 0
fi
print_step "Replacing package name: $BASE_PACKAGE -> $target_package"
# Replace all occurrences of base package with target package
# This handles:
# - package="gamehub.lite"
# - android:authorities="gamehub.lite.xxx"
# - android:name="gamehub.lite.xxx"
# - action android:name="gamehub.lite.xxx"
sed -i.bak "s/${BASE_PACKAGE}/${target_package}/g" "$manifest"
rm -f "$manifest.bak"
print_success "Package name replaced"
}
# Restore original AndroidManifest.xml from backup
restore_manifest() {
if [ -f "$WORK_DIR/decompiled/AndroidManifest.xml.original" ]; then
cp "$WORK_DIR/decompiled/AndroidManifest.xml.original" "$WORK_DIR/decompiled/AndroidManifest.xml"
fi
}
# Backup original AndroidManifest.xml
backup_manifest() {
cp "$WORK_DIR/decompiled/AndroidManifest.xml" "$WORK_DIR/decompiled/AndroidManifest.xml.original"
}
# Get output filename for a variant
get_output_filename() {
local variant="$1"
if [ "$variant" = "base" ]; then
if [ "$RELEASE" = "true" ]; then
echo "$OUTPUT_DIR/GameHub-Lite-v${VERSION}.apk"
else
echo "$OUTPUT_DIR/GameHub-Lite.apk"
fi
else
echo "$OUTPUT_DIR/GameHub-Lite-v${VERSION}-${variant}.apk"
fi
}
check_dependencies() {
print_step "Checking dependencies..."
local missing=()
if [ ! -f "$APKTOOL_JAR" ] && ! command -v apktool &>/dev/null; then
missing+=("apktool")
fi
if ! command -v java &>/dev/null; then
missing+=("java")
fi
if ! command -v zipalign &>/dev/null && ! command -v "$ANDROID_HOME/build-tools/"*/zipalign &>/dev/null; then
print_warning "zipalign not found - APK may not be optimized"
fi
if ! command -v apksigner &>/dev/null && ! command -v jarsigner &>/dev/null; then
missing+=("apksigner or jarsigner")
fi
if ! command -v unzip &>/dev/null; then
missing+=("unzip")
fi
if ! command -v zip &>/dev/null; then
missing+=("zip")
fi
if [ ${#missing[@]} -ne 0 ]; then
print_error "Missing dependencies: ${missing[*]}"
echo ""
echo "Install instructions:"
echo " macOS: brew install apktool openjdk"
echo " Ubuntu: sudo apt install apktool openjdk-17-jdk"
exit 1
fi
local apktool_version
apktool_version="$(get_apktool_version || true)"
if [ -z "$apktool_version" ]; then
print_error "Unable to determine apktool version"
exit 1
fi
if [ "$apktool_version" != "$APKTOOL_REQUIRED_VERSION" ]; then
print_error "Unsupported apktool version: $apktool_version"
echo ""
echo "This patch set is generated for apktool $APKTOOL_REQUIRED_VERSION."
echo "Apktool 3.x changes decompiled XML/apktool.yml formatting, causing existing resource patches to fail."
echo ""
echo "Use one of:"
echo " APKTOOL_JAR=\"$SCRIPT_DIR/tools/apktool_${APKTOOL_REQUIRED_VERSION}.jar\" ./patch.sh"
echo " or install apktool $APKTOOL_REQUIRED_VERSION in PATH."
exit 1
fi
print_success "Using apktool $apktool_version"
print_success "All dependencies found"
}
verify_source_apk() {
print_step "Verifying source APK..."
if [ ! -f "$SOURCE_APK" ]; then
print_error "Source APK not found: $SOURCE_APK"
echo ""
echo "Please provide GameHub 5.1.0 APK as first argument or place it at:"
echo " $SCRIPT_DIR/apk/GameHub-5.1.0.apk"
exit 1
fi
# Calculate MD5 of source APK
local md5
if command -v md5sum &>/dev/null; then
md5=$(md5sum "$SOURCE_APK" | awk '{print $1}')
else
md5=$(md5 -q "$SOURCE_APK")
fi
# Expected MD5 for GameHub 5.1.0
local expected_md5="42db81116bf3c74e52e6f6afb4ec9f91" # Replace with actual MD5 if you are intentionally using a different APK
print_success "Source APK found: $(basename "$SOURCE_APK")"
echo " MD5: $md5"
if [ "$md5" != "$expected_md5" ]; then
print_warning "MD5 checksum does not match expected value."
print_warning "Proceeding may lead to unexpected results."
read -pr "Do you want to continue? (y/N): " choice
if [[ ! "$choice" =~ ^[Yy]$ ]]; then
print_error "Aborting."
exit 1
fi
else
print_success "MD5 checksum verified."
fi
}
setup_keystore() {
print_step "Setting up signing keystore..."
if [ ! -f "$KEYSTORE" ]; then
mkdir -p "$(dirname "$KEYSTORE")"
keytool -genkey -v -keystore "$KEYSTORE" \
-alias "$KEY_ALIAS" \
-keyalg RSA \
-keysize 2048 \
-validity 10000 \
-storepass "$KEYSTORE_PASS" \
-keypass "$KEYSTORE_PASS" \
-dname "CN=GameHub Lite, OU=Community, O=GameHub Lite, L=Unknown, S=Unknown, C=XX"
print_success "Created debug keystore"
else
print_success "Using existing keystore"
fi
}
decompile_apk() {
print_step "Decompiling APK (this may take a few minutes)..."
rm -rf "$WORK_DIR"
mkdir -p "$WORK_DIR"
run_apktool d -f "$SOURCE_APK" -o "$WORK_DIR/decompiled" 2>&1 | tail -5
print_success "APK decompiled to $WORK_DIR/decompiled"
}
apply_deletions() {
print_step "Removing telemetry and unnecessary files..."
local count=0
local total=$(wc -l <"$PATCHES_DIR/files_to_delete.txt")
while IFS= read -r file; do
target="$WORK_DIR/decompiled/$file"
if [ -e "$target" ]; then
rm -rf "$target"
count=$((count + 1))
fi
done <"$PATCHES_DIR/files_to_delete.txt"
print_success "Removed $count of $total files/directories"
}
apply_patches() {
print_step "Applying code patches..."
local count=0
local failed=0
while IFS= read -r file; do
patch_file="$PATCHES_DIR/diffs/$file.patch"
target="$WORK_DIR/decompiled/$file"
# Skip if this is a binary file (handled separately)
if [ -f "$PATCHES_DIR/binary_replacements/$file" ]; then
continue
fi
if [ -f "$patch_file" ] && [ -f "$target" ]; then
if patch -s -N "$target" <"$patch_file" 2>/dev/null; then
count=$((count + 1))
else
failed=$((failed + 1))
print_warning "Failed to patch: $file"
fi
fi
done <"$PATCHES_DIR/files_to_patch.txt"
if [ $failed -gt 0 ]; then
print_warning "Applied $count patches, $failed failed"
else
print_success "Applied $count patches successfully"
fi
# Clean up .orig and .rej files created by patch command.
# macOS patch creates .orig automatically; failed patches leave .rej files.
# aapt2 will fail if it finds non-resource files (like .orig/.rej) inside res/.
local orig_count=0
while IFS= read -r -d '' orig_file; do
rm -f "$orig_file"
orig_count=$((orig_count + 1))
done < <(find "$WORK_DIR/decompiled" -type f \( -name '*.orig' -o -name '*.rej' \) -print0 2>/dev/null)
if [ $orig_count -gt 0 ]; then
print_warning "Cleaned up $orig_count .orig/.rej file(s)"
fi
}
apply_binary_replacements() {
print_step "Applying binary replacements..."
local count=0
if [ -d "$PATCHES_DIR/binary_replacements" ]; then
while IFS= read -d '' -r file; do
rel_path="${file#$PATCHES_DIR/binary_replacements/}"
target="$WORK_DIR/decompiled/$rel_path"
target_dir=$(dirname "$target")
mkdir -p "$target_dir"
cp "$file" "$target"
count=$((count + 1))
done < <(find "$PATCHES_DIR/binary_replacements" -type f -print0)
fi
print_success "Replaced $count binary files"
}
apply_additions() {
print_step "Adding new files..."
local count=0
if [ -d "$PATCHES_DIR/new_files" ]; then
cp -r "$PATCHES_DIR/new_files/"* "$WORK_DIR/decompiled/" 2>/dev/null || true
count=$(find "$PATCHES_DIR/new_files" -type f | wc -l)
fi
print_success "Added $count new files"
}
rebuild_apk() {
print_step "Rebuilding APK..."
mkdir -p "$OUTPUT_DIR"
if ! run_apktool b "$WORK_DIR/decompiled" -o "$WORK_DIR/unsigned.apk"; then
print_error "apktool build failed"
return 1
fi
print_success "APK rebuilt"
inject_extension_dex
}
# Compile extension/*.java into a classes.dex for local builds.
# Mirrors the CI step in .github/workflows/build-debug.yml.
# Sets EXTENSION_DEX_PATH on success.
compile_extension_dex() {
local src_dir="$1"
print_step "Compiling extension/*.java for local dex injection..."
if ! command -v javac &>/dev/null; then
print_error "javac not found in PATH."
print_error "Install a JDK, or pre-build the dex and export EXTENSION_DEX_PATH."
return 1
fi
local sdk_root="${ANDROID_SDK_ROOT:-${ANDROID_HOME:-}}"
if [ -z "$sdk_root" ] || [ ! -d "$sdk_root" ]; then
print_error "ANDROID_SDK_ROOT (or ANDROID_HOME) is not set."
print_error "Set it to your Android SDK, or pre-build the dex and export EXTENSION_DEX_PATH."
return 1
fi
local android_jar
android_jar=$(find "$sdk_root/platforms" -maxdepth 2 -name 'android.jar' -type f 2>/dev/null | sort -V | tail -1)
if [ -z "$android_jar" ] || [ ! -f "$android_jar" ]; then
print_error "android.jar not found under $sdk_root/platforms/."
print_error "Install a platform, e.g. sdkmanager 'platforms;android-34'."
return 1
fi
local d8_bin
d8_bin=$(find "$sdk_root/build-tools" -maxdepth 2 -name 'd8' -type f 2>/dev/null | sort -V | tail -1)
if [ -z "$d8_bin" ] || [ ! -x "$d8_bin" ]; then
print_error "d8 not found under $sdk_root/build-tools/."
print_error "Install build-tools, e.g. sdkmanager 'build-tools;34.0.0'."
return 1
fi
local ext_build_dir="$WORK_DIR/ext_build"
rm -rf "$ext_build_dir"
mkdir -p "$ext_build_dir/classes" "$ext_build_dir/dex"
javac -source 8 -target 8 -cp "$android_jar" -d "$ext_build_dir/classes" "$src_dir"/*.java
# shellcheck disable=SC2046
"$d8_bin" --release --output "$ext_build_dir/dex" $(find "$ext_build_dir/classes" -name '*.class')
if [ ! -f "$ext_build_dir/dex/classes.dex" ]; then
print_error "d8 did not produce classes.dex"
return 1
fi
EXTENSION_DEX_PATH="$ext_build_dir/dex/classes.dex"
print_success "Compiled extension dex: $EXTENSION_DEX_PATH"
}
# Inject Java extension dex (extension/*.java -> classes.dex).
# CI sets EXTENSION_DEX_PATH to a pre-built classes.dex.
# Local builds auto-compile extension/*.java when present so the resulting APK
# is not missing classes referenced by unconditional smali hooks.
# If neither a pre-built dex nor extension sources are present, skip silently to
# preserve downstream sub-branches that have stripped both the sources and the
# hooks. Detects next free classesN.dex slot in the APK and zips ours in.
inject_extension_dex() {
local ext_src_dir="$SCRIPT_DIR/extension"
if [ -z "$EXTENSION_DEX_PATH" ] && [ -d "$ext_src_dir" ] && compgen -G "$ext_src_dir/*.java" >/dev/null; then
compile_extension_dex "$ext_src_dir" || exit 1
fi
if [ -z "$EXTENSION_DEX_PATH" ] || [ ! -f "$EXTENSION_DEX_PATH" ]; then
return 0
fi
print_step "Injecting extension dex from $EXTENSION_DEX_PATH..."
# Find next free classesN.dex slot
local next=2
while unzip -l "$WORK_DIR/unsigned.apk" 2>/dev/null | grep -qE "classes${next}\.dex$"; do
next=$((next + 1))
done
local tmp_dir
tmp_dir=$(mktemp -d)
cp "$EXTENSION_DEX_PATH" "$tmp_dir/classes${next}.dex"
(cd "$tmp_dir" && zip -j -q "$WORK_DIR/unsigned.apk" "classes${next}.dex")
rm -rf "$tmp_dir"
print_success "Extension dex injected as classes${next}.dex"
}
align_apk() {
print_step "Aligning APK..."
local zipalign_cmd=""
if command -v zipalign &>/dev/null; then
zipalign_cmd="zipalign"
elif [ -n "$ANDROID_HOME" ]; then
zipalign_cmd=$(find "$ANDROID_HOME/build-tools" -name "zipalign" | head -1)
fi
if [ -n "$zipalign_cmd" ]; then
"$zipalign_cmd" -f -p 4 "$WORK_DIR/unsigned.apk" "$WORK_DIR/aligned.apk"
mv "$WORK_DIR/aligned.apk" "$WORK_DIR/unsigned.apk"
print_success "APK aligned"
else
print_warning "zipalign not found, skipping alignment"
fi
}
sign_apk() {
local target_apk="${1:-$OUTPUT_APK}"
print_step "Signing APK -> $(basename "$target_apk")"
if command -v apksigner &>/dev/null; then
apksigner sign --ks "$KEYSTORE" \
--ks-pass "pass:$KEYSTORE_PASS" \
--ks-key-alias "$KEY_ALIAS" \
--out "$target_apk" \
"$WORK_DIR/unsigned.apk"
elif [ -n "$ANDROID_HOME" ]; then
local apksigner_cmd=$(find "$ANDROID_HOME/build-tools" -name "apksigner" | head -1)
if [ -n "$apksigner_cmd" ]; then
"$apksigner_cmd" sign --ks "$KEYSTORE" \
--ks-pass "pass:$KEYSTORE_PASS" \
--ks-key-alias "$KEY_ALIAS" \
--out "$target_apk" \
"$WORK_DIR/unsigned.apk"
else
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 \
-keystore "$KEYSTORE" \
-storepass "$KEYSTORE_PASS" \
-keypass "$KEYSTORE_PASS" \
-signedjar "$target_apk" \
"$WORK_DIR/unsigned.apk" "$KEY_ALIAS"
fi
else
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 \
-keystore "$KEYSTORE" \
-storepass "$KEYSTORE_PASS" \
-keypass "$KEYSTORE_PASS" \
-signedjar "$target_apk" \
"$WORK_DIR/unsigned.apk" "$KEY_ALIAS" 2>&1 | tail -3
fi
print_success "APK signed: $(basename "$target_apk")"
}
# Build a single variant
build_variant() {
local variant="$1"
local package=$(get_variant_package "$variant")
local output_apk=$(get_output_filename "$variant")
echo ""
echo -e "${BLUE}--- Building variant: $variant (package: $package) ---${NC}"
# Restore manifest and replace package if not base
restore_manifest
replace_package_name "$package"
# Rebuild
rebuild_apk
align_apk
sign_apk "$output_apk"
# Track built APKs (newline separated)
if [ -z "$BUILT_APKS" ]; then
BUILT_APKS="$output_apk"
else
BUILT_APKS="$BUILT_APKS
$output_apk"
fi
}
cleanup() {
print_step "Cleaning up..."
rm -rf "$WORK_DIR"
# Remove .idsig files (APK Signature Scheme v4) - not needed for distribution
rm -f "$OUTPUT_DIR"/*.idsig
print_success "Cleanup complete"
}
show_result() {
echo ""
echo -e "${GREEN}========================================${NC}"
echo -e "${GREEN} GameHub Lite build complete!${NC}"
echo -e "${GREEN}========================================${NC}"
echo ""
if [ "$RELEASE" = "true" ]; then
local count=$(echo "$BUILT_APKS" | wc -l | tr -d ' ')
echo "Built $count APK variant(s):"
echo ""
echo "$BUILT_APKS" | while IFS= read -r apk; do
if [ -n "$apk" ] && [ -f "$apk" ]; then
local pkg=$(aapt dump badging "$apk" 2>/dev/null | grep "package:" | awk -F"'" '{print $2}' || echo "unknown")
echo " $(basename "$apk")"
echo " Package: $pkg"
echo " Size: $(du -h "$apk" | cut -f1)"
echo ""
fi
done
else
echo "Output APK: $OUTPUT_APK"
echo "Size: $(du -h "$OUTPUT_APK" | cut -f1)"
echo ""
echo "Install on your device:"
echo " adb install $OUTPUT_APK"
fi
echo ""
}
# String to track built APKs (newline-separated)
BUILT_APKS=""
main() {
echo ""
echo "====================================="
echo " GameHub Lite Patcher v1.0"
echo "====================================="
echo ""
if [ "$RELEASE" = "true" ]; then
echo -e "${YELLOW}RELEASE MODE: Building all variants${NC}"
echo ""
fi
check_dependencies
verify_source_apk
setup_keystore
decompile_apk
# Extract version after decompilation
extract_version
apply_deletions
apply_patches
apply_binary_replacements
apply_additions
if [ "$RELEASE" = "true" ]; then
# Backup manifest for variant builds
backup_manifest
# Build all variants (iterate over VARIANTS string)
for pair in $VARIANTS; do
local variant="${pair%%:*}"
build_variant "$variant"
done
else
# Standard single build
rebuild_apk
align_apk
sign_apk "$OUTPUT_APK"
BUILT_APKS="$OUTPUT_APK"
fi
cleanup
show_result
}
# Run main function
main "$@"