mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-12-04 06:01:26 +09:00
* feat: use libagw * feat: add conanfile for libagw * chore: fix android build with agw * refactor: gateway error code parsing * fix: build fixes * fix: return proxy cache * chore: update link to libagw * fix: libagw 1.0.6, log request trace, persist state synchronously * chore: fetch libagw as a release archive with sha256 instead of git clone
38 lines
1.3 KiB
C++
38 lines
1.3 KiB
C++
#ifndef APIUTILS_H
|
|
#define APIUTILS_H
|
|
|
|
#include <QNetworkReply>
|
|
#include <QObject>
|
|
|
|
#include "core/utils/serverConfigUtils.h"
|
|
#include "core/utils/constants/apiKeys.h"
|
|
#include "core/utils/constants/apiConstants.h"
|
|
#include "core/utils/errorCodes.h"
|
|
#include "core/utils/routeModes.h"
|
|
#include "core/utils/commonStructs.h"
|
|
|
|
class SecureAppSettingsRepository;
|
|
|
|
namespace apiUtils
|
|
{
|
|
QString getAppLanguageCode(const SecureAppSettingsRepository *appSettingsRepository);
|
|
QString getDistributionChannel();
|
|
|
|
// Flag lookup: prefer serverCountryCodeL10n (ISO code from Stack); fall back to serverCountryCode
|
|
// for old stacks. Routing code may contain region/pool suffixes — strip at most one dash segment
|
|
// on fallback only. Returns upper-case ISO 3166-1 alpha-2 when possible.
|
|
QString getCountryFlagCode(const QString &serverCountryCodeL10n, const QString &serverCountryCode);
|
|
|
|
bool isSubscriptionExpired(const QString &subscriptionEndDate);
|
|
|
|
bool isSubscriptionExpiringSoon(const QString &subscriptionEndDate, int withinDays = 30);
|
|
|
|
bool isPremiumServer(const QJsonObject &serverConfigObject);
|
|
|
|
amnezia::ErrorCode checkApiResponseErrors(const QByteArray &responseBody);
|
|
|
|
QString getPremiumV2VpnKey(const QJsonObject &serverConfigObject);
|
|
}
|
|
|
|
#endif // APIUTILS_H
|