mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-07-13 21:36:42 +02:00
- All Sources now have a "Track-Only" option that will prevent Obtainium from looking for APKs (though the App must still have a release of some kind so that a version string can be grabbed). - These Apps cannot be installed through Obtainium, but update notifications will still be sent. - The user needs to manually mark them as updated when appropriate. - This addresses issue #119. - It also partially addresses #44 by allowing some sources to be configured as "Track-Only"-only. The first such source (APKMirror) will be added later. - Includes various UI changes to accommodate the above change. - Also makes App loading a bit more responsive (sending Obtainium to the background then returning will now cause App re-load to pick up changes in App versioning that may have been made in the meantime, for instance through update checking).
41 lines
1.1 KiB
Dart
41 lines
1.1 KiB
Dart
import 'dart:convert';
|
|
import 'package:http/http.dart';
|
|
import 'package:obtainium/custom_errors.dart';
|
|
import 'package:obtainium/providers/source_provider.dart';
|
|
|
|
class Signal extends AppSource {
|
|
Signal() {
|
|
host = 'signal.org';
|
|
}
|
|
|
|
@override
|
|
String standardizeURL(String url) {
|
|
return 'https://$host';
|
|
}
|
|
|
|
@override
|
|
String? changeLogPageFromStandardUrl(String standardUrl) => null;
|
|
|
|
@override
|
|
Future<APKDetails> getLatestAPKDetails(
|
|
String standardUrl, List<String> additionalData) async {
|
|
Response res =
|
|
await get(Uri.parse('https://updates.$host/android/latest.json'));
|
|
if (res.statusCode == 200) {
|
|
var json = jsonDecode(res.body);
|
|
String? apkUrl = json['url'];
|
|
List<String> apkUrls = apkUrl == null ? [] : [apkUrl];
|
|
String? version = json['versionName'];
|
|
if (version == null) {
|
|
throw NoVersionError();
|
|
}
|
|
return APKDetails(version, apkUrls);
|
|
} else {
|
|
throw NoReleasesError();
|
|
}
|
|
}
|
|
|
|
@override
|
|
AppNames getAppNames(String standardUrl) => AppNames('Signal', 'Signal');
|
|
}
|