Merge pull request #472 from ImranR98/dev

Bugfix in getting APK name from URL (affected Sourceforge and potentially others)
This commit is contained in:
Imran Remtulla
2023-04-15 14:43:02 -04:00
committed by GitHub
4 changed files with 9 additions and 7 deletions

View File

@@ -31,7 +31,7 @@ class SourceForge extends AppSource {
getVersion(String url) {
try {
var tokens = url.split('/');
return tokens[tokens.length - 3];
return tokens[tokens.length - 2];
} catch (e) {
return null;
}

View File

@@ -21,7 +21,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart';
// ignore: implementation_imports
import 'package:easy_localization/src/localization.dart';
const String currentVersion = '0.11.31';
const String currentVersion = '0.11.32';
const String currentReleaseTag =
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES

View File

@@ -266,10 +266,12 @@ Map<String, dynamic> getDefaultValuesFromFormItems(
.reduce((value, element) => [...value, ...element]));
}
getApkUrlsFromUrls(List<String> urls) => urls
.map((e) =>
MapEntry(e.split('/').where((el) => el.trim().isNotEmpty).last, e))
.toList();
List<MapEntry<String, String>> getApkUrlsFromUrls(List<String> urls) =>
urls.map((e) {
var segments = e.split('/').where((el) => el.trim().isNotEmpty);
var apkSegs = segments.where((s) => s.toLowerCase().endsWith('.apk'));
return MapEntry(apkSegs.isNotEmpty ? apkSegs.last : segments.last, e);
}).toList();
class AppSource {
String? host;

View File

@@ -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.11.31+153 # When changing this, update the tag in main() accordingly
version: 0.11.32+154 # When changing this, update the tag in main() accordingly
environment:
sdk: '>=2.18.2 <3.0.0'