Files
amnezia-client/client/core/utils/api/apiUtils.h
T
vkamn 693d00ded5 feat: use libagw (#3028)
* 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
2026-10-13 21:25:58 +08:00

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