mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-19 05:00:21 +02:00
Added APKMirror (Phew!)
This commit is contained in:
@@ -64,6 +64,9 @@ class AppsProvider with ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<ApkFile> downloadApp(String apkUrl, String appId) async {
|
||||
apkUrl = await SourceProvider()
|
||||
.getSource(apps[appId]!.app.url)
|
||||
.apkUrlPrefetchModifier(apkUrl);
|
||||
StreamedResponse response =
|
||||
await Client().send(Request('GET', Uri.parse(apkUrl)));
|
||||
File downloadFile =
|
||||
@@ -420,7 +423,10 @@ class _APKPickerState extends State<APKPicker> {
|
||||
Text('${widget.app.name} has more than one package:'),
|
||||
const SizedBox(height: 16),
|
||||
...widget.app.apkUrls.map((u) => RadioListTile<String>(
|
||||
title: Text(Uri.parse(u).pathSegments.last),
|
||||
title: Text(Uri.parse(u)
|
||||
.pathSegments
|
||||
.where((element) => element.isNotEmpty)
|
||||
.last),
|
||||
value: u,
|
||||
groupValue: apkUrl,
|
||||
onChanged: (String? val) {
|
||||
|
@@ -4,6 +4,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:html/dom.dart';
|
||||
import 'package:obtainium/app_sources/apkmirror.dart';
|
||||
import 'package:obtainium/app_sources/fdroid.dart';
|
||||
import 'package:obtainium/app_sources/github.dart';
|
||||
import 'package:obtainium/app_sources/gitlab.dart';
|
||||
@@ -137,6 +138,7 @@ abstract class AppSource {
|
||||
late List<String> additionalDataDefaults;
|
||||
late List<GeneratedFormItem> moreSourceSettingsFormItems;
|
||||
String? changeLogPageFromStandardUrl(String standardUrl);
|
||||
Future<String> apkUrlPrefetchModifier(String apkUrl);
|
||||
}
|
||||
|
||||
abstract class MassAppSource {
|
||||
@@ -154,7 +156,8 @@ class SourceProvider {
|
||||
IzzyOnDroid(),
|
||||
Mullvad(),
|
||||
Signal(),
|
||||
SourceForge()
|
||||
SourceForge(),
|
||||
APKMirror()
|
||||
];
|
||||
|
||||
// Add more mass source classes here so they are available via the service
|
||||
|
Reference in New Issue
Block a user