diff --git a/app/src/main/java/com/droiddeck/launcher/core/DeviceReport.kt b/app/src/main/java/com/droiddeck/launcher/core/DeviceReport.kt index 9ff0c002a6..8b7b74a5e1 100644 --- a/app/src/main/java/com/droiddeck/launcher/core/DeviceReport.kt +++ b/app/src/main/java/com/droiddeck/launcher/core/DeviceReport.kt @@ -166,7 +166,7 @@ object DeviceReport { h("Device switch files in Download") for (name in listOf("droiddeck-env", "droiddeck-tu-debug", "droiddeck-driver", "droiddeck-osc", "droiddeck-no-pad", "droiddeck-pad-log", - "droiddeck-no-hud", "droiddeck-wlr-renderer")) { + "droiddeck-no-hud", "droiddeck-wlr-renderer", "droiddeck-catalog-url")) { val f = File(Environment.getExternalStorageDirectory(), "Download/$name") if (f.isFile) k(name, FileUtils.readString(f)?.trim()?.replace('\n', ' ')?.ifEmpty { "(present, empty)" } ?: "(present)") } diff --git a/app/src/main/java/com/droiddeck/launcher/runtime/DesktopCatalog.kt b/app/src/main/java/com/droiddeck/launcher/runtime/DesktopCatalog.kt index 2de78f99c6..09033524d5 100644 --- a/app/src/main/java/com/droiddeck/launcher/runtime/DesktopCatalog.kt +++ b/app/src/main/java/com/droiddeck/launcher/runtime/DesktopCatalog.kt @@ -26,8 +26,18 @@ object DesktopCatalog { val icon: String, val category: String, ) + /** + * The catalog to read: Download/droiddeck-catalog-url (one https URL) points this device alone + * at another one - a catalog branch with a package that is not live for everyone yet. + */ + private fun catalogUrl(): String { + val override = File(android.os.Environment.getExternalStorageDirectory(), "Download/droiddeck-catalog-url") + .takeIf { it.isFile }?.let { FileUtils.readString(it)?.trim()?.lineSequence()?.firstOrNull()?.trim() } + return override?.takeIf { it.startsWith("https://") }?.also { Log.i(TAG, "catalog override: $it") } ?: CATALOG_URL + } + fun fetch(): List? { - val body = Downloader.downloadString(CATALOG_URL) ?: return null + val body = Downloader.downloadString(catalogUrl()) ?: return null return try { val json = JSONObject(body) val arr = json.getJSONArray("packages") diff --git a/tools/shadps4/build-in-debian.sh b/tools/shadps4/build-in-debian.sh index 0c857c3c09..b65f5be772 100755 --- a/tools/shadps4/build-in-debian.sh +++ b/tools/shadps4/build-in-debian.sh @@ -56,8 +56,20 @@ cat > "$APPDIR/AppRun" <<'RUN' #!/bin/sh # shadPS4 is a command-line emulator; opened from a menu with nothing to run, it shows its own # Big Picture game list instead of a usage box. +# The first time, the ROMs folder's ps4 folder (any case) is added to its game folders so the +# list is not empty; a folder the player removes later stays removed. HERE=$(dirname "$(readlink -f "$0")") -[ $# -eq 0 ] && set -- --big-picture +if [ $# -eq 0 ]; then + MARK="${XDG_DATA_HOME:-$HOME/.local/share}/shadPS4/.droiddeck-games-folder" + if [ ! -e "$MARK" ]; then + for d in /root/ROMs/*; do + case "$(basename "$d" | tr 'A-Z' 'a-z')" in + ps4) [ -d "$d" ] && "$HERE/usr/bin/shadps4" --add-game-folder "$d" && mkdir -p "$(dirname "$MARK")" && : > "$MARK" ;; + esac + done + fi + set -- --big-picture +fi exec "$HERE/usr/bin/shadps4" "$@" RUN chmod 755 "$APPDIR/AppRun"