diff options
| author | Ruslan Mustakov | 2017-08-18 21:17:35 +0700 |
|---|---|---|
| committer | Ruslan Mustakov | 2017-08-30 18:14:19 +0700 |
| commit | 5ccdeccb6ed6b8480a86b0db36f192526cba1274 (patch) | |
| tree | eafb890997ee985210b66272957aa22ad00df125 /platform/android/export/export.cpp | |
| parent | 8b9026c05e9982a7bc0c7f52776ad74276b90252 (diff) | |
| download | godot-5ccdeccb6ed6b8480a86b0db36f192526cba1274.tar.gz godot-5ccdeccb6ed6b8480a86b0db36f192526cba1274.tar.zst godot-5ccdeccb6ed6b8480a86b0db36f192526cba1274.zip | |
Diffstat (limited to 'platform/android/export/export.cpp')
| -rw-r--r-- | platform/android/export/export.cpp | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 8b3a64bbe..da1b2617e 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -468,11 +468,36 @@ class EditorExportAndroid : public EditorExportPlatform { return zipfi; } - static Error save_apk_file(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total) { + static Set<String> get_abis() { + Set<String> abis; + abis.insert("armeabi"); + abis.insert("armeabi-v7a"); + abis.insert("arm64-v8a"); + abis.insert("x86"); + abis.insert("x86_64"); + abis.insert("mips"); + abis.insert("mips64"); + return abis; + } + static Error save_apk_file(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total) { APKExportData *ed = (APKExportData *)p_userdata; String dst_path = p_path; - dst_path = dst_path.replace_first("res://", "assets/"); + static Set<String> android_abis = get_abis(); + + if (dst_path.ends_with(".so")) { + String abi = dst_path.get_base_dir().get_file().strip_edges(); // parent dir name + if (android_abis.has(abi)) { + dst_path = "lib/" + abi + "/" + dst_path.get_file(); + } else { + String err = "Dynamic libraries must be located in the folder named after Android ABI they were compiled for. " + + p_path + " does not follow this convention."; + ERR_PRINT(err.utf8().get_data()); + return ERR_FILE_BAD_PATH; + } + } else { + dst_path = dst_path.replace_first("res://", "assets/"); + } zip_fileinfo zipfi = get_zip_fileinfo(); @@ -1375,15 +1400,15 @@ public: } } - if (file == "lib/x86/libgodot_android.so" && !export_x86) { + if (file == "lib/x86/*.so" && !export_x86) { skip = true; } - if (file.match("lib/armeabi*/libgodot_android.so") && !export_arm) { + if (file.match("lib/armeabi*/*.so") && !export_arm) { skip = true; } - if (file.match("lib/arm64*/libgodot_android.so") && !export_arm64) { + if (file.match("lib/arm64*/*.so") && !export_arm64) { skip = true; } |
