Skip to content

Commit

Permalink
Merge pull request #1063 from ImranR98/dev
Browse files Browse the repository at this point in the history
Various bugfixes and minor enhancements (#454, #1026, #1050, #1052, #1060)
  • Loading branch information
ImranR98 authored Nov 3, 2023
2 parents bdc7d9d + b036758 commit 13aed69
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 52 deletions.
2 changes: 1 addition & 1 deletion lib/app_sources/fdroid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ APKDetails getAPKUrlsFromFDroidPackagesAPIResponse(
List<String> apkUrls = releaseChoices
.map((e) => '${apkUrlPrefix}_${e['versionCode']}.apk')
.toList();
return APKDetails(version, getApkUrlsFromUrls(apkUrls),
return APKDetails(version, getApkUrlsFromUrls(apkUrls.toSet().toList()),
AppNames(sourceName, Uri.parse(standardUrl).pathSegments.last));
} else {
throw getObtainiumHttpError(res);
Expand Down
3 changes: 2 additions & 1 deletion lib/app_sources/fdroidrepo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ class FDroidRepo extends AppSource {
if (appIdOrName == null) {
throw NoReleasesError();
}
var res = await sourceRequest('$standardUrl/index.xml');
var res = await sourceRequest(
'$standardUrl${standardUrl.endsWith('/index.xml') ? '' : '/index.xml'}');
if (res.statusCode == 200) {
var body = parse(res.body);
var foundApps = body.querySelectorAll('application').where((element) {
Expand Down
8 changes: 8 additions & 0 deletions lib/app_sources/html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,15 @@ class HTML extends AppSource {
List<String> allLinks = html
.querySelectorAll('a')
.map((element) => element.attributes['href'] ?? '')
.where((element) => element.isNotEmpty)
.toList();
if (allLinks.isEmpty) {
allLinks = RegExp(
r'(http|ftp|https)://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?')
.allMatches(res.body)
.map((match) => match.group(0)!)
.toList();
}
List<String> links = [];
if ((additionalSettings['intermediateLinkRegex'] as String?)
?.isNotEmpty ==
Expand Down
8 changes: 4 additions & 4 deletions lib/app_sources/uptodown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ class Uptodown extends AppSource {
throw getObtainiumHttpError(res);
}
var html = parse(res.body);
var finalUrl =
(html.querySelector('.post-download')?.attributes['data-url']);
if (finalUrl == null) {
var finalUrlKey =
html.querySelector('.post-download')?.attributes['data-url'];
if (finalUrlKey == null) {
throw NoAPKError();
}
return finalUrl;
return 'https://dw.$host/dwn/$finalUrlKey';
}
}
4 changes: 3 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart';
// ignore: implementation_imports
import 'package:easy_localization/src/localization.dart';

const String currentVersion = '0.14.31';
const String currentVersion = '0.14.32';
const String currentReleaseTag =
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES

Expand All @@ -40,6 +40,8 @@ List<MapEntry<Locale, String>> supportedLocales = const [
MapEntry(Locale('bs'), 'Bosanski'),
MapEntry(Locale('pt'), 'Brasileiro'),
MapEntry(Locale('cs'), 'Česky'),
MapEntry(Locale('sv'), 'Svenska'),
MapEntry(Locale('nl'), 'Nederlands'),
];
const fallbackLocale = Locale('en');
const localeDir = 'assets/translations';
Expand Down
27 changes: 15 additions & 12 deletions lib/pages/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,13 @@ class _AppPageState extends State<AppPage> {
const SizedBox(height: 20),
app?.icon != null
? Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Image.memory(
app!.icon!,
height: 150,
gaplessPlayback: true,
GestureDetector(
child: Image.memory(
app!.icon!,
height: 150,
gaplessPlayback: true,
),
onTap: () => pm.openApp(app.app.id),
)
])
: Container(),
Expand Down Expand Up @@ -463,15 +466,15 @@ class _AppPageState extends State<AppPage> {
: null))
],
));

appScreenAppBar() => AppBar(
leading: IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () {
Navigator.pop(context);
},
),
);
leading: IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () {
Navigator.pop(context);
},
),
);

return Scaffold(
appBar: settingsProvider.showAppWebpage ? AppBar() : appScreenAppBar(),
Expand Down
5 changes: 1 addition & 4 deletions lib/providers/source_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,6 @@ preStandardizeUrl(String url) {
url.toLowerCase().indexOf('https://') != 0) {
url = 'https://$url';
}
if (url.toLowerCase().indexOf('https://www.') == 0) {
url = 'https://${url.substring(12)}';
}
url = url
.split('/')
.where((e) => e.isNotEmpty)
Expand Down Expand Up @@ -599,7 +596,7 @@ class SourceProvider {
AppSource? source;
for (var s in sources.where((element) => element.host != null)) {
if (RegExp(
'://${s.allowSubDomains ? '([^\\.]+\\.)*' : ''}${s.host}(/|\\z)?')
'://(${s.allowSubDomains ? '([^\\.]+\\.)*' : ''}|www\\.)${s.host}(/|\\z)?')
.hasMatch(url)) {
source = s;
break;
Expand Down
56 changes: 28 additions & 28 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
sha256: ad76540d21c066228ee3f9d1dad64a9f7e46530e8bb7c85011a88bc1fd874bc5
sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7
url: "https://pub.dev"
source: hosted
version: "3.0.0"
version: "3.0.1"
flutter_local_notifications:
dependency: "direct main"
description:
Expand Down Expand Up @@ -328,10 +328,10 @@ packages:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: f185ac890306b5779ecbd611f52502d8d4d63d27703ef73161ca0407e815f02c
sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da
url: "https://pub.dev"
source: hosted
version: "2.0.16"
version: "2.0.17"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -498,10 +498,10 @@ packages:
dependency: transitive
description:
name: path_provider_android
sha256: "6b8b19bd80da4f11ce91b2d1fb931f3006911477cec227cce23d3253d80df3f1"
sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72
url: "https://pub.dev"
source: hosted
version: "2.2.0"
version: "2.2.1"
path_provider_foundation:
dependency: transitive
description:
Expand Down Expand Up @@ -799,66 +799,66 @@ packages:
dependency: "direct main"
description:
name: url_launcher
sha256: "47e208a6711459d813ba18af120d9663c20bdf6985d6ad39fe165d2538378d27"
sha256: b1c9e98774adf8820c96fbc7ae3601231d324a7d5ebd8babe27b6dfac91357ba
url: "https://pub.dev"
source: hosted
version: "6.1.14"
version: "6.2.1"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: b04af59516ab45762b2ca6da40fa830d72d0f6045cd97744450b73493fa76330
sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def"
url: "https://pub.dev"
source: hosted
version: "6.1.0"
version: "6.2.0"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: "7c65021d5dee51813d652357bc65b8dd4a6177082a9966bc8ba6ee477baa795f"
sha256: "4ac97281cf60e2e8c5cc703b2b28528f9b50c8f7cebc71df6bdf0845f647268a"
url: "https://pub.dev"
source: hosted
version: "6.1.5"
version: "6.2.0"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: b651aad005e0cb06a01dbd84b428a301916dc75f0e7ea6165f80057fee2d8e8e
sha256: "9f2d390e096fdbe1e6e6256f97851e51afc2d9c423d3432f1d6a02a8a9a8b9fd"
url: "https://pub.dev"
source: hosted
version: "3.0.6"
version: "3.1.0"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: b55486791f666e62e0e8ff825e58a023fd6b1f71c49926483f1128d3bbd8fe88
sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234
url: "https://pub.dev"
source: hosted
version: "3.0.7"
version: "3.1.0"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: "95465b39f83bfe95fcb9d174829d6476216f2d548b79c38ab2506e0458787618"
sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50"
url: "https://pub.dev"
source: hosted
version: "2.1.5"
version: "2.2.0"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
sha256: "2942294a500b4fa0b918685aff406773ba0a4cd34b7f42198742a94083020ce5"
sha256: "7fd2f55fe86cea2897b963e864dc01a7eb0719ecc65fcef4c1cc3d686d718bb2"
url: "https://pub.dev"
source: hosted
version: "2.0.20"
version: "2.2.0"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: "95fef3129dc7cfaba2bc3d5ba2e16063bb561fc6d78e63eee16162bc70029069"
sha256: "7754a1ad30ee896b265f8d14078b0513a4dba28d358eabb9d5f339886f4a1adc"
url: "https://pub.dev"
source: hosted
version: "3.0.8"
version: "3.1.0"
uuid:
dependency: transitive
description:
Expand Down Expand Up @@ -887,18 +887,18 @@ packages:
dependency: "direct main"
description:
name: webview_flutter
sha256: c1ab9b81090705c6069197d9fdc1625e587b52b8d70cdde2339d177ad0dbb98e
sha256: "42393b4492e629aa3a88618530a4a00de8bb46e50e7b3993fedbfdc5352f0dbf"
url: "https://pub.dev"
source: hosted
version: "4.4.1"
version: "4.4.2"
webview_flutter_android:
dependency: transitive
description:
name: webview_flutter_android
sha256: b0cd33dd7d3dd8e5f664e11a19e17ba12c352647269921a3b568406b001f1dff
sha256: "8326ee235f87605a2bfc444a4abc897f4abc78d83f054ba7d3d1074ce82b4fbf"
url: "https://pub.dev"
source: hosted
version: "3.12.0"
version: "3.12.1"
webview_flutter_platform_interface:
dependency: transitive
description:
Expand All @@ -911,10 +911,10 @@ packages:
dependency: transitive
description:
name: webview_flutter_wkwebview
sha256: "30b9af6bdd457b44c08748b9190d23208b5165357cc2eb57914fee1366c42974"
sha256: af6f5ab05918070b33507b0d453ba9fb7d39338a3256c23cf9433dc68100774a
url: "https://pub.dev"
source: hosted
version: "3.9.1"
version: "3.9.3"
win32:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
# 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.
version: 0.14.31+223 # When changing this, update the tag in main() accordingly
version: 0.14.32+226 # When changing this, update the tag in main() accordingly

environment:
sdk: '>=3.0.0 <4.0.0'
Expand Down

0 comments on commit 13aed69

Please sign in to comment.