mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-22 05:59:30 +02:00
Merge pull request #1774 from ImranR98/dev
- Fix bug introduced in v1.1.16: APKPure fails to find universal APKs - Fix bugs found in APKPure URL matching
This commit is contained in:
@@ -25,9 +25,9 @@ Currently supported App sources:
|
|||||||
- [APKPure](https://apkpure.net/)
|
- [APKPure](https://apkpure.net/)
|
||||||
- [Aptoide](https://aptoide.com/)
|
- [Aptoide](https://aptoide.com/)
|
||||||
- [Uptodown](https://uptodown.com/)
|
- [Uptodown](https://uptodown.com/)
|
||||||
- [APKMirror](https://apkmirror.com/) (Track-Only)
|
|
||||||
- [Huawei AppGallery](https://appgallery.huawei.com/)
|
- [Huawei AppGallery](https://appgallery.huawei.com/)
|
||||||
- Jenkins Jobs
|
- Jenkins Jobs
|
||||||
|
- [APKMirror](https://apkmirror.com/) (Track-Only)
|
||||||
- Open Source - App-Specific:
|
- Open Source - App-Specific:
|
||||||
- [Signal](https://signal.org/)
|
- [Signal](https://signal.org/)
|
||||||
- [VLC](https://videolan.org/)
|
- [VLC](https://videolan.org/)
|
||||||
|
@@ -31,14 +31,15 @@ class APKPure extends AppSource {
|
|||||||
@override
|
@override
|
||||||
String sourceSpecificStandardizeURL(String url) {
|
String sourceSpecificStandardizeURL(String url) {
|
||||||
RegExp standardUrlRegExB = RegExp(
|
RegExp standardUrlRegExB = RegExp(
|
||||||
'^https?://m.${getSourceRegex(hosts)}/+[^/]+/+[^/]+(/+[^/]+)?',
|
'^https?://m.${getSourceRegex(hosts)}(/+[^/]{2})?/+[^/]+/+[^/]+',
|
||||||
caseSensitive: false);
|
caseSensitive: false);
|
||||||
RegExpMatch? match = standardUrlRegExB.firstMatch(url);
|
RegExpMatch? match = standardUrlRegExB.firstMatch(url);
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
url = 'https://${getSourceRegex(hosts)}${Uri.parse(url).path}';
|
var uri = Uri.parse(url);
|
||||||
|
url = 'https://${uri.host.substring(2)}${uri.path}';
|
||||||
}
|
}
|
||||||
RegExp standardUrlRegExA = RegExp(
|
RegExp standardUrlRegExA = RegExp(
|
||||||
'^https?://(www\\.)?${getSourceRegex(hosts)}/+[^/]+/+[^/]+(/+[^/]+)?',
|
'^https?://(www\\.)?${getSourceRegex(hosts)}(/+[^/]{2})?/+[^/]+/+[^/]+',
|
||||||
caseSensitive: false);
|
caseSensitive: false);
|
||||||
match = standardUrlRegExA.firstMatch(url);
|
match = standardUrlRegExA.firstMatch(url);
|
||||||
if (match == null) {
|
if (match == null) {
|
||||||
@@ -93,7 +94,11 @@ class APKPure extends AppSource {
|
|||||||
var apkUrls = apksDiv
|
var apkUrls = apksDiv
|
||||||
?.querySelectorAll('div.group-title')
|
?.querySelectorAll('div.group-title')
|
||||||
.map((e) {
|
.map((e) {
|
||||||
String? architecture = e.text.trim();
|
String architecture = e.text.trim();
|
||||||
|
if (architecture.toLowerCase() == 'unlimited' ||
|
||||||
|
architecture.toLowerCase() == 'universal') {
|
||||||
|
architecture = '';
|
||||||
|
}
|
||||||
// Only take the first APK for each architecture, ignore others for now, for simplicity
|
// Only take the first APK for each architecture, ignore others for now, for simplicity
|
||||||
// Unclear why there can even be multiple APKs for the same version and arch
|
// Unclear why there can even be multiple APKs for the same version and arch
|
||||||
var apkInfo = e.nextElementSibling?.querySelector('div.info');
|
var apkInfo = e.nextElementSibling?.querySelector('div.info');
|
||||||
@@ -116,6 +121,7 @@ class APKPure extends AppSource {
|
|||||||
DateTime? releaseDate =
|
DateTime? releaseDate =
|
||||||
parseDateTimeMMMddCommayyyy(dateString);
|
parseDateTimeMMMddCommayyyy(dateString);
|
||||||
if (additionalSettings['autoApkFilterByArch'] == true &&
|
if (additionalSettings['autoApkFilterByArch'] == true &&
|
||||||
|
architecture.isNotEmpty &&
|
||||||
!supportedArchs.contains(architecture)) {
|
!supportedArchs.contains(architecture)) {
|
||||||
return const MapEntry('', '');
|
return const MapEntry('', '');
|
||||||
}
|
}
|
||||||
|
@@ -763,9 +763,9 @@ class SourceProvider {
|
|||||||
APKPure(),
|
APKPure(),
|
||||||
Aptoide(),
|
Aptoide(),
|
||||||
Uptodown(),
|
Uptodown(),
|
||||||
APKMirror(),
|
|
||||||
HuaweiAppGallery(),
|
HuaweiAppGallery(),
|
||||||
Jenkins(),
|
Jenkins(),
|
||||||
|
APKMirror(),
|
||||||
Signal(),
|
Signal(),
|
||||||
VLC(),
|
VLC(),
|
||||||
WhatsApp(),
|
WhatsApp(),
|
||||||
|
@@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.1.16+2273
|
version: 1.1.17+2274
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.0.0 <4.0.0'
|
sdk: '>=3.0.0 <4.0.0'
|
||||||
|
Reference in New Issue
Block a user