mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-10-24 19:33:45 +02:00 
			
		
		
		
	| @@ -29,11 +29,12 @@ Currently supported App sources: | ||||
|   - [Uptodown](https://uptodown.com/) | ||||
|   - [Huawei AppGallery](https://appgallery.huawei.com/) | ||||
|   - [Tencent App Store](https://sj.qq.com/) | ||||
|   - [RuStore](https://rustore.ru/) | ||||
|   - Jenkins Jobs | ||||
|   - [APKMirror](https://apkmirror.com/) (Track-Only) | ||||
| - Other - App-Specific: | ||||
|   - [Telegram App](https://telegram.org) | ||||
|   - [Neutron Code](https://neutroncode.com) | ||||
|   - [Telegram App](https://telegram.org/) | ||||
|   - [Neutron Code](https://neutroncode.com/) | ||||
| - Direct APK Link | ||||
| - "HTML" (Fallback): Any other URL that returns an HTML page with links to APK files | ||||
|  | ||||
|   | ||||
| @@ -13,7 +13,6 @@ | ||||
| 			<li>F-Droid</li> | ||||
| 			<li>Third Party F-Droid Repos</li> | ||||
| 			<li>IzzyOnDroid</li> | ||||
| 			<li>SourceForge</li> | ||||
| 			<li>SourceHut</li> | ||||
| 		</ul> | ||||
| 	</li> | ||||
| @@ -22,24 +21,17 @@ | ||||
| 		<ul> | ||||
| 			<li>APKPure</li> | ||||
| 			<li>Aptoide</li> | ||||
| 			<li>Uptodowng</li> | ||||
| 			<li>Uptodown</li> | ||||
| 			<li>APKMirror (Track-Only)</li> | ||||
| 			<li>Huawei AppGallery</li> | ||||
| 			<li>Tencent App Store</li> | ||||
| 			<li>Jenkins Jobs</li> | ||||
| 		</ul> | ||||
| 	</li> | ||||
| 	<li> | ||||
| 		<p>Open Source - App-Specific:</p> | ||||
| 		<ul> | ||||
| 			<li>Mullvad</li> | ||||
| 			<li>Signal</li> | ||||
| 			<li>VLC</li> | ||||
| 			<li>RuStore</li> | ||||
| 		</ul> | ||||
| 	</li> | ||||
| 	<li> | ||||
| 		<p>Other - App-Specific:</p> | ||||
| 		<ul> | ||||
| 			<li>WhatsApp</li> | ||||
| 			<li>Telegram App</li> | ||||
| 			<li>Neutron Code</li> | ||||
| 		</ul> | ||||
|   | ||||
| @@ -13,7 +13,6 @@ | ||||
| 			<li>F-Droid</li> | ||||
| 			<li>Third Party F-Droid Repos</li> | ||||
| 			<li>IzzyOnDroid</li> | ||||
| 			<li>SourceForge</li> | ||||
| 			<li>SourceHut</li> | ||||
| 		</ul> | ||||
| 	</li> | ||||
| @@ -22,24 +21,17 @@ | ||||
| 		<ul> | ||||
| 			<li>APKPure</li> | ||||
| 			<li>Aptoide</li> | ||||
| 			<li>Uptodowng</li> | ||||
| 			<li>Uptodown</li> | ||||
| 			<li>APKMirror (Track-Only)</li> | ||||
| 			<li>Huawei AppGallery</li> | ||||
| 			<li>Tencent App Store</li> | ||||
| 			<li>Jenkins Jobs</li> | ||||
| 		</ul> | ||||
| 	</li> | ||||
| 	<li> | ||||
| 		<p>Свободное ПО - Для отдельных приложений:</p> | ||||
| 		<ul> | ||||
| 			<li>Mullvad</li> | ||||
| 			<li>Signal</li> | ||||
| 			<li>VLC</li> | ||||
| 			<li>RuStore</li> | ||||
| 		</ul> | ||||
| 	</li> | ||||
| 	<li> | ||||
| 		<p>Другие - Для отдельных приложений:</p> | ||||
| 		<ul> | ||||
| 			<li>WhatsApp</li> | ||||
| 			<li>Telegram App</li> | ||||
| 			<li>Neutron Code</li> | ||||
| 		</ul> | ||||
|   | ||||
							
								
								
									
										82
									
								
								lib/app_sources/rustore.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								lib/app_sources/rustore.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,82 @@ | ||||
| import 'dart:convert'; | ||||
|  | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:http/http.dart'; | ||||
| import 'package:obtainium/custom_errors.dart'; | ||||
| import 'package:obtainium/providers/source_provider.dart'; | ||||
|  | ||||
| class RuStore extends AppSource { | ||||
|   RuStore() { | ||||
|     hosts = ['rustore.ru']; | ||||
|     name = 'RuStore'; | ||||
|     naiveStandardVersionDetection = true; | ||||
|     showReleaseDateAsVersionToggle = true; | ||||
|   } | ||||
|  | ||||
|   @override | ||||
|   String sourceSpecificStandardizeURL(String url, {bool forSelection = false}) { | ||||
|     RegExp standardUrlRegEx = RegExp( | ||||
|         '^https?://(www\\.)?${getSourceRegex(hosts)}/catalog/app/+[^/]+', | ||||
|         caseSensitive: false); | ||||
|     RegExpMatch? match = standardUrlRegEx.firstMatch(url); | ||||
|     if (match == null) { | ||||
|       throw InvalidURLError(name); | ||||
|     } | ||||
|     return match.group(0)!; | ||||
|   } | ||||
|  | ||||
|   @override | ||||
|   Future<String?> tryInferringAppId(String standardUrl, | ||||
|       {Map<String, dynamic> additionalSettings = const {}}) async { | ||||
|     return Uri.parse(standardUrl).pathSegments.last; | ||||
|   } | ||||
|  | ||||
|   @override | ||||
|   Future<APKDetails> getLatestAPKDetails( | ||||
|     String standardUrl, | ||||
|     Map<String, dynamic> additionalSettings, | ||||
|   ) async { | ||||
|     String? appId = await tryInferringAppId(standardUrl); | ||||
|     Response res0 = await sourceRequest( | ||||
|         'https://backapi.rustore.ru/applicationData/overallInfo/$appId', | ||||
|         additionalSettings); | ||||
|     if (res0.statusCode != 200) { | ||||
|       throw getObtainiumHttpError(res0); | ||||
|     } | ||||
|     var appDetails = jsonDecode(res0.body)['body']; | ||||
|     if (appDetails['appId'] == null) { | ||||
|       throw NoReleasesError(); | ||||
|     } | ||||
|  | ||||
|     String appName = appDetails['appName'] ?? tr('app'); | ||||
|     String author = appDetails['companyName'] ?? name; | ||||
|     String? dateStr = appDetails['updatedAt']; | ||||
|     String? version = appDetails['versionName']; | ||||
|     if (version == null) { | ||||
|       throw NoVersionError(); | ||||
|     } | ||||
|     DateTime? relDate; | ||||
|     if (dateStr != null) { | ||||
|       relDate = DateTime.parse(dateStr); | ||||
|     } | ||||
|  | ||||
|     Response res1 = await sourceRequest( | ||||
|         'https://backapi.rustore.ru/applicationData/download-link', | ||||
|         additionalSettings, | ||||
|         followRedirects: false, | ||||
|         postBody: {"appId": appDetails['appId'], "firstInstall": true}); | ||||
|     var downloadDetails = jsonDecode(res1.body)['body']; | ||||
|     if (res1.statusCode != 200 || downloadDetails['apkUrl'] == null) { | ||||
|       throw NoAPKError(); | ||||
|     } | ||||
|  | ||||
|     return APKDetails( | ||||
|         version, | ||||
|         getApkUrlsFromUrls([ | ||||
|           (downloadDetails['apkUrl'] as String) | ||||
|               .replaceAll(RegExp('\\.zip\$'), '.apk') | ||||
|         ]), | ||||
|         AppNames(author, appName), | ||||
|         releaseDate: relDate); | ||||
|   } | ||||
| } | ||||
| @@ -23,6 +23,7 @@ import 'package:obtainium/app_sources/izzyondroid.dart'; | ||||
| import 'package:obtainium/app_sources/html.dart'; | ||||
| import 'package:obtainium/app_sources/jenkins.dart'; | ||||
| import 'package:obtainium/app_sources/neutroncode.dart'; | ||||
| import 'package:obtainium/app_sources/rustore.dart'; | ||||
| import 'package:obtainium/app_sources/sourceforge.dart'; | ||||
| import 'package:obtainium/app_sources/sourcehut.dart'; | ||||
| import 'package:obtainium/app_sources/telegramapp.dart'; | ||||
| @@ -864,6 +865,7 @@ class SourceProvider { | ||||
|         Tencent(), | ||||
|         Jenkins(), | ||||
|         APKMirror(), | ||||
|         RuStore(), | ||||
|         TelegramApp(), | ||||
|         NeutronCode(), | ||||
|         DirectAPKLink(), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user