Removed Steam Source (existing apps auto-switched to HTML) (#1244) + bugfixes

This commit is contained in:
Imran Remtulla
2024-01-06 23:37:27 -05:00
parent 06a761c0d0
commit 09b24b36f2
4 changed files with 27 additions and 8 deletions

View File

@ -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

View File

@ -123,7 +123,7 @@ class GeneratedFormSubForm extends GeneratedFormItem {
final List<List<GeneratedFormItem>> items;
GeneratedFormSubForm(super.key, this.items,
{super.label, super.belowWidgets, super.defaultValue});
{super.label, super.belowWidgets, super.defaultValue = const []});
@override
ensureType(val) {

View File

@ -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);
}

View File

@ -163,6 +163,24 @@ appJSONCompatibilityModifiers(Map<String, dynamic> 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
];