From 0838a6d30bbd7ca78b0e3d2a8e14d204380d264f Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sun, 5 May 2024 21:51:05 -0400 Subject: [PATCH] Support for more Huawei AppGallery URL schemes (#1570) --- lib/app_sources/huaweiappgallery.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/app_sources/huaweiappgallery.dart b/lib/app_sources/huaweiappgallery.dart index 203b79f..8948faf 100644 --- a/lib/app_sources/huaweiappgallery.dart +++ b/lib/app_sources/huaweiappgallery.dart @@ -6,7 +6,7 @@ import 'package:obtainium/providers/source_provider.dart'; class HuaweiAppGallery extends AppSource { HuaweiAppGallery() { name = 'Huawei AppGallery'; - hosts = ['appgallery.huawei.com']; + hosts = ['appgallery.huawei.com', 'appgallery.cloud.huawei.com']; versionDetectionDisallowed = true; showReleaseDateAsVersionToggle = true; } @@ -14,7 +14,7 @@ class HuaweiAppGallery extends AppSource { @override String sourceSpecificStandardizeURL(String url) { RegExp standardUrlRegEx = RegExp( - '^https?://(www\\.)?${getSourceRegex(hosts)}/app/[^/]+', + '^https?://(www\\.)?${getSourceRegex(hosts)}(/#)?/(app|appdl)/[^/]+', caseSensitive: false); RegExpMatch? match = standardUrlRegEx.firstMatch(url); if (match == null) { @@ -24,7 +24,7 @@ class HuaweiAppGallery extends AppSource { } getDlUrl(String standardUrl) => - 'https://${hosts[0].replaceAll('appgallery.', 'appgallery.cloud.')}/appdl/${standardUrl.split('/').last}'; + 'https://${hosts[0].replaceAll('appgallery.huawei', 'appgallery.cloud.huawei')}/appdl/${standardUrl.split('/').last}'; requestAppdlRedirect( String dlUrl, Map additionalSettings) async {