mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-11-09 17:43:29 +01:00
Support for more Huawei AppGallery URL schemes (#1570)
This commit is contained in:
@@ -6,7 +6,7 @@ import 'package:obtainium/providers/source_provider.dart';
|
|||||||
class HuaweiAppGallery extends AppSource {
|
class HuaweiAppGallery extends AppSource {
|
||||||
HuaweiAppGallery() {
|
HuaweiAppGallery() {
|
||||||
name = 'Huawei AppGallery';
|
name = 'Huawei AppGallery';
|
||||||
hosts = ['appgallery.huawei.com'];
|
hosts = ['appgallery.huawei.com', 'appgallery.cloud.huawei.com'];
|
||||||
versionDetectionDisallowed = true;
|
versionDetectionDisallowed = true;
|
||||||
showReleaseDateAsVersionToggle = true;
|
showReleaseDateAsVersionToggle = true;
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@ class HuaweiAppGallery extends AppSource {
|
|||||||
@override
|
@override
|
||||||
String sourceSpecificStandardizeURL(String url) {
|
String sourceSpecificStandardizeURL(String url) {
|
||||||
RegExp standardUrlRegEx = RegExp(
|
RegExp standardUrlRegEx = RegExp(
|
||||||
'^https?://(www\\.)?${getSourceRegex(hosts)}/app/[^/]+',
|
'^https?://(www\\.)?${getSourceRegex(hosts)}(/#)?/(app|appdl)/[^/]+',
|
||||||
caseSensitive: false);
|
caseSensitive: false);
|
||||||
RegExpMatch? match = standardUrlRegEx.firstMatch(url);
|
RegExpMatch? match = standardUrlRegEx.firstMatch(url);
|
||||||
if (match == null) {
|
if (match == null) {
|
||||||
@@ -24,7 +24,7 @@ class HuaweiAppGallery extends AppSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getDlUrl(String standardUrl) =>
|
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(
|
requestAppdlRedirect(
|
||||||
String dlUrl, Map<String, dynamic> additionalSettings) async {
|
String dlUrl, Map<String, dynamic> additionalSettings) async {
|
||||||
|
|||||||
Reference in New Issue
Block a user