ddnet/scripts
Robert Müller 986508e091 Improve Android storage usage, faster launch, remove permissions
Split the user storage location and the data folder in the app specific external storage in the folders `data` and `user` instead of writing the user setting directly to the external storage.

Remove unnecessary storage permissions. The client only accesses files in its own external storage location, hence these permissions are not necessary for Android API 19 and higher, which is always given as we only target API 19 and higher.

Only unpack changed assets when their hash in the integrity index is different instead of unpacking all assets again, so the app starts faster after updates. Avoid unpacking the entire integrity index file unless it changed, by initially reading only the first hash directly from the asset, so the app starts faster when the data is up-to-date.

Add error handling for external storage not being accessible and other I/O errors during unpacking of assets.

Add `android_main.h` header to export the `InitAndroid` function and potentially other functions in the future. The `extern "C"` and `__attribute__((visibility("default")))` attributes seem to be unnecessary, as this function is only called directly from the native code like many other functions without these attributes.

Initialize the Android storage after the loggers, so the log message are printed properly.

Add documentation for the use of `std::exit` on Android, which is used to forcefully terminate the entire process, to ensure that static variables will be initialized correctly when the app is started again after quitting. Returning from the main function is not enough, as this only results in the native thread terminating, but the Java thread will continue. Java does not support unloading libraries once they have been loaded, so all static variables will not have their expected initial values anymore when the app is started again after quitting.

Use `fs_chdir` and `fs_makedir` instead of `chdir` and `mkdir`.
2024-05-25 21:09:42 +02:00
..
android Improve Android storage usage, faster launch, remove permissions 2024-05-25 21:09:42 +02:00
compile_libs Split compile_source function for readability 2024-05-23 20:43:53 +02:00
languages Fix performance regression in copy_fix.py 2024-05-19 19:47:12 +02:00
check_config_variables.py Move config variables to config_variables.h, remove variables.h 2023-11-25 16:40:55 +01:00
check_dilate.sh Run shellcheck over check_dilate.sh 2020-12-08 15:02:16 +01:00
check_header_guards.py Add support for Rust code in DDNet 2022-10-19 23:46:06 +02:00
check_identifiers.py Update scripts/check_identifiers.py 2022-07-27 09:37:24 +02:00
check_standard_headers.sh Use shfmt as formatter for shell scripts 2024-05-23 08:05:00 +08:00
check_unused_header_files.py Rewrite unused header style check shell script in Python 2023-10-14 15:21:28 +02:00
checksum.py [WIP] Require Python 3.6 (f-strings) and fix pylints 2022-07-27 09:37:24 +02:00
darwin_strip_rpath.py Support libfat directory for macOS, use arm64 libs (fixes #3250) 2021-12-20 00:17:38 +01:00
extract_identifiers.py Fix rest of pylint manually 2022-07-27 09:37:25 +02:00
fix_style.py check for newline at the end of source files 2024-03-23 16:01:00 +01:00
gen_keys.py Handle ordinal joystick hat keys as combined cardinal hat keys 2022-12-17 17:18:01 +01:00
generate_fake_curl.py [WIP] Require Python 3.6 (f-strings) and fix pylints 2022-07-27 09:37:24 +02:00
generate_unicode_confusables_data.py Replace all usages of C standard headers with C++ headers 2023-03-01 19:26:51 +01:00
generate_unicode_tolower.py Replace all usages of C standard headers with C++ headers 2023-03-01 19:26:51 +01:00
git_revision.py scripts/git_revision.py: Allow to pass in the git shortrev 2023-03-19 18:02:04 +01:00
hash_passwords.py [WIP] Require Python 3.6 (f-strings) and fix pylints 2022-07-27 09:37:24 +02:00
import_file_score.py Rename all variables for strict camel-casing of abbreviations 2024-03-05 15:44:09 +01:00
integration_test.sh Use shfmt as formatter for shell scripts 2024-05-23 08:05:00 +08:00
move_sqlite.py Improve move_sqlite script to adapt timezone 2022-12-14 18:35:01 +01:00
parse_drmingw.sh Use shfmt as formatter for shell scripts 2024-05-23 08:05:00 +08:00
SDL_scancode.h Regenerate key lists with latest SDL version 2023-05-30 23:39:47 +02:00
send_named_pipe.ps1 Improve Windows pipe (FIFO) support 2023-09-05 19:15:09 +02:00
tw_api.py Run flynt -a 2022-07-27 09:37:24 +02:00
unicode.py [WIP] Require Python 3.6 (f-strings) and fix pylints 2022-07-27 09:37:24 +02:00
wordlist.py [WIP] Require Python 3.6 (f-strings) and fix pylints 2022-07-27 09:37:24 +02:00