From 6e0819b0a7b664cab191ecc8957c7bf56c17916a Mon Sep 17 00:00:00 2001 From: bernikr Date: Mon, 19 May 2025 18:39:18 +0200 Subject: [PATCH] apkpure: only use nc query param if not empty --- lib/app_sources/apkpure.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/app_sources/apkpure.dart b/lib/app_sources/apkpure.dart index 1c66fb0..4a57552 100644 --- a/lib/app_sources/apkpure.dart +++ b/lib/app_sources/apkpure.dart @@ -87,9 +87,18 @@ class APKPure extends AppSource { type = 'APK'; } + var downloadUri = Uri.parse("https://d.cdnpure.com/b/$type/$appId"); + var queryParameters = { + "versionCode": versionCode, + }; + if (architectureString.isNotEmpty) { + queryParameters["nc"] = architectureString; + } + downloadUri = downloadUri.replace(queryParameters: queryParameters); + return MapEntry( '$appId-$versionCode-$architectureString.${type.toLowerCase()}', - 'https://d.cdnpure.com/b/$type/$appId?versionCode=$versionCode&nc=$architectureString'); + downloadUri.toString()); }) .nonNulls .toList()