mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-10-31 05:23:28 +01:00 
			
		
		
		
	Only ask for install perm. for non-track-only apps
This commit is contained in:
		| @@ -155,15 +155,19 @@ class _AddAppPageState extends State<AddAppPage> { | |||||||
|                                             } |                                             } | ||||||
|                                             if (cont) { |                                             if (cont) { | ||||||
|                                               HapticFeedback.selectionClick(); |                                               HapticFeedback.selectionClick(); | ||||||
|                                               App app = await sourceProvider.getApp( |                                               var trackOnly = pickedSource! | ||||||
|                                                   pickedSource!, |                                                       .enforceTrackOnly || | ||||||
|                                                   userInput, |                                                   userPickedTrackOnly; | ||||||
|                                                   sourceSpecificAdditionalData, |                                               App app = | ||||||
|                                                   trackOnly: pickedSource! |                                                   await sourceProvider.getApp( | ||||||
|                                                           .enforceTrackOnly || |                                                       pickedSource!, | ||||||
|                                                       userPickedTrackOnly); |                                                       userInput, | ||||||
|                                               await settingsProvider |                                                       sourceSpecificAdditionalData, | ||||||
|                                                   .getInstallPermission(); |                                                       trackOnly: trackOnly); | ||||||
|  |                                               if (!trackOnly) { | ||||||
|  |                                                 await settingsProvider | ||||||
|  |                                                     .getInstallPermission(); | ||||||
|  |                                               } | ||||||
|                                               // Only download the APK here if you need to for the package ID |                                               // Only download the APK here if you need to for the package ID | ||||||
|                                               if (sourceProvider |                                               if (sourceProvider | ||||||
|                                                       .isTempId(app.id) && |                                                       .isTempId(app.id) && | ||||||
|   | |||||||
| @@ -223,13 +223,17 @@ class _AppPageState extends State<AppPage> { | |||||||
|                                         !appsProvider.areDownloadsRunning() |                                         !appsProvider.areDownloadsRunning() | ||||||
|                                     ? () { |                                     ? () { | ||||||
|                                         HapticFeedback.heavyImpact(); |                                         HapticFeedback.heavyImpact(); | ||||||
|                                         appsProvider |                                         settingsProvider | ||||||
|                                             .downloadAndInstallLatestApps( |                                             .getInstallPermission() | ||||||
|                                                 [app!.app.id], |                                             .then((value) { | ||||||
|                                                 context).then((res) { |                                           appsProvider | ||||||
|                                           if (res.isNotEmpty && mounted) { |                                               .downloadAndInstallLatestApps( | ||||||
|                                             Navigator.of(context).pop(); |                                                   [app!.app.id], | ||||||
|                                           } |                                                   context).then((res) { | ||||||
|  |                                             if (res.isNotEmpty && mounted) { | ||||||
|  |                                               Navigator.of(context).pop(); | ||||||
|  |                                             } | ||||||
|  |                                           }); | ||||||
|                                         }).catchError((e) { |                                         }).catchError((e) { | ||||||
|                                           showError(e, context); |                                           showError(e, context); | ||||||
|                                         }); |                                         }); | ||||||
|   | |||||||
| @@ -428,8 +428,13 @@ class AppsPageState extends State<AppsPage> { | |||||||
|                                     findGeneratedFormValueByKey(formInputs, |                                     findGeneratedFormValueByKey(formInputs, | ||||||
|                                             values, 'trackonlies') == |                                             values, 'trackonlies') == | ||||||
|                                         'true'; |                                         'true'; | ||||||
|                                 settingsProvider |                                 (() async { | ||||||
|                                     .getInstallPermission() |                                   if (shouldInstallNew || | ||||||
|  |                                       shouldInstallUpdates) { | ||||||
|  |                                     await settingsProvider | ||||||
|  |                                         .getInstallPermission(); | ||||||
|  |                                   } | ||||||
|  |                                 })() | ||||||
|                                     .then((_) { |                                     .then((_) { | ||||||
|                                   List<String> toInstall = []; |                                   List<String> toInstall = []; | ||||||
|                                   if (shouldInstallUpdates) { |                                   if (shouldInstallUpdates) { | ||||||
|   | |||||||
| @@ -41,7 +41,6 @@ class _ImportExportPageState extends State<ImportExportPage> { | |||||||
|     ); |     ); | ||||||
|  |  | ||||||
|     Future<List<List<String>>> addApps(List<String> urls) async { |     Future<List<List<String>>> addApps(List<String> urls) async { | ||||||
|       await settingsProvider.getInstallPermission(); |  | ||||||
|       List<dynamic> results = await sourceProvider.getAppsByURLNaive(urls, |       List<dynamic> results = await sourceProvider.getAppsByURLNaive(urls, | ||||||
|           ignoreUrls: appsProvider.apps.values.map((e) => e.app.url).toList()); |           ignoreUrls: appsProvider.apps.values.map((e) => e.app.url).toList()); | ||||||
|       List<App> apps = results[0]; |       List<App> apps = results[0]; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user