amnezia-client/client/main.cpp
Mykola Baibuz f58a16ca9d
Prebuilt binaries for third-party submodules (#252)
* Add prebuilt submodule
* Remove Android native library
* Add links for Android prebuilt library
* Update OpenSSL to prebuilt binaries
* Setup links for prebuilt OpenSSL
* Set correct OpenSSL header dir
* Update prebuilt submodule
* Use static OpenSSL for linux build
* Use prebuilt binary from 3rd-prebuilt for Win installer
* Use prebuilt binary from 3rd-prebuilt for Linux installer
* Use prebuilt binary from 3rd-prebuilt for MacOS installer
* Use Android prebuilt openvpn libs
* Cleanup some unneeded code
* Add new maven repo for gradle-versions-plugin
* Use jitpack version of jsocks
* Fix some unnecessary header copy
* Fix issue with package name of original WG libs
* Change submodule path to https (3rd-prebuilt)
* Fix windows installer
* MacOS deploy fixes
* NetworkChange detection for OpenVPN protocol (#256)
* NetworkChange detection for OpenVPN protocol
* Update android native libs
* Always on VPN mode for OpenVPN, Cloak+OpenVPN
* Set foregroundService type
* Android 14 require to set foregroundServiceType
* Remove unused code and cleanup submodules
* Cleanup gradle build script
* Fix start button status
* Pull OpenSSL prebuilt for MacOS, iOS
* Update links for OpenSSL MacOS, iOS prebuilt
* Update OpenSSL binaries path
* Refactor some OpenSSL includes
* Update MacOS OpenVPN binary with statically linked dependency
* Use prebilt for LibSSH
* Android resources cleanup
* Set static runtime linux
* Use shared LibSSH for Android
* Update SS Android lib name
* Fix Linux install path and file permissions
* Feature/iOS GitHub actions (#265)
* Move Android cpp code to openvpn-pt-android repo
* Remove unused OpenVPN2 Android Libs
* Cleanup Gemfile

---------

Co-authored-by: Mazay B <pokamest@gmail.com>
2023-08-04 18:35:43 +01:00

69 lines
1.4 KiB
C++

#include <QDebug>
#include <QTimer>
#include "amnezia_application.h"
#include "version.h"
#include "migrations.h"
#include <QTimer>
#ifdef Q_OS_WIN
#include "Windows.h"
#endif
#if defined(Q_OS_IOS)
#include "platforms/ios/QtAppDelegate-C-Interface.h"
#endif
int main(int argc, char *argv[])
{
Migrations migrationsManager;
migrationsManager.doMigrations();
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
#ifdef Q_OS_WIN
AllowSetForegroundWindow(ASFW_ANY);
#endif
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
AmneziaApplication app(argc, argv);
#else
AmneziaApplication app(argc, argv, true, SingleApplication::Mode::User | SingleApplication::Mode::SecondaryNotification);
if (!app.isPrimary()) {
QTimer::singleShot(1000, &app, [&](){
app.quit();
});
return app.exec();
}
#endif
// Allow to raise app window if secondary instance launched
#ifdef Q_OS_WIN
AllowSetForegroundWindow(0);
#endif
#if defined(Q_OS_IOS)
QtAppDelegateInitialize();
#endif
app.registerTypes();
app.setApplicationName(APPLICATION_NAME);
app.setOrganizationName(ORGANIZATION_NAME);
app.setApplicationDisplayName(APPLICATION_NAME);
app.loadTranslator();
app.loadFonts();
bool doExec = app.parseCommands();
if (doExec) {
app.init();
return app.exec();
}
return 0;
}