diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index e2658932cbd..d94974eb0c3 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -903,6 +903,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { bool focus_awareness = p_preset->get("xr_features/focus_awareness"); bool backup_allowed = p_preset->get("user_data_backup/allow"); + bool classify_as_game = p_preset->get("package/classify_as_game"); Vector perms; // Write permissions into the perms variable. @@ -1006,6 +1007,10 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { encode_uint32(backup_allowed, &p_manifest.write[iofs + 16]); } + if (tname == "application" && attrname == "isGame") { + encode_uint32(classify_as_game, &p_manifest.write[iofs + 16]); + } + if (tname == "instrumentation" && attrname == "targetPackage") { string_table.write[attr_value] = get_package_name(package_name); } @@ -1758,6 +1763,7 @@ public: r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/unique_name", PROPERTY_HINT_PLACEHOLDER_TEXT, "ext.domain.name"), "org.godotengine.$genname")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/name", PROPERTY_HINT_PLACEHOLDER_TEXT, "Game Name [default if blank]"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "package/signed"), true)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "package/classify_as_game"), true)); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, launcher_icon_option, PROPERTY_HINT_FILE, "*.png"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, launcher_adaptive_icon_foreground_option, PROPERTY_HINT_FILE, "*.png"), "")); diff --git a/platform/android/export/gradle_export_util.h b/platform/android/export/gradle_export_util.h index 25253c15497..0f1a081b111 100644 --- a/platform/android/export/gradle_export_util.h +++ b/platform/android/export/gradle_export_util.h @@ -263,12 +263,14 @@ String _get_application_tag(const Ref &p_preset, bool p_has_ bool uses_xr = (int)(p_preset->get("xr_features/xr_mode")) == 1; String manifest_application_text = vformat( " \n\n" - " \n", + " tools:replace=\"android:allowBackup,android:isGame,android:requestLegacyExternalStorage\"\n" + " tools:ignore=\"GoogleAppIndexingWarning\">\n\n", bool_to_string(p_preset->get("user_data_backup/allow")), + bool_to_string(p_preset->get("package/classify_as_game")), bool_to_string(p_has_storage_permission)); if (uses_xr) { diff --git a/platform/android/java/app/AndroidManifest.xml b/platform/android/java/app/AndroidManifest.xml index d5d5bcf99f8..c790d08c2fb 100644 --- a/platform/android/java/app/AndroidManifest.xml +++ b/platform/android/java/app/AndroidManifest.xml @@ -28,7 +28,7 @@ - +