mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-11-03 23:03:29 +01:00 
			
		
		
		
	Merge pull request #472 from ImranR98/dev
Bugfix in getting APK name from URL (affected Sourceforge and potentially others)
This commit is contained in:
		@@ -31,7 +31,7 @@ class SourceForge extends AppSource {
 | 
				
			|||||||
      getVersion(String url) {
 | 
					      getVersion(String url) {
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
          var tokens = url.split('/');
 | 
					          var tokens = url.split('/');
 | 
				
			||||||
          return tokens[tokens.length - 3];
 | 
					          return tokens[tokens.length - 2];
 | 
				
			||||||
        } catch (e) {
 | 
					        } catch (e) {
 | 
				
			||||||
          return null;
 | 
					          return null;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,7 +21,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart';
 | 
				
			|||||||
// ignore: implementation_imports
 | 
					// ignore: implementation_imports
 | 
				
			||||||
import 'package:easy_localization/src/localization.dart';
 | 
					import 'package:easy_localization/src/localization.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const String currentVersion = '0.11.31';
 | 
					const String currentVersion = '0.11.32';
 | 
				
			||||||
const String currentReleaseTag =
 | 
					const String currentReleaseTag =
 | 
				
			||||||
    'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES
 | 
					    'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -266,10 +266,12 @@ Map<String, dynamic> getDefaultValuesFromFormItems(
 | 
				
			|||||||
      .reduce((value, element) => [...value, ...element]));
 | 
					      .reduce((value, element) => [...value, ...element]));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
getApkUrlsFromUrls(List<String> urls) => urls
 | 
					List<MapEntry<String, String>> getApkUrlsFromUrls(List<String> urls) =>
 | 
				
			||||||
    .map((e) =>
 | 
					    urls.map((e) {
 | 
				
			||||||
        MapEntry(e.split('/').where((el) => el.trim().isNotEmpty).last, e))
 | 
					      var segments = e.split('/').where((el) => el.trim().isNotEmpty);
 | 
				
			||||||
    .toList();
 | 
					      var apkSegs = segments.where((s) => s.toLowerCase().endsWith('.apk'));
 | 
				
			||||||
 | 
					      return MapEntry(apkSegs.isNotEmpty ? apkSegs.last : segments.last, e);
 | 
				
			||||||
 | 
					    }).toList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class AppSource {
 | 
					class AppSource {
 | 
				
			||||||
  String? host;
 | 
					  String? host;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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: 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:
 | 
					environment:
 | 
				
			||||||
  sdk: '>=2.18.2 <3.0.0'
 | 
					  sdk: '>=2.18.2 <3.0.0'
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user