Skip to content

Commit

Permalink
Support for more Huawei AppGallery URL schemes (#1570)
Browse files Browse the repository at this point in the history
  • Loading branch information
Imran Remtulla committed May 6, 2024
1 parent 8cee268 commit 0838a6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/app_sources/huaweiappgallery.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ 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;
}

@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) {
Expand All @@ -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<String, dynamic> additionalSettings) async {
Expand Down

0 comments on commit 0838a6d

Please sign in to comment.