diff --git a/install.ps1 b/install.ps1 index c0f19d74..c4407102 100644 --- a/install.ps1 +++ b/install.ps1 @@ -11,7 +11,7 @@ $ErrorActionPreference = "Stop" $defaultInstallUrl = "https://raw.githubusercontent.com/Abdess/retrobios/main/install.py" - $defaultInstallSha256 = "b37588b71f2a6273cedf31ee05fc7b7053b5489f074349fef9cfae0dcf2555ff" + $defaultInstallSha256 = "956eba5f9d01138abda5550973810ccdc1138daa54c9065bf3f04cc0ba051468" $maximumInstallerBytes = 2MB $installerExit = 0 $installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null } diff --git a/install.py b/install.py index e77a8d2e..abf3af2e 100644 --- a/install.py +++ b/install.py @@ -1171,11 +1171,14 @@ def _android_storage_root() -> Path: def _detect_android() -> list[tuple[str, Path]]: """Find the RetroArch system directory on Android. - The config is read from the app external files directory first, then from - the internal one (platform_unix.c:1327-1395). A system_directory left at - default resolves against /RetroArch, which is also where - the directory sits when no config has been written yet - (platform_unix.c:2836-2851). + RetroArch v1.22.2: the launcher picks retroarch.cfg in the app external + files directory, else in the internal one + (pkg/android/phoenix-common/src/com/retroarch/browser/preferences/util/ + UserPreferences.java:36-89), and passes it as CONFIGFILE + (MainMenuActivity.java:178, read at frontend/drivers/platform_unix.c: + 1428-1444). A system_directory left at default resolves against + /RetroArch/system (platform_unix.c:1670-1697), which is + also where the directory sits when no config has been written yet. """ found: list[tuple[str, Path]] = [] storage = _android_storage_root() diff --git a/install.sh b/install.sh index d3ceca20..c67e9b2e 100755 --- a/install.sh +++ b/install.sh @@ -18,7 +18,7 @@ esac TEMP_INSTALLER="" TEMP_DIRECTORY="" DEFAULT_INSTALL_URL="https://raw.githubusercontent.com/Abdess/retrobios/main/install.py" -DEFAULT_INSTALL_SHA256="b37588b71f2a6273cedf31ee05fc7b7053b5489f074349fef9cfae0dcf2555ff" +DEFAULT_INSTALL_SHA256="956eba5f9d01138abda5550973810ccdc1138daa54c9065bf3f04cc0ba051468" MAX_INSTALLER_BYTES=2097152 cleanup() { diff --git a/tests/test_install.py b/tests/test_install.py index d60f0bc1..c7d4e708 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -2711,6 +2711,19 @@ class RetroDeckFoldersMovedOneByOne(unittest.TestCase): self.assertNotIn("bios/ at", label) +class AndroidCitationsNameTheRelease(unittest.TestCase): + """The Android detection cited platform_unix.c lines of a RetroArch + revision nobody named, which no longer held the code they described.""" + + def test_the_lines_are_those_of_v1_22_2(self): + page = (REPO_ROOT / "wiki" / "installer.md").read_text(encoding="utf-8") + for text in (install._detect_android.__doc__, page): + self.assertIn("v1.22.2", text) + self.assertIn("platform_unix.c:1670-1697", text.replace("\n ", "")) + self.assertNotIn("1327-1395", text) + self.assertNotIn("2836-2851", text) + + class TheBoardTheSystemNamesIsTheTarget(unittest.TestCase): """Batocera, Recalbox and ROCKNIX each write the board they were built for, but the installer read none of them, so a Batocera RPi4 installed diff --git a/wiki/installer.md b/wiki/installer.md index aac250cd..cd7161e4 100644 --- a/wiki/installer.md +++ b/wiki/installer.md @@ -499,9 +499,10 @@ with `/system/build.prop` covering a shell started without them. Detection then looks for RetroArch, the only Android frontend keeping a shared BIOS directory. `retroarch.cfg` is read from the app external files directory and then from the internal one, the order the frontend itself follows -(`platform_unix.c:1327-1395`), and a `system_directory` left at `default` -resolves against `/RetroArch`, where the directory also sits -when no config has been written yet (`platform_unix.c:2836-2851`). +(RetroArch v1.22.2, `UserPreferences.java:36-89`), and a `system_directory` +left at `default` resolves against `/RetroArch`, where the +directory also sits when no config has been written yet +(`platform_unix.c:1670-1697`). Under scoped storage those two config paths are unreadable from Termux on Android 11 and later, so on current devices the shared directory is what