Compare commits

..
Author SHA1 Message Date
vkamn c71e65d9cd chore: minor fixes (#3493)
* fix: keep TestFlight upload going while another build is in beta review

* chore: drop cisco, asus, logitech, dropbox and speedtest from default SNI list

* fix: keep safe area when screenshots are disallowed

* chore: bump version
2026-11-19 12:56:22 +09:00
vkamn 5aff2ce580 fix: run deploy jobs with always() and check build results in a step (#3483) 2026-11-17 02:03:55 +09:00
vkamn 41a6757042 fix: gate deploy jobs on always() with explicit build result checks (#3482) 2026-11-17 01:20:54 +09:00
vkamn f0b12257ab chore: minor fixes (#3481)
* fix: distribute TestFlight builds to the test-external group

* chore: bump version
2026-11-16 22:10:45 +09:00
14 changed files with 74 additions and 191 deletions

No files matched your search

+27 -11
View File
@@ -1695,13 +1695,21 @@ jobs:
# ------------------------------------------------------
Pre-Release:
if: ${{ !cancelled() && startsWith(github.ref, 'refs/tags/') && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'skipped') }}
if: ${{ always() && startsWith(github.ref, 'refs/tags/') }}
needs: [Build-Linux-Ubuntu, Build-Windows, Build-iOS, Build-MacOS, Build-MacOS-NE, Build-Android]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 'Check builds'
working-directory: .
env:
NEEDS: ${{ toJSON(needs) }}
run: |
jq -c 'map_values(.result)' <<< "$NEEDS"
jq -e 'all(.[]; .result == "success" or .result == "skipped")' <<< "$NEEDS"
- name: 'Get release notes template'
uses: actions/checkout@v4
with:
@@ -1722,14 +1730,6 @@ jobs:
path: dist
merge-multiple: true
- name: 'Compute SHA-256 checksums'
working-directory: dist
run: |
for f in *; do
sha256sum "$f" > "$f.sha256"
done
cat *.sha256
- name: 'Publish pre-release'
env:
GH_TOKEN: ${{ github.token }}
@@ -1750,7 +1750,7 @@ jobs:
# ------------------------------------------------------
TestFlight:
if: ${{ !cancelled() && startsWith(github.ref, 'refs/tags/') && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'skipped') }}
if: ${{ always() && startsWith(github.ref, 'refs/tags/') }}
needs: [Build-Linux-Ubuntu, Build-Windows, Build-iOS, Build-MacOS, Build-MacOS-NE, Build-Android]
runs-on: macos-26
@@ -1765,6 +1765,14 @@ jobs:
shell: bash
steps:
- name: 'Check builds'
working-directory: .
env:
NEEDS: ${{ toJSON(needs) }}
run: |
jq -c 'map_values(.result)' <<< "$NEEDS"
jq -e 'all(.[]; .result == "success" or .result == "skipped")' <<< "$NEEDS"
- name: 'Get fastlane config'
uses: actions/checkout@v4
with:
@@ -1794,7 +1802,7 @@ jobs:
# ------------------------------------------------------
Google-Play:
if: ${{ !cancelled() && startsWith(github.ref, 'refs/tags/') && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'skipped') }}
if: ${{ always() && startsWith(github.ref, 'refs/tags/') }}
needs: [Build-Linux-Ubuntu, Build-Windows, Build-iOS, Build-MacOS, Build-MacOS-NE, Build-Android]
runs-on: ubuntu-24.04
@@ -1804,6 +1812,14 @@ jobs:
shell: bash
steps:
- name: 'Check builds'
working-directory: .
env:
NEEDS: ${{ toJSON(needs) }}
run: |
jq -c 'map_values(.result)' <<< "$NEEDS"
jq -e 'all(.[]; .result == "success" or .result == "skipped")' <<< "$NEEDS"
- name: 'Get fastlane config'
uses: actions/checkout@v4
with:
+2 -2
View File
@@ -5,7 +5,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(PROJECT AmneziaVPN)
if(NOT AMNEZIAVPN_VERSION)
set(AMNEZIAVPN_VERSION 5.1.1.6 CACHE STRING "Client app version")
set(AMNEZIAVPN_VERSION 5.1.1.10 CACHE STRING "Client app version")
endif()
set(QT_CREATOR_SKIP_PACKAGE_MANAGER_SETUP ON CACHE BOOL "" FORCE)
@@ -34,7 +34,7 @@ set(RELEASE_DATE "${CURRENT_DATE}")
set(APP_MAJOR_VERSION ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH})
# bump by 2 on every release, because we're releasing two versions on the play store
set(APP_ANDROID_VERSION_CODE 2192)
set(APP_ANDROID_VERSION_CODE 2194)
if(DEFINED APP_ANDROID_VERSION_CODE_OFFSET)
math(EXPR APP_ANDROID_VERSION_CODE "${APP_ANDROID_VERSION_CODE} + ${APP_ANDROID_VERSION_CODE_OFFSET}")
endif()
-1
View File
@@ -98,7 +98,6 @@ android {
}
getByName("oss") {
manifest.srcFile("oss/AndroidManifest.xml")
java.setSrcDirs(listOf("oss"))
}
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
</manifest>
@@ -806,29 +806,6 @@ class AmneziaActivity : QtActivity() {
}
}
@Suppress("unused")
fun installApk(path: String) {
Log.d(TAG, "Install apk $path")
mainScope.launch {
val uri = try {
FileProvider.getUriForFile(this@AmneziaActivity, FILE_PROVIDER_AUTHORITY, File(path))
} catch (e: IllegalArgumentException) {
Log.e(TAG, "Failed to install apk $path: $e")
return@launch
}
Intent(Intent.ACTION_VIEW).apply {
setDataAndType(uri, "application/vnd.android.package-archive")
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
}.also {
try {
startActivity(it)
} catch (_: ActivityNotFoundException) {
Toast.makeText(this@AmneziaActivity, "Unsupported", Toast.LENGTH_LONG).show()
}
}
}
}
@Suppress("unused")
fun openFile(filter: String?) {
Log.v(TAG, "Open file with filter: $filter")
+36 -121
View File
@@ -1,16 +1,12 @@
#include "updateController.h"
#include <QCryptographicHash>
#include <QDesktopServices>
#include <QDir>
#include <QFileInfo>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QNetworkReply>
#include <QTimer>
#include <QUrl>
#include <QStandardPaths>
#include "amneziaApplication.h"
#include "logger.h"
@@ -22,8 +18,6 @@
#include "core/utils/selfhosted/scriptsRegistry.h"
#if defined(Q_OS_ANDROID)
#include <QOperatingSystemVersion>
#include "platforms/android/android_controller.h"
#endif
@@ -32,73 +26,14 @@ namespace
Logger logger("UpdateController");
#if defined(Q_OS_WINDOWS)
QString installerRemoteFileName(const QString &version)
{
return QStringLiteral("AmneziaVPN_%1_windows_x64.exe").arg(version);
}
QString installerLocalPath()
{
return QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/AmneziaVPN_installer.exe";
}
const QLatin1String kInstallerRemoteFileNamePattern("AmneziaVPN_%1_windows_x64.exe");
const QString kInstallerLocalPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/AmneziaVPN_installer.exe";
#elif defined(Q_OS_MACOS) && !defined(MACOS_NE)
QString installerRemoteFileName(const QString &version)
{
return QStringLiteral("AmneziaVPN_%1_macos_x64.pkg").arg(version);
}
QString installerLocalPath()
{
return QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/AmneziaVPN.pkg";
}
#elif defined(Q_OS_ANDROID)
#if defined(Q_PROCESSOR_ARM_64)
const QLatin1String kAndroidAbi("arm64-v8a");
#elif defined(Q_PROCESSOR_ARM_32)
const QLatin1String kAndroidAbi("armeabi-v7a");
#elif defined(Q_PROCESSOR_X86_64)
const QLatin1String kAndroidAbi("x86_64");
#elif defined(Q_PROCESSOR_X86_32)
const QLatin1String kAndroidAbi("x86");
#endif
QString installerRemoteFileName(const QString &version)
{
const QLatin1String osLabel = QOperatingSystemVersion::current() >= QOperatingSystemVersion::Android11
? QLatin1String("android11+")
: QLatin1String("android9-10");
return QStringLiteral("AmneziaVPN_%1_%2_%3.apk").arg(version, osLabel, kAndroidAbi);
}
QString installerLocalPath()
{
return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/update/AmneziaVPN.apk";
}
bool isSha256Hex(const QByteArray &hash)
{
return hash.size() == 64 && QByteArray::fromHex(hash).toHex() == hash;
}
#elif defined(Q_OS_LINUX)
QString installerRemoteFileName(const QString &version)
{
return QStringLiteral("AmneziaVPN_%1_linux_x64.run").arg(version);
}
QString installerLocalPath()
{
return QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/AmneziaVPN.run";
}
#endif
#if !defined(Q_OS_IOS) && !defined(MACOS_NE)
QNetworkReply *requestDownload(const QString &url)
{
QNetworkRequest request;
request.setTransferTimeout(30000);
request.setUrl(QUrl(url));
return amnApp->networkManager()->get(request);
}
const QLatin1String kInstallerRemoteFileNamePattern("AmneziaVPN_%1_macos_x64.pkg");
const QString kInstallerLocalPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/AmneziaVPN.pkg";
#elif defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
const QLatin1String kInstallerRemoteFileNamePattern("AmneziaVPN_%1_linux_x64.run");
const QString kInstallerLocalPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/AmneziaVPN.run";
#endif
QStringList stringListFromJsonValue(const QJsonValue &value)
@@ -241,14 +176,7 @@ void UpdateController::checkForUpdates()
if (m_downloadBaseUrl.endsWith('/')) {
m_downloadBaseUrl.chop(1);
}
#if defined(Q_OS_ANDROID)
m_installerSha256 = gatewayData.value(apiDefs::key::checksums)
.toObject()
.value(installerRemoteFileName(m_version))
.toString()
.toLower()
.toLatin1();
#endif
m_releasePageUrl = gatewayData.value(apiDefs::key::releasePageUrl).toString();
if (m_version.isEmpty()) {
logger.error() << "Update response has no version, ignoring";
@@ -282,18 +210,27 @@ void UpdateController::startUpdate()
return;
}
#if !defined(Q_OS_IOS) && !defined(MACOS_NE)
#if defined(Q_OS_ANDROID)
// GitHub build on Android: open the release page in a browser, the system downloads the APK.
if (m_releasePageUrl.isEmpty()) {
logger.error() << "Release page URL is empty";
setUpdateState(UpdateState::State::DownloadError);
return;
}
QDesktopServices::openUrl(QUrl(m_releasePageUrl));
#elif !defined(Q_OS_IOS) && !defined(MACOS_NE)
downloadInstaller();
#endif
}
QString UpdateController::composeDownloadUrl() const
{
#if !defined(Q_OS_IOS) && !defined(MACOS_NE)
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) && !defined(MACOS_NE)
if (m_downloadBaseUrl.isEmpty() || m_version.isEmpty()) {
return QString();
}
return m_downloadBaseUrl + "/" + QString::fromLatin1(QUrl::toPercentEncoding(installerRemoteFileName(m_version)));
const QString fileName = QString(kInstallerRemoteFileNamePattern).arg(m_version);
return m_downloadBaseUrl + "/" + fileName;
#else
return QString();
#endif
@@ -301,7 +238,7 @@ QString UpdateController::composeDownloadUrl() const
void UpdateController::downloadInstaller()
{
#if !defined(Q_OS_IOS) && !defined(MACOS_NE)
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) && !defined(MACOS_NE)
if (m_updateState == UpdateState::State::Downloading) {
return;
}
@@ -313,25 +250,15 @@ void UpdateController::downloadInstaller()
return;
}
#if defined(Q_OS_ANDROID)
if (!isSha256Hex(m_installerSha256)) {
logger.error() << "Update response has no valid checksum for the installer";
setUpdateState(UpdateState::State::DownloadError);
return;
}
#endif
setUpdateState(UpdateState::State::Downloading);
downloadInstallerFile(downloadUrl, m_installerSha256);
#endif
}
void UpdateController::downloadInstallerFile(const QString &downloadUrl, const QByteArray &expectedSha256)
{
#if !defined(Q_OS_IOS) && !defined(MACOS_NE)
QNetworkReply *reply = requestDownload(downloadUrl);
QNetworkRequest request;
request.setTransferTimeout(30000);
request.setUrl(QUrl(downloadUrl));
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, expectedSha256]() {
QNetworkReply *reply = amnApp->networkManager()->get(request);
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply]() {
reply->deleteLater();
if (reply->error() != QNetworkReply::NoError) {
@@ -342,26 +269,16 @@ void UpdateController::downloadInstallerFile(const QString &downloadUrl, const Q
return;
}
const QByteArray data = reply->readAll();
if (!expectedSha256.isEmpty() && QCryptographicHash::hash(data, QCryptographicHash::Sha256).toHex() != expectedSha256) {
logger.error() << "Installer checksum mismatch";
setUpdateState(UpdateState::State::DownloadError);
return;
}
const QString localPath = installerLocalPath();
QDir().mkpath(QFileInfo(localPath).absolutePath());
QFile file(localPath);
QFile file(kInstallerLocalPath);
if (!file.open(QIODevice::WriteOnly)) {
logger.error() << "Failed to open installer file for writing:" << localPath
logger.error() << "Failed to open installer file for writing:" << kInstallerLocalPath
<< "Error:" << file.errorString();
setUpdateState(UpdateState::State::DownloadError);
return;
}
if (file.write(data) == -1) {
logger.error() << "Failed to write installer data to file:" << localPath
if (file.write(reply->readAll()) == -1) {
logger.error() << "Failed to write installer data to file:" << kInstallerLocalPath
<< "Error:" << file.errorString();
file.close();
setUpdateState(UpdateState::State::DownloadError);
@@ -376,20 +293,18 @@ void UpdateController::downloadInstallerFile(const QString &downloadUrl, const Q
void UpdateController::installUpdate()
{
#if !defined(Q_OS_IOS) && !defined(MACOS_NE)
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) && !defined(MACOS_NE)
if (m_updateState != UpdateState::State::ReadyToInstall) {
logger.error() << "Installer is not downloaded yet";
return;
}
#if defined(Q_OS_WINDOWS)
runWindowsInstaller(installerLocalPath());
runWindowsInstaller(kInstallerLocalPath);
#elif defined(Q_OS_MACOS) && !defined(MACOS_NE)
runMacInstaller(installerLocalPath());
#elif defined(Q_OS_ANDROID)
AndroidController::instance()->installApk(installerLocalPath());
#elif defined(Q_OS_LINUX)
runLinuxInstaller(installerLocalPath());
runMacInstaller(kInstallerLocalPath);
#elif defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
runLinuxInstaller(kInstallerLocalPath);
#endif
#endif
}
+1 -2
View File
@@ -58,7 +58,6 @@ private:
void setUpdateState(UpdateState::State state);
void setUpdateCheckRunning(bool running);
void downloadInstaller();
void downloadInstallerFile(const QString &downloadUrl, const QByteArray &expectedSha256);
QString composeDownloadUrl() const;
void openStorePage() const;
@@ -72,7 +71,7 @@ private:
QStringList m_improvements;
QStringList m_bugFixes;
QString m_downloadBaseUrl;
QByteArray m_installerSha256;
QString m_releasePageUrl;
UpdateState::State m_updateState = UpdateState::State::Idle;
bool m_updateCheckRunning = false;
+1 -1
View File
@@ -92,7 +92,7 @@ namespace apiDefs
constexpr QLatin1String improvements("improvements");
constexpr QLatin1String bugFixes("bug_fixes");
constexpr QLatin1String downloadBaseUrl("download_base_url");
constexpr QLatin1String checksums("checksums");
constexpr QLatin1String releasePageUrl("release_page_url");
constexpr QLatin1String publicKeyInfo("public_key");
constexpr QLatin1String publicKey("public_key");
@@ -65,13 +65,8 @@ namespace amnezia
"www.bing.com",
"www.samsung.com",
"www.nvidia.com",
"www.cisco.com",
"www.asus.com",
"www.logitech.com",
"www.dropbox.com",
"www.mozilla.org",
"addons.mozilla.org",
"www.speedtest.net",
};
constexpr char defaultPort[] = "443";
@@ -202,11 +202,6 @@ void AndroidController::shareFile(const QString &path, const QString &mime)
QJniObject::fromString(mime).object<jstring>());
}
void AndroidController::installApk(const QString &path)
{
callActivityMethod("installApk", "(Ljava/lang/String;)V", QJniObject::fromString(path).object<jstring>());
}
QString AndroidController::openFile(const QString &filter)
{
QEventLoop wait;
@@ -36,7 +36,6 @@ public:
void saveFile(const QString &fileName, const QString &data);
bool saveFile(const QString &fileName, const QByteArray &data, const QString &mime, bool *cancelled = nullptr);
void shareFile(const QString &path, const QString &mime);
void installApk(const QString &path);
QString openFile(const QString &filter);
int getFd(const QString &fileName);
void closeFd();
+3 -4
View File
@@ -81,9 +81,8 @@ class ScreenProtection {
public func enable(for view: UIView) {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
view.subviews.forEach {
self.pairs.append(ProtectionPair(from: $0))
}
guard self.pairs.isEmpty else { return }
self.pairs.append(ProtectionPair(from: view))
}
}
@@ -128,7 +127,7 @@ struct ProtectionPair {
}
func removeProtection() {
textField.superview?.superview?.layer.addSublayer(layer)
textField.layer.superlayer?.insertSublayer(layer, above: textField.layer)
textField.layer.removeFromSuperlayer()
textField.removeFromSuperview()
}
-8
View File
@@ -38,14 +38,6 @@ download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${
download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_macos_x64.pkg
download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/AmneziaVPN_${VERSION}_windows_x64.exe
for label in android11+ android9-10; do
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
apk=AmneziaVPN_${VERSION}_${label}_${abi}.apk
download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/${apk}
download_file https://github.com/amnezia-vpn/amnezia-client/releases/download/${VERSION}/${apk}.sha256
done
done
cd ../
echo "Syncing to R2..."
+4 -1
View File
@@ -36,9 +36,12 @@ def upload_to_external_testers(package)
upload_to_testflight(
**package,
distribute_external: true,
groups: ["test"],
groups: ["test-external"],
changelog: "Improve stability"
)
rescue Spaceship::UnexpectedResponse => e
raise unless e.message.include?("already in beta review")
UI.important(e.message)
end
platform :ios do