mirror of
https://github.com/izzy2lost/WeeU.git
synced 2026-07-06 00:19:59 -07:00
Fixed conversion from native paths & check for intent data if launch
path from extras was null
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user