mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-10-31 13:33:28 +01:00 
			
		
		
		
	Removed Steam Source (existing apps auto-switched to HTML) (#1244) + bugfixes
This commit is contained in:
		| @@ -34,7 +34,6 @@ Currently supported App sources: | |||||||
| - Other - App-Specific: | - Other - App-Specific: | ||||||
|   - [WhatsApp](https://whatsapp.com) |   - [WhatsApp](https://whatsapp.com) | ||||||
|   - [Telegram App](https://telegram.org) |   - [Telegram App](https://telegram.org) | ||||||
|   - [Steam Mobile Apps](https://store.steampowered.com/mobile) |  | ||||||
|   - [Neutron Code](https://neutroncode.com) |   - [Neutron Code](https://neutroncode.com) | ||||||
| - "HTML" (Fallback): Any other URL that returns an HTML page with links to APK files | - "HTML" (Fallback): Any other URL that returns an HTML page with links to APK files | ||||||
|  |  | ||||||
|   | |||||||
| @@ -123,7 +123,7 @@ class GeneratedFormSubForm extends GeneratedFormItem { | |||||||
|   final List<List<GeneratedFormItem>> items; |   final List<List<GeneratedFormItem>> items; | ||||||
|  |  | ||||||
|   GeneratedFormSubForm(super.key, this.items, |   GeneratedFormSubForm(super.key, this.items, | ||||||
|       {super.label, super.belowWidgets, super.defaultValue}); |       {super.label, super.belowWidgets, super.defaultValue = const []}); | ||||||
|  |  | ||||||
|   @override |   @override | ||||||
|   ensureType(val) { |   ensureType(val) { | ||||||
|   | |||||||
| @@ -527,7 +527,8 @@ class AppsProvider with ChangeNotifier { | |||||||
|             ? 0 |             ? 0 | ||||||
|             : 1; |             : 1; | ||||||
|       case InstallMethodSettings.root: |       case InstallMethodSettings.root: | ||||||
|         code = (await NativeFeatures.installWithRoot(apkFilePath: file.file.path)) |         code = | ||||||
|  |             (await NativeFeatures.installWithRoot(apkFilePath: file.file.path)) | ||||||
|                 ? 0 |                 ? 0 | ||||||
|                 : 1; |                 : 1; | ||||||
|     } |     } | ||||||
| @@ -1300,6 +1301,9 @@ class AppsProvider with ChangeNotifier { | |||||||
|           settingsProvider.prefs?.setInt(key, value); |           settingsProvider.prefs?.setInt(key, value); | ||||||
|         } else if (value is bool) { |         } else if (value is bool) { | ||||||
|           settingsProvider.prefs?.setBool(key, value); |           settingsProvider.prefs?.setBool(key, value); | ||||||
|  |         } else if (value is List) { | ||||||
|  |           settingsProvider.prefs | ||||||
|  |               ?.setStringList(key, value.map((e) => e as String).toList()); | ||||||
|         } else { |         } else { | ||||||
|           settingsProvider.prefs?.setString(key, value as String); |           settingsProvider.prefs?.setString(key, value as String); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -163,6 +163,24 @@ appJSONCompatibilityModifiers(Map<String, dynamic> json) { | |||||||
|         return e['customLinkFilterRegex']?.isNotEmpty == true; |         return e['customLinkFilterRegex']?.isNotEmpty == true; | ||||||
|       }).toList(); |       }).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); |   json['additionalSettings'] = jsonEncode(additionalSettings); | ||||||
|   // F-Droid no longer needs cloudflare exception since override can be used - migrate apps appropriately |   // F-Droid no longer needs cloudflare exception since override can be used - migrate apps appropriately | ||||||
| @@ -658,13 +676,11 @@ class SourceProvider { | |||||||
|         APKMirror(), |         APKMirror(), | ||||||
|         HuaweiAppGallery(), |         HuaweiAppGallery(), | ||||||
|         Jenkins(), |         Jenkins(), | ||||||
|         // APKCombo(), // Can't get past their scraping blocking yet (get 403 Forbidden) |  | ||||||
|         Mullvad(), |         Mullvad(), | ||||||
|         Signal(), |         Signal(), | ||||||
|         VLC(), |         VLC(), | ||||||
|         WhatsApp(), // As of 2023-03-20 this is unusable as the version on the webpage is months out of date |         WhatsApp(), | ||||||
|         TelegramApp(), |         TelegramApp(), | ||||||
|         SteamMobile(), |  | ||||||
|         NeutronCode(), |         NeutronCode(), | ||||||
|         HTML() // This should ALWAYS be the last option as they are tried in order |         HTML() // This should ALWAYS be the last option as they are tried in order | ||||||
|       ]; |       ]; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user