mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-15 10:40:01 +01:00
Merge pull request #18107 from hrydgard/android-fix-homebrew
Fix running homebrew on Android with content URIs (scoped storage)
This commit is contained in:
2 files changed
+6
-3
No files matched your search
+5
-2
@@ -18,6 +18,7 @@
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
|
||||
#include "Common/File/AndroidContentURI.h"
|
||||
#include "Common/File/FileUtil.h"
|
||||
#include "Common/File/Path.h"
|
||||
#include "Common/StringUtils.h"
|
||||
@@ -263,10 +264,9 @@ bool LoadFile(FileLoader **fileLoaderPtr, std::string *error_string) {
|
||||
switch (type) {
|
||||
case IdentifiedFileType::PSP_PBP_DIRECTORY:
|
||||
{
|
||||
// TODO: Perhaps we should/can never get here now?
|
||||
fileLoader = ResolveFileLoaderTarget(fileLoader);
|
||||
if (fileLoader->Exists()) {
|
||||
INFO_LOG(LOADER, "File is a PBP in a directory!");
|
||||
INFO_LOG(LOADER, "File is a PBP in a directory: %s", fileLoader->GetPath().c_str());
|
||||
IdentifiedFileType ebootType = Identify_File(fileLoader, error_string);
|
||||
if (ebootType == IdentifiedFileType::PSP_ISO_NP) {
|
||||
InitMemoryForGameISO(fileLoader);
|
||||
@@ -284,6 +284,9 @@ bool LoadFile(FileLoader **fileLoaderPtr, std::string *error_string) {
|
||||
}
|
||||
|
||||
std::string dir = fileLoader->GetPath().GetDirectory();
|
||||
if (fileLoader->GetPath().Type() == PathType::CONTENT_URI) {
|
||||
dir = AndroidContentURI(dir.c_str()).FilePath();
|
||||
}
|
||||
size_t pos = dir.find("PSP/GAME/");
|
||||
if (pos != std::string::npos) {
|
||||
dir = ResolvePBPDirectory(Path(dir)).ToString();
|
||||
|
||||
+1
-1
@@ -382,7 +382,7 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) {
|
||||
std::string file = full_path.GetFilename();
|
||||
|
||||
if (full_path.Type() == PathType::CONTENT_URI) {
|
||||
path = AndroidContentURI(full_path.c_str()).FilePath();
|
||||
path = AndroidContentURI(full_path.GetDirectory().c_str()).FilePath();
|
||||
}
|
||||
|
||||
size_t pos = path.find("PSP/GAME/");
|
||||
|
||||
Reference in new issue
Block a user