Added Steam as a Source (#159) + Bugfixes

This commit is contained in:
Imran Remtulla
2022-12-16 19:26:07 -05:00
parent 2b6a16637e
commit a68d49c71c
9 changed files with 96 additions and 9 deletions

View File

@@ -274,9 +274,14 @@ class AppsProvider with ChangeNotifier {
);
});
}
getHost(String url) {
var temp = Uri.parse(url).host.split('.');
return temp.sublist(temp.length - 2).join('.');
}
// If the picked APK comes from an origin different from the source, get user confirmation (if context provided)
if (apkUrl != null &&
Uri.parse(apkUrl).origin != Uri.parse(app.url).origin &&
getHost(apkUrl) != getHost(app.url) &&
context != null) {
if (await showDialog(
context: context,

View File

@@ -8,13 +8,14 @@ import 'package:html/dom.dart';
import 'package:http/http.dart';
import 'package:obtainium/app_sources/apkmirror.dart';
import 'package:obtainium/app_sources/fdroid.dart';
import 'package:obtainium/app_sources/fdroidRepo.dart';
import 'package:obtainium/app_sources/fdroidrepo.dart';
import 'package:obtainium/app_sources/github.dart';
import 'package:obtainium/app_sources/gitlab.dart';
import 'package:obtainium/app_sources/izzyondroid.dart';
import 'package:obtainium/app_sources/mullvad.dart';
import 'package:obtainium/app_sources/signal.dart';
import 'package:obtainium/app_sources/sourceforge.dart';
import 'package:obtainium/app_sources/steammobile.dart';
import 'package:obtainium/components/generated_form.dart';
import 'package:obtainium/custom_errors.dart';
import 'package:obtainium/mass_app_sources/githubstars.dart';
@@ -212,7 +213,8 @@ class SourceProvider {
Signal(),
SourceForge(),
APKMirror(),
FDroidRepo()
FDroidRepo(),
SteamMobile()
];
// Add more mass url source classes here so they are available via the service
@@ -247,7 +249,7 @@ class SourceProvider {
bool ifSourceAppsRequireAdditionalData(AppSource source) {
for (var row in source.additionalSourceAppSpecificFormItems) {
for (var element in row) {
if (element.required) {
if (element.required && element.opts == null) {
return true;
}
}