Files
plexamp-lite/build.sh
T
xockoandClaude Opus 5.5 bbdab09f83 Minamp 1.6: adjustable UI size, larger text and controls
- New setting "Text and button size" (Normal / Large / Extra large): scales
  text, icons and buttons on top of the phone's density (App.UI_SCALES)
- Larger default text, rows, tiles, touch targets and player icons; all sizes
  now live in res/values/dimens.xml
- Seek bar knob drawn in code, since Android 2.x caches XML shapes at the
  size they were first loaded
- Full-width buttons wrap to two lines instead of cutting words off
- Shorter labels so they fit 240x320 screens in both languages
- tools/check_fit.py checks that UI texts fit their slots at every size and
  language using Droid Sans metrics; build.sh runs it and setup_toolchain.sh
  fetches the font

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 08:02:49 +02:00

47 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
# Builds Minamp.apk for Android 2.2+ without the Android SDK/Gradle:
# aapt2 (resources) -> javac (Java 8 bytecode vs android-8 API) -> dx (dex 035) -> signapk.py (v1/SHA-1 + zipalign).
set -euo pipefail
cd "$(dirname "$0")"
T=${TOOLS:-$PWD/toolchain}
ANDROID_JAR=$T/platforms/android-8/android.jar
BC_SRC=$T/bcsrc
OUT=build
rm -rf $OUT && mkdir -p $OUT/res $OUT/gen $OUT/classes
echo "== resources"
$T/aapt2 compile --dir res -o $OUT/res/compiled.zip
$T/aapt2 link -o $OUT/base.apk -I $ANDROID_JAR --manifest AndroidManifest.xml \
--java $OUT/gen -A assets --min-sdk-version 8 --target-sdk-version 10 \
--no-version-vectors $OUT/res/compiled.zip
echo "== java"
find src $OUT/gen -name '*.java' > $OUT/sources.txt
javac -nowarn -Xlint:-options -source 8 -target 8 -encoding UTF-8 -g:source,lines \
-bootclasspath $ANDROID_JAR -sourcepath "src:$BC_SRC:$OUT/gen" \
-d $OUT/classes @$OUT/sources.txt 2>&1 | grep -v -E '^Picked up|^Note:' || true
test -f $OUT/classes/com/minamp/HomeActivity.class
echo "== text fit check (240x320, all languages and sizes)"
if [ -f "$T/fonts/droidsans-regular.ttf" ]; then
python3 tools/check_fit.py "$T/fonts" || { echo "Some texts don't fit their space (see above)"; exit 1; }
else
echo "(skipped: run tools/setup_toolchain.sh to fetch the Droid Sans font)"
fi
echo "== Dalvik 2.x link check"
python3 tools/scan_dalvik.py $OUT/classes $ANDROID_JAR > $OUT/dalvik-scan.txt
if ! grep -q "^total patterns: 0$" $OUT/dalvik-scan.txt; then
cat $OUT/dalvik-scan.txt; echo "Calls Android 2.x can't link (see above): fix before shipping"; exit 1
fi
echo "== dex"
java -Xmx2g -jar $T/dx.jar --dex --output=$OUT/classes.dex $OUT/classes 2>&1 | grep -v '^Picked up' || true
echo "== package"
cp $OUT/base.apk $OUT/unsigned.apk
(cd $OUT && zip -q unsigned.apk classes.dex)
# v1 signature in the classic Android SignApk format (jarsigner's modern output won't install on Android <= 4.2)
python3 tools/signapk.py ${KEYSTORE:-$T/minamp.keystore} ${KEYPASS:-minamp123} $OUT/unsigned.apk $OUT/Minamp.apk
ls -la $OUT/Minamp.apk