diff --git a/README.md b/README.md index 44f7cf6..648bf53 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,6 @@ Currently supported App sources: - Other - App-Specific: - [WhatsApp](https://whatsapp.com) - [Telegram App](https://telegram.org) - - [Steam Mobile Apps](https://store.steampowered.com/mobile) - [Neutron Code](https://neutroncode.com) - "HTML" (Fallback): Any other URL that returns an HTML page with links to APK files diff --git a/lib/components/generated_form.dart b/lib/components/generated_form.dart index 3eb2865..02ecc29 100644 --- a/lib/components/generated_form.dart +++ b/lib/components/generated_form.dart @@ -123,7 +123,7 @@ class GeneratedFormSubForm extends GeneratedFormItem { final List> items; GeneratedFormSubForm(super.key, this.items, - {super.label, super.belowWidgets, super.defaultValue}); + {super.label, super.belowWidgets, super.defaultValue = const []}); @override ensureType(val) { diff --git a/lib/providers/apps_provider.dart b/lib/providers/apps_provider.dart index 043f399..3a53819 100644 --- a/lib/providers/apps_provider.dart +++ b/lib/providers/apps_provider.dart @@ -527,9 +527,10 @@ class AppsProvider with ChangeNotifier { ? 0 : 1; case InstallMethodSettings.root: - code = (await NativeFeatures.installWithRoot(apkFilePath: file.file.path)) - ? 0 - : 1; + code = + (await NativeFeatures.installWithRoot(apkFilePath: file.file.path)) + ? 0 + : 1; } bool installed = false; if (code != null && code != 0 && code != 3) { @@ -1300,6 +1301,9 @@ class AppsProvider with ChangeNotifier { settingsProvider.prefs?.setInt(key, value); } else if (value is bool) { settingsProvider.prefs?.setBool(key, value); + } else if (value is List) { + settingsProvider.prefs + ?.setStringList(key, value.map((e) => e as String).toList()); } else { settingsProvider.prefs?.setString(key, value as String); } diff --git a/lib/providers/source_provider.dart b/lib/providers/source_provider.dart index 8f4e648..aef2e00 100644 --- a/lib/providers/source_provider.dart +++ b/lib/providers/source_provider.dart @@ -163,6 +163,24 @@ appJSONCompatibilityModifiers(Map json) { return e['customLinkFilterRegex']?.isNotEmpty == true; }).toList(); } + // Steam source apps should be converted to HTML (#1244) + var legacySteamSourceApps = SteamMobile().apks.keys; + if (legacySteamSourceApps.contains(additionalSettings['app'] ?? '')) { + json['url'] = '${json['url']}/mobile'; + var replacementAdditionalSettings = getDefaultValuesFromFormItems( + HTML().combinedAppSpecificSettingFormItems); + for (var s in replacementAdditionalSettings.keys) { + if (additionalSettings.containsKey(s)) { + replacementAdditionalSettings[s] = additionalSettings[s]; + } + } + replacementAdditionalSettings['customLinkFilterRegex'] = + '/${additionalSettings['app']}-(([0-9]+\\.?){1,})\\.apk'; + replacementAdditionalSettings['versionExtractionRegEx'] = + replacementAdditionalSettings['customLinkFilterRegex']; + replacementAdditionalSettings['matchGroupToUse'] = '\$1'; + additionalSettings = replacementAdditionalSettings; + } } json['additionalSettings'] = jsonEncode(additionalSettings); // F-Droid no longer needs cloudflare exception since override can be used - migrate apps appropriately @@ -658,13 +676,11 @@ class SourceProvider { APKMirror(), HuaweiAppGallery(), Jenkins(), - // APKCombo(), // Can't get past their scraping blocking yet (get 403 Forbidden) Mullvad(), Signal(), VLC(), - WhatsApp(), // As of 2023-03-20 this is unusable as the version on the webpage is months out of date + WhatsApp(), TelegramApp(), - SteamMobile(), NeutronCode(), HTML() // This should ALWAYS be the last option as they are tried in order ];