diff --git a/scripts/sync-android-sources.sh b/scripts/sync-android-sources.sh index dd84de0..1f40be6 100755 --- a/scripts/sync-android-sources.sh +++ b/scripts/sync-android-sources.sh @@ -41,4 +41,30 @@ if [ -f "$APP_GRADLE_SRC" ]; then echo " Copied: app/build.gradle.kts" fi +# Custom ProGuard/R8 keep rules. Required for minified release builds: +# the player/ and security/ Kotlin classes are loaded by name via JNI from +# Rust, so R8 can't see the references and would strip them without this. +# build.gradle.kts globs **/*.pro, so dropping it in app/ is enough. +PROGUARD_SRC="$PROJECT_ROOT/src-tauri/android/app/proguard-jellytau.pro" +PROGUARD_DST="$PROJECT_ROOT/src-tauri/gen/android/app/proguard-jellytau.pro" +if [ -f "$PROGUARD_SRC" ]; then + cp "$PROGUARD_SRC" "$PROGUARD_DST" + echo " Copied: app/proguard-jellytau.pro" +fi + +# Launcher icons / adaptive-icon mipmaps. `tauri android init` generates +# low-quality launcher icons from tauri.conf.json (which has no high-res +# Android source), so overwrite them with the real committed mipmaps. +RES_SRC="$PROJECT_ROOT/src-tauri/android/src/main/res" +RES_DST="$PROJECT_ROOT/src-tauri/gen/android/app/src/main/res" +if [ -d "$RES_SRC" ]; then + for dir in "$RES_SRC"/mipmap-*; do + [ -d "$dir" ] || continue + name="$(basename "$dir")" + mkdir -p "$RES_DST/$name" + cp "$dir"/* "$RES_DST/$name/" + echo " Copied res: $name" + done +fi + echo "✓ Android sources synced successfully" diff --git a/src-tauri/android/app/proguard-jellytau.pro b/src-tauri/android/app/proguard-jellytau.pro new file mode 100644 index 0000000..210db21 --- /dev/null +++ b/src-tauri/android/app/proguard-jellytau.pro @@ -0,0 +1,14 @@ +# JellyTau custom keep rules. +# +# These classes are loaded by name from the Rust backend via JNI +# (env.find_class / class-loader lookups), so R8 cannot see the +# references and would otherwise strip or rename them in a minified +# release build — causing an instant ClassNotFoundException crash on +# startup. See src-tauri/src/player/android/mod.rs and +# src-tauri/src/credentials.rs. +-keep class com.dtourolle.jellytau.player.** { *; } +-keep class com.dtourolle.jellytau.security.** { *; } + +# Media3 / ExoPlayer is accessed reflectively in places; keep it intact. +-keep class androidx.media3.** { *; } +-dontwarn androidx.media3.** diff --git a/src-tauri/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/src-tauri/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..345888d --- /dev/null +++ b/src-tauri/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src-tauri/android/src/main/res/mipmap-hdpi/ic_launcher.png b/src-tauri/android/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..4a6dcd7 Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src-tauri/android/src/main/res/mipmap-hdpi/ic_launcher_background.png b/src-tauri/android/src/main/res/mipmap-hdpi/ic_launcher_background.png new file mode 100644 index 0000000..df2de67 Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-hdpi/ic_launcher_background.png differ diff --git a/src-tauri/android/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/src-tauri/android/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..a801e66 Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/android/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png b/src-tauri/android/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..a801e66 Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png differ diff --git a/src-tauri/android/src/main/res/mipmap-mdpi/ic_launcher.png b/src-tauri/android/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..9700e69 Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src-tauri/android/src/main/res/mipmap-mdpi/ic_launcher_background.png b/src-tauri/android/src/main/res/mipmap-mdpi/ic_launcher_background.png new file mode 100644 index 0000000..8f4c4b9 Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-mdpi/ic_launcher_background.png differ diff --git a/src-tauri/android/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/src-tauri/android/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..62f3f71 Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/android/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png b/src-tauri/android/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..0af8348 Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png differ diff --git a/src-tauri/android/src/main/res/mipmap-xhdpi/ic_launcher.png b/src-tauri/android/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..234da33 Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src-tauri/android/src/main/res/mipmap-xhdpi/ic_launcher_background.png b/src-tauri/android/src/main/res/mipmap-xhdpi/ic_launcher_background.png new file mode 100644 index 0000000..8cd983f Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-xhdpi/ic_launcher_background.png differ diff --git a/src-tauri/android/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/src-tauri/android/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..d13335b Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/android/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png b/src-tauri/android/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..d13335b Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png differ diff --git a/src-tauri/android/src/main/res/mipmap-xxhdpi/ic_launcher.png b/src-tauri/android/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..5aafc45 Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src-tauri/android/src/main/res/mipmap-xxhdpi/ic_launcher_background.png b/src-tauri/android/src/main/res/mipmap-xxhdpi/ic_launcher_background.png new file mode 100644 index 0000000..ca89c08 Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-xxhdpi/ic_launcher_background.png differ diff --git a/src-tauri/android/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/src-tauri/android/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..97c21ad Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/android/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png b/src-tauri/android/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..97c21ad Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png differ diff --git a/src-tauri/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/src-tauri/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..2ba6098 Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src-tauri/android/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png b/src-tauri/android/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png new file mode 100644 index 0000000..a274215 Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png differ diff --git a/src-tauri/android/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/src-tauri/android/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..61ad01d Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/android/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png b/src-tauri/android/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..61ad01d Binary files /dev/null and b/src-tauri/android/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png differ