Magic tools: Android forbids restricted users from some standard dirs, detecting custom ones at runtime.

This commit is contained in:
Pere Pujal i Carabantes 2021-01-16 00:43:46 +01:00
parent 2a159dd049
commit eafa02812e

View file

@ -18942,7 +18942,15 @@ static void load_magic_plugins(void)
for (plc = 0; plc < NUM_MAGIC_PLACES; plc++)
{
if (plc == MAGIC_PLACE_GLOBAL)
place = strdup(MAGIC_PREFIX);
{
#if defined (__ANDROID__)
/* Need this at runtime as Android installs on different locations depending on the user */
place = strdup(SDL_AndroidGetInternalStoragePath());
strcpy(strstr(place, "/files"), "/lib/");
#else
place = strdup(MAGIC_PREFIX);
#endif
}
else if (plc == MAGIC_PLACE_LOCAL)
place = get_fname("plugins/", DIR_DATA);
#ifdef __APPLE__