Merge pull request #1606 from ImranR98/dev

- Add more links to the settings page (#1554)
- Support for more Huawei AppGallery URL schemes (#1570)
- Fix HTML release asset download (#1578)
- Fix non-APK GitHub release asset downloads (#1581)
- Fix asset date UI (#1590)
This commit is contained in:
Imran
2024-05-05 22:07:51 -04:00
committed by GitHub
28 changed files with 288 additions and 208 deletions

View File

@@ -113,6 +113,7 @@
"dark": "Tamna",
"light": "Svijetla",
"followSystem": "Pratite sistem",
"followSystemThemeExplanation": "Following system theme is possible only by using third-party applications",
"useBlackTheme": "Koristite čisto crnu tamnu temu",
"appSortBy": "Aplikacije sortirane po",
"authorName": "Autor/Ime",
@@ -309,6 +310,8 @@
"badDownload": "The APK could not be parsed (incompatible or partial download)",
"beforeNewInstallsShareToAppVerifier": "Share new Apps with AppVerifier (if available)",
"appVerifierInstructionToast": "Share to AppVerifier, then return here when ready.",
"wiki": "Help/Wiki",
"crowdsourcedConfigsLabel": "Crowdsourced App Configurations (use at your own risk)",
"removeAppQuestion": {
"one": "Želite li ukloniti aplikaciju?",
"other": "Želite li ukloniti aplikacije?"

View File

@@ -113,6 +113,7 @@
"dark": "Tmavé",
"light": "Světlé",
"followSystem": "Jako systém",
"followSystemThemeExplanation": "Sledování motivu systému je možné pouze pomocí aplikací třetích stran.",
"useBlackTheme": "Použít čistě černé tmavé téma",
"appSortBy": "Seřadit podle",
"authorName": "Autor/Jméno",
@@ -309,6 +310,8 @@
"badDownload": "APK nelze analyzovat (nekompatibilní nebo částečné stažení)",
"beforeNewInstallsShareToAppVerifier": "Sdílení nových aplikací s aplikací AppVerifier (pokud je k dispozici)",
"appVerifierInstructionToast": "Sdílejte do aplikace AppVerifier a po dokončení se sem vraťte.",
"wiki": "Nápověda/Wiki",
"crowdsourcedConfigsLabel": "Konfigurace aplikací s využitím crowdsourcingu (použití na vlastní nebezpečí)",
"removeAppQuestion": {
"one": "Odstranit Apku?",
"other": "Odstranit Apky?"

View File

@@ -310,6 +310,8 @@
"badDownload": "Die APK konnte nicht geparst werden (inkompatibler oder teilweiser Download)",
"beforeNewInstallsShareToAppVerifier": "Neue Apps mit AppVerifier teilen (falls verfügbar)",
"appVerifierInstructionToast": "Geben Sie die Daten an AppVerifier weiter und kehren Sie dann hierher zurück, wenn Sie fertig sind.",
"wiki": "Hilfe/Wiki",
"crowdsourcedConfigsLabel": "Crowdsourced App Configurations (Verwendung auf eigene Gefahr)",
"removeAppQuestion": {
"one": "App entfernen?",
"other": "Apps entfernen?"

View File

@@ -310,6 +310,8 @@
"badDownload": "The APK could not be parsed (incompatible or partial download)",
"beforeNewInstallsShareToAppVerifier": "Share new Apps with AppVerifier (if available)",
"appVerifierInstructionToast": "Share to AppVerifier, then return here when ready.",
"wiki": "Help/Wiki",
"crowdsourcedConfigsLabel": "Crowdsourced App Configurations (use at your own risk)",
"removeAppQuestion": {
"one": "Remove App?",
"other": "Remove Apps?"

View File

@@ -113,6 +113,7 @@
"dark": "Oscuro",
"light": "Claro",
"followSystem": "Seguir al sistema",
"followSystemThemeExplanation": "Seguir el tema del sistema sólo es posible utilizando aplicaciones de terceros",
"useBlackTheme": "Negro puro en tema oscuro",
"appSortBy": "Ordenar aplicaciones por",
"authorName": "Autor/nombre",
@@ -309,6 +310,8 @@
"badDownload": "No se ha podido analizar el APK (incompatible o descarga parcial)",
"beforeNewInstallsShareToAppVerifier": "Compartir nuevas aplicaciones con AppVerifier (si está disponible)",
"appVerifierInstructionToast": "Comparta con AppVerifier y vuelva aquí cuando esté listo.",
"wiki": "Ayuda/Wiki",
"crowdsourcedConfigsLabel": "Crowdsourced App Configurations (uso bajo su propia responsabilidad)",
"removeAppQuestion": {
"one": "¿Eliminar aplicación?",
"other": "¿Eliminar aplicaciones?"

View File

@@ -113,6 +113,7 @@
"dark": "تاریک",
"light": "روشن",
"followSystem": "هماهنگ با سیستم",
"followSystemThemeExplanation": "Following system theme is possible only by using third-party applications",
"useBlackTheme": "استفاده از تم تیره سیاه خالص",
"appSortBy": "مرتب سازی برنامه بر اساس",
"authorName": "سازنده/اسم",
@@ -309,6 +310,8 @@
"badDownload": "The APK could not be parsed (incompatible or partial download)",
"beforeNewInstallsShareToAppVerifier": "Share new Apps with AppVerifier (if available)",
"appVerifierInstructionToast": "Share to AppVerifier, then return here when ready.",
"wiki": "Help/Wiki",
"crowdsourcedConfigsLabel": "Crowdsourced App Configurations (use at your own risk)",
"removeAppQuestion": {
"one": "برنامه حذف شود؟",
"other": "برنامه ها حذف شوند؟"

View File

@@ -113,6 +113,7 @@
"dark": "Sombre",
"light": "Clair",
"followSystem": "Suivre le système",
"followSystemThemeExplanation": "Il n'est possible de suivre le thème du système qu'en utilisant des applications tierces.",
"useBlackTheme": "Utilisez le thème noir pur",
"appSortBy": "Applications triées par",
"authorName": "Auteur/Nom",
@@ -309,6 +310,8 @@
"badDownload": "L'APK n'a pas pu être analysé (téléchargement incompatible ou partiel)",
"beforeNewInstallsShareToAppVerifier": "Partager les nouvelles applications avec AppVerifier (si disponible)",
"appVerifierInstructionToast": "Partagez avec AppVerifier, puis revenez ici lorsque vous êtes prêt.",
"wiki": "Aide/Wiki",
"crowdsourcedConfigsLabel": "Configurations d'applications par la foule (utilisation à vos risques et périls)",
"removeAppQuestion": {
"one": "Supprimer l'application ?",
"other": "Supprimer les applications ?"

View File

@@ -113,6 +113,7 @@
"dark": "Sötét",
"light": "Világos",
"followSystem": "Rendszer szerint",
"followSystemThemeExplanation": "A következő rendszer téma csak harmadik féltől származó alkalmazások használatával lehetséges",
"useBlackTheme": "Használjon teljesen fekete sötét témát",
"appSortBy": "App rendezés...",
"authorName": "Szerző/Név",
@@ -309,6 +310,8 @@
"badDownload": "Az APK-t nem lehetett elemezni (inkompatibilis vagy részleges letöltés)",
"beforeNewInstallsShareToAppVerifier": "Új alkalmazások megosztása az AppVerifierrel (ha elérhető)",
"appVerifierInstructionToast": "Ossza meg az AppVerifierrel, majd térjen vissza ide, ha kész.",
"wiki": "Súgó/Wiki",
"crowdsourcedConfigsLabel": "Crowdsourced App Configurations (használat saját felelősségre)",
"removeAppQuestion": {
"one": "Eltávolítja az alkalmazást?",
"other": "Eltávolítja az alkalmazásokat?"

View File

@@ -113,6 +113,7 @@
"dark": "Scuro",
"light": "Chiaro",
"followSystem": "Segui il sistema",
"followSystemThemeExplanation": "È possibile seguire il tema di sistema solo utilizzando applicazioni di terze parti.",
"useBlackTheme": "Usa il tema nero puro",
"appSortBy": "App ordinate per",
"authorName": "Autore/Nome",
@@ -309,6 +310,8 @@
"badDownload": "Non è stato possibile analizzare l'APK (download incompatibile o parziale).",
"beforeNewInstallsShareToAppVerifier": "Condividere le nuove applicazioni con AppVerifier (se disponibile)",
"appVerifierInstructionToast": "Condividete con AppVerifier, quindi tornate qui quando siete pronti.",
"wiki": "Aiuto/Wiki",
"crowdsourcedConfigsLabel": "Configurazioni di app in crowdsourcing (uso a proprio rischio)",
"removeAppQuestion": {
"one": "Rimuovere l'app?",
"other": "Rimuovere le app?"

View File

@@ -113,6 +113,7 @@
"dark": "ダーク",
"light": "ライト",
"followSystem": "システムに従う",
"followSystemThemeExplanation": "以下のシステムテーマは、サードパーティのアプリケーションを使用することによってのみ可能です。",
"useBlackTheme": "ピュアブラックダークテーマを使用する",
"appSortBy": "アプリの並び方",
"authorName": "作者名/アプリ名",
@@ -309,6 +310,8 @@
"badDownload": "APK を解析できませんでした(互換性がないか、部分的にダウンロードされています)。",
"beforeNewInstallsShareToAppVerifier": "AppVerifierで新しいアプリを共有する利用可能な場合",
"appVerifierInstructionToast": "AppVerifierに共有し、準備ができたらここに戻ってください。",
"wiki": "ヘルプ/ウィキ",
"crowdsourcedConfigsLabel": "クラウドソーシングによるアプリの設定(利用は自己責任で)",
"removeAppQuestion": {
"one": "アプリを削除しますか?",
"other": "アプリを削除しますか?"

View File

@@ -310,6 +310,8 @@
"badDownload": "De APK kon niet worden verwerkt (incompatibele of gedeeltelijke download)",
"beforeNewInstallsShareToAppVerifier": "Nieuwe Apps delen met AppVerifier (indien beschikbaar)",
"appVerifierInstructionToast": "Deel het met AppVerifier en keer daarna hier terug.",
"wiki": "Help/Wiki",
"crowdsourcedConfigsLabel": "Crowdsourced App-configuraties (gebruik op eigen risico)",
"removeAppQuestion": {
"one": "App verwijderen?",
"other": "Apps verwijderen?"

View File

@@ -113,6 +113,7 @@
"dark": "Ciemny",
"light": "Jasny",
"followSystem": "Zgodny z systemem",
"followSystemThemeExplanation": "Podążanie za motywem systemowym jest możliwe tylko przy użyciu aplikacji firm trzecich",
"useBlackTheme": "Użyj czarnego motywu",
"appSortBy": "Sortuj aplikacje według",
"authorName": "Autor/Nazwa",
@@ -309,6 +310,8 @@
"badDownload": "Nie można przeanalizować pliku APK (niekompatybilny lub częściowo pobrany).",
"beforeNewInstallsShareToAppVerifier": "Udostępnianie nowych aplikacji za pomocą AppVerifier (jeśli dostępne)",
"appVerifierInstructionToast": "Udostępnij w AppVerifier, a następnie wróć tutaj, gdy będziesz gotowy.",
"wiki": "Pomoc/Wiki",
"crowdsourcedConfigsLabel": "Konfiguracje aplikacji pochodzące z crowdsourcingu (korzystanie na własne ryzyko)",
"removeAppQuestion": {
"one": "Usunąć aplikację?",
"few": "Usunąć aplikacje?",

View File

@@ -113,6 +113,7 @@
"dark": "Escuro",
"light": "Claro",
"followSystem": "Padrão do sistema",
"followSystemThemeExplanation": "O tema do sistema seguinte só é possível através da utilização de aplicações de terceiros",
"useBlackTheme": "Usar tema preto AMOLED",
"appSortBy": "Classificar aplicativo por",
"authorName": "Autor/Nome",
@@ -309,6 +310,8 @@
"badDownload": "Não foi possível analisar o APK (transferência incompatível ou parcial)",
"beforeNewInstallsShareToAppVerifier": "Partilhar novas aplicações com o AppVerifier (se disponível)",
"appVerifierInstructionToast": "Partilhe com o AppVerifier e, em seguida, regresse aqui quando estiver pronto.",
"wiki": "Ajuda/Wiki",
"crowdsourcedConfigsLabel": "Configurações de aplicações de crowdsourcing (utilização por sua conta e risco)",
"removeAppQuestion": {
"one": "Remover aplicativo?",
"other": "Remover aplicativos?"

View File

@@ -310,6 +310,8 @@
"badDownload": "APK не удалось разобрать (несовместимая или неполная загрузка)",
"beforeNewInstallsShareToAppVerifier": "Поделитесь новыми приложениями с AppVerifier (если доступно)",
"appVerifierInstructionToast": "Поделитесь с AppVerifier, а затем вернитесь сюда, когда будете готовы.",
"wiki": "Помощь/Вики",
"crowdsourcedConfigsLabel": "Конфигурации приложений на основе краудсорсинга (используйте на свой страх и риск)",
"removeAppQuestion": {
"one": "Удалить приложение?",
"other": "Удалить приложения?"

View File

@@ -113,6 +113,7 @@
"dark": "Mörkt",
"light": "Ljust",
"followSystem": "Följ System",
"followSystemThemeExplanation": "Följande systemtema är endast möjligt med hjälp av tredjepartsapplikationer",
"useBlackTheme": "Använd svart tema",
"appSortBy": "Sortera Appar via",
"authorName": "Utvecklare/Namn",
@@ -309,6 +310,8 @@
"badDownload": "APK kunde inte analyseras (inkompatibel eller partiell nedladdning)",
"beforeNewInstallsShareToAppVerifier": "Dela nya appar med AppVerifier (om tillgängligt)",
"appVerifierInstructionToast": "Dela till AppVerifier och återvänd sedan hit när du är klar.",
"wiki": "Hjälp/Wiki",
"crowdsourcedConfigsLabel": "Crowdsourcade appkonfigurationer (använd på egen risk)",
"removeAppQuestion": {
"one": "Ta Bort App?",
"other": "Ta Bort Appar?"

View File

@@ -113,6 +113,7 @@
"dark": "Koyu",
"light": "Aydınlık",
"followSystem": "Sistemi Takip Et",
"followSystemThemeExplanation": "Sistem temasını takip etmek yalnızca üçüncü taraf uygulamaları kullanarak mümkündür",
"useBlackTheme": "Saf siyah koyu temasını kullan",
"appSortBy": "Uygulama Sıralama Ölçütü",
"authorName": "Yazar/Ad",
@@ -309,6 +310,8 @@
"badDownload": "APK ayrıştırılamadı (uyumsuz veya kısmi indirme)",
"beforeNewInstallsShareToAppVerifier": "Yeni Uygulamaları AppVerifier ile paylaşın (varsa)",
"appVerifierInstructionToast": "AppVerifier ile paylaşın, hazır olduğunuzda buraya dönün.",
"wiki": "Yardım/Wiki",
"crowdsourcedConfigsLabel": "Kitle Kaynaklı Uygulama Yapılandırmaları (riski size ait olmak üzere kullanın)",
"removeAppQuestion": {
"one": "Uygulamayı Kaldır?",
"other": "Uygulamaları Kaldır?"

View File

@@ -113,6 +113,7 @@
"dark": "Темна",
"light": "Світла",
"followSystem": "Дотримуватися системи",
"followSystemThemeExplanation": "Зміна теми системи можлива лише за допомогою сторонніх додатків",
"useBlackTheme": "Використовувати чорну тему (Amoled)",
"appSortBy": "Сортувати застосунки за",
"authorName": "Автор/Назва",
@@ -309,6 +310,8 @@
"badDownload": "APK не вдалося розпарсити (несумісний або часткове завантаження)",
"beforeNewInstallsShareToAppVerifier": "Діліться новими додатками з AppVerifier (якщо доступно)",
"appVerifierInstructionToast": "Надішліть на AppVerifier, а потім поверніться сюди, коли будете готові.",
"wiki": "Довідка/Вікі",
"crowdsourcedConfigsLabel": "Краудсорсингові конфігурації додатків (використовуйте на свій страх і ризик)",
"removeAppQuestion": {
"one": "Видалити застосунок?",
"other": "Видалити застосунки?"

View File

@@ -113,6 +113,7 @@
"dark": "Tối",
"light": "Sáng",
"followSystem": "Theo hệ thống",
"followSystemThemeExplanation": "Following system theme is possible only by using third-party applications",
"useBlackTheme": "Nền đen",
"appSortBy": "Sắp xếp ứng dụng",
"authorName": "Tác giả",
@@ -309,6 +310,8 @@
"badDownload": "Không thể phân tích cú pháp APK (tải xuống một phần hoặc không tương thích)",
"beforeNewInstallsShareToAppVerifier": "Chia sẻ ứng dụng mới với AppVerifier (nếu có)",
"appVerifierInstructionToast": "Chia sẻ lên AppVerifier, sau đó quay lại đây khi sẵn sàng.",
"wiki": "Help/Wiki",
"crowdsourcedConfigsLabel": "Crowdsourced App Configurations (use at your own risk)",
"removeAppQuestion": {
"one": "Gỡ ứng dụng?",
"other": "Gỡ ứng dụng?"

View File

@@ -310,6 +310,8 @@
"badDownload": "无法解析 APK 文件(不兼容或文件不完整)",
"beforeNewInstallsShareToAppVerifier": "通过 AppVerifier 校验新应用(如果可用)",
"appVerifierInstructionToast": "分享至 AppVerifier完成后返回此处。",
"wiki": "帮助/维基",
"crowdsourcedConfigsLabel": "众包应用程序配置(使用风险自负)",
"removeAppQuestion": {
"one": "是否删除应用?",
"other": "是否删除应用?"

View File

@@ -273,10 +273,11 @@ class GitHub extends AppSource {
List<MapEntry<String, String>> getReleaseAssetUrls(dynamic release) =>
(release['assets'] as List<dynamic>?)?.map((e) {
return (e['name'] != null) &&
((e['url'] ?? e['browser_download_url']) != null)
? MapEntry(e['name'] as String,
(e['url'] ?? e['browser_download_url']) as String)
var url = !e['name'].toString().toLowerCase().endsWith('.apk')
? (e['browser_download_url'] ?? e['url'])
: (e['url'] ?? e['browser_download_url']);
return (e['name'] != null) && (url != null)
? MapEntry(e['name'] as String, url as String)
: const MapEntry('', '');
}).toList() ??
[];

View File

@@ -6,7 +6,7 @@ import 'package:obtainium/providers/source_provider.dart';
class HuaweiAppGallery extends AppSource {
HuaweiAppGallery() {
name = 'Huawei AppGallery';
hosts = ['appgallery.huawei.com'];
hosts = ['appgallery.huawei.com', 'appgallery.cloud.huawei.com'];
versionDetectionDisallowed = true;
showReleaseDateAsVersionToggle = true;
}
@@ -14,7 +14,7 @@ class HuaweiAppGallery extends AppSource {
@override
String sourceSpecificStandardizeURL(String url) {
RegExp standardUrlRegEx = RegExp(
'^https?://(www\\.)?${getSourceRegex(hosts)}/app/[^/]+',
'^https?://(www\\.)?${getSourceRegex(hosts)}(/#)?/(app|appdl)/[^/]+',
caseSensitive: false);
RegExpMatch? match = standardUrlRegEx.firstMatch(url);
if (match == null) {
@@ -24,7 +24,7 @@ class HuaweiAppGallery extends AppSource {
}
getDlUrl(String standardUrl) =>
'https://${hosts[0].replaceAll('appgallery.', 'appgallery.cloud.')}/appdl/${standardUrl.split('/').last}';
'https://${hosts[0].replaceAll('appgallery.huawei', 'appgallery.cloud.huawei')}/appdl/${standardUrl.split('/').last}';
requestAppdlRedirect(
String dlUrl, Map<String, dynamic> additionalSettings) async {

View File

@@ -133,7 +133,7 @@ class _AppPageState extends State<AppPage> {
child: Text(
app?.app.releaseDate == null
? tr('changes')
: app!.app.releaseDate.toString(),
: app!.app.releaseDate!.toLocal().toString(),
textAlign: TextAlign.center,
style:
Theme.of(context).textTheme.labelSmall!.copyWith(
@@ -175,9 +175,8 @@ class _AppPageState extends State<AppPage> {
tr('downloadX', args: [tr('releaseAsset').toLowerCase()]),
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.labelSmall!.copyWith(
decoration:
changeLogFn != null ? TextDecoration.underline : null,
fontStyle: changeLogFn != null ? FontStyle.italic : null,
decoration: TextDecoration.underline,
fontStyle: FontStyle.italic,
),
),
),

View File

@@ -437,7 +437,7 @@ class AppsPageState extends State<AppsPage> {
? tr('changes')
: ''
: DateFormat('yyyy-MM-dd')
.format(listedApps[appIndex].app.releaseDate!);
.format(listedApps[appIndex].app.releaseDate!.toLocal());
}
getSingleAppHorizTile(int index) {

View File

@@ -119,7 +119,7 @@ class _HomePageState extends State<HomePage> {
}
// Check initial link if app was in cold state (terminated)
final appLink = await _appLinks.getInitialAppLink();
final appLink = await _appLinks.getInitialLink();
if (appLink != null) {
await interpretLink(appLink);
}

View File

@@ -26,7 +26,19 @@ class SettingsPage extends StatefulWidget {
class _SettingsPageState extends State<SettingsPage> {
List<int> updateIntervalNodes = [
15, 30, 60, 120, 180, 360, 720, 1440, 4320, 10080, 20160, 43200];
15,
30,
60,
120,
180,
360,
720,
1440,
4320,
10080,
20160,
43200
];
int updateInterval = 0;
late SplineInterpolation updateIntervalInterpolator; // 🤓
String updateIntervalLabel = tr('neverManualOnly');
@@ -39,7 +51,8 @@ class _SettingsPageState extends State<SettingsPage> {
void initUpdateIntervalInterpolator() {
List<InterpolationNode> nodes = [];
for (final (index, element) in updateIntervalNodes.indexed) {
nodes.add(InterpolationNode(x: index.toDouble()+1, y: element.toDouble()));
nodes.add(
InterpolationNode(x: index.toDouble() + 1, y: element.toDouble()));
}
updateIntervalInterpolator = SplineInterpolation(nodes: nodes);
}
@@ -90,21 +103,18 @@ class _SettingsPageState extends State<SettingsPage> {
var followSystemThemeExplanation = FutureBuilder(
builder: (ctx, val) {
return ((val.data?.version.sdkInt ?? 30) < 29) ?
Text(tr('followSystemThemeExplanation'),
return ((val.data?.version.sdkInt ?? 30) < 29)
? Text(tr('followSystemThemeExplanation'),
style: Theme.of(context).textTheme.labelSmall)
: const SizedBox.shrink();
},
future: DeviceInfoPlugin().androidInfo
);
future: DeviceInfoPlugin().androidInfo);
Future<bool> colorPickerDialog() async {
return ColorPicker(
color: settingsProvider.themeColor,
onColorChanged: (Color color) =>
setState(() =>
settingsProvider.themeColor = color
),
setState(() => settingsProvider.themeColor = color),
actionButtons: const ColorPickerActionButtons(
okButton: true,
closeButton: true,
@@ -137,19 +147,17 @@ class _SettingsPageState extends State<SettingsPage> {
showColorName: true,
materialNameTextStyle: Theme.of(context).textTheme.bodySmall,
colorNameTextStyle: Theme.of(context).textTheme.bodySmall,
copyPasteBehavior: const ColorPickerCopyPasteBehavior(longPressMenu: true),
copyPasteBehavior:
const ColorPickerCopyPasteBehavior(longPressMenu: true),
).showPickerDialog(
context,
transitionBuilder: (BuildContext context,
Animation<double> a1, Animation<double> a2, Widget widget) {
transitionBuilder: (BuildContext context, Animation<double> a1,
Animation<double> a2, Widget widget) {
final double curvedValue = Curves.easeInCubic.transform(a1.value);
return Transform(
alignment: Alignment.center,
transform: Matrix4.diagonal3Values(curvedValue, curvedValue, 1),
child: Opacity(
opacity: curvedValue,
child: widget
),
child: Opacity(opacity: curvedValue, child: widget),
);
},
transitionDuration: const Duration(milliseconds: 250),
@@ -160,9 +168,9 @@ class _SettingsPageState extends State<SettingsPage> {
dense: true,
contentPadding: EdgeInsets.zero,
title: Text(tr('selectX', args: [tr('colour')])),
subtitle: Text("${ColorTools.nameThatColor(settingsProvider.themeColor)} "
"(${ColorTools.materialNameAndCode(settingsProvider.themeColor,
colorSwatchNameMap: colorsNameMap)})"),
subtitle: Text(
"${ColorTools.nameThatColor(settingsProvider.themeColor)} "
"(${ColorTools.materialNameAndCode(settingsProvider.themeColor, colorSwatchNameMap: colorsNameMap)})"),
trailing: ColorIndicator(
width: 40,
height: 40,
@@ -176,14 +184,12 @@ class _SettingsPageState extends State<SettingsPage> {
settingsProvider.themeColor = colorBeforeDialog;
});
}
}
)
);
}));
var useMaterialThemeSwitch = FutureBuilder(
builder: (ctx, val) {
return ((val.data?.version.sdkInt ?? 0) >= 31) ?
Row(
return ((val.data?.version.sdkInt ?? 0) >= 31)
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(child: Text(tr('useMaterialYou'))),
@@ -193,10 +199,10 @@ class _SettingsPageState extends State<SettingsPage> {
settingsProvider.useMaterialYou = value;
})
],
) : const SizedBox.shrink();
)
: const SizedBox.shrink();
},
future: DeviceInfoPlugin().androidInfo
);
future: DeviceInfoPlugin().androidInfo);
var sortDropdown = DropdownButtonFormField(
isExpanded: true,
@@ -343,13 +349,20 @@ class _SettingsPageState extends State<SettingsPage> {
),
//intervalDropdown,
height16,
if (showIntervalLabel) SizedBox(
child: Text("${tr('bgUpdateCheckInterval')}: $updateIntervalLabel")
) else const SizedBox(height: 16),
if (showIntervalLabel)
SizedBox(
child: Text(
"${tr('bgUpdateCheckInterval')}: $updateIntervalLabel"))
else
const SizedBox(height: 16),
intervalSlider,
FutureBuilder(
builder: (ctx, val) {
return (settingsProvider.updateInterval > 0) && (((val.data?.version.sdkInt ?? 0) >= 30) || settingsProvider.useShizuku)
return (settingsProvider.updateInterval >
0) &&
(((val.data?.version.sdkInt ?? 0) >=
30) ||
settingsProvider.useShizuku)
? Column(
crossAxisAlignment:
CrossAxisAlignment.start,
@@ -531,17 +544,31 @@ class _SettingsPageState extends State<SettingsPage> {
value: settingsProvider.useShizuku,
onChanged: (useShizuku) {
if (useShizuku) {
ShizukuApkInstaller.checkPermission().then((resCode) {
settingsProvider.useShizuku = resCode!.startsWith('granted');
ShizukuApkInstaller.checkPermission()
.then((resCode) {
settingsProvider.useShizuku =
resCode!.startsWith('granted');
switch (resCode) {
case 'binder_not_found':
showError(ObtainiumError(tr('shizukuBinderNotFound')), context);
showError(
ObtainiumError(tr(
'shizukuBinderNotFound')),
context);
case 'old_shizuku':
showError(ObtainiumError(tr('shizukuOld')), context);
showError(
ObtainiumError(
tr('shizukuOld')),
context);
case 'old_android_with_adb':
showError(ObtainiumError(tr('shizukuOldAndroidWithADB')), context);
showError(
ObtainiumError(tr(
'shizukuOldAndroidWithADB')),
context);
case 'denied':
showError(ObtainiumError(tr('cancelled')), context);
showError(
ObtainiumError(
tr('cancelled')),
context);
}
});
} else {
@@ -566,7 +593,8 @@ class _SettingsPageState extends State<SettingsPage> {
color: Theme.of(context).colorScheme.primary),
),
DropdownButtonFormField(
decoration: InputDecoration(labelText: tr('theme')),
decoration:
InputDecoration(labelText: tr('theme')),
value: settingsProvider.theme,
items: [
DropdownMenuItem(
@@ -593,17 +621,17 @@ class _SettingsPageState extends State<SettingsPage> {
height16,
if (settingsProvider.theme != ThemeSettings.light)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Flexible(child: Text(tr('useBlackTheme'))),
Switch(
value: settingsProvider.useBlackTheme,
onChanged: (value) {
settingsProvider.useBlackTheme = value;
}
)
]
),
settingsProvider.useBlackTheme =
value;
})
]),
height8,
useMaterialThemeSwitch,
if (!settingsProvider.useMaterialYou) colorPicker,
@@ -624,28 +652,39 @@ class _SettingsPageState extends State<SettingsPage> {
builder: (ctx, val) {
return (val.data?.version.sdkInt ?? 0) >= 34
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
height16,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Flexible(child: Text(tr('useSystemFont'))),
Flexible(
child: Text(tr(
'useSystemFont'))),
Switch(
value: settingsProvider.useSystemFont,
onChanged: (useSystemFont) {
value: settingsProvider
.useSystemFont,
onChanged:
(useSystemFont) {
if (useSystemFont) {
NativeFeatures.loadSystemFont().then((val) {
settingsProvider.useSystemFont = true;
NativeFeatures
.loadSystemFont()
.then((val) {
settingsProvider
.useSystemFont =
true;
});
} else {
settingsProvider.useSystemFont = false;
settingsProvider
.useSystemFont =
false;
}
})
]
)
]
)
])
])
: const SizedBox.shrink();
},
future: DeviceInfoPlugin().androidInfo),
@@ -801,17 +840,31 @@ class _SettingsPageState extends State<SettingsPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
TextButton.icon(
IconButton(
onPressed: () {
launchUrlString(settingsProvider.sourceUrl,
mode: LaunchMode.externalApplication);
},
icon: const Icon(Icons.code),
label: Text(
tr('appSource'),
tooltip: tr('appSource'),
),
IconButton(
onPressed: () {
launchUrlString('${settingsProvider.sourceUrl}/wiki',
mode: LaunchMode.externalApplication);
},
icon: const Icon(Icons.help_outline_rounded),
tooltip: tr('wiki'),
),
TextButton.icon(
IconButton(
onPressed: () {
launchUrlString('https://apps.obtainium.imranr.dev/',
mode: LaunchMode.externalApplication);
},
icon: const Icon(Icons.apps_rounded),
tooltip: tr('crowdsourcedConfigsLabel'),
),
IconButton(
onPressed: () {
context.read<LogsProvider>().get().then((logs) {
if (logs.isEmpty) {
@@ -827,7 +880,7 @@ class _SettingsPageState extends State<SettingsPage> {
});
},
icon: const Icon(Icons.bug_report_outlined),
label: Text(tr('appLogs'))),
tooltip: tr('appLogs'))
],
),
const SizedBox(

View File

@@ -142,19 +142,20 @@ List<MapEntry<String, int>> moveStrToEndMapEntryWithCount(
return arr;
}
Future<File> downloadFileWithRetry(
String url, String fileNameNoExt, Function? onProgress, String destDir,
Future<File> downloadFileWithRetry(String url, String fileName,
bool fileNameHasExt, Function? onProgress, String destDir,
{bool useExisting = true,
Map<String, String>? headers,
int retries = 3}) async {
try {
return await downloadFile(url, fileNameNoExt, onProgress, destDir,
return await downloadFile(
url, fileName, fileNameHasExt, onProgress, destDir,
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, destDir,
url, fileName, fileNameHasExt, onProgress, destDir,
useExisting: useExisting, headers: headers, retries: (retries - 1));
} else {
rethrow;
@@ -201,8 +202,8 @@ Future<String> checkPartialDownloadHash(String url, int bytesToGrab,
return hashListOfLists(bytes);
}
Future<File> downloadFile(
String url, String fileNameNoExt, Function? onProgress, String destDir,
Future<File> downloadFile(String url, String fileName, bool fileNameHasExt,
Function? onProgress, String destDir,
{bool useExisting = true, Map<String, String>? headers}) async {
// Send the initial request but cancel it as soon as you have the headers
var reqHeaders = headers ?? {};
@@ -222,7 +223,12 @@ Future<File> downloadFile(
if (url.toLowerCase().endsWith('.apk') && ext != 'apk') {
ext = 'apk';
}
File downloadedFile = File('$destDir/$fileNameNoExt.$ext');
fileName = fileName.split('/').last; // Ensure the fileName is a file name
File downloadedFile = File('$destDir/$fileName.$ext');
if (fileNameHasExt) {
// If the user says the filename already has an ext, ignore whatever you inferred from above
downloadedFile = File('$destDir/$fileName');
}
bool rangeFeatureEnabled = false;
if (resHeaders['accept-ranges']?.isNotEmpty == true) {
@@ -435,8 +441,8 @@ class AppsProvider with ChangeNotifier {
var headers = await source.getRequestHeaders(app.additionalSettings,
forAPKDownload: true);
var downloadedFile = await downloadFileWithRetry(
downloadUrl, fileNameNoExt,
headers: headers, (double? progress) {
downloadUrl, fileNameNoExt, false, headers: headers,
(double? progress) {
int? prog = progress?.ceil();
if (apps[app.id] != null) {
apps[app.id]!.downloadProgress = progress;
@@ -969,15 +975,8 @@ class AppsProvider with ChangeNotifier {
if (!downloadsAccessible && exportDir != null) {
downloadPath = exportDir.path;
}
await downloadFile(
fileUrl.value,
fileUrl.key
.split('.')
.reversed
.toList()
.sublist(1)
.reversed
.join('.'), (double? progress) {
await downloadFile(fileUrl.value, fileUrl.key, true,
(double? progress) {
notificationsProvider
.notify(DownloadNotification(fileUrl.key, progress?.ceil() ?? 0));
}, downloadPath,

View File

@@ -47,18 +47,18 @@ packages:
dependency: "direct main"
description:
name: app_links
sha256: "42dc15aecf2618ace4ffb74a2e58a50e45cd1b9f2c17c8f0cafe4c297f08c815"
sha256: "1c2b9e9c56d80d17610bcbd111b37187875c5d0ded8654caa1bda14ea753d001"
url: "https://pub.dev"
source: hosted
version: "4.0.1"
version: "6.0.1"
archive:
dependency: transitive
description:
name: archive
sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d"
sha256: ecf4273855368121b1caed0d10d4513c7241dfc813f7d3c8933b36622ae9b265
url: "https://pub.dev"
source: hosted
version: "3.4.10"
version: "3.5.1"
args:
dependency: transitive
description:
@@ -79,10 +79,10 @@ packages:
dependency: "direct main"
description:
name: background_fetch
sha256: "81d0d4eeecd17c971335438a5a55554c8302f479f92c7f7bc7f147f75d3f6074"
sha256: "2fe367c9be0e256dadb75b8b637b0b58a2a2d2317b7c8420bb1ae8b41e23fde3"
url: "https://pub.dev"
source: hosted
version: "1.3.3"
version: "1.3.4"
boolean_selector:
dependency: transitive
description:
@@ -147,14 +147,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.0"
convert:
dependency: transitive
description:
name: convert
sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592"
url: "https://pub.dev"
source: hosted
version: "3.1.1"
cross_file:
dependency: transitive
description:
@@ -271,10 +263,10 @@ packages:
dependency: "direct main"
description:
name: file_picker
sha256: "45c70b43df893027e441a6fa0aacc8f484fb9f9c60c746dc8f1dc4f774cf55cd"
sha256: "29c90806ac5f5fb896547720b73b17ee9aed9bba540dc5d91fe29f8c5745b10a"
url: "https://pub.dev"
source: hosted
version: "8.0.2"
version: "8.0.3"
fixnum:
dependency: transitive
description:
@@ -340,10 +332,10 @@ packages:
dependency: "direct main"
description:
name: flutter_local_notifications
sha256: "8cdc719114ab1c86c64bb7a86d3a679674c3637edd229e3a994797d4a1504ce4"
sha256: "84a3af6c7fb43c85c3528b434dacc7a7ed4551d1209d93773bf6045cec9ace68"
url: "https://pub.dev"
source: hosted
version: "17.1.0"
version: "17.1.1"
flutter_local_notifications_linux:
dependency: transitive
description:
@@ -463,22 +455,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.18.1"
js:
dependency: transitive
description:
name: js
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
url: "https://pub.dev"
source: hosted
version: "0.7.1"
json_annotation:
dependency: transitive
description:
name: json_annotation
sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
url: "https://pub.dev"
source: hosted
version: "4.8.1"
version: "4.9.0"
leak_tracker:
dependency: transitive
description:
@@ -635,10 +619,10 @@ packages:
dependency: transitive
description:
name: permission_handler_android
sha256: "1acac6bae58144b442f11e66621c062aead9c99841093c38f5bcdcc24c1c3474"
sha256: "8bb852cd759488893805c3161d0b2b5db55db52f773dbb014420b304055ba2c5"
url: "https://pub.dev"
source: hosted
version: "12.0.5"
version: "12.0.6"
permission_handler_apple:
dependency: transitive
description:
@@ -695,14 +679,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.8"
pointycastle:
dependency: transitive
description:
name: pointycastle
sha256: "79fbafed02cfdbe85ef3fd06c7f4bc2cbcba0177e61b765264853d4253b21744"
url: "https://pub.dev"
source: hosted
version: "3.9.0"
provider:
dependency: "direct main"
description:
@@ -825,10 +801,10 @@ packages:
dependency: "direct main"
description:
name: sqflite
sha256: "5ce2e1a15e822c3b4bfb5400455775e421da7098eed8adc8f26298ada7c9308c"
sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d
url: "https://pub.dev"
source: hosted
version: "2.3.3"
version: "2.3.3+1"
sqflite_common:
dependency: transitive
description:
@@ -889,10 +865,10 @@ packages:
dependency: transitive
description:
name: timezone
sha256: "1cfd8ddc2d1cfd836bc93e67b9be88c3adaeca6f40a00ca999104c30693cdca0"
sha256: a6ccda4a69a442098b602c44e61a1e2b4bf6f5516e875bbf0f427d5df14745d5
url: "https://pub.dev"
source: hosted
version: "0.9.2"
version: "0.9.3"
typed_data:
dependency: transitive
description:
@@ -1009,10 +985,10 @@ packages:
dependency: transitive
description:
name: webview_flutter_android
sha256: f038ee2fae73b509dde1bc9d2c5a50ca92054282de17631a9a3d515883740934
sha256: dad3313c9ead95517bb1cae5e1c9d20ba83729d5a59e5e83c0a2d66203f27f91
url: "https://pub.dev"
source: hosted
version: "3.16.0"
version: "3.16.1"
webview_flutter_platform_interface:
dependency: transitive
description:
@@ -1033,10 +1009,10 @@ packages:
dependency: transitive
description:
name: win32
sha256: "0a989dc7ca2bb51eac91e8fd00851297cfffd641aa7538b165c62637ca0eaa4a"
sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb"
url: "https://pub.dev"
source: hosted
version: "5.4.0"
version: "5.5.0"
win32_registry:
dependency: transitive
description:

View File

@@ -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.1.6+2263
version: 1.1.7+2264
environment:
sdk: '>=3.0.0 <4.0.0'
@@ -66,7 +66,7 @@ dependencies:
connectivity_plus: ^6.0.1
shared_storage: ^0.8.0
crypto: ^3.0.3
app_links: ^4.0.0
app_links: ^6.0.1
background_fetch: ^1.2.1
equations: ^5.0.2
flex_color_picker: ^3.4.1