diff --git a/android.pri b/android.pri index 83f574f2230d6a66cfd10032d8c5c49f6d027082..2355bc93486e9c81ffedf52d0c9c71ce2964c11b 100644 --- a/android.pri +++ b/android.pri @@ -3,17 +3,20 @@ message("Adding Serial Java Classes") QT += androidextras ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android + exists($$PWD/custom/android) { message("Merging $$PWD/custom/android/ -> $$PWD/android/") + ANDROID_PACKAGE_SOURCE_DIR = $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR + android_source_dir_target.target = android_source_dir + PRE_TARGETDEPS += $$android_source_dir_target.target + QMAKE_EXTRA_TARGETS += android_source_dir_target - javaforce.target = custom_android - javaforce.commands = $$QMAKE_MKDIR $$ANDROID_PACKAGE_SOURCE_DIR && \ - $$QMAKE_COPY_DIR $$PWD/android/* $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR && \ - $$QMAKE_COPY_DIR $$PWD/custom/android/* $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR - javaforce.depends = FORCE - PRE_TARGETDEPS += $$javaforce.target - QMAKE_EXTRA_TARGETS += javaforce + android_source_dir_target.commands = $$QMAKE_MKDIR $$ANDROID_PACKAGE_SOURCE_DIR && \ + $$QMAKE_COPY_DIR $$PWD/android/* $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR && \ + $$QMAKE_COPY_DIR $$PWD/custom/android/* $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR && \ + $$QMAKE_STREAM_EDITOR -i \"s/package="org.mavlink.qgroundcontrol"/package=\"$$QGC_ORG_DOMAIN.qgroundcontrol\"/\" $$ANDROID_PACKAGE_SOURCE_DIR/AndroidManifest.xml + android_source_dir_target.depends = FORCE } exists($$PWD/custom/android/AndroidManifest.xml) { diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 46bebf0fa6d046211ef22bf89637b85d5e2cd5f4..c3571cac7bd067f1dca247a0f1491ad8e7f81503 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -82,3 +82,4 @@ + diff --git a/custom-example/android/AndroidManifest.xml b/custom-example/android/AndroidManifest.xml deleted file mode 100644 index e6a349cb50e7a78fe857f2738e07c68ecc76f410..0000000000000000000000000000000000000000 --- a/custom-example/android/AndroidManifest.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/custom-example/android/src/org/custom/qgroundcontrol/CustomQGCActivity.java b/custom-example/android/src/org/custom/qgroundcontrol/CustomQGCActivity.java deleted file mode 100644 index c224ea748140d8ac23b91038c7e110a7c2e827fe..0000000000000000000000000000000000000000 --- a/custom-example/android/src/org/custom/qgroundcontrol/CustomQGCActivity.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.custom.qgroundcontrol; - -import org.mavlink.qgroundcontrol.QGCActivity; - -public class CustomQGCActivity extends QGCActivity {} diff --git a/custom-example/custom.pri b/custom-example/custom.pri index c5325f5537302e5070158246d47085f6b3b29e25..cc233b283dbd661fdad98aa05f1027e47256e074 100644 --- a/custom-example/custom.pri +++ b/custom-example/custom.pri @@ -45,6 +45,7 @@ QGC_APP_NAME = "Custom QGroundControl" QGC_BINARY_NAME = "CustomQGroundControl" QGC_ORG_NAME = "Custom" QGC_ORG_DOMAIN = "org.custom" +QGC_ANDROID_PACKAGE = "org.custom.qgroundcontrol" QGC_APP_DESCRIPTION = "Custom QGroundControl" QGC_APP_COPYRIGHT = "Copyright (C) 2020 QGroundControl Development Team. All rights reserved."