diff --git a/.flutter b/.flutter index 67457e66..41456452 160000 --- a/.flutter +++ b/.flutter @@ -1 +1 @@ -Subproject commit 67457e669f79e9f8d13d7a68fe09775fefbb79f4 +Subproject commit 41456452f29d64e8deb623a3c927524bcf9f111b diff --git a/android/app/build.gradle b/android/app/build.gradle index dc8cd61b..249b190f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -108,3 +108,16 @@ dependencies { implementation "com.github.topjohnwu.libsu:core:5.2.2" } + +ext.abiCodes = ["x86_64": 1, "armeabi-v7a": 2, "arm64-v8a": 3] +import com.android.build.OutputFile +android.applicationVariants.all { variant -> + variant.outputs.each { output -> + def abiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI)) + if (abiVersionCode != null) { + output.versionCodeOverride = variant.versionCode * 10 + abiVersionCode + } else { + output.versionCodeOverride = variant.versionCode * 10 + } + } +} \ No newline at end of file diff --git a/assets/translations/bs.json b/assets/translations/bs.json index fdd514ec..3c86b69f 100644 --- a/assets/translations/bs.json +++ b/assets/translations/bs.json @@ -298,6 +298,8 @@ "installed": "Instalirano", "latest": "Najnoviji", "invertRegEx": "Obrni regularni izraz", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "Želite li ukloniti aplikaciju?", "other": "Želite li ukloniti aplikacije?" diff --git a/assets/translations/cs.json b/assets/translations/cs.json index e5776ee1..5c652819 100644 --- a/assets/translations/cs.json +++ b/assets/translations/cs.json @@ -298,6 +298,8 @@ "installed": "Instalováno", "latest": "Nejnovější", "invertRegEx": "Invertovat regulární výraz", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "Odstranit Apku?", "other": "Odstranit Apky?" diff --git a/assets/translations/de.json b/assets/translations/de.json index dc64d83d..2c976dc2 100644 --- a/assets/translations/de.json +++ b/assets/translations/de.json @@ -298,6 +298,8 @@ "installed": "Installiert", "latest": "Neueste Version", "invertRegEx": "Regulären Ausdruck invertieren", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "App entfernen?", "other": "Apps entfernen?" diff --git a/assets/translations/en.json b/assets/translations/en.json index 6238bb0d..d37888fe 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -298,6 +298,8 @@ "installed": "Installed", "latest": "Latest", "invertRegEx": "Invert regular expression", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "Remove App?", "other": "Remove Apps?" diff --git a/assets/translations/es.json b/assets/translations/es.json index b14d00ac..c9da3931 100644 --- a/assets/translations/es.json +++ b/assets/translations/es.json @@ -298,6 +298,8 @@ "installed": "Instalado", "latest": "Versión más reciente", "invertRegEx": "Invertir expresión regular", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "¿Eliminar Aplicación?", "other": "¿Eliminar Aplicaciones?" diff --git a/assets/translations/fa.json b/assets/translations/fa.json index 7162ec08..756e3209 100644 --- a/assets/translations/fa.json +++ b/assets/translations/fa.json @@ -298,6 +298,8 @@ "installed": "نصب شده است", "latest": "آخرین", "invertRegEx": "معکوس کردن عبارت منظم", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "برنامه حذف شود؟", "other": "برنامه ها حذف شوند؟" diff --git a/assets/translations/fr.json b/assets/translations/fr.json index 791b6373..41649ea6 100644 --- a/assets/translations/fr.json +++ b/assets/translations/fr.json @@ -298,6 +298,8 @@ "installed": "Installée", "latest": "Dernier", "invertRegEx": "Inverser l'expression régulière", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "Supprimer l'application ?", "other": "Supprimer les applications ?" diff --git a/assets/translations/hu.json b/assets/translations/hu.json index fc3b2710..173dab88 100644 --- a/assets/translations/hu.json +++ b/assets/translations/hu.json @@ -298,6 +298,8 @@ "installed": "Telepített", "latest": "Legújabb", "invertRegEx": "Invertált reguláris kifejezés", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "Eltávolítja az alkalmazást?", "other": "Eltávolítja az alkalmazást?" diff --git a/assets/translations/it.json b/assets/translations/it.json index 3c148e5f..ddbe043f 100644 --- a/assets/translations/it.json +++ b/assets/translations/it.json @@ -298,6 +298,8 @@ "installed": "Installato", "latest": "Ultimo", "invertRegEx": "Inverti espressione regolare", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "Rimuovere l'app?", "other": "Rimuovere le app?" diff --git a/assets/translations/ja.json b/assets/translations/ja.json index 580a7c8c..ae470568 100644 --- a/assets/translations/ja.json +++ b/assets/translations/ja.json @@ -298,6 +298,8 @@ "installed": "インストール済み", "latest": "最新", "invertRegEx": "正規表現を反転", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "アプリを削除しますか?", "other": "アプリを削除しますか?" diff --git a/assets/translations/nl.json b/assets/translations/nl.json index 6891395b..372760e8 100644 --- a/assets/translations/nl.json +++ b/assets/translations/nl.json @@ -298,6 +298,8 @@ "installed": "Geïnstalleerd", "latest": "Laatste", "invertRegEx": "Reguliere expressie omkeren", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "App verwijderen?", "other": "Apps verwijderen?" diff --git a/assets/translations/pl.json b/assets/translations/pl.json index 5b269869..f92a37b0 100644 --- a/assets/translations/pl.json +++ b/assets/translations/pl.json @@ -298,6 +298,8 @@ "installed": "Zainstalowano", "latest": "Najnowszy", "invertRegEx": "Odwróć wyrażenie regularne", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "Usunąć aplikację?", "few": "Usunąć aplikacje?", diff --git a/assets/translations/pt.json b/assets/translations/pt.json index 6375a906..675d352e 100644 --- a/assets/translations/pt.json +++ b/assets/translations/pt.json @@ -298,6 +298,8 @@ "installed": "Instalado", "latest": "Mais recente", "invertRegEx": "Inverter expressão regular", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "Remover aplicativo?", "other": "Remover aplicativos?" diff --git a/assets/translations/ru.json b/assets/translations/ru.json index 12d90e14..062e5b41 100644 --- a/assets/translations/ru.json +++ b/assets/translations/ru.json @@ -298,6 +298,8 @@ "installed": "Установлен", "latest": "Последний", "invertRegEx": "Инвертировать регулярное выражение", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "Удалить приложение?", "other": "Удалить приложения?" diff --git a/assets/translations/sv.json b/assets/translations/sv.json index 5ef19196..b61e3b28 100644 --- a/assets/translations/sv.json +++ b/assets/translations/sv.json @@ -298,6 +298,8 @@ "installed": "Installerad", "latest": "Senast", "invertRegEx": "Invertera reguljärt uttryck", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "Ta Bort App?", "other": "Ta Bort Appar?" diff --git a/assets/translations/tr.json b/assets/translations/tr.json index e5efc936..e3bc3a35 100644 --- a/assets/translations/tr.json +++ b/assets/translations/tr.json @@ -298,6 +298,8 @@ "installed": "Kurulmuş", "latest": "En sonuncu", "invertRegEx": "Normal ifadeyi ters çevir", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "Uygulamayı Kaldır?", "other": "Uygulamaları Kaldır?" diff --git a/assets/translations/vi.json b/assets/translations/vi.json index d28fe3fd..abe297ff 100644 --- a/assets/translations/vi.json +++ b/assets/translations/vi.json @@ -298,6 +298,8 @@ "installed": "Đã cài đặt", "latest": "Mới nhất", "invertRegEx": "Đảo ngược biểu thức chính quy", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "Gỡ ứng dụng?", "other": "Gỡ ứng dụng?" diff --git a/assets/translations/zh.json b/assets/translations/zh.json index 72e134a7..d5be7dbb 100644 --- a/assets/translations/zh.json +++ b/assets/translations/zh.json @@ -298,6 +298,8 @@ "installed": "已安装", "latest": "最新的", "invertRegEx": "反转正则表达式", + "note": "Note", + "selfHostedNote": "The \"{}\" dropdown can be used to reach self-hosted/custom instances of any source.", "removeAppQuestion": { "one": "是否删除应用?", "other": "是否删除应用?" diff --git a/build.sh b/build.sh index baadadbb..4bf3c486 100755 --- a/build.sh +++ b/build.sh @@ -8,6 +8,7 @@ if [ -z "$1" ]; then git fetch && git merge origin/main && git push # Typically run after a PR to main, so bring dev up to date fi cd .flutter +git fetch git checkout "$(flutter --version | head -2 | tail -1 | awk '{print $4}')" # Ensure included Flutter submodule version equals my environment cd .. rm ./build/app/outputs/flutter-apk/* 2>/dev/null # Get rid of older builds if any diff --git a/lib/app_sources/fdroid.dart b/lib/app_sources/fdroid.dart index 9129f3ca..259f824a 100644 --- a/lib/app_sources/fdroid.dart +++ b/lib/app_sources/fdroid.dart @@ -3,6 +3,8 @@ import 'dart:convert'; import 'package:easy_localization/easy_localization.dart'; import 'package:html/parser.dart'; import 'package:http/http.dart'; +import 'package:obtainium/app_sources/github.dart'; +import 'package:obtainium/app_sources/gitlab.dart'; import 'package:obtainium/components/generated_form.dart'; import 'package:obtainium/custom_errors.dart'; import 'package:obtainium/providers/source_provider.dart'; @@ -95,17 +97,32 @@ class FDroid extends AppSource { details.names.author = authorLines.first.split(': ').sublist(1).join(': '); } - var changelogUrls = lines.where((l) => l.startsWith('Changelog: ')); + var changelogUrls = lines + .where((l) => l.startsWith('Changelog: ')) + .map((e) => e.split(' ').sublist(1).join(' ')); if (changelogUrls.isNotEmpty) { details.changeLog = changelogUrls.first; - details.changeLog = (await sourceRequest( - details.changeLog! - .split(': ') - .sublist(1) - .join(': ') - .replaceFirst('/blob/', '/raw/'), - additionalSettings)) - .body; + bool isGitHub = false; + bool isGitLab = false; + try { + GitHub().sourceSpecificStandardizeURL(details.changeLog!); + isGitHub = true; + } catch (e) { + // + } + try { + GitLab().sourceSpecificStandardizeURL(details.changeLog!); + isGitLab = true; + } catch (e) { + // + } + if ((isGitHub || isGitLab) && + (details.changeLog?.indexOf('/blob/') ?? -1) >= 0) { + details.changeLog = (await sourceRequest( + details.changeLog!.replaceFirst('/blob/', '/raw/'), + additionalSettings)) + .body; + } } } catch (e) { // Fail silently diff --git a/lib/app_sources/sourcehut.dart b/lib/app_sources/sourcehut.dart index 0c691c40..e28294c5 100644 --- a/lib/app_sources/sourcehut.dart +++ b/lib/app_sources/sourcehut.dart @@ -39,6 +39,15 @@ class SourceHut extends AppSource { String standardUrl, Map additionalSettings, ) async { + if (standardUrl.endsWith('/refs')) { + standardUrl = standardUrl + .split('/') + .reversed + .toList() + .sublist(1) + .reversed + .join('/'); + } Uri standardUri = Uri.parse(standardUrl); String appName = standardUri.pathSegments.last; bool fallbackToOlderReleases = diff --git a/lib/pages/add_app.dart b/lib/pages/add_app.dart index 820e08d5..e73829ef 100644 --- a/lib/pages/add_app.dart +++ b/lib/pages/add_app.dart @@ -530,7 +530,20 @@ class AddAppPageState extends State { ? TextDecoration.underline : TextDecoration.none), ))), - ) + ), + const SizedBox( + height: 16, + ), + Text( + '${tr('note')}:', + style: + const TextStyle(fontWeight: FontWeight.bold), + ), + const SizedBox( + height: 4, + ), + Text(tr('selfHostedNote', + args: [tr('overrideSource')])), ], ); }, diff --git a/lib/pages/app.dart b/lib/pages/app.dart index efd66074..d7a4e671 100644 --- a/lib/pages/app.dart +++ b/lib/pages/app.dart @@ -205,6 +205,12 @@ class _AppPageState extends State { textAlign: TextAlign.center, style: Theme.of(context).textTheme.displayLarge, ), + Text(tr('byX', args: [app?.app.author ?? tr('unknown')]), + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.headlineMedium), + const SizedBox( + height: 24, + ), GestureDetector( onTap: () { if (app?.app.url != null) { @@ -219,15 +225,12 @@ class _AppPageState extends State { )); }, child: Text( - tr('byX', args: [app?.app.author ?? tr('unknown')]), + app?.app.url ?? '', textAlign: TextAlign.center, - style: Theme.of(context).textTheme.headlineMedium!.copyWith( + style: Theme.of(context).textTheme.labelSmall!.copyWith( decoration: TextDecoration.underline, fontStyle: FontStyle.italic), )), - const SizedBox( - height: 8, - ), Text( app?.app.id ?? '', textAlign: TextAlign.center, diff --git a/lib/pages/apps.dart b/lib/pages/apps.dart index 04721434..f4b6b847 100644 --- a/lib/pages/apps.dart +++ b/lib/pages/apps.dart @@ -358,6 +358,16 @@ class AppsPageState extends State { String? changesUrl = appSource.changeLogPageFromStandardUrl(listedApps[appIndex].app.url); String? changeLog = listedApps[appIndex].app.changeLog; + if (changeLog?.split('\n').length == 1) { + if (RegExp( + '(http|ftp|https)://([\\w_-]+(?:(?:\\.[\\w_-]+)+))([\\w.,@?^=%&:/~+#-]*[\\w@?^=%&/~+#-])?') + .hasMatch(changeLog!)) { + if (changesUrl == null) { + changesUrl = changeLog; + changeLog = null; + } + } + } return (changeLog == null && changesUrl == null) ? null : () { diff --git a/pubspec.lock b/pubspec.lock index 990d1bbb..62160292 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -751,18 +751,18 @@ packages: dependency: "direct main" description: name: sqflite - sha256: c2c32eb0c74021d987336522acc3b6bf0082fbd0c540c36a9cf4ddb8ba891ddc + sha256: a9016f495c927cb90557c909ff26a6d92d9bd54fc42ba92e19d4e79d61e798c6 url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: bb4738f15b23352822f4c42a531677e5c6f522e079461fd240ead29d8d8a54a6 + sha256: "28d8c66baee4968519fb8bd6cdbedad982d6e53359091f0b74544a9f32ec72d5" url: "https://pub.dev" source: hosted - version: "2.5.0+2" + version: "2.5.3" stack_trace: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 8f1d4f8a..50c4d68f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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: 1.0.0+250 # When changing this, update the tag in main() accordingly +version: 1.0.1+251 # When changing this, update the tag in main() accordingly environment: sdk: '>=3.0.0 <4.0.0'