Skip to content

Conversation

@ggchelu
Copy link

@ggchelu ggchelu commented Nov 15, 2025

Guidelines

  1. Rebase before opening a pull request
  2. If you are sending several unrelated fixes or features, use a branch and a separate pull request for each
  3. If possible try squashing everything in a single commit. This is particularly beneficial in the case of feature merges since it allows easy bisecting when a problem arises

Description

This PR implements core sideloading functionality for RetroArch on Android, allowing external launchers and frontends to dynamically provide cores at runtime without requiring manual installation.

Changes Made

MainMenuActivity.java:

  • Forward intent extras (ROM, LIBRETRO, CONFIGFILE, IME, DATADIR, APK) from external launchers to RetroActivityFuture
  • Support launching RetroArch with content and core in a single intent
  • Use provided values from intent extras or fall back to default preferences

RetroActivityFuture.java:

  • Add automatic permission checking on activity creation
    • Redirect to MainMenuActivity if READ/WRITE_EXTERNAL_STORAGE permissions are missing
    • Preserve all intent extras during permission request flow
  • Implement core sideloading logic
    • Detect when LIBRETRO intent extra points to a core outside RetroArch's cores folder
    • Automatically copy external cores to {dataDir}/cores/
    • Update intent to reference the new internal location
    • Create cores directory if it doesn't exist
  • Add helper methods: checkPermissions(), handleCoreSideloading(), copyFile()

Benefits

  1. Simplified Frontend Integration: External launchers (LaunchBox, KODI, etc.) can download cores from libretro's buildbot and pass them directly to RetroArch
  2. Single-Launch Setup: First-time users no longer need to launch RetroArch separately to grant permissions before loading content
  3. Dynamic Core Management: Frontends can manage core versions independently without user intervention
  4. Backward Compatible: Existing launchers continue to work; new functionality is opt-in via intent extras

Usage Example

Intent intent = new Intent();
intent.setComponent(new ComponentName("com.retroarch",
"com.retroarch.browser.retroactivity.RetroActivityFuture"));
intent.putExtra("ROM", "/path/to/game.rom");
intent.putExtra("LIBRETRO", "/external/path/core_libretro_android.so");
startActivity(intent);RetroArch will automatically copy the core to its internal cores folder and launch the game.

Related Issues

This implements the functionality requested in the community for better frontend integration on Android.

Related Pull Requests

This is based on the approach discussed in #14578 (original PR by @jasonunbrokensoftware for LaunchBox integration).

@hizzlekizzle
Copy link
Collaborator

We're in the midst of a stable release, but I suspect we'll be able to get some eyes on this as soon as it's fully out the door.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants