From 4327c7f44d5ce06a560a761dc52a97b4a693e609 Mon Sep 17 00:00:00 2001
From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com>
Date: Tue, 21 Nov 2023 01:00:02 +0200
Subject: [PATCH 1/7] Adding the `ANDROID_IS_GAME` to the tools.
---
tools/platforms/AndroidPlatform.hx | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx
index 9372437ee2..fe013ee6f8 100644
--- a/tools/platforms/AndroidPlatform.hx
+++ b/tools/platforms/AndroidPlatform.hx
@@ -450,6 +450,7 @@ class AndroidPlatform extends PlatformTarget
context.CPP_DIR = targetDirectory + "/obj";
context.OUTPUT_DIR = targetDirectory;
context.ANDROID_INSTALL_LOCATION = project.config.getString("android.install-location", "auto");
+ context.ANDROID_IS_GAME = project.config.getString("android.isGame", "false");
context.ANDROID_MINIMUM_SDK_VERSION = project.config.getInt("android.minimum-sdk-version", 21);
context.ANDROID_TARGET_SDK_VERSION = project.config.getInt("android.target-sdk-version", 30);
context.ANDROID_EXTENSIONS = project.config.getArrayString("android.extension");
From 7d28f025f7f67ea0bf25457a7915cb17d57a416f Mon Sep 17 00:00:00 2001
From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com>
Date: Tue, 21 Nov 2023 01:03:52 +0200
Subject: [PATCH 2/7] Adding `android:isGame` to the template
---
templates/android/template/app/src/main/AndroidManifest.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/android/template/app/src/main/AndroidManifest.xml b/templates/android/template/app/src/main/AndroidManifest.xml
index af4261bf95..4339420847 100644
--- a/templates/android/template/app/src/main/AndroidManifest.xml
+++ b/templates/android/template/app/src/main/AndroidManifest.xml
@@ -7,7 +7,7 @@
::if (ANDROID_PERMISSIONS != null)::::foreach ANDROID_PERMISSIONS::
::end::::end::
- =30):: android:allowNativeHeapPointerTagging="false" ::end::>
+ =30):: android:allowNativeHeapPointerTagging="false" ::end::>
::if (WIN_ORIENTATION=="portrait")::
From 9e437efa63b362a98289544e621963246668ae79 Mon Sep 17 00:00:00 2001
From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com>
Date: Fri, 1 Dec 2023 18:06:18 +0000
Subject: [PATCH 3/7] `android:appCategory`
---
templates/android/template/app/src/main/AndroidManifest.xml | 2 +-
tools/platforms/AndroidPlatform.hx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/templates/android/template/app/src/main/AndroidManifest.xml b/templates/android/template/app/src/main/AndroidManifest.xml
index 4339420847..d44bd4f5a5 100644
--- a/templates/android/template/app/src/main/AndroidManifest.xml
+++ b/templates/android/template/app/src/main/AndroidManifest.xml
@@ -7,7 +7,7 @@
::if (ANDROID_PERMISSIONS != null)::::foreach ANDROID_PERMISSIONS::
::end::::end::
- =30):: android:allowNativeHeapPointerTagging="false" ::end::>
+ =30):: android:allowNativeHeapPointerTagging="false" ::end::>
::if (WIN_ORIENTATION=="portrait")::
diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx
index fe013ee6f8..e4e2971c9d 100644
--- a/tools/platforms/AndroidPlatform.hx
+++ b/tools/platforms/AndroidPlatform.hx
@@ -450,7 +450,7 @@ class AndroidPlatform extends PlatformTarget
context.CPP_DIR = targetDirectory + "/obj";
context.OUTPUT_DIR = targetDirectory;
context.ANDROID_INSTALL_LOCATION = project.config.getString("android.install-location", "auto");
- context.ANDROID_IS_GAME = project.config.getString("android.isGame", "false");
+ context.ANDROID_APP_CATEGORY = project.config.getString("android.appCategory", "");
context.ANDROID_MINIMUM_SDK_VERSION = project.config.getInt("android.minimum-sdk-version", 21);
context.ANDROID_TARGET_SDK_VERSION = project.config.getInt("android.target-sdk-version", 30);
context.ANDROID_EXTENSIONS = project.config.getArrayString("android.extension");
From 2c4dc77c21b83869c5a65cbec3da8783f313c83a Mon Sep 17 00:00:00 2001
From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com>
Date: Fri, 1 Dec 2023 20:33:25 +0200
Subject: [PATCH 4/7] Update AndroidPlatform.hx
---
tools/platforms/AndroidPlatform.hx | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx
index e4e2971c9d..30d4ba9356 100644
--- a/tools/platforms/AndroidPlatform.hx
+++ b/tools/platforms/AndroidPlatform.hx
@@ -450,7 +450,7 @@ class AndroidPlatform extends PlatformTarget
context.CPP_DIR = targetDirectory + "/obj";
context.OUTPUT_DIR = targetDirectory;
context.ANDROID_INSTALL_LOCATION = project.config.getString("android.install-location", "auto");
- context.ANDROID_APP_CATEGORY = project.config.getString("android.appCategory", "");
+ context.ANDROID_APP_CATEGORY = project.config.getString("android.appCategory", null);
context.ANDROID_MINIMUM_SDK_VERSION = project.config.getInt("android.minimum-sdk-version", 21);
context.ANDROID_TARGET_SDK_VERSION = project.config.getInt("android.target-sdk-version", 30);
context.ANDROID_EXTENSIONS = project.config.getArrayString("android.extension");
@@ -464,7 +464,6 @@ class AndroidPlatform extends PlatformTarget
context.ANDROID_GRADLE_PLUGIN = project.config.getString("android.gradle-plugin", "7.3.1");
context.ANDROID_USE_ANDROIDX = project.config.getString("android.useAndroidX", "true");
context.ANDROID_ENABLE_JETIFIER = project.config.getString("android.enableJetifier", "false");
-
context.ANDROID_LIBRARY_PROJECTS = [];
if (!project.environment.exists("ANDROID_SDK") || !project.environment.exists("ANDROID_NDK_ROOT"))
From 1b3bd27dc27797829e52fc924cec628c944fb2aa Mon Sep 17 00:00:00 2001
From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com>
Date: Fri, 1 Dec 2023 20:34:53 +0200
Subject: [PATCH 5/7] Update AndroidManifest.xml
---
templates/android/template/app/src/main/AndroidManifest.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/android/template/app/src/main/AndroidManifest.xml b/templates/android/template/app/src/main/AndroidManifest.xml
index d44bd4f5a5..3e44b884ca 100644
--- a/templates/android/template/app/src/main/AndroidManifest.xml
+++ b/templates/android/template/app/src/main/AndroidManifest.xml
@@ -7,7 +7,7 @@
::if (ANDROID_PERMISSIONS != null)::::foreach ANDROID_PERMISSIONS::
::end::::end::
- =30):: android:allowNativeHeapPointerTagging="false" ::end::>
+ =30):: android:allowNativeHeapPointerTagging="false" ::end::>
::if (WIN_ORIENTATION=="portrait")::
From c1d568a626834bab74d3c63f1708f05bf2187567 Mon Sep 17 00:00:00 2001
From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com>
Date: Sat, 2 Dec 2023 01:39:38 +0200
Subject: [PATCH 6/7] My bad
---
tools/platforms/AndroidPlatform.hx | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx
index 30d4ba9356..bfb66437b7 100644
--- a/tools/platforms/AndroidPlatform.hx
+++ b/tools/platforms/AndroidPlatform.hx
@@ -450,7 +450,12 @@ class AndroidPlatform extends PlatformTarget
context.CPP_DIR = targetDirectory + "/obj";
context.OUTPUT_DIR = targetDirectory;
context.ANDROID_INSTALL_LOCATION = project.config.getString("android.install-location", "auto");
- context.ANDROID_APP_CATEGORY = project.config.getString("android.appCategory", null);
+
+ if (project.config.exists("android.appCategory"))
+ {
+ context.ANDROID_APP_CATEGORY = project.config.getString("android.appCategory");
+ }
+
context.ANDROID_MINIMUM_SDK_VERSION = project.config.getInt("android.minimum-sdk-version", 21);
context.ANDROID_TARGET_SDK_VERSION = project.config.getInt("android.target-sdk-version", 30);
context.ANDROID_EXTENSIONS = project.config.getArrayString("android.extension");
From 3887275c64bfeb9e3c2b4e0f1b4ff066a0cfd720 Mon Sep 17 00:00:00 2001
From: player-03
Date: Sat, 2 Dec 2023 00:18:22 -0500
Subject: [PATCH 7/7] Rearrange `AndroidPlatform.update()`.
These two bits of code stood out among all the one-line assignments, so I figured there was somewhere better for both. I put the `if` block next to the other two `if` blocks and moved `ANDROID_LIBRARY_PROJECTS` to where it was used.
---
tools/platforms/AndroidPlatform.hx | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx
index bfb66437b7..7bffb5d23b 100644
--- a/tools/platforms/AndroidPlatform.hx
+++ b/tools/platforms/AndroidPlatform.hx
@@ -450,12 +450,6 @@ class AndroidPlatform extends PlatformTarget
context.CPP_DIR = targetDirectory + "/obj";
context.OUTPUT_DIR = targetDirectory;
context.ANDROID_INSTALL_LOCATION = project.config.getString("android.install-location", "auto");
-
- if (project.config.exists("android.appCategory"))
- {
- context.ANDROID_APP_CATEGORY = project.config.getString("android.appCategory");
- }
-
context.ANDROID_MINIMUM_SDK_VERSION = project.config.getInt("android.minimum-sdk-version", 21);
context.ANDROID_TARGET_SDK_VERSION = project.config.getInt("android.target-sdk-version", 30);
context.ANDROID_EXTENSIONS = project.config.getArrayString("android.extension");
@@ -469,7 +463,6 @@ class AndroidPlatform extends PlatformTarget
context.ANDROID_GRADLE_PLUGIN = project.config.getString("android.gradle-plugin", "7.3.1");
context.ANDROID_USE_ANDROIDX = project.config.getString("android.useAndroidX", "true");
context.ANDROID_ENABLE_JETIFIER = project.config.getString("android.enableJetifier", "false");
- context.ANDROID_LIBRARY_PROJECTS = [];
if (!project.environment.exists("ANDROID_SDK") || !project.environment.exists("ANDROID_NDK_ROOT"))
{
@@ -481,6 +474,11 @@ class AndroidPlatform extends PlatformTarget
Sys.exit(1);
}
+ if (project.config.exists("android.appCategory"))
+ {
+ context.ANDROID_APP_CATEGORY = project.config.getString("android.appCategory");
+ }
+
if (project.config.exists("android.gradle-build-directory"))
{
context.ANDROID_GRADLE_BUILD_DIRECTORY = project.config.getString("android.gradle-build-directory");
@@ -505,6 +503,7 @@ class AndroidPlatform extends PlatformTarget
"KEY_STORE_ALIAS_PASSWORD")) context.KEY_STORE_ALIAS_PASSWORD = StringTools.replace(context.KEY_STORE_ALIAS_PASSWORD, "\\", "\\\\");
var index = 1;
+ context.ANDROID_LIBRARY_PROJECTS = [];
for (dependency in project.dependencies)
{