IOS7: Remove support for non-sandboxed mode

This commit is contained in:
Thierry Crozat 2023-04-26 22:31:31 +01:00
parent 5bfa6feaa1
commit f1f808f7a4
7 changed files with 7 additions and 59 deletions

View file

@ -48,7 +48,7 @@
#include "audio/mpu401.h"
#include "audio/softsynth/emumidi.h"
#include "gui/message.h"
#if defined(IPHONE_IOS7) && defined(IPHONE_SANDBOXED)
#if defined(IPHONE_IOS7)
#include "backends/platform/ios7/ios7_common.h"
#endif
#ifdef __ANDROID__
@ -438,7 +438,7 @@ int MidiDriver_FluidSynth::open() {
} else
#endif // FS_HAS_STREAM_SUPPORT
{
#if defined(IPHONE_IOS7) && defined(IPHONE_SANDBOXED)
#if defined(IPHONE_IOS7)
// HACK: Due to the sandbox on non-jailbroken iOS devices, we need to deal
// with the chroot filesystem. All the path selected by the user are
// relative to the Document directory. So, we need to adjust the path to

View file

@ -43,7 +43,6 @@
- (void)applicationDidFinishLaunching:(UIApplication *)application {
CGRect rect = [[UIScreen mainScreen] bounds];
#ifdef IPHONE_SANDBOXED
// Create the directory for savegames
NSFileManager *fm = [NSFileManager defaultManager];
NSString *documentPath = [NSString stringWithUTF8String:iOS7_getDocumentsDir()];
@ -51,7 +50,6 @@
if (![fm fileExistsAtPath:savePath]) {
[fm createDirectoryAtPath:savePath withIntermediateDirectories:YES attributes:nil error:nil];
}
#endif
_window = [[UIWindow alloc] initWithFrame:rect];
[_window retain];

View file

@ -59,7 +59,6 @@ AQCallbackStruct OSystem_iOS7::s_AudioQueue;
SoundProc OSystem_iOS7::s_soundCallback = NULL;
void *OSystem_iOS7::s_soundParam = NULL;
#ifdef IPHONE_SANDBOXED
class SandboxedSaveFileManager : public DefaultSaveFileManager {
Common::String _sandboxRootPath;
public:
@ -84,7 +83,6 @@ public:
}
}
};
#endif
OSystem_iOS7::OSystem_iOS7() :
_mixer(NULL), _lastMouseTap(0), _queuedEventTime(0),
@ -95,7 +93,7 @@ OSystem_iOS7::OSystem_iOS7() :
_mouseCursorPaletteEnabled(false), _gfxTransactionError(kTransactionSuccess) {
_queuedInputEvent.type = Common::EVENT_INVALID;
_touchpadModeEnabled = !iOS7_isBigDevice();
#ifdef IPHONE_SANDBOXED
_chrootBasePath = iOS7_getDocumentsDir();
ChRootFilesystemFactory *chFsFactory = new ChRootFilesystemFactory(_chrootBasePath);
_fsFactory = chFsFactory;
@ -107,9 +105,7 @@ OSystem_iOS7::OSystem_iOS7() :
chFsFactory->addVirtualDrive("appbundle:", Common::String((const char *)buf));
CFRelease(fileUrl);
}
#else
_fsFactory = new POSIXFilesystemFactory();
#endif
initVideoContext();
memset(_gamePalette, 0, sizeof(_gamePalette));
@ -146,11 +142,7 @@ int OSystem_iOS7::timerHandler(int t) {
}
void OSystem_iOS7::initBackend() {
#ifdef IPHONE_SANDBOXED
_savefileManager = new SandboxedSaveFileManager(_chrootBasePath, "/Savegames");
#else
_savefileManager = new DefaultSaveFileManager(SCUMMVM_SAVE_PATH);
#endif
_timerManager = new DefaultTimerManager();
@ -354,12 +346,8 @@ OSystem_iOS7 *OSystem_iOS7::sharedInstance() {
}
Common::String OSystem_iOS7::getDefaultConfigFileName() {
#ifdef IPHONE_SANDBOXED
Common::String path = "/Preferences";
return path;
#else
return SCUMMVM_PREFS_PATH;
#endif
}
void OSystem_iOS7::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
@ -371,12 +359,8 @@ void OSystem_iOS7::addSysArchivesToSearchSet(Common::SearchSet &s, int priority)
if (CFURLGetFileSystemRepresentation(fileUrl, true, buf, sizeof(buf))) {
// Success: Add it to the search path
Common::String bundlePath((const char *)buf);
#ifdef IPHONE_SANDBOXED
POSIXFilesystemNode *posixNode = new POSIXFilesystemNode(bundlePath);
s.add("__IOS_BUNDLE__", new Common::FSDirectory(AbstractFSNode::makeFSNode(posixNode)), priority);
#else
s.add("__IOS_BUNDLE__", new Common::FSDirectory(bundlePath), priority);
#endif
}
CFRelease(fileUrl);
}
@ -408,14 +392,7 @@ void iOS7_main(int argc, char **argv) {
//gDebugLevel = 10;
}
#ifdef IPHONE_SANDBOXED
chdir(iOS7_getDocumentsDir());
#else
system("mkdir " SCUMMVM_ROOT_PATH);
system("mkdir " SCUMMVM_SAVE_PATH);
chdir("/var/mobile/");
#endif
g_system = OSystem_iOS7::sharedInstance();
assert(g_system);

View file

@ -39,10 +39,6 @@
#define WAVE_BUFFER_SIZE 2048
#define AUDIO_SAMPLE_RATE 44100
#define SCUMMVM_ROOT_PATH "/var/mobile/Library/ScummVM"
#define SCUMMVM_SAVE_PATH SCUMMVM_ROOT_PATH "/Savegames"
#define SCUMMVM_PREFS_PATH SCUMMVM_ROOT_PATH "/Preferences"
typedef void (*SoundProc)(void *param, byte *buf, int len);
typedef int (*TimerProc)(int interval);
@ -111,9 +107,7 @@ protected:
Common::String _lastErrorMessage;
#ifdef IPHONE_SANDBOXED
Common::String _chrootBasePath;
#endif
public:

View file

@ -56,13 +56,8 @@ void OSystem_iOS7::updateStartSettings(const Common::String &executable, Common:
// If the bundle contains a scummvm.ini, use it as initial config
NSString *iniPath = [bundle pathForResource:@"scummvm" ofType:@"ini"];
if (iniPath && !settings.contains("initial-cfg")) {
#ifdef IPHONE_SANDBOXED
if (iniPath && !settings.contains("initial-cfg"))
settings["initial-cfg"] = "appbundle:/scummvm.ini";
#else
settings["initial-cfg"] = Common::String([iniPath fileSystemRepresentation]);
#endif
}
// If a command was specified on the command line, do not override it
if (!command.empty())
@ -73,11 +68,7 @@ void OSystem_iOS7::updateStartSettings(const Common::String &executable, Common:
if (autorunPath) {
Common::File autorun;
Common::String line;
#ifdef IPHONE_SANDBOXED
if (autorun.open(Common::FSNode("appbundle:/scummvm-autorun"))) {
#else
if (autorun.open(Common::FSNode([autorunPath fileSystemRepresentation]))) {
#endif
while (!autorun.eos()) {
line = autorun.readLine();
if (!line.empty() && line[0] != '#')
@ -94,11 +85,7 @@ void OSystem_iOS7::updateStartSettings(const Common::String &executable, Common:
if (exists && isDir) {
// Use auto-detection
command = "auto-detect";
#ifdef IPHONE_SANDBOXED
settings["path"] = "appbundle:/game";
#else
settings["path"] = [gamePath fileSystemRepresentation];
#endif
return;
}
@ -118,11 +105,7 @@ void OSystem_iOS7::updateStartSettings(const Common::String &executable, Common:
if (exists && isDir) {
// Detect and add games
command = "add";
#ifdef IPHONE_SANDBOXED
settings["path"] = "appbundle:/games";
#else
settings["path"] = [gamesPath fileSystemRepresentation];
#endif
settings["recursive"] = "true";
settings["exit"] = "false";
return;

4
configure vendored
View file

@ -3520,7 +3520,7 @@ if test -n "$_host"; then
;;
ios7*)
add_line_to_config_mk 'IPHONE = 1'
append_var DEFINES "-DIPHONE -DIPHONE_IOS7 -DIPHONE_SANDBOXED"
append_var DEFINES "-DIPHONE -DIPHONE_IOS7"
_backend="ios7"
_seq_midi=no
_timidity=no
@ -3780,7 +3780,7 @@ if test -n "$_host"; then
;;
tvos)
add_line_to_config_mk 'IPHONE = 1'
append_var DEFINES "-DIPHONE -DIPHONE_IOS7 -DIPHONE_SANDBOXED"
append_var DEFINES "-DIPHONE -DIPHONE_IOS7"
_backend="ios7"
_seq_midi=no
_timidity=no

View file

@ -1265,7 +1265,6 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
REMOVE_DEFINE(scummvm_defines, "MACOSX");
REMOVE_DEFINE(scummvm_defines, "IPHONE");
REMOVE_DEFINE(scummvm_defines, "IPHONE_IOS7");
REMOVE_DEFINE(scummvm_defines, "IPHONE_SANDBOXED");
REMOVE_DEFINE(scummvm_defines, "SDL_BACKEND");
ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, kSettingsNoQuote | kSettingsAsList, 5);
ADD_SETTING(scummvm_Debug, "GCC_WARN_ABOUT_RETURN_TYPE", "YES");
@ -1360,7 +1359,6 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
ADD_DEFINE(scummvmIOS_defines, "\"$(inherited)\"");
ADD_DEFINE(scummvmIOS_defines, "IPHONE");
ADD_DEFINE(scummvmIOS_defines, "IPHONE_IOS7");
ADD_DEFINE(scummvmIOS_defines, "IPHONE_SANDBOXED");
if (CONTAINS_DEFINE(setup.defines, "USE_SDL_NET"))
ADD_DEFINE(scummvmIOS_defines, "WITHOUT_SDL");
ADD_SETTING_LIST(iPhone_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmIOS_defines, kSettingsNoQuote | kSettingsAsList, 5);
@ -1517,7 +1515,6 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
ADD_DEFINE(scummvmTVOS_defines, "\"$(inherited)\"");
ADD_DEFINE(scummvmTVOS_defines, "IPHONE");
ADD_DEFINE(scummvmTVOS_defines, "IPHONE_IOS7");
ADD_DEFINE(scummvmTVOS_defines, "IPHONE_SANDBOXED");
if (CONTAINS_DEFINE(setup.defines, "USE_SDL_NET"))
ADD_DEFINE(scummvmTVOS_defines, "WITHOUT_SDL");
ADD_SETTING_LIST(tvOS_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmTVOS_defines, kSettingsNoQuote | kSettingsAsList, 5);
@ -1603,7 +1600,6 @@ void XcodeProvider::setupDefines(const BuildSetup &setup) {
REMOVE_DEFINE(_defines, "MACOSX");
REMOVE_DEFINE(_defines, "IPHONE");
REMOVE_DEFINE(_defines, "IPHONE_IOS7");
REMOVE_DEFINE(_defines, "IPHONE_SANDBOXED");
REMOVE_DEFINE(_defines, "SDL_BACKEND");
ADD_DEFINE(_defines, "CONFIG_H");
ADD_DEFINE(_defines, "UNIX");