Skip to content
This repository was archived by the owner on Mar 4, 2023. It is now read-only.

Commit 7d604f3

Browse files
committed
optional automated jniOnLoad
1 parent 56fb054 commit 7d604f3

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

androidutils.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@
99
#include <QDebug>
1010
#endif
1111

12-
#ifdef Q_OS_ANDROID
12+
#if defined(Q_OS_ANDROID) && !defined(NO_JNI_ONLOAD)
1313
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) {
1414
Q_UNUSED(vm);
15-
qDebug("NativeInterface::JNI_OnLoad()");
16-
1715
// It must call this function within JNI_OnLoad to enable System Dispatcher
1816
AndroidNative::SystemDispatcher::registerNatives();
19-
2017
return JNI_VERSION_1_6;
2118
}
2219
#endif

de_skycoder42_androidutils.pri

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ INCLUDEPATH += $$PWD
1414
DISTFILES += \
1515
$$PWD/android/androidutils.gradle \
1616
$$PWD/android/src/de/skycoder42/androidutils/AlarmReceiver.java \
17-
$$PWD/android/src/de/skycoder42/androidutils/AndroidUtils.java
17+
$$PWD/android/src/de/skycoder42/androidutils/AndroidUtils.java
1818

1919
android {
2020
isEmpty(QPM_ROOT):QPM_ROOT = $$_PRO_FILE_PWD_/vendor
@@ -29,3 +29,5 @@ android {
2929
export(first.depends)
3030
QMAKE_EXTRA_TARGETS += first copygradle setupnative setupgradle
3131
}
32+
33+
noJniOnLoad: DEFINES += NO_JNI_ONLOAD

0 commit comments

Comments
 (0)