Skip to content

Commit 32795e1

Browse files
committed
Fixed conversion from native paths & check for intent data if launch
path from extras was null
1 parent 317e207 commit 32795e1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/android/app/src/main/java/info/cemu/Cemu/emulation/EmulationActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package info.cemu.Cemu.emulation;
22

3-
import android.content.DialogInterface;
43
import android.content.Intent;
54
import android.net.Uri;
65
import android.os.Bundle;
@@ -53,7 +52,8 @@ protected void onCreate(Bundle savedInstanceState) {
5352
String launchPath = null;
5453
if (extras != null) {
5554
launchPath = extras.getString(LAUNCH_PATH);
56-
} else if (data != null) {
55+
}
56+
if (launchPath == null && data != null) {
5757
launchPath = data.toString();
5858
}
5959
if (launchPath == null) {

src/android/app/src/main/java/info/cemu/Cemu/utils/FileUtil.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,15 @@ public class FileUtil {
2222
private static String toCppPath(Uri uri) {
2323
String uriPath = uri.toString();
2424
int delimiterPos = uriPath.lastIndexOf(COLON_ENCODED);
25+
if (delimiterPos == -1)
26+
return uriPath;
2527
return uriPath.substring(0, delimiterPos) + uriPath.substring(delimiterPos).replace(PATH_SEPARATOR_ENCODED, PATH_SEPARATOR_DECODED);
2628
}
2729

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

0 commit comments

Comments
 (0)