Files
fabiodalez-dev 3aab74e451 v2.1.0: Fix audio playback (CORS/workbox), add console logger
Audio Fix:
- Unregister service worker on Android — workbox CacheFirst on
  audio/video caused CORS failures on Tidal CDN streams
- Patch workbox config: CacheFirst → NetworkOnly for audio/video
- Shim @capgo/capacitor-media-session (our AudioForegroundService
  handles MediaSession natively)

Console Logger:
- fm-logger.js loaded synchronously in <head> (captures ALL output
  from the very first script execution)
- Intercepts console.log/warn/error/info/debug + window.onerror +
  unhandledrejection + fetch errors (4xx/5xx/network)
- Saves to Downloads/FabiodalezMusic/fm-console-log.txt every 30s
  and on app background
- Max 3000 entries, timestamped, with error flag

Search Simplification:
- Removed wrapper-side search hooks (dropdown preview, highlight,
  monkey-patch, cache cleanup) — upstream search flow handles it
- Kept upstream patches: debounce 700ms, limit=100, min 3 chars,
  cache normalization

Upstream Sync:
- Pulled ~60 new commits including Tidal API v2 migration for
  artists, artist banners, animated covers, mobile CSS, audio
  slider fix, international fonts

Closes #4: haptic feedback removed.
2026-04-18 13:23:22 +02:00

68 lines
2.3 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
# ─────────────────────────────────────────────────────────
# Fabiodalez Music — Android overlay installer
# Copies Android-specific files into a Monochrome clone
# ─────────────────────────────────────────────────────────
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
if [ -z "${1:-}" ]; then
echo "Usage: ./install.sh /path/to/monochrome"
echo ""
echo "Example:"
echo " git clone https://github.com/monochrome-music/monochrome.git"
echo " ./install.sh ./monochrome"
exit 1
fi
TARGET="$(cd "$1" && pwd)"
if [ ! -f "$TARGET/index.html" ] || [ ! -f "$TARGET/package.json" ]; then
echo "Error: $TARGET doesn't look like a Monochrome project"
exit 1
fi
echo "Installing Fabiodalez Music Android overlay into: $TARGET"
# Copy build script and config
cp "$SCRIPT_DIR/build-android.sh" "$TARGET/"
cp "$SCRIPT_DIR/capacitor.config.ts" "$TARGET/"
chmod +x "$TARGET/build-android.sh"
# Copy wrapper JS files
mkdir -p "$TARGET/android"
cp "$SCRIPT_DIR/android/android-service.js" "$TARGET/android/"
cp "$SCRIPT_DIR/android/fm-logger.js" "$TARGET/android/"
# Copy Java sources
JAVA_DEST="$TARGET/android/app/src/main/java/com/monochrome/app"
mkdir -p "$JAVA_DEST"
cp "$SCRIPT_DIR/android/app/src/main/java/com/monochrome/app/"*.java "$JAVA_DEST/"
# Copy AndroidManifest
mkdir -p "$TARGET/android/app/src/main"
cp "$SCRIPT_DIR/android/app/src/main/AndroidManifest.xml" "$TARGET/android/app/src/main/"
# Copy resources
RES_DEST="$TARGET/android/app/src/main/res"
for dir in values values-v31 drawable; do
mkdir -p "$RES_DEST/$dir"
cp "$SCRIPT_DIR/android/app/src/main/res/$dir/"* "$RES_DEST/$dir/" 2>/dev/null || true
done
# Copy icons
for dir in mipmap-mdpi mipmap-hdpi mipmap-xhdpi mipmap-xxhdpi mipmap-xxxhdpi; do
mkdir -p "$RES_DEST/$dir"
cp "$SCRIPT_DIR/android/app/src/main/res/$dir/"* "$RES_DEST/$dir/" 2>/dev/null || true
done
# Copy build.gradle customizations
cp "$SCRIPT_DIR/android/app/build.gradle" "$TARGET/android/app/"
echo ""
echo "Done! Now run:"
echo " cd $TARGET"
echo " ./build-android.sh"