From 3e3dfb4a0255e96cf502c9a04dd33c5ec9653ff5 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Wed, 12 Feb 2025 08:53:27 +0800 Subject: [PATCH] OS: remove option `--escape-bedrock` --- src/data/help.json | 10 ---------- src/detection/os/os_linux.c | 2 +- src/options/general.c | 8 -------- src/options/general.h | 1 - 4 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/data/help.json b/src/data/help.json index 6acbb17bf..70184e529 100644 --- a/src/data/help.json +++ b/src/data/help.json @@ -104,16 +104,6 @@ "default": true } }, - { - "long": "escape-bedrock", - "desc": "On Bedrock Linux, whether to escape the bedrock jail", - "remark": "Linux only", - "arg": { - "type": "bool", - "optional": true, - "default": true - } - }, { "long": "wmi-timeout", "desc": "Set the timeout (ms) for WMI queries", diff --git a/src/detection/os/os_linux.c b/src/detection/os/os_linux.c index 487c651a5..44a362605 100644 --- a/src/detection/os/os_linux.c +++ b/src/detection/os/os_linux.c @@ -261,7 +261,7 @@ static void detectOS(FFOSResult* os) return; #endif - if(instance.config.general.escapeBedrock && parseOsRelease(FASTFETCH_TARGET_DIR_ROOT "/bedrock" FASTFETCH_TARGET_DIR_ETC "/bedrock-release", os)) + if(parseOsRelease(FASTFETCH_TARGET_DIR_ROOT "/bedrock" FASTFETCH_TARGET_DIR_ETC "/bedrock-release", os)) { if(os->id.length == 0) ffStrbufAppendS(&os->id, "bedrock"); diff --git a/src/options/general.c b/src/options/general.c index 535c02626..eb09b127e 100644 --- a/src/options/general.c +++ b/src/options/general.c @@ -31,8 +31,6 @@ const char* ffOptionsParseGeneralJsonConfig(FFOptionsGeneral* options, yyjson_va options->detectVersion = yyjson_get_bool(val); #if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__) - else if (ffStrEqualsIgnCase(key, "escapeBedrock")) - options->escapeBedrock = yyjson_get_bool(val); else if (ffStrEqualsIgnCase(key, "playerName")) ffStrbufSetS(&options->playerName, yyjson_get_str(val)); else if (ffStrEqualsIgnCase(key, "dsForceDrm")) @@ -76,8 +74,6 @@ bool ffOptionsParseGeneralCommandLine(FFOptionsGeneral* options, const char* key options->detectVersion = ffOptionParseBoolean(value); #if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__) - else if(ffStrEqualsIgnCase(key, "--escape-bedrock")) - options->escapeBedrock = ffOptionParseBoolean(value); else if(ffStrEqualsIgnCase(key, "--player-name")) ffOptionParseString(key, value, &options->playerName); else if(ffStrEqualsIgnCase(key, "--ds-force-drm")) @@ -107,7 +103,6 @@ void ffOptionsInitGeneral(FFOptionsGeneral* options) options->detectVersion = true; #if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__) - options->escapeBedrock = true; ffStrbufInit(&options->playerName); options->dsForceDrm = FF_DS_FORCE_DRM_TYPE_FALSE; #elif defined(_WIN32) @@ -137,9 +132,6 @@ void ffOptionsGenerateGeneralJsonConfig(FFOptionsGeneral* options, yyjson_mut_do #if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__) - if (options->escapeBedrock != defaultOptions.escapeBedrock) - yyjson_mut_obj_add_bool(doc, obj, "escapeBedrock", options->escapeBedrock); - if (!ffStrbufEqual(&options->playerName, &defaultOptions.playerName)) yyjson_mut_obj_add_strbuf(doc, obj, "playerName", &options->playerName); diff --git a/src/options/general.h b/src/options/general.h index a4ce0e199..9e703a946 100644 --- a/src/options/general.h +++ b/src/options/general.h @@ -18,7 +18,6 @@ typedef struct FFOptionsGeneral // Module options that cannot be put in module option structure #if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__) FFstrbuf playerName; - bool escapeBedrock; FFDsForceDrmType dsForceDrm; #elif defined(_WIN32) int32_t wmiTimeout;