mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-01 05:10:15 +02:00
28 lines
770 B
Dart
28 lines
770 B
Dart
import 'package:obtainium/services/source_service.dart';
|
|
|
|
class App {
|
|
late String id;
|
|
late String url;
|
|
String? installedVersion;
|
|
late String latestVersion;
|
|
late String apkUrl;
|
|
App(this.id, this.url, this.installedVersion, this.latestVersion,
|
|
this.apkUrl);
|
|
}
|
|
|
|
class AppService {
|
|
late SourceService sourceService;
|
|
AppService(this.sourceService);
|
|
|
|
Future<App> getApp(String url) async {
|
|
AppSource source = sourceService.getSource(url);
|
|
String standardUrl = source.standardizeURL(url);
|
|
AppNames names = source.getAppNames(standardUrl);
|
|
APKDetails apk = await source.getLatestAPKUrl(standardUrl);
|
|
return App("${names.author}_${names.name}", standardUrl, null, apk.version,
|
|
apk.downloadUrl);
|
|
}
|
|
|
|
// Load Apps, Save App
|
|
}
|