mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-10-31 13:33:28 +01:00 
			
		
		
		
	Compare commits
	
		
			18 Commits
		
	
	
		
			v0.13.13-b
			...
			v0.13.15-b
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | f74df57400 | ||
|  | 6b29a0f0f3 | ||
|  | 2a58ee8729 | ||
|  | 41d9edcf83 | ||
|  | 3ec33a1c77 | ||
|  | 3f4c6a1b76 | ||
|  | 60ad3199ca | ||
|  | 1984ffb1c0 | ||
|  | 7877a14f07 | ||
|  | 568a94968b | ||
|  | a6a68af24e | ||
|  | 5cdd110544 | ||
|  | 5bbe306f8f | ||
|  | 48acbc563a | ||
|  | ab1f7e7179 | ||
|  | 667e909a70 | ||
|  | bcc0d280ab | ||
|  | da027b7734 | 
| @@ -32,9 +32,6 @@ Currently supported App sources: | ||||
| [<img src="https://github.com/machiav3lli/oandbackupx/blob/034b226cea5c1b30eb4f6a6f313e4dadcbb0ece4/badge_github.png" | ||||
|     alt="Get it on GitHub" | ||||
|     height="80">](https://github.com/ImranR98/Obtainium/releases) | ||||
| [<img src="https://gitlab.com/IzzyOnDroid/repo/-/raw/master/assets/IzzyOnDroid.png" | ||||
|      alt="Get it on IzzyOnDroid" | ||||
|      height="80">](https://apt.izzysoft.de/fdroid/index/apk/dev.imranr.obtainium) | ||||
|  | ||||
| ## Limitations | ||||
| - Auto (unattended) updates are unsupported due to a lack of any capable Flutter plugin. | ||||
|   | ||||
| @@ -234,6 +234,9 @@ | ||||
|     "requiresCredentialsInSettings": "Benötigt zusätzliche Anmeldedaten (in den Einstellungen)", | ||||
|     "checkOnStart": "Überprüfe einmalig beim Start", | ||||
|     "tryInferAppIdFromCode": "Try inferring App ID from source code", | ||||
|     "removeOnExternalUninstall": "Automatically remove externally uninstalled Apps", | ||||
|     "pickHighestVersionCode": "Auto-select highest version code APK", | ||||
|     "checkUpdateOnDetailPage": "Check for updates on opening an App detail page", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "App entfernen?", | ||||
|         "other": "Apps entfernen?" | ||||
|   | ||||
| @@ -121,7 +121,7 @@ | ||||
|     "followSystem": "Follow System", | ||||
|     "obtainium": "Obtainium", | ||||
|     "materialYou": "Material You", | ||||
|     "useBlackTheme": "Use Pure Black Dark Theme", | ||||
|     "useBlackTheme": "Use pure black dark theme", | ||||
|     "appSortBy": "App Sort By", | ||||
|     "authorName": "Author/Name", | ||||
|     "nameAuthor": "Name/Author", | ||||
| @@ -132,8 +132,8 @@ | ||||
|     "bgUpdateCheckInterval": "Background Update Checking Interval", | ||||
|     "neverManualOnly": "Never - Manual Only", | ||||
|     "appearance": "Appearance", | ||||
|     "showWebInAppView": "Show Source Webpage in App View", | ||||
|     "pinUpdates": "Pin Updates to Top of Apps View", | ||||
|     "showWebInAppView": "Show Source webpage in App view", | ||||
|     "pinUpdates": "Pin updates to top of Apps view", | ||||
|     "updates": "Updates", | ||||
|     "sourceSpecific": "Source-Specific", | ||||
|     "appSource": "App Source", | ||||
| @@ -226,14 +226,17 @@ | ||||
|     "autoApkFilterByArch": "Attempt to filter APKs by CPU architecture if possible", | ||||
|     "overrideSource": "Override Source", | ||||
|     "dontShowAgain": "Don't show this again", | ||||
|     "dontShowTrackOnlyWarnings": "Don't Show 'Track-Only' Warnings", | ||||
|     "dontShowAPKOriginWarnings": "Don't Show APK Origin Warnings", | ||||
|     "moveNonInstalledAppsToBottom": "Move Non-Installed Apps to Bottom of Apps View", | ||||
|     "dontShowTrackOnlyWarnings": "Don't show 'Track-Only' warnings", | ||||
|     "dontShowAPKOriginWarnings": "Don't show APK origin warnings", | ||||
|     "moveNonInstalledAppsToBottom": "Move non-installed Apps to bottom of Apps view", | ||||
|     "gitlabPATLabel": "GitLab Personal Access Token (Enables Search)", | ||||
|     "about": "About", | ||||
|     "requiresCredentialsInSettings": "This needs additional credentials (in Settings)", | ||||
|     "checkOnStart": "Check Once on Start", | ||||
|     "checkOnStart": "Check for updates on startup", | ||||
|     "tryInferAppIdFromCode": "Try inferring App ID from source code", | ||||
|     "removeOnExternalUninstall": "Automatically remove externally uninstalled Apps", | ||||
|     "pickHighestVersionCode": "Auto-select highest version code APK", | ||||
|     "checkUpdateOnDetailPage": "Check for updates on opening an App detail page", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "Remove App?", | ||||
|         "other": "Remove Apps?" | ||||
|   | ||||
| @@ -228,12 +228,15 @@ | ||||
|     "dontShowAgain": "No mostrar de nuevo", | ||||
|     "dontShowTrackOnlyWarnings": "No mostrar avisos de 'Solo Seguimiento'", | ||||
|     "dontShowAPKOriginWarnings": "No mostrar avisos de las fuentes de las APks", | ||||
|     "moveNonInstalledAppsToBottom": "Move Non-Installed Apps to Bottom of Apps View", | ||||
|     "moveNonInstalledAppsToBottom": "Move non-installed Apps to bottom of Apps view", | ||||
|     "gitlabPATLabel": "GitLab Personal Access Token (Enables Search)", | ||||
|     "about": "About", | ||||
|     "requiresCredentialsInSettings": "This needs additional credentials (in Settings)", | ||||
|     "checkOnStart": "Check Once on Start", | ||||
|     "checkOnStart": "Check for updates on startup", | ||||
|     "tryInferAppIdFromCode": "Try inferring App ID from source code", | ||||
|     "removeOnExternalUninstall": "Automatically remove externally uninstalled Apps", | ||||
|     "pickHighestVersionCode": "Auto-select highest version code APK", | ||||
|     "checkUpdateOnDetailPage": "Check for updates on opening an App detail page", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "¿Eliminar Aplicación?", | ||||
|         "other": "¿Eliminar Aplicaciones?" | ||||
|   | ||||
| @@ -234,6 +234,9 @@ | ||||
|     "requiresCredentialsInSettings": "این به اعتبارنامه های اضافی نیاز دارد (در تنظیمات)", | ||||
|     "checkOnStart": "بررسی در شروع", | ||||
|     "tryInferAppIdFromCode": "شناسه برنامه را از کد منبع استنباط کنید", | ||||
|     "removeOnExternalUninstall": "Automatically remove externally uninstalled Apps", | ||||
|     "pickHighestVersionCode": "Auto-select highest version code APK", | ||||
|     "checkUpdateOnDetailPage": "Check for updates on opening an App detail page", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "برنامه حذف شود؟", | ||||
|         "other": "برنامه ها حذف شوند؟" | ||||
|   | ||||
| @@ -121,7 +121,7 @@ | ||||
|     "followSystem": "Suivre le système", | ||||
|     "obtainium": "Obtainium", | ||||
|     "materialYou": "Material You", | ||||
|     "useBlackTheme": "Use Pure Black Dark Theme", | ||||
|     "useBlackTheme": "Use pure black dark theme", | ||||
|     "appSortBy": "Applications triées par", | ||||
|     "authorName": "Auteur/Nom", | ||||
|     "nameAuthor": "Nom/Auteur", | ||||
| @@ -227,13 +227,16 @@ | ||||
|     "overrideSource": "Override Source", | ||||
|     "dontShowAgain": "Don't show this again", | ||||
|     "dontShowTrackOnlyWarnings": "Don't Show the 'Track-Only' Warning", | ||||
|     "dontShowAPKOriginWarnings": "Don't Show APK Origin Warnings", | ||||
|     "moveNonInstalledAppsToBottom": "Move Non-Installed Apps to Bottom of Apps View", | ||||
|     "dontShowAPKOriginWarnings": "Don't show APK origin warnings", | ||||
|     "moveNonInstalledAppsToBottom": "Move non-installed Apps to bottom of Apps view", | ||||
|     "gitlabPATLabel": "GitLab Personal Access Token (Enables Search)", | ||||
|     "about": "About", | ||||
|     "requiresCredentialsInSettings": "This needs additional credentials (in Settings)", | ||||
|     "checkOnStart": "Check Once on Start", | ||||
|     "checkOnStart": "Check for updates on startup", | ||||
|     "tryInferAppIdFromCode": "Try inferring App ID from source code", | ||||
|     "removeOnExternalUninstall": "Automatically remove externally uninstalled Apps", | ||||
|     "pickHighestVersionCode": "Auto-select highest version code APK", | ||||
|     "checkUpdateOnDetailPage": "Check for updates on opening an App detail page", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "Supprimer l'application ?", | ||||
|         "other": "Supprimer les applications ?" | ||||
|   | ||||
| @@ -233,6 +233,9 @@ | ||||
|     "requiresCredentialsInSettings": "Ehhez további hitelesítő adatokra van szükség (a Beállításokban)", | ||||
|     "checkOnStart": "Egyszer az indításkor", | ||||
|     "tryInferAppIdFromCode": "Próbálja kikövetkeztetni az app azonosítót a forráskódból", | ||||
|     "removeOnExternalUninstall": "Automatically remove externally uninstalled Apps", | ||||
|     "pickHighestVersionCode": "Auto-select highest version code APK", | ||||
|     "checkUpdateOnDetailPage": "Check for updates on opening an App detail page", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "Eltávolítja az alkalmazást?", | ||||
|         "other": "Eltávolítja az alkalmazást?" | ||||
|   | ||||
| @@ -234,6 +234,9 @@ | ||||
|     "requiresCredentialsInSettings": "Servono credenziali aggiuntive (in Impostazioni)", | ||||
|     "checkOnStart": "Controlla una volta all'avvio", | ||||
|     "tryInferAppIdFromCode": "Prova a dedurre l'ID dell'app dal codice sorgente", | ||||
|     "removeOnExternalUninstall": "Automatically remove externally uninstalled Apps", | ||||
|     "pickHighestVersionCode": "Auto-select highest version code APK", | ||||
|     "checkUpdateOnDetailPage": "Check for updates on opening an App detail page", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "Rimuovere l'app?", | ||||
|         "other": "Rimuovere le app?" | ||||
|   | ||||
| @@ -232,8 +232,11 @@ | ||||
|     "gitlabPATLabel": "GitLab パーソナルアクセストークン (検索を有効化する)", | ||||
|     "about": "概要", | ||||
|     "requiresCredentialsInSettings": "これには追加の認証が必要です (設定にて)", | ||||
|     "checkOnStart": "Check Once on Start", | ||||
|     "checkOnStart": "Check for updates on startup", | ||||
|     "tryInferAppIdFromCode": "Try inferring App ID from source code", | ||||
|     "removeOnExternalUninstall": "Automatically remove externally uninstalled Apps", | ||||
|     "pickHighestVersionCode": "Auto-select highest version code APK", | ||||
|     "checkUpdateOnDetailPage": "Check for updates on opening an App detail page", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "アプリを削除しますか?", | ||||
|         "other": "アプリを削除しますか?" | ||||
|   | ||||
| @@ -238,6 +238,9 @@ | ||||
|     "requiresCredentialsInSettings": "Wymaga to dodatkowych poświadczeń (w Ustawieniach)", | ||||
|     "checkOnStart": "Sprawdź raz przy starcie", | ||||
|     "tryInferAppIdFromCode": "Spróbuj wywnioskować identyfikator aplikacji z kodu źródłowego", | ||||
|     "removeOnExternalUninstall": "Automatically remove externally uninstalled Apps", | ||||
|     "pickHighestVersionCode": "Auto-select highest version code APK", | ||||
|     "checkUpdateOnDetailPage": "Check for updates on opening an App detail page", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "Usunąć aplikację?", | ||||
|         "other": "Usunąć aplikacje?" | ||||
|   | ||||
| @@ -234,6 +234,9 @@ | ||||
|     "requiresCredentialsInSettings": "Для этого требуются дополнительные учетные данные (в настройках)", | ||||
|     "checkOnStart": "Проверить один раз при запуске", | ||||
|     "tryInferAppIdFromCode": "Попытаться определить ID приложения из исходного кода", | ||||
|     "removeOnExternalUninstall": "Automatically remove externally uninstalled Apps", | ||||
|     "pickHighestVersionCode": "Auto-select highest version code APK", | ||||
|     "checkUpdateOnDetailPage": "Check for updates on opening an App detail page", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "Удалить приложение?", | ||||
|         "other": "Удалить приложения?" | ||||
|   | ||||
| @@ -135,7 +135,7 @@ | ||||
|     "showWebInAppView": "在应用详情页显示来源网页", | ||||
|     "pinUpdates": "将待更新应用置顶", | ||||
|     "updates": "更新", | ||||
|     "sourceSpecific": "来源相关", | ||||
|     "sourceSpecific": "来源", | ||||
|     "appSource": "源代码", | ||||
|     "noLogs": "无日志", | ||||
|     "appLogs": "日志", | ||||
| @@ -229,11 +229,14 @@ | ||||
|     "dontShowTrackOnlyWarnings": "不显示“仅追踪”模式警告", | ||||
|     "dontShowAPKOriginWarnings": "不显示 APK 文件来源警告", | ||||
|     "moveNonInstalledAppsToBottom": "将未安装应用置底", | ||||
|     "gitlabPATLabel": "GitLab 个人访问令牌(用于搜索)", | ||||
|     "gitlabPATLabel": "GitLab 个人访问令牌(用于搜索应用)", | ||||
|     "about": "相关文档", | ||||
|     "requiresCredentialsInSettings": "此功能需要额外的凭据(在“设置”中添加)", | ||||
|     "checkOnStart": "启动时进行一次检查", | ||||
|     "tryInferAppIdFromCode": "Try inferring App ID from source code", | ||||
|     "tryInferAppIdFromCode": "尝试从源代码推断应用 ID", | ||||
|     "removeOnExternalUninstall": "Automatically remove externally uninstalled Apps", | ||||
|     "pickHighestVersionCode": "Auto-select highest version code APK", | ||||
|     "checkUpdateOnDetailPage": "Check for updates on opening an App detail page", | ||||
|     "removeAppQuestion": { | ||||
|         "one": "是否删除应用?", | ||||
|         "other": "是否删除应用?" | ||||
|   | ||||
| @@ -37,8 +37,10 @@ class APKPure extends AppSource { | ||||
|     String appId = (await tryInferringAppId(standardUrl))!; | ||||
|     String host = Uri.parse(standardUrl).host; | ||||
|     var res = await sourceRequest('$standardUrl/download'); | ||||
|     if (res.statusCode == 200) { | ||||
|     var resChangelog = await sourceRequest(standardUrl); | ||||
|     if (res.statusCode == 200 && resChangelog.statusCode == 200) { | ||||
|       var html = parse(res.body); | ||||
|       var htmlChangelog = parse(resChangelog.body); | ||||
|       String? version = html.querySelector('span.info-sdk span')?.text.trim(); | ||||
|       if (version == null) { | ||||
|         throw NoVersionError(); | ||||
| @@ -68,8 +70,11 @@ class APKPure extends AppSource { | ||||
|           Uri.parse(standardUrl).pathSegments.reversed.last; | ||||
|       String appName = | ||||
|           html.querySelector('h1.info-title')?.text.trim() ?? appId; | ||||
|       String? changeLog = htmlChangelog.querySelector("div.whats-new-info p:not(.date)")?.innerHtml | ||||
|           .trim().replaceAll("<br>", "  \n"); | ||||
|       return APKDetails(version, apkUrls, AppNames(author, appName), | ||||
|           releaseDate: releaseDate); | ||||
|           releaseDate: releaseDate, | ||||
|           changeLog: changeLog); | ||||
|     } else { | ||||
|       throw getObtainiumHttpError(res); | ||||
|     } | ||||
|   | ||||
| @@ -14,6 +14,10 @@ class FDroidRepo extends AppSource { | ||||
|             label: tr('appIdOrName'), | ||||
|             hint: tr('reposHaveMultipleApps'), | ||||
|             required: true) | ||||
|       ], | ||||
|       [ | ||||
|         GeneratedFormSwitch('pickHighestVersionCode', | ||||
|             label: tr('pickHighestVersionCode'), defaultValue: false) | ||||
|       ] | ||||
|     ]; | ||||
|   } | ||||
| @@ -24,6 +28,7 @@ class FDroidRepo extends AppSource { | ||||
|     Map<String, dynamic> additionalSettings, | ||||
|   ) async { | ||||
|     String? appIdOrName = additionalSettings['appIdOrName']; | ||||
|     bool pickHighestVersionCode = additionalSettings['pickHighestVersionCode']; | ||||
|     if (appIdOrName == null) { | ||||
|       throw NoReleasesError(); | ||||
|     } | ||||
| @@ -62,10 +67,19 @@ class FDroidRepo extends AppSource { | ||||
|       if (latestVersion == null) { | ||||
|         throw NoVersionError(); | ||||
|       } | ||||
|       List<String> apkUrls = releases | ||||
|       var latestVersionReleases = releases | ||||
|           .where((element) => | ||||
|               element.querySelector('version')?.innerHtml == latestVersion && | ||||
|               element.querySelector('apkname') != null) | ||||
|           .toList(); | ||||
|       if (latestVersionReleases.length > 1 && pickHighestVersionCode) { | ||||
|         latestVersionReleases.sort((e1, e2) { | ||||
|           return int.parse(e2.querySelector('versioncode')!.innerHtml) | ||||
|               .compareTo(int.parse(e1.querySelector('versioncode')!.innerHtml)); | ||||
|         }); | ||||
|         latestVersionReleases = [latestVersionReleases[0]]; | ||||
|       } | ||||
|       List<String> apkUrls = latestVersionReleases | ||||
|           .map((e) => '$standardUrl/${e.querySelector('apkname')!.innerHtml}') | ||||
|           .toList(); | ||||
|       return APKDetails(latestVersion, getApkUrlsFromUrls(apkUrls), | ||||
|   | ||||
| @@ -21,7 +21,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart'; | ||||
| // ignore: implementation_imports | ||||
| import 'package:easy_localization/src/localization.dart'; | ||||
|  | ||||
| const String currentVersion = '0.13.13'; | ||||
| const String currentVersion = '0.13.15'; | ||||
| const String currentReleaseTag = | ||||
|     'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES | ||||
|  | ||||
| @@ -226,9 +226,9 @@ class _ObtainiumState extends State<Obtainium> { | ||||
|       if (!supportedLocales | ||||
|               .map((e) => e.key.languageCode) | ||||
|               .contains(context.locale.languageCode) || | ||||
|           settingsProvider.forcedLocale == null && | ||||
|           (settingsProvider.forcedLocale == null && | ||||
|               context.deviceLocale.languageCode != | ||||
|                   context.locale.languageCode) { | ||||
|                   context.locale.languageCode)) { | ||||
|         settingsProvider.resetLocaleSafe(context); | ||||
|       } | ||||
|       // Register the background update task according to the user's setting | ||||
|   | ||||
| @@ -44,7 +44,10 @@ class _AppPageState extends State<AppPage> { | ||||
|         ? sourceProvider.getSource(app.app.url, | ||||
|             overrideSource: app.app.overrideSource) | ||||
|         : null; | ||||
|     if (!areDownloadsRunning && prevApp == null && app != null) { | ||||
|     if (!areDownloadsRunning && | ||||
|         prevApp == null && | ||||
|         app != null && | ||||
|         settingsProvider.checkUpdateOnDetailPage) { | ||||
|       prevApp = app; | ||||
|       getUpdate(app.app.id); | ||||
|     } | ||||
|   | ||||
| @@ -240,6 +240,21 @@ class _SettingsPageState extends State<SettingsPage> { | ||||
|                                     }) | ||||
|                               ], | ||||
|                             ), | ||||
|                             height16, | ||||
|                             Row( | ||||
|                               mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|                               children: [ | ||||
|                                 Flexible( | ||||
|                                     child: Text(tr('checkUpdateOnDetailPage'))), | ||||
|                                 Switch( | ||||
|                                     value: settingsProvider | ||||
|                                         .checkUpdateOnDetailPage, | ||||
|                                     onChanged: (value) { | ||||
|                                       settingsProvider.checkUpdateOnDetailPage = | ||||
|                                           value; | ||||
|                                     }) | ||||
|                               ], | ||||
|                             ), | ||||
|                             height32, | ||||
|                             Text( | ||||
|                               tr('sourceSpecific'), | ||||
| @@ -322,6 +337,22 @@ class _SettingsPageState extends State<SettingsPage> { | ||||
|                               ], | ||||
|                             ), | ||||
|                             height16, | ||||
|                             Row( | ||||
|                               mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|                               children: [ | ||||
|                                 Flexible( | ||||
|                                     child: | ||||
|                                         Text(tr('removeOnExternalUninstall'))), | ||||
|                                 Switch( | ||||
|                                     value: settingsProvider | ||||
|                                         .removeOnExternalUninstall, | ||||
|                                     onChanged: (value) { | ||||
|                                       settingsProvider | ||||
|                                           .removeOnExternalUninstall = value; | ||||
|                                     }) | ||||
|                               ], | ||||
|                             ), | ||||
|                             height16, | ||||
|                             Row( | ||||
|                               mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|                               children: [ | ||||
|   | ||||
| @@ -27,7 +27,7 @@ import 'package:flutter_fgbg/flutter_fgbg.dart'; | ||||
| import 'package:obtainium/providers/source_provider.dart'; | ||||
| import 'package:http/http.dart'; | ||||
| import 'package:android_intent_plus/android_intent.dart'; | ||||
| import 'package:archive/archive_io.dart'; | ||||
| import 'package:flutter_archive/flutter_archive.dart'; | ||||
|  | ||||
| class AppInMemory { | ||||
|   late App app; | ||||
| @@ -264,7 +264,7 @@ class AppsProvider with ChangeNotifier { | ||||
|       } else { | ||||
|         // Assume XAPK | ||||
|         String xapkDirPath = '${downloadedFile.path}-dir'; | ||||
|         unzipFile(downloadedFile.path, '${downloadedFile.path}-dir'); | ||||
|         await unzipFile(downloadedFile.path, '${downloadedFile.path}-dir'); | ||||
|         xapkDir = Directory(xapkDirPath); | ||||
|         var apks = xapkDir | ||||
|             .listSync() | ||||
| @@ -334,22 +334,22 @@ class AppsProvider with ChangeNotifier { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   void unzipFile(String filePath, String destinationPath) { | ||||
|     final inputStream = InputFileStream(filePath); | ||||
|     final archive = ZipDecoder().decodeBuffer(inputStream); | ||||
|     extractArchiveToDisk(archive, destinationPath); | ||||
|   Future<void> unzipFile(String filePath, String destinationPath) async { | ||||
|     await ZipFile.extractToDirectory( | ||||
|         zipFile: File(filePath), destinationDir: Directory(destinationPath)); | ||||
|   } | ||||
|  | ||||
|   Future<void> installXApkDir(DownloadedXApkDir dir, | ||||
|       {bool silent = false}) async { | ||||
|     try { | ||||
|       var somethingInstalled = false; | ||||
|       for (var file in dir.extracted.listSync(recursive: true, followLinks: false).whereType<File>()) { | ||||
|       for (var file in dir.extracted | ||||
|           .listSync(recursive: true, followLinks: false) | ||||
|           .whereType<File>()) { | ||||
|         if (file.path.toLowerCase().endsWith('.apk')) { | ||||
|           somethingInstalled = somethingInstalled || | ||||
|               await installApk(DownloadedApk(dir.appId, file), silent: silent); | ||||
|         } | ||||
|         else if (file.path.toLowerCase().endsWith('.obb')) { | ||||
|         } else if (file.path.toLowerCase().endsWith('.obb')) { | ||||
|           await moveObbFile(file, dir.appId); | ||||
|         } | ||||
|       } | ||||
| @@ -391,7 +391,7 @@ class AppsProvider with ChangeNotifier { | ||||
|   } | ||||
|  | ||||
|   Future<void> moveObbFile(File file, String appId) async { | ||||
|     if(!file.path.toLowerCase().endsWith('.obb')) return; | ||||
|     if (!file.path.toLowerCase().endsWith('.obb')) return; | ||||
|  | ||||
|     // TODO: Does not support Android 11+ | ||||
|     if ((await DeviceInfoPlugin().androidInfo).version.sdkInt <= 29) { | ||||
| @@ -756,21 +756,37 @@ class AppsProvider with ChangeNotifier { | ||||
|     } | ||||
|     loadingApps = false; | ||||
|     notifyListeners(); | ||||
|     refreshInstallStatuses(); | ||||
|  | ||||
|     refreshInstallStatuses(useExistingInstalledInfo: true); | ||||
|   } | ||||
|  | ||||
|   Future<void> refreshInstallStatuses() async { | ||||
|   Future<void> refreshInstallStatuses( | ||||
|       {bool useExistingInstalledInfo = false}) async { | ||||
|     if (await doesInstalledAppsPluginWork()) { | ||||
|       List<App> modifiedApps = []; | ||||
|       for (var app in apps.values) { | ||||
|         var moddedApp = | ||||
|             getCorrectedInstallStatusAppIfPossible(app.app, app.installedInfo); | ||||
|         var moddedApp = getCorrectedInstallStatusAppIfPossible( | ||||
|             app.app, | ||||
|             useExistingInstalledInfo | ||||
|                 ? app.installedInfo | ||||
|                 : await getInstalledInfo(app.app.id)); | ||||
|         if (moddedApp != null) { | ||||
|           modifiedApps.add(moddedApp); | ||||
|         } | ||||
|       } | ||||
|       if (modifiedApps.isNotEmpty) { | ||||
|         await saveApps(modifiedApps, attemptToCorrectInstallStatus: false); | ||||
|         var removedAppIds = modifiedApps | ||||
|             .where((a) => a.installedVersion == null) | ||||
|             .map((e) => e.id) | ||||
|             .toList(); | ||||
|         if (removedAppIds.isNotEmpty) { | ||||
|           var settingsProvider = SettingsProvider(); | ||||
|           await settingsProvider.initializeSettings(); | ||||
|           if (settingsProvider.removeOnExternalUninstall) { | ||||
|             await removeApps(removedAppIds); | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| @@ -787,8 +803,10 @@ class AppsProvider with ChangeNotifier { | ||||
|       if (attemptToCorrectInstallStatus) { | ||||
|         app = getCorrectedInstallStatusAppIfPossible(app, info) ?? app; | ||||
|       } | ||||
|       File('${(await getAppsDir()).path}/${app.id}.json') | ||||
|           .writeAsStringSync(jsonEncode(app.toJson())); | ||||
|       if (!onlyIfExists || this.apps.containsKey(app.id)) { | ||||
|         File('${(await getAppsDir()).path}/${app.id}.json') | ||||
|             .writeAsStringSync(jsonEncode(app.toJson())); | ||||
|       } | ||||
|       try { | ||||
|         this.apps.update( | ||||
|             app.id, (value) => AppInMemory(app, value.downloadProgress, info), | ||||
|   | ||||
| @@ -273,4 +273,22 @@ class SettingsProvider with ChangeNotifier { | ||||
|       context.deleteSaveLocale(); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   bool get removeOnExternalUninstall { | ||||
|     return prefs?.getBool('removeOnExternalUninstall') ?? false; | ||||
|   } | ||||
|  | ||||
|   set removeOnExternalUninstall(bool show) { | ||||
|     prefs?.setBool('removeOnExternalUninstall', show); | ||||
|     notifyListeners(); | ||||
|   } | ||||
|  | ||||
|   bool get checkUpdateOnDetailPage { | ||||
|     return prefs?.getBool('checkUpdateOnDetailPage') ?? true; | ||||
|   } | ||||
|  | ||||
|   set checkUpdateOnDetailPage(bool show) { | ||||
|     prefs?.setBool('checkUpdateOnDetailPage', show); | ||||
|     notifyListeners(); | ||||
|   } | ||||
| } | ||||
|   | ||||
							
								
								
									
										90
									
								
								pubspec.lock
									
									
									
									
									
								
							
							
						
						
									
										90
									
								
								pubspec.lock
									
									
									
									
									
								
							| @@ -35,7 +35,7 @@ packages: | ||||
|     source: hosted | ||||
|     version: "2.0.7" | ||||
|   archive: | ||||
|     dependency: "direct main" | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: archive | ||||
|       sha256: "0c8368c9b3f0abbc193b9d6133649a614204b528982bebc7026372d61677ce3a" | ||||
| @@ -174,10 +174,10 @@ packages: | ||||
|     dependency: "direct main" | ||||
|     description: | ||||
|       name: dynamic_color | ||||
|       sha256: "74dff1435a695887ca64899b8990004f8d1232b0e84bfc4faa1fdda7c6f57cc1" | ||||
|       sha256: de4798a7069121aee12d5895315680258415de9b00e717723a1bd73d58f0126d | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "1.6.5" | ||||
|     version: "1.6.6" | ||||
|   easy_localization: | ||||
|     dependency: "direct main" | ||||
|     description: | ||||
| @@ -231,6 +231,14 @@ packages: | ||||
|     description: flutter | ||||
|     source: sdk | ||||
|     version: "0.0.0" | ||||
|   flutter_archive: | ||||
|     dependency: "direct main" | ||||
|     description: | ||||
|       name: flutter_archive | ||||
|       sha256: aec85d1da65e5b33a529db00a86df0b8e92bda78088a7cfaeeba5187701d0d85 | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "5.0.0" | ||||
|   flutter_fgbg: | ||||
|     dependency: "direct main" | ||||
|     description: | ||||
| @@ -259,10 +267,10 @@ packages: | ||||
|     dependency: "direct main" | ||||
|     description: | ||||
|       name: flutter_local_notifications | ||||
|       sha256: "812791d43ccfc1b443a0d39fa02a206fc228c597e28ff9337e09e3ca8d370391" | ||||
|       sha256: "3cc40fe8c50ab8383f3e053a499f00f975636622ecdc8e20a77418ece3b1e975" | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "14.1.1" | ||||
|     version: "15.1.0+1" | ||||
|   flutter_local_notifications_linux: | ||||
|     dependency: transitive | ||||
|     description: | ||||
| @@ -288,10 +296,10 @@ packages: | ||||
|     dependency: "direct main" | ||||
|     description: | ||||
|       name: flutter_markdown | ||||
|       sha256: "9e0202b5339cd88ac0f109abae8502681bfab0b13a8e02a0e7158124610b5d98" | ||||
|       sha256: "4b1bfbb802d76320a1a46d9ce984106135093efd9d969765d07c2125af107bdf" | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "0.6.15+1" | ||||
|     version: "0.6.17" | ||||
|   flutter_plugin_android_lifecycle: | ||||
|     dependency: transitive | ||||
|     description: | ||||
| @@ -394,10 +402,10 @@ packages: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: markdown | ||||
|       sha256: "8e332924094383133cee218b676871f42db2514f1f6ac617b6cf6152a7faab8e" | ||||
|       sha256: acf35edccc0463a9d7384e437c015a3535772e09714cf60e07eeef3a15870dcd | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "7.1.0" | ||||
|     version: "7.1.1" | ||||
|   matcher: | ||||
|     dependency: transitive | ||||
|     description: | ||||
| @@ -482,10 +490,10 @@ packages: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: path_provider_foundation | ||||
|       sha256: "1995d88ec2948dac43edf8fe58eb434d35d22a2940ecee1a9fefcd62beee6eb3" | ||||
|       sha256: "916731ccbdce44d545414dd9961f26ba5fbaa74bcbb55237d8e65a623a8c7297" | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "2.2.3" | ||||
|     version: "2.2.4" | ||||
|   path_provider_linux: | ||||
|     dependency: transitive | ||||
|     description: | ||||
| @@ -514,34 +522,34 @@ packages: | ||||
|     dependency: "direct main" | ||||
|     description: | ||||
|       name: permission_handler | ||||
|       sha256: "37fcc3c3182ac0bf8856f3e973e11c7bef5556d69f1a0d8fb908f51019c2912d" | ||||
|       sha256: "63e5216aae014a72fe9579ccd027323395ce7a98271d9defa9d57320d001af81" | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "10.4.1" | ||||
|     version: "10.4.3" | ||||
|   permission_handler_android: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: permission_handler_android | ||||
|       sha256: "3b61f3da3b1c83bc3fb6a2b431e8dab01d0e5b45f6a3d9c7609770ec88b2a89e" | ||||
|       sha256: c0c9754479a4c4b1c1f3862ddc11930c9b3f03bef2816bb4ea6eed1e13551d6f | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "10.3.0" | ||||
|     version: "10.3.2" | ||||
|   permission_handler_apple: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: permission_handler_apple | ||||
|       sha256: "0d1f8007b17573ff1fbeae0f04b6c8e83e1d2f6c4fe8e8226d4d2456aa8ecffe" | ||||
|       sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5" | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "9.1.2" | ||||
|     version: "9.1.4" | ||||
|   permission_handler_platform_interface: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: permission_handler_platform_interface | ||||
|       sha256: "79b36d93a41a4aecfd0d635d77552f327cb84227c718ce5e68b5f7b85546fe7e" | ||||
|       sha256: "7c6b1500385dd1d2ca61bb89e2488ca178e274a69144d26bbd65e33eae7c02a9" | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "3.11.0+1" | ||||
|     version: "3.11.3" | ||||
|   permission_handler_windows: | ||||
|     dependency: transitive | ||||
|     description: | ||||
| @@ -582,14 +590,6 @@ packages: | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "3.7.3" | ||||
|   process: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: process | ||||
|       sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "4.2.4" | ||||
|   provider: | ||||
|     dependency: "direct main" | ||||
|     description: | ||||
| @@ -634,10 +634,10 @@ packages: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: shared_preferences_foundation | ||||
|       sha256: "0dc5c49ad8a05ed358b991b60c7b0ba1a14e16dae58af9b420d6b9e82dc024ab" | ||||
|       sha256: f39696b83e844923b642ce9dd4bd31736c17e697f6731a5adf445b1274cf3cd4 | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "2.3.0" | ||||
|     version: "2.3.2" | ||||
|   shared_preferences_linux: | ||||
|     dependency: transitive | ||||
|     description: | ||||
| @@ -767,10 +767,10 @@ packages: | ||||
|     dependency: "direct main" | ||||
|     description: | ||||
|       name: url_launcher | ||||
|       sha256: eb1e00ab44303d50dd487aab67ebc575456c146c6af44422f9c13889984c00f3 | ||||
|       sha256: "781bd58a1eb16069412365c98597726cd8810ae27435f04b3b4d3a470bacd61e" | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "6.1.11" | ||||
|     version: "6.1.12" | ||||
|   url_launcher_android: | ||||
|     dependency: transitive | ||||
|     description: | ||||
| @@ -799,10 +799,10 @@ packages: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: url_launcher_macos | ||||
|       sha256: "91ee3e75ea9dadf38036200c5d3743518f4a5eb77a8d13fda1ee5764373f185e" | ||||
|       sha256: "1c4fdc0bfea61a70792ce97157e5cc17260f61abbe4f39354513f39ec6fd73b1" | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "3.0.5" | ||||
|     version: "3.0.6" | ||||
|   url_launcher_platform_interface: | ||||
|     dependency: transitive | ||||
|     description: | ||||
| @@ -815,18 +815,18 @@ packages: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: url_launcher_web | ||||
|       sha256: "6bb1e5d7fe53daf02a8fee85352432a40b1f868a81880e99ec7440113d5cfcab" | ||||
|       sha256: cc26720eefe98c1b71d85f9dc7ef0cada5132617046369d9dc296b3ecaa5cbb4 | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "2.0.17" | ||||
|     version: "2.0.18" | ||||
|   url_launcher_windows: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: url_launcher_windows | ||||
|       sha256: "254708f17f7c20a9c8c471f67d86d76d4a3f9c1591aad1e15292008aceb82771" | ||||
|       sha256: "7967065dd2b5fccc18c653b97958fdf839c5478c28e767c61ee879f4e7882422" | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "3.0.6" | ||||
|     version: "3.0.7" | ||||
|   uuid: | ||||
|     dependency: transitive | ||||
|     description: | ||||
| @@ -855,26 +855,26 @@ packages: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: webview_flutter_android | ||||
|       sha256: "69787707339e7588aad256386475c18223cc0da87d9812343bc27c33c01eeab4" | ||||
|       sha256: "27ad6a99c4b2d5e1ffd2b993a10f738b6b4979f139b4d64c34ac511595fcd748" | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "3.8.1" | ||||
|     version: "3.9.0" | ||||
|   webview_flutter_platform_interface: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: webview_flutter_platform_interface | ||||
|       sha256: "656e2aeaef318900fffd21468b6ddc7958c7092a642f0e7220bac328b70d4a81" | ||||
|       sha256: "564ef378cafc1a0e29f1d76ce175ef517a0a6115875dff7b43fccbef2b0aeb30" | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "2.3.1" | ||||
|     version: "2.4.0" | ||||
|   webview_flutter_wkwebview: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: webview_flutter_wkwebview | ||||
|       sha256: "7b203961d6830f3e5ed1df4c4f0493fea8388a46c4d43716167c4a8ba8ecbe83" | ||||
|       sha256: "369fdf6160944a7db660ff15fa048c2bd681b09557907beaef1f95e8557d21dc" | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "3.6.0" | ||||
|     version: "3.7.0" | ||||
|   win32: | ||||
|     dependency: transitive | ||||
|     description: | ||||
| @@ -895,10 +895,10 @@ packages: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|       name: xdg_directories | ||||
|       sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 | ||||
|       sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff | ||||
|       url: "https://pub.dev" | ||||
|     source: hosted | ||||
|     version: "1.0.0" | ||||
|     version: "1.0.1" | ||||
|   xml: | ||||
|     dependency: transitive | ||||
|     description: | ||||
|   | ||||
| @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev | ||||
| # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html | ||||
| # In Windows, build-name is used as the major, minor, and patch parts | ||||
| # of the product and file versions while build-number is used as the build suffix. | ||||
| version: 0.13.13+177 # When changing this, update the tag in main() accordingly | ||||
| version: 0.13.15+179 # When changing this, update the tag in main() accordingly | ||||
|  | ||||
| environment: | ||||
|   sdk: '>=2.18.2 <3.0.0' | ||||
| @@ -38,7 +38,7 @@ dependencies: | ||||
|   cupertino_icons: ^1.0.5 | ||||
|   path_provider: ^2.0.11 | ||||
|   flutter_fgbg: ^0.2.0 # Try removing reliance on this | ||||
|   flutter_local_notifications: ^14.0.0+1 | ||||
|   flutter_local_notifications: ^15.1.0+1 | ||||
|   provider: ^6.0.3 | ||||
|   http: ^1.0.0 | ||||
|   webview_flutter: ^4.0.0 | ||||
| @@ -63,7 +63,7 @@ dependencies: | ||||
|   easy_localization: ^3.0.1 | ||||
|   android_intent_plus: ^4.0.0 | ||||
|   flutter_markdown: ^0.6.14 | ||||
|   archive: ^3.3.7 | ||||
|   flutter_archive: ^5.0.0 | ||||
|  | ||||
|  | ||||
| dev_dependencies: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user