Skip to content

Commit

Permalink
Add option to add debug keystore in Android export
Browse files Browse the repository at this point in the history
  • Loading branch information
vnen committed Dec 19, 2018
1 parent aa819a8 commit e3e5a1b
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions platform/android/export/export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,9 @@ class EditorExportAndroid : public EditorExportPlatform {
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, launcher_icons[i].option_id, PROPERTY_HINT_FILE, "*.png"), ""));
}

r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "keystore/debug", PROPERTY_HINT_GLOBAL_FILE, "*.keystore"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "keystore/debug_user"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "keystore/debug_password"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "keystore/release", PROPERTY_HINT_GLOBAL_FILE, "*.keystore"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "keystore/release_user"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "keystore/release_password"), ""));
Expand Down Expand Up @@ -1417,12 +1420,15 @@ class EditorExportAndroid : public EditorExportPlatform {
err += "OpenJDK 8 jarsigner not configured in the Editor Settings.\n";
}

String dk = EditorSettings::get_singleton()->get("export/android/debug_keystore");
String dk = p_preset->get("keystore/debug");

if (!FileAccess::exists(dk)) {

valid = false;
err += "Debug keystore not configured in the Editor Settings.\n";
dk = EditorSettings::get_singleton()->get("export/android/debug_keystore");
if (!FileAccess::exists(dk)) {
valid = false;
err += "Debug keystore not configured in the Editor Settings nor in the preset.\n";
}
}

bool apk_expansion = p_preset->get("apk_expansion/enable");
Expand Down Expand Up @@ -1772,9 +1778,17 @@ class EditorExportAndroid : public EditorExportPlatform {
String password;
String user;
if (p_debug) {
keystore = EditorSettings::get_singleton()->get("export/android/debug_keystore");
password = EditorSettings::get_singleton()->get("export/android/debug_keystore_pass");
user = EditorSettings::get_singleton()->get("export/android/debug_keystore_user");

keystore = p_preset->get("keystore/debug");
password = p_preset->get("keystore/debug_password");
user = p_preset->get("keystore/debug_user");

if (keystore.empty()) {

keystore = EditorSettings::get_singleton()->get("export/android/debug_keystore");
password = EditorSettings::get_singleton()->get("export/android/debug_keystore_pass");
user = EditorSettings::get_singleton()->get("export/android/debug_keystore_user");
}

ep.step("Signing debug APK...", 103);

Expand Down

0 comments on commit e3e5a1b

Please sign in to comment.