Skip to content

Commit

Permalink
Fixed conversion from native paths & check for intent data if launch
Browse files Browse the repository at this point in the history
path from extras was null
  • Loading branch information
SSimco committed Sep 22, 2024
1 parent 317e207 commit 32795e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package info.cemu.Cemu.emulation;

import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
Expand Down Expand Up @@ -53,7 +52,8 @@ protected void onCreate(Bundle savedInstanceState) {
String launchPath = null;
if (extras != null) {
launchPath = extras.getString(LAUNCH_PATH);
} else if (data != null) {
}
if (launchPath == null && data != null) {
launchPath = data.toString();
}
if (launchPath == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ public class FileUtil {
private static String toCppPath(Uri uri) {
String uriPath = uri.toString();
int delimiterPos = uriPath.lastIndexOf(COLON_ENCODED);
if (delimiterPos == -1)
return uriPath;
return uriPath.substring(0, delimiterPos) + uriPath.substring(delimiterPos).replace(PATH_SEPARATOR_ENCODED, PATH_SEPARATOR_DECODED);
}

private static Uri fromCppPath(String cppPath) {
int delimiterPos = cppPath.lastIndexOf(COLON_ENCODED);
if (delimiterPos == -1)
return Uri.parse(cppPath);
return Uri.parse(cppPath.substring(0, delimiterPos) + cppPath.substring(delimiterPos).replace(PATH_SEPARATOR_DECODED, PATH_SEPARATOR_ENCODED));
}

Expand Down

0 comments on commit 32795e1

Please sign in to comment.