1 Commits
Author SHA1 Message Date
SSimco 32795e1e25 Fixed conversion from native paths & check for intent data if launch
path from extras was null
2024-09-22 07:59:28 +03:00
2 changed files with 6 additions and 2 deletions
@@ -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;
@@ -53,7 +52,8 @@ public class EmulationActivity extends AppCompatActivity implements Observer<Emu
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) {
@@ -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));
}