mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-11-03 23:03:29 +01:00 
			
		
		
		
	Merge branch 'main' into patch-1
This commit is contained in:
		@@ -240,6 +240,10 @@
 | 
			
		||||
   "disablePageTransitions": "Ugasite animaciju prijelaza stranice",
 | 
			
		||||
   "reversePageTransitions": "Reverzne animacije prijelaza stranice",
 | 
			
		||||
   "minStarCount": "Minimum Star Count",
 | 
			
		||||
   "addInfoBelow": "Add this info below.",
 | 
			
		||||
   "addInfoInSettings": "Add this info in the Settings.",
 | 
			
		||||
   "githubSourceNote": "GitHub rate limiting can be avoided using an API key.",
 | 
			
		||||
   "gitlabSourceNote": "GitLab APK extraction may not work without an API key.",
 | 
			
		||||
   "removeAppQuestion": {
 | 
			
		||||
      "one": "Želite li ukloniti aplikaciju?",
 | 
			
		||||
      "other": "Želite li ukloniti aplikacije?"
 | 
			
		||||
 
 | 
			
		||||
@@ -240,6 +240,10 @@
 | 
			
		||||
    "disablePageTransitions": "Animationen für Seitenübergänge deaktivieren",
 | 
			
		||||
    "reversePageTransitions": "Umgekehrte Animationen für Seitenübergänge",
 | 
			
		||||
    "minStarCount": "Minimale Anzahl von Sternen",
 | 
			
		||||
    "addInfoBelow": "Add this info below.",
 | 
			
		||||
    "addInfoInSettings": "Add this info in the Settings.",
 | 
			
		||||
    "githubSourceNote": "GitHub rate limiting can be avoided using an API key.",
 | 
			
		||||
    "gitlabSourceNote": "GitLab APK extraction may not work without an API key.",
 | 
			
		||||
    "removeAppQuestion": {
 | 
			
		||||
        "one": "App entfernen?",
 | 
			
		||||
        "other": "Apps entfernen?"
 | 
			
		||||
 
 | 
			
		||||
@@ -240,6 +240,10 @@
 | 
			
		||||
    "disablePageTransitions": "Disable page transition animations",
 | 
			
		||||
    "reversePageTransitions": "Reverse page transition animations",
 | 
			
		||||
    "minStarCount": "Minimum Star Count",
 | 
			
		||||
    "addInfoBelow": "Add this info below.",
 | 
			
		||||
    "addInfoInSettings": "Add this info in the Settings.",
 | 
			
		||||
    "githubSourceNote": "GitHub rate limiting can be avoided using an API key.",
 | 
			
		||||
    "gitlabSourceNote": "GitLab APK extraction may not work without an API key.",
 | 
			
		||||
    "removeAppQuestion": {
 | 
			
		||||
        "one": "Remove App?",
 | 
			
		||||
        "other": "Remove Apps?"
 | 
			
		||||
 
 | 
			
		||||
@@ -240,6 +240,10 @@
 | 
			
		||||
    "disablePageTransitions": "Disable page transition animations",
 | 
			
		||||
    "reversePageTransitions": "Reverse page transition animations",
 | 
			
		||||
    "minStarCount": "Minimum Star Count",
 | 
			
		||||
    "addInfoBelow": "Add this info below.",
 | 
			
		||||
    "addInfoInSettings": "Add this info in the Settings.",
 | 
			
		||||
    "githubSourceNote": "GitHub rate limiting can be avoided using an API key.",
 | 
			
		||||
    "gitlabSourceNote": "GitLab APK extraction may not work without an API key.",
 | 
			
		||||
    "removeAppQuestion": {
 | 
			
		||||
        "one": "¿Eliminar Aplicación?",
 | 
			
		||||
        "other": "¿Eliminar Aplicaciones?"
 | 
			
		||||
 
 | 
			
		||||
@@ -240,6 +240,10 @@
 | 
			
		||||
    "disablePageTransitions": "Disable page transition animations",
 | 
			
		||||
    "reversePageTransitions": "Reverse page transition animations",
 | 
			
		||||
    "minStarCount": "Minimum Star Count",
 | 
			
		||||
    "addInfoBelow": "Add this info below.",
 | 
			
		||||
    "addInfoInSettings": "Add this info in the Settings.",
 | 
			
		||||
    "githubSourceNote": "GitHub rate limiting can be avoided using an API key.",
 | 
			
		||||
    "gitlabSourceNote": "GitLab APK extraction may not work without an API key.",
 | 
			
		||||
    "removeAppQuestion": {
 | 
			
		||||
        "one": "برنامه حذف شود؟",
 | 
			
		||||
        "other": "برنامه ها حذف شوند؟"
 | 
			
		||||
 
 | 
			
		||||
@@ -240,6 +240,10 @@
 | 
			
		||||
    "disablePageTransitions": "Disable page transition animations",
 | 
			
		||||
    "reversePageTransitions": "Reverse page transition animations",
 | 
			
		||||
    "minStarCount": "Minimum Star Count",
 | 
			
		||||
    "addInfoBelow": "Add this info below.",
 | 
			
		||||
    "addInfoInSettings": "Add this info in the Settings.",
 | 
			
		||||
    "githubSourceNote": "GitHub rate limiting can be avoided using an API key.",
 | 
			
		||||
    "gitlabSourceNote": "GitLab APK extraction may not work without an API key.",
 | 
			
		||||
    "removeAppQuestion": {
 | 
			
		||||
        "one": "Supprimer l'application ?",
 | 
			
		||||
        "other": "Supprimer les applications ?"
 | 
			
		||||
 
 | 
			
		||||
@@ -239,6 +239,10 @@
 | 
			
		||||
    "disablePageTransitions": "Lap áttűnési animációk tiltása",
 | 
			
		||||
    "reversePageTransitions": "Fordított lap áttűnési animációk",
 | 
			
		||||
    "minStarCount": "Minimális csillag szám",
 | 
			
		||||
    "addInfoBelow": "Add this info below.",
 | 
			
		||||
    "addInfoInSettings": "Add this info in the Settings.",
 | 
			
		||||
    "githubSourceNote": "GitHub rate limiting can be avoided using an API key.",
 | 
			
		||||
    "gitlabSourceNote": "GitLab APK extraction may not work without an API key.",
 | 
			
		||||
    "removeAppQuestion": {
 | 
			
		||||
        "one": "Eltávolítja az alkalmazást?",
 | 
			
		||||
        "other": "Eltávolítja az alkalmazást?"
 | 
			
		||||
 
 | 
			
		||||
@@ -240,6 +240,10 @@
 | 
			
		||||
    "disablePageTransitions": "Disable page transition animations",
 | 
			
		||||
    "reversePageTransitions": "Reverse page transition animations",
 | 
			
		||||
    "minStarCount": "Minimum Star Count",
 | 
			
		||||
    "addInfoBelow": "Add this info below.",
 | 
			
		||||
    "addInfoInSettings": "Add this info in the Settings.",
 | 
			
		||||
    "githubSourceNote": "GitHub rate limiting can be avoided using an API key.",
 | 
			
		||||
    "gitlabSourceNote": "GitLab APK extraction may not work without an API key.",
 | 
			
		||||
    "removeAppQuestion": {
 | 
			
		||||
        "one": "Rimuovere l'app?",
 | 
			
		||||
        "other": "Rimuovere le app?"
 | 
			
		||||
 
 | 
			
		||||
@@ -240,6 +240,10 @@
 | 
			
		||||
    "disablePageTransitions": "ページ遷移アニメーションを無効化する",
 | 
			
		||||
    "reversePageTransitions": "ページ遷移アニメーションを反転する",
 | 
			
		||||
    "minStarCount": "Minimum Star Count",
 | 
			
		||||
    "addInfoBelow": "Add this info below.",
 | 
			
		||||
    "addInfoInSettings": "Add this info in the Settings.",
 | 
			
		||||
    "githubSourceNote": "GitHub rate limiting can be avoided using an API key.",
 | 
			
		||||
    "gitlabSourceNote": "GitLab APK extraction may not work without an API key.",
 | 
			
		||||
    "removeAppQuestion": {
 | 
			
		||||
        "one": "アプリを削除しますか?",
 | 
			
		||||
        "other": "アプリを削除しますか?"
 | 
			
		||||
 
 | 
			
		||||
@@ -244,6 +244,10 @@
 | 
			
		||||
    "disablePageTransitions": "Wyłącz animacje przejścia między stronami",
 | 
			
		||||
    "reversePageTransitions": "Odwróć animacje przejścia pomiędzy stronami",
 | 
			
		||||
    "minStarCount": "Minimum Star Count",
 | 
			
		||||
    "addInfoBelow": "Add this info below.",
 | 
			
		||||
    "addInfoInSettings": "Add this info in the Settings.",
 | 
			
		||||
    "githubSourceNote": "GitHub rate limiting can be avoided using an API key.",
 | 
			
		||||
    "gitlabSourceNote": "GitLab APK extraction may not work without an API key.",
 | 
			
		||||
    "removeAppQuestion": {
 | 
			
		||||
        "one": "Usunąć aplikację?",
 | 
			
		||||
        "other": "Usunąć aplikacje?"
 | 
			
		||||
 
 | 
			
		||||
@@ -240,6 +240,10 @@
 | 
			
		||||
    "disablePageTransitions": "Отключить анимацию перехода между страницами",
 | 
			
		||||
    "reversePageTransitions": "Реверс анимации перехода между страницами",
 | 
			
		||||
    "minStarCount": "Минимальное количество звёзд",
 | 
			
		||||
    "addInfoBelow": "Add this info below.",
 | 
			
		||||
    "addInfoInSettings": "Add this info in the Settings.",
 | 
			
		||||
    "githubSourceNote": "GitHub rate limiting can be avoided using an API key.",
 | 
			
		||||
    "gitlabSourceNote": "GitLab APK extraction may not work without an API key.",
 | 
			
		||||
    "removeAppQuestion": {
 | 
			
		||||
        "one": "Удалить приложение?",
 | 
			
		||||
        "other": "Удалить приложения?"
 | 
			
		||||
 
 | 
			
		||||
@@ -240,6 +240,10 @@
 | 
			
		||||
    "disablePageTransitions": "禁用页面过渡动画效果",
 | 
			
		||||
    "reversePageTransitions": "反转页面过渡动画效果",
 | 
			
		||||
    "minStarCount": "最小星标数",
 | 
			
		||||
    "addInfoBelow": "Add this info below.",
 | 
			
		||||
    "addInfoInSettings": "Add this info in the Settings.",
 | 
			
		||||
    "githubSourceNote": "GitHub rate limiting can be avoided using an API key.",
 | 
			
		||||
    "gitlabSourceNote": "GitLab APK extraction may not work without an API key.",
 | 
			
		||||
    "removeAppQuestion": {
 | 
			
		||||
        "one": "是否删除应用?",
 | 
			
		||||
        "other": "是否删除应用?"
 | 
			
		||||
 
 | 
			
		||||
@@ -9,8 +9,6 @@ class Codeberg extends AppSource {
 | 
			
		||||
  Codeberg() {
 | 
			
		||||
    host = 'codeberg.org';
 | 
			
		||||
 | 
			
		||||
    additionalSourceSpecificSettingFormItems = [];
 | 
			
		||||
 | 
			
		||||
    additionalSourceAppSpecificSettingFormItems = [
 | 
			
		||||
      [
 | 
			
		||||
        GeneratedFormSwitch('includePrereleases',
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ class GitHub extends AppSource {
 | 
			
		||||
    host = 'github.com';
 | 
			
		||||
    appIdInferIsOptional = true;
 | 
			
		||||
 | 
			
		||||
    additionalSourceSpecificSettingFormItems = [
 | 
			
		||||
    sourceConfigSettingFormItems = [
 | 
			
		||||
      GeneratedFormTextField('github-creds',
 | 
			
		||||
          label: tr('githubPATLabel'),
 | 
			
		||||
          password: true,
 | 
			
		||||
@@ -107,7 +107,7 @@ class GitHub extends AppSource {
 | 
			
		||||
    for (var path in possibleBuildGradleLocations) {
 | 
			
		||||
      try {
 | 
			
		||||
        var res = await sourceRequest(
 | 
			
		||||
            '${await convertStandardUrlToAPIUrl(standardUrl)}/contents/$path');
 | 
			
		||||
            '${await convertStandardUrlToAPIUrl(standardUrl, additionalSettings)}/contents/$path');
 | 
			
		||||
        if (res.statusCode == 200) {
 | 
			
		||||
          try {
 | 
			
		||||
            var body = jsonDecode(res.body);
 | 
			
		||||
@@ -155,19 +155,30 @@ class GitHub extends AppSource {
 | 
			
		||||
    return url.substring(0, match.end);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Future<String> getCredentialPrefixIfAny() async {
 | 
			
		||||
  Future<String> getCredentialPrefixIfAny(
 | 
			
		||||
      Map<String, dynamic> additionalSettings) async {
 | 
			
		||||
    SettingsProvider settingsProvider = SettingsProvider();
 | 
			
		||||
    await settingsProvider.initializeSettings();
 | 
			
		||||
    String? creds = settingsProvider
 | 
			
		||||
        .getSettingString(additionalSourceSpecificSettingFormItems[0].key);
 | 
			
		||||
    var sourceConfig =
 | 
			
		||||
        await getSourceConfigValues(additionalSettings, settingsProvider);
 | 
			
		||||
    String? creds = sourceConfig['github-creds'];
 | 
			
		||||
    return creds != null && creds.isNotEmpty ? '$creds@' : '';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Future<String> getAPIHost() async =>
 | 
			
		||||
      'https://${await getCredentialPrefixIfAny()}api.$host';
 | 
			
		||||
  @override
 | 
			
		||||
  Future<String?> getSourceNote() async {
 | 
			
		||||
    if (!hostChanged && (await getCredentialPrefixIfAny({})).isEmpty) {
 | 
			
		||||
      return '${tr('githubSourceNote')} ${hostChanged ? tr('addInfoBelow') : tr('addInfoInSettings')}';
 | 
			
		||||
    }
 | 
			
		||||
    return null;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Future<String> convertStandardUrlToAPIUrl(String standardUrl) async =>
 | 
			
		||||
      '${await getAPIHost()}/repos${standardUrl.substring('https://$host'.length)}';
 | 
			
		||||
  Future<String> getAPIHost(Map<String, dynamic> additionalSettings) async =>
 | 
			
		||||
      'https://${await getCredentialPrefixIfAny(additionalSettings)}api.$host';
 | 
			
		||||
 | 
			
		||||
  Future<String> convertStandardUrlToAPIUrl(
 | 
			
		||||
          String standardUrl, Map<String, dynamic> additionalSettings) async =>
 | 
			
		||||
      '${await getAPIHost(additionalSettings)}/repos${standardUrl.substring('https://$host'.length)}';
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  String? changeLogPageFromStandardUrl(String standardUrl) =>
 | 
			
		||||
@@ -311,7 +322,7 @@ class GitHub extends AppSource {
 | 
			
		||||
  ) async {
 | 
			
		||||
    return await getLatestAPKDetailsCommon2(standardUrl, additionalSettings,
 | 
			
		||||
        (bool useTagUrl) async {
 | 
			
		||||
      return '${await convertStandardUrlToAPIUrl(standardUrl)}/${useTagUrl ? 'tags' : 'releases'}?per_page=100';
 | 
			
		||||
      return '${await convertStandardUrlToAPIUrl(standardUrl, additionalSettings)}/${useTagUrl ? 'tags' : 'releases'}?per_page=100';
 | 
			
		||||
    }, (Response res) {
 | 
			
		||||
      rateLimitErrorCheck(res);
 | 
			
		||||
    });
 | 
			
		||||
@@ -360,7 +371,7 @@ class GitHub extends AppSource {
 | 
			
		||||
      {Map<String, dynamic> querySettings = const {}}) async {
 | 
			
		||||
    return searchCommon(
 | 
			
		||||
        query,
 | 
			
		||||
        '${await getAPIHost()}/search/repositories?q=${Uri.encodeQueryComponent(query)}&per_page=100',
 | 
			
		||||
        '${await getAPIHost({})}/search/repositories?q=${Uri.encodeQueryComponent(query)}&per_page=100',
 | 
			
		||||
        'items', onHttpErrorCode: (Response res) {
 | 
			
		||||
      rateLimitErrorCheck(res);
 | 
			
		||||
    }, querySettings: querySettings);
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ class GitLab extends AppSource {
 | 
			
		||||
    host = 'gitlab.com';
 | 
			
		||||
    canSearch = true;
 | 
			
		||||
 | 
			
		||||
    additionalSourceSpecificSettingFormItems = [
 | 
			
		||||
    sourceConfigSettingFormItems = [
 | 
			
		||||
      GeneratedFormTextField('gitlab-creds',
 | 
			
		||||
          label: tr('gitlabPATLabel'),
 | 
			
		||||
          password: true,
 | 
			
		||||
@@ -60,18 +60,27 @@ class GitLab extends AppSource {
 | 
			
		||||
    return url.substring(0, match.end);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Future<String?> getPATIfAny() async {
 | 
			
		||||
  Future<String?> getPATIfAny(Map<String, dynamic> additionalSettings) async {
 | 
			
		||||
    SettingsProvider settingsProvider = SettingsProvider();
 | 
			
		||||
    await settingsProvider.initializeSettings();
 | 
			
		||||
    String? creds = settingsProvider
 | 
			
		||||
        .getSettingString(additionalSourceSpecificSettingFormItems[0].key);
 | 
			
		||||
    var sourceConfig =
 | 
			
		||||
        await getSourceConfigValues(additionalSettings, settingsProvider);
 | 
			
		||||
    String? creds = sourceConfig['gitlab-creds'];
 | 
			
		||||
    return creds != null && creds.isNotEmpty ? creds : null;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Future<String?> getSourceNote() async {
 | 
			
		||||
    if ((await getPATIfAny({})) == null) {
 | 
			
		||||
      return '${tr('gitlabSourceNote')} ${hostChanged ? tr('addInfoBelow') : tr('addInfoInSettings')}';
 | 
			
		||||
    }
 | 
			
		||||
    return null;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Future<Map<String, List<String>>> search(String query,
 | 
			
		||||
      {Map<String, dynamic> querySettings = const {}}) async {
 | 
			
		||||
    String? PAT = await getPATIfAny();
 | 
			
		||||
    String? PAT = await getPATIfAny({});
 | 
			
		||||
    if (PAT == null) {
 | 
			
		||||
      throw CredsNeededError(name);
 | 
			
		||||
    }
 | 
			
		||||
@@ -103,7 +112,7 @@ class GitLab extends AppSource {
 | 
			
		||||
  ) async {
 | 
			
		||||
    bool fallbackToOlderReleases =
 | 
			
		||||
        additionalSettings['fallbackToOlderReleases'] == true;
 | 
			
		||||
    String? PAT = await getPATIfAny();
 | 
			
		||||
    String? PAT = await getPATIfAny(hostChanged ? additionalSettings : {});
 | 
			
		||||
    Iterable<APKDetails> apkDetailsList = [];
 | 
			
		||||
    if (PAT != null) {
 | 
			
		||||
      var names = GitHub().getAppNames(standardUrl);
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,7 @@ import 'dart:math';
 | 
			
		||||
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:flutter/services.dart';
 | 
			
		||||
import 'package:http/http.dart';
 | 
			
		||||
import 'package:obtainium/custom_errors.dart';
 | 
			
		||||
import 'package:obtainium/pages/home.dart';
 | 
			
		||||
import 'package:obtainium/providers/apps_provider.dart';
 | 
			
		||||
@@ -21,7 +22,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.21';
 | 
			
		||||
const String currentVersion = '0.13.22';
 | 
			
		||||
const String currentReleaseTag =
 | 
			
		||||
    'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES
 | 
			
		||||
 | 
			
		||||
@@ -101,10 +102,15 @@ Future<void> bgUpdateCheck(int taskId, Map<String, dynamic>? params) async {
 | 
			
		||||
      await appsProvider.checkUpdates(
 | 
			
		||||
          ignoreAppsCheckedAfter: ignoreAfter, throwErrorsForRetry: true);
 | 
			
		||||
    } catch (e) {
 | 
			
		||||
      if (e is RateLimitError || e is SocketException) {
 | 
			
		||||
      if (e is RateLimitError || e is ClientException) {
 | 
			
		||||
        var remainingMinutes = e is RateLimitError ? e.remainingMinutes : 15;
 | 
			
		||||
        logs.add(plural('bgUpdateGotErrorRetryInMinutes', remainingMinutes,
 | 
			
		||||
            args: [e.toString(), remainingMinutes.toString()]));
 | 
			
		||||
        logs.add(
 | 
			
		||||
            plural('bgUpdateGotErrorRetryInMinutes', remainingMinutes, args: [
 | 
			
		||||
          e is ClientException
 | 
			
		||||
              ? '${(e).message}, ${e.uri?.path}'
 | 
			
		||||
              : e.toString(),
 | 
			
		||||
          remainingMinutes.toString()
 | 
			
		||||
        ]));
 | 
			
		||||
        AndroidAlarmManager.oneShot(Duration(minutes: remainingMinutes),
 | 
			
		||||
            Random().nextInt(pow(2, 31) as int), bgUpdateCheck, params: {
 | 
			
		||||
          'ignoreAfterMicroseconds': nextIgnoreAfter.microsecondsSinceEpoch
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ class GitHubStars implements MassAppUrlSource {
 | 
			
		||||
  Future<Map<String, List<String>>> getOnePageOfUserStarredUrlsWithDescriptions(
 | 
			
		||||
      String username, int page) async {
 | 
			
		||||
    Response res = await get(Uri.parse(
 | 
			
		||||
        'https://${await GitHub().getCredentialPrefixIfAny()}api.github.com/users/$username/starred?per_page=100&page=$page'));
 | 
			
		||||
        'https://${await GitHub().getCredentialPrefixIfAny({})}api.github.com/users/$username/starred?per_page=100&page=$page'));
 | 
			
		||||
    if (res.statusCode == 200) {
 | 
			
		||||
      Map<String, List<String>> urlsWithDescriptions = {};
 | 
			
		||||
      for (var e in (jsonDecode(res.body) as List<dynamic>)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -41,6 +41,7 @@ class _AddAppPageState extends State<AddAppPage> {
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    AppsProvider appsProvider = context.read<AppsProvider>();
 | 
			
		||||
    SettingsProvider settingsProvider = context.watch<SettingsProvider>();
 | 
			
		||||
 | 
			
		||||
    bool doingSomething = gettingAppInfo || searching;
 | 
			
		||||
 | 
			
		||||
@@ -85,8 +86,7 @@ class _AddAppPageState extends State<AddAppPage> {
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Future<bool> getTrackOnlyConfirmationIfNeeded(
 | 
			
		||||
        bool userPickedTrackOnly, SettingsProvider settingsProvider,
 | 
			
		||||
    Future<bool> getTrackOnlyConfirmationIfNeeded(bool userPickedTrackOnly,
 | 
			
		||||
        {bool ignoreHideSetting = false}) async {
 | 
			
		||||
      var useTrackOnly = userPickedTrackOnly || pickedSource!.enforceTrackOnly;
 | 
			
		||||
      if (useTrackOnly &&
 | 
			
		||||
@@ -138,11 +138,9 @@ class _AddAppPageState extends State<AddAppPage> {
 | 
			
		||||
        gettingAppInfo = true;
 | 
			
		||||
      });
 | 
			
		||||
      try {
 | 
			
		||||
        var settingsProvider = context.read<SettingsProvider>();
 | 
			
		||||
        var userPickedTrackOnly = additionalSettings['trackOnly'] == true;
 | 
			
		||||
        App? app;
 | 
			
		||||
        if ((await getTrackOnlyConfirmationIfNeeded(
 | 
			
		||||
                userPickedTrackOnly, settingsProvider)) &&
 | 
			
		||||
        if ((await getTrackOnlyConfirmationIfNeeded(userPickedTrackOnly)) &&
 | 
			
		||||
            (await getReleaseDateAsVersionConfirmationIfNeeded(
 | 
			
		||||
                userPickedTrackOnly))) {
 | 
			
		||||
          var trackOnly = pickedSource!.enforceTrackOnly || userPickedTrackOnly;
 | 
			
		||||
@@ -410,7 +408,13 @@ class _AddAppPageState extends State<AddAppPage> {
 | 
			
		||||
            ),
 | 
			
		||||
            GeneratedForm(
 | 
			
		||||
                key: Key(pickedSource.runtimeType.toString()),
 | 
			
		||||
                items: pickedSource!.combinedAppSpecificSettingFormItems,
 | 
			
		||||
                items: [
 | 
			
		||||
                  ...pickedSource!.combinedAppSpecificSettingFormItems,
 | 
			
		||||
                  ...(pickedSourceOverride != null
 | 
			
		||||
                      ? pickedSource!.sourceConfigSettingFormItems
 | 
			
		||||
                          .map((e) => [e])
 | 
			
		||||
                      : [])
 | 
			
		||||
                ],
 | 
			
		||||
                onValueChanges: (values, valid, isBuilding) {
 | 
			
		||||
                  if (!isBuilding) {
 | 
			
		||||
                    setState(() {
 | 
			
		||||
@@ -504,6 +508,18 @@ class _AddAppPageState extends State<AddAppPage> {
 | 
			
		||||
                                  HTML().runtimeType.toString()))
 | 
			
		||||
                        getHTMLSourceOverrideDropdown(),
 | 
			
		||||
                      if (shouldShowSearchBar()) getSearchBarRow(),
 | 
			
		||||
                      if (pickedSource != null)
 | 
			
		||||
                        FutureBuilder(
 | 
			
		||||
                            builder: (ctx, val) {
 | 
			
		||||
                              return val.data != null && val.data!.isNotEmpty
 | 
			
		||||
                                  ? Text(
 | 
			
		||||
                                      val.data!,
 | 
			
		||||
                                      style:
 | 
			
		||||
                                          Theme.of(context).textTheme.bodySmall,
 | 
			
		||||
                                    )
 | 
			
		||||
                                  : const SizedBox();
 | 
			
		||||
                            },
 | 
			
		||||
                            future: pickedSource?.getSourceNote()),
 | 
			
		||||
                      const SizedBox(
 | 
			
		||||
                        height: 16,
 | 
			
		||||
                      ),
 | 
			
		||||
 
 | 
			
		||||
@@ -431,8 +431,7 @@ class _AppPageState extends State<AppPage> {
 | 
			
		||||
                              ? getResetInstallStatusButton()
 | 
			
		||||
                              : getInstallOrUpdateButton()),
 | 
			
		||||
                      const SizedBox(width: 16.0),
 | 
			
		||||
                      Expanded(
 | 
			
		||||
                          child: TextButton(
 | 
			
		||||
                      IconButton(
 | 
			
		||||
                        onPressed: app?.downloadProgress != null
 | 
			
		||||
                            ? null
 | 
			
		||||
                            : () {
 | 
			
		||||
@@ -445,13 +444,9 @@ class _AppPageState extends State<AppPage> {
 | 
			
		||||
                                  }
 | 
			
		||||
                                });
 | 
			
		||||
                              },
 | 
			
		||||
                        style: TextButton.styleFrom(
 | 
			
		||||
                            foregroundColor:
 | 
			
		||||
                                Theme.of(context).colorScheme.error,
 | 
			
		||||
                            surfaceTintColor:
 | 
			
		||||
                                Theme.of(context).colorScheme.error),
 | 
			
		||||
                        child: Text(tr('remove')),
 | 
			
		||||
                      )),
 | 
			
		||||
                        tooltip: tr('remove'),
 | 
			
		||||
                        icon: const Icon(Icons.delete_outline),
 | 
			
		||||
                      ),
 | 
			
		||||
                    ])),
 | 
			
		||||
            if (app?.downloadProgress != null)
 | 
			
		||||
              Padding(
 | 
			
		||||
 
 | 
			
		||||
@@ -543,7 +543,6 @@ class AppsPageState extends State<AppsPage> {
 | 
			
		||||
                        : FontWeight.normal)),
 | 
			
		||||
            trailing: listedApps[index].downloadProgress != null
 | 
			
		||||
                ? SizedBox(
 | 
			
		||||
                    width: 90,
 | 
			
		||||
                    child: Text(
 | 
			
		||||
                    listedApps[index].downloadProgress! >= 0
 | 
			
		||||
                        ? tr('percentProgress', args: [
 | 
			
		||||
 
 | 
			
		||||
@@ -166,9 +166,9 @@ class _SettingsPageState extends State<SettingsPage> {
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
    var sourceSpecificFields = sourceProvider.sources.map((e) {
 | 
			
		||||
      if (e.additionalSourceSpecificSettingFormItems.isNotEmpty) {
 | 
			
		||||
      if (e.sourceConfigSettingFormItems.isNotEmpty) {
 | 
			
		||||
        return GeneratedForm(
 | 
			
		||||
            items: e.additionalSourceSpecificSettingFormItems.map((e) {
 | 
			
		||||
            items: e.sourceConfigSettingFormItems.map((e) {
 | 
			
		||||
              e.defaultValue = settingsProvider.getSettingString(e.key);
 | 
			
		||||
              return [e];
 | 
			
		||||
            }).toList(),
 | 
			
		||||
 
 | 
			
		||||
@@ -154,6 +154,7 @@ class AppsProvider with ChangeNotifier {
 | 
			
		||||
          useExisting: useExisting, headers: headers);
 | 
			
		||||
    } catch (e) {
 | 
			
		||||
      if (retries > 0 && e is ClientException) {
 | 
			
		||||
        await Future.delayed(const Duration(seconds: 5));
 | 
			
		||||
        return await downloadFileWithRetry(url, fileNameNoExt, onProgress,
 | 
			
		||||
            useExisting: useExisting, headers: headers, retries: (retries - 1));
 | 
			
		||||
      } else {
 | 
			
		||||
 
 | 
			
		||||
@@ -28,6 +28,7 @@ import 'package:obtainium/app_sources/vlc.dart';
 | 
			
		||||
import 'package:obtainium/components/generated_form.dart';
 | 
			
		||||
import 'package:obtainium/custom_errors.dart';
 | 
			
		||||
import 'package:obtainium/mass_app_sources/githubstars.dart';
 | 
			
		||||
import 'package:obtainium/providers/settings_provider.dart';
 | 
			
		||||
 | 
			
		||||
class AppNames {
 | 
			
		||||
  late String author;
 | 
			
		||||
@@ -424,12 +425,31 @@ abstract class AppSource {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // Some Sources may have additional settings at the Source level (not specific to Apps) - these use SettingsProvider
 | 
			
		||||
  List<GeneratedFormItem> additionalSourceSpecificSettingFormItems = [];
 | 
			
		||||
  // If the source has been overridden, we expect the user to define one-time values as additional settings - don't use the stored values
 | 
			
		||||
  List<GeneratedFormItem> sourceConfigSettingFormItems = [];
 | 
			
		||||
  Future<Map<String, String>> getSourceConfigValues(
 | 
			
		||||
      Map<String, dynamic> additionalSettings,
 | 
			
		||||
      SettingsProvider settingsProvider) async {
 | 
			
		||||
    Map<String, String> results = {};
 | 
			
		||||
    sourceConfigSettingFormItems.forEach((e) {
 | 
			
		||||
      var val = hostChanged
 | 
			
		||||
          ? additionalSettings[e.key]
 | 
			
		||||
          : settingsProvider.getSettingString(e.key);
 | 
			
		||||
      if (val != null) {
 | 
			
		||||
        results[e.key] = val;
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
    return results;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  String? changeLogPageFromStandardUrl(String standardUrl) {
 | 
			
		||||
    return null;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Future<String?> getSourceNote() async {
 | 
			
		||||
    return null;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Future<String> apkUrlPrefetchModifier(
 | 
			
		||||
      String apkUrl, String standardUrl) async {
 | 
			
		||||
    return apkUrl;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								pubspec.lock
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								pubspec.lock
									
									
									
									
									
								
							@@ -695,18 +695,18 @@ packages:
 | 
			
		||||
    dependency: "direct main"
 | 
			
		||||
    description:
 | 
			
		||||
      name: sqflite
 | 
			
		||||
      sha256: b4d6710e1200e96845747e37338ea8a819a12b51689a3bcf31eff0003b37a0b9
 | 
			
		||||
      sha256: "591f1602816e9c31377d5f008c2d9ef7b8aca8941c3f89cc5fd9d84da0c38a9a"
 | 
			
		||||
      url: "https://pub.dev"
 | 
			
		||||
    source: hosted
 | 
			
		||||
    version: "2.2.8+4"
 | 
			
		||||
    version: "2.3.0"
 | 
			
		||||
  sqflite_common:
 | 
			
		||||
    dependency: transitive
 | 
			
		||||
    description:
 | 
			
		||||
      name: sqflite_common
 | 
			
		||||
      sha256: "8f7603f3f8f126740bc55c4ca2d1027aab4b74a1267a3e31ce51fe40e3b65b8f"
 | 
			
		||||
      sha256: "1b92f368f44b0dee2425bb861cfa17b6f6cf3961f762ff6f941d20b33355660a"
 | 
			
		||||
      url: "https://pub.dev"
 | 
			
		||||
    source: hosted
 | 
			
		||||
    version: "2.4.5+1"
 | 
			
		||||
    version: "2.5.0"
 | 
			
		||||
  stack_trace:
 | 
			
		||||
    dependency: transitive
 | 
			
		||||
    description:
 | 
			
		||||
@@ -863,10 +863,10 @@ packages:
 | 
			
		||||
    dependency: transitive
 | 
			
		||||
    description:
 | 
			
		||||
      name: webview_flutter_android
 | 
			
		||||
      sha256: "8587d0b4991bd0f223f4b4957101c2c7449f905601571315f4967072498dd3fb"
 | 
			
		||||
      sha256: d936a09fbfd08cb78f7329e0bbacf6158fbdfe24ffc908b22444c07d295eb193
 | 
			
		||||
      url: "https://pub.dev"
 | 
			
		||||
    source: hosted
 | 
			
		||||
    version: "3.9.1"
 | 
			
		||||
    version: "3.9.2"
 | 
			
		||||
  webview_flutter_platform_interface:
 | 
			
		||||
    dependency: transitive
 | 
			
		||||
    description:
 | 
			
		||||
@@ -879,18 +879,18 @@ packages:
 | 
			
		||||
    dependency: transitive
 | 
			
		||||
    description:
 | 
			
		||||
      name: webview_flutter_wkwebview
 | 
			
		||||
      sha256: "3e36a8f564809cb7c257ff4278502b185e2191349df0ddee98837f91805c74b8"
 | 
			
		||||
      sha256: "5fa098f28b606f699e8ca52d9e4e11edbbfef65189f5f77ae92703ba5408fd25"
 | 
			
		||||
      url: "https://pub.dev"
 | 
			
		||||
    source: hosted
 | 
			
		||||
    version: "3.7.1"
 | 
			
		||||
    version: "3.7.2"
 | 
			
		||||
  win32:
 | 
			
		||||
    dependency: transitive
 | 
			
		||||
    description:
 | 
			
		||||
      name: win32
 | 
			
		||||
      sha256: dfdf0136e0aa7a1b474ea133e67cb0154a0acd2599c4f3ada3b49d38d38793ee
 | 
			
		||||
      sha256: f2add6fa510d3ae152903412227bda57d0d5a8da61d2c39c1fb022c9429a41c0
 | 
			
		||||
      url: "https://pub.dev"
 | 
			
		||||
    source: hosted
 | 
			
		||||
    version: "5.0.5"
 | 
			
		||||
    version: "5.0.6"
 | 
			
		||||
  win32_registry:
 | 
			
		||||
    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.21+185 # When changing this, update the tag in main() accordingly
 | 
			
		||||
version: 0.13.22+186 # When changing this, update the tag in main() accordingly
 | 
			
		||||
 | 
			
		||||
environment:
 | 
			
		||||
  sdk: '>=2.18.2 <3.0.0'
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user