summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/export/export.cpp12
-rw-r--r--platform/osx/export/export.cpp31
2 files changed, 24 insertions, 19 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index d7a72779e6..b4b38ac450 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -883,10 +883,10 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
ns_android_string = string_table.size() - 1;
}
- int32_t attr_uses_permission_string = string_table.find("uses-feature");
- if (attr_uses_permission_string == -1) {
+ int32_t attr_uses_feature_string = string_table.find("uses-feature");
+ if (attr_uses_feature_string == -1) {
string_table.push_back("uses-feature");
- attr_uses_permission_string = string_table.size() - 1;
+ attr_uses_feature_string = string_table.size() - 1;
}
int32_t attr_required_string = string_table.find("required");
@@ -928,7 +928,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
}
{
- manifest_cur_size += 96 + 20; // node and three attrs + end node
+ manifest_cur_size += 96 + 24; // node and three attrs + end node
p_manifest.resize(manifest_cur_size);
// start tag
@@ -938,7 +938,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
encode_uint32(0, &p_manifest.write[ofs + 8]); // lineno
encode_uint32(-1, &p_manifest.write[ofs + 12]); // comment
encode_uint32(-1, &p_manifest.write[ofs + 16]); // ns
- encode_uint32(attr_uses_permission_string, &p_manifest.write[ofs + 20]); // name
+ encode_uint32(attr_uses_feature_string, &p_manifest.write[ofs + 20]); // name
encode_uint16(20, &p_manifest.write[ofs + 24]); // attr_start
encode_uint16(20, &p_manifest.write[ofs + 26]); // attr_size
encode_uint16(3, &p_manifest.write[ofs + 28]); // num_attrs
@@ -982,7 +982,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
encode_uint32(0, &p_manifest.write[ofs + 8]); // lineno
encode_uint32(-1, &p_manifest.write[ofs + 12]); // comment
encode_uint32(-1, &p_manifest.write[ofs + 16]); // ns
- encode_uint32(attr_uses_permission_string, &p_manifest.write[ofs + 20]); // name
+ encode_uint32(attr_uses_feature_string, &p_manifest.write[ofs + 20]); // name
ofs += 24;
}
diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp
index ce7b47c414..1cb72943fc 100644
--- a/platform/osx/export/export.cpp
+++ b/platform/osx/export/export.cpp
@@ -509,12 +509,13 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
io2.opaque = &dst_f;
zipFile dst_pkg_zip = NULL;
+ DirAccess *tmp_app_path = NULL;
String export_format = use_dmg() && p_path.ends_with("dmg") ? "dmg" : "zip";
if (export_format == "dmg") {
// We're on OSX so we can export to DMG, but first we create our application bundle
tmp_app_path_name = EditorSettings::get_singleton()->get_cache_dir().plus_file(pkg_name + ".app");
print_line("Exporting to " + tmp_app_path_name);
- DirAccess *tmp_app_path = DirAccess::create_for_path(tmp_app_path_name);
+ tmp_app_path = DirAccess::create_for_path(tmp_app_path_name);
if (!tmp_app_path) {
err = ERR_CANT_CREATE;
}
@@ -617,19 +618,23 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
if (export_format == "dmg") {
// write it into our application bundle
file = tmp_app_path_name.plus_file(file);
-
- // write the file, need to add chmod
- FileAccess *f = FileAccess::open(file, FileAccess::WRITE);
- if (f) {
- f->store_buffer(data.ptr(), data.size());
- f->close();
- if (is_execute) {
- // Chmod with 0755 if the file is executable
- FileAccess::set_unix_permissions(file, 0755);
+ if (err == OK) {
+ err = tmp_app_path->make_dir_recursive(file.get_base_dir());
+ }
+ if (err == OK) {
+ // write the file, need to add chmod
+ FileAccess *f = FileAccess::open(file, FileAccess::WRITE);
+ if (f) {
+ f->store_buffer(data.ptr(), data.size());
+ f->close();
+ if (is_execute) {
+ // Chmod with 0755 if the file is executable
+ FileAccess::set_unix_permissions(file, 0755);
+ }
+ memdelete(f);
+ } else {
+ err = ERR_CANT_CREATE;
}
- memdelete(f);
- } else {
- err = ERR_CANT_CREATE;
}
} else {
// add it to our zip file