From e019c8027b95d8150e54d1de8f67261fe66918f6 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Thu, 5 Sep 2024 13:10:02 -0400 Subject: [PATCH] Improved APKPure compatibility by prioritizing APK when available (over XAPK) --- lib/app_sources/apkpure.dart | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/app_sources/apkpure.dart b/lib/app_sources/apkpure.dart index 3fe3237..fe5e549 100644 --- a/lib/app_sources/apkpure.dart +++ b/lib/app_sources/apkpure.dart @@ -109,11 +109,16 @@ class APKPure extends AppSource { '') ?.group(0) ?.trim(); - String? type = apkInfo - ?.querySelector('div.info-top span.tag') - ?.text - .trim() ?? - 'APK'; + var types = apkInfo + ?.querySelectorAll('div.info-top span.tag') + .map((e) => e.text.trim()) + .map((t) => t == 'APKs' ? 'APK' : t) ?? + []; + String type = types.length == 0 + ? 'APK' + : types.length == 1 + ? types.first + : types.last; String? dateString = apkInfo ?.querySelector('div.info-bottom span.time') ?.text