You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
src/main-executable/main.c: change the naming scheme for app data dirs to fix Unity
Unity can't comprehend that a directory name could end in .apk, and will not handle
obb files properly if the path to the obb file includes such a folder.
To convert your existing app data dirs to the new scheme, simply `cd` into
the app_data_dir (`~/.local/share/android_translation_layer` by default)
and run `find . -maxdepth 1 -exec mv {} {}_ \;`
This commit is contained in:
@@ -207,12 +207,13 @@ static void open(GtkApplication *app, GFile** files, gint nfiles, const gchar* h
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
app_data_dir = malloc(strlen(app_data_dir_base) + 1 + strlen(apk_name) + 1 + 1); // +1 for middle '/', +1 for end '/', and +1 for NULL
|
app_data_dir = malloc(strlen(app_data_dir_base) + 1 + strlen(apk_name) + 1 + 1 + 1); // +1 for middle '/', + 1 for _, +1 for end '/', and +1 for NULL
|
||||||
strcpy(app_data_dir, app_data_dir_base);
|
strcpy(app_data_dir, app_data_dir_base);
|
||||||
strcat(app_data_dir, "/");
|
strcat(app_data_dir, "/");
|
||||||
// TODO: we should possibly use the app id instead, but we don't currently have a way to get that
|
// TODO: we should possibly use the app id instead, but we don't currently have a way to get that soon enough
|
||||||
// arguably both the app id and the apk name might have an issue with duplicates, but if two apks use the same app id, chances are it's less of an issue than when two apks have the same name
|
// arguably both the app id and the apk name might have an issue with duplicates, but if two apks use the same app id, chances are it's less of an issue than when two apks have the same name
|
||||||
strcat(app_data_dir, apk_name);
|
strcat(app_data_dir, apk_name);
|
||||||
|
strcat(app_data_dir, "_"); // !IMPORTANT! Unity can't comprehend that a directory name could end in .apk, so we have to avoid that here
|
||||||
strcat(app_data_dir, "/");
|
strcat(app_data_dir, "/");
|
||||||
|
|
||||||
ret = mkdir(app_data_dir, DEFFILEMODE | S_IXUSR | S_IXGRP | S_IXOTH);
|
ret = mkdir(app_data_dir, DEFFILEMODE | S_IXUSR | S_IXGRP | S_IXOTH);
|
||||||
|
|||||||
Reference in New Issue
Block a user