Compare commits

...

8 Commits

Author SHA1 Message Date
Imran
d32befb832 Merge pull request #2130 from ImranR98/dev
Bugfix - app crashes when language set to zh_Hant_TW
2025-02-21 11:52:02 -06:00
Imran Remtulla
94d8295992 Bugfix - app crashes when language set to zh_Hant_TW 2025-02-21 12:51:44 -05:00
Imran
dcf9f5732a Merge pull request #2129 from ImranR98/dev
- Correct spelling of Wi-Fi - not "WiFi" (#2121)
- Change font to Montserrat (#2122)
- Extract GitLab Asset Filenames (#2127)
- Fix "Bad State: No element" Error on Some Direct APK Links (#2128)
2025-02-21 10:05:46 -06:00
Imran Remtulla
c89790d58f Increment version, update packages 2025-02-21 11:04:25 -05:00
Imran Remtulla
3633c58bea Change font to Montserrat (#2122) 2025-02-21 11:01:38 -05:00
Imran Remtulla
9770501aec Correct spelling of Wi-Fi - not "WiFi" (#2121) 2025-02-21 10:44:49 -05:00
Imran Remtulla
167d0ccced Extract GitLab Asset Filenames (#2127) 2025-02-21 10:39:45 -05:00
Imran Remtulla
430d1f2690 Fix "Bad State: No element" Error on Some Direct APK Links (#2128) 2025-02-21 10:22:49 -05:00
20 changed files with 93 additions and 86 deletions

Binary file not shown.

View File

@@ -255,7 +255,7 @@
"intermediateLinkNotFound": "Intermediate veza nije nađena",
"intermediateLink": "Intermediate veza",
"exemptFromBackgroundUpdates": "Izuzmi iz ažuriranja u pozadini (ako su uključeni)",
"bgUpdatesOnWiFiOnly": "Isključite ažuriranje u pozadini kada niste na WiFi-ju",
"bgUpdatesOnWiFiOnly": "Isključite ažuriranje u pozadini kada niste naWi-Fi-ju",
"bgUpdatesWhileChargingOnly": "Disable background updates when not charging",
"autoSelectHighestVersionCode": "Automatski izaberite najveću (verziju) versionCode APK-a",
"versionExtractionRegEx": "RegEx ekstrakcija verzije",

View File

@@ -255,7 +255,7 @@
"intermediateLinkNotFound": "Intermediate link not found",
"intermediateLink": "Intermediate link",
"exemptFromBackgroundUpdates": "Exempt from background updates (if enabled)",
"bgUpdatesOnWiFiOnly": "Disable background updates when not on WiFi",
"bgUpdatesOnWiFiOnly": "Disable background updates when not onWi-Fi",
"bgUpdatesWhileChargingOnly": "Disable background updates when not charging",
"autoSelectHighestVersionCode": "Auto-select highest versionCode APK",
"versionExtractionRegEx": "Version String Extraction RegEx",

View File

@@ -255,7 +255,7 @@
"intermediateLinkNotFound": "Enlace intermedio no encontrado",
"intermediateLink": "Enlace intermedio",
"exemptFromBackgroundUpdates": "Exenta de actualizciones en segundo plano (si están habilitadas)",
"bgUpdatesOnWiFiOnly": "Deshabilitar las actualizaciones en segundo plano sin WiFi",
"bgUpdatesOnWiFiOnly": "Deshabilitar las actualizaciones en segundo plano sinWi-Fi",
"bgUpdatesWhileChargingOnly": "Desactiva las actualizaciones en segundo plano cuando no estés cargando",
"autoSelectHighestVersionCode": "Auto selección del paquete APK con versión más reciente",
"versionExtractionRegEx": "Versión de extracción RegEx",

View File

@@ -255,7 +255,7 @@
"intermediateLinkNotFound": "لینک میانی پیدا نشد",
"intermediateLink": "پیوند میانی",
"exemptFromBackgroundUpdates": "معاف از به‌روزرسانی‌های پس‌زمینه (در صورت فعال بودن)",
"bgUpdatesOnWiFiOnly": "به‌روزرسانی‌های پس‌زمینه را در صورت عدم اتصال به WiFi غیرفعال کنید",
"bgUpdatesOnWiFiOnly": "به‌روزرسانی‌های پس‌زمینه را در صورت عدم اتصال بهWi-Fi غیرفعال کنید",
"bgUpdatesWhileChargingOnly": "به‌روزرسانی‌های پس‌زمینه را هنگام شارژ نشدن غیرفعال کنید",
"autoSelectHighestVersionCode": "انتخاب خودکار بالاترین نسخه کد APK",
"versionExtractionRegEx": "نسخه استخراج RegEx",

View File

@@ -255,7 +255,7 @@
"intermediateLinkNotFound": "Lien intermédiaire introuvable",
"intermediateLink": "Lien intermédiaire",
"exemptFromBackgroundUpdates": "Exclure de la mise à jour en arrière-plan (si activé)",
"bgUpdatesOnWiFiOnly": "Désactiver les mises à jour en arrière-plan lorsque vous n'êtes pas en WiFi",
"bgUpdatesOnWiFiOnly": "Désactiver les mises à jour en arrière-plan lorsque vous n'êtes pas enWi-Fi",
"bgUpdatesWhileChargingOnly": "Désactiver les mises à jour en arrière-plan lorsque le véhicule n'est pas en charge",
"autoSelectHighestVersionCode": "Sélectionner automatiquement la version la plus récente du code APK",
"versionExtractionRegEx": "Extraire la version par Expression régulière",

View File

@@ -255,7 +255,7 @@
"intermediateLinkNotFound": "Tautan perantara tidak ditemukan",
"intermediateLink": "Tautan perantara",
"exemptFromBackgroundUpdates": "Dikecualikan dari pembaruan latar belakang (jika diaktifkan)",
"bgUpdatesOnWiFiOnly": "Nonaktifkan pembaruan latar belakang saat tidak menggunakan WiFi",
"bgUpdatesOnWiFiOnly": "Nonaktifkan pembaruan latar belakang saat tidak menggunakanWi-Fi",
"bgUpdatesWhileChargingOnly": "Menonaktifkan pembaruan latar belakang saat tidak mengisi daya",
"autoSelectHighestVersionCode": "Pilih otomatis APK dengan versi kode tertinggi",
"versionExtractionRegEx": "Reguler ekspresi terkait ekstraksi versi string",

View File

@@ -255,7 +255,7 @@
"intermediateLinkNotFound": "Link intermedio non trovato",
"intermediateLink": "Collegamento intermedio",
"exemptFromBackgroundUpdates": "Esente da aggiornamenti in secondo piano (se attivo)",
"bgUpdatesOnWiFiOnly": "Disattiva aggiornamenti in secondo piano quando non si usa il WiFi",
"bgUpdatesOnWiFiOnly": "Disattiva aggiornamenti in secondo piano quando non si usa ilWi-Fi",
"bgUpdatesWhileChargingOnly": "Disabilita gli aggiornamenti in background quando non è in carica",
"autoSelectHighestVersionCode": "Auto-seleziona APK con versionCode più alto",
"versionExtractionRegEx": "RegEx di estrazione versione",

View File

@@ -255,7 +255,7 @@
"intermediateLinkNotFound": "Intermediaire link niet gevonden",
"intermediateLink": "Intermediaire link",
"exemptFromBackgroundUpdates": "Vrijgesteld van achtergrond-updates (indien ingeschakeld)",
"bgUpdatesOnWiFiOnly": "Achtergrond-updates uitschakelen wanneer niet verbonden met WiFi",
"bgUpdatesOnWiFiOnly": "Achtergrond-updates uitschakelen wanneer niet verbonden metWi-Fi",
"bgUpdatesWhileChargingOnly": "Achtergrondupdates uitschakelen als er niet wordt opgeladen",
"autoSelectHighestVersionCode": "De APK met de hoogste versiecode automatisch selecteren",
"versionExtractionRegEx": "Reguliere expressie voor versie-extractie",

View File

@@ -255,7 +255,7 @@
"intermediateLinkNotFound": "Mellanlänk hittades inte",
"intermediateLink": "Mellanlänk",
"exemptFromBackgroundUpdates": "Undta från bakgrundsuppdateringar (om aktiverad)",
"bgUpdatesOnWiFiOnly": "Inaktivera Bakgrundsuppdateringar utan WiFi",
"bgUpdatesOnWiFiOnly": "Inaktivera Bakgrundsuppdateringar utanWi-Fi",
"bgUpdatesWhileChargingOnly": "Inaktivera bakgrundsuppdateringar när du inte laddar",
"autoSelectHighestVersionCode": "Välj automatiskt högsta versionskod APK",
"versionExtractionRegEx": "Version Extraction RegEx",

View File

@@ -255,7 +255,7 @@
"intermediateLinkNotFound": "Không tìm thấy liên kết trung gian",
"intermediateLink": "Liên kết trung gian",
"exemptFromBackgroundUpdates": "Miễn cập nhật nền (nếu được bật)",
"bgUpdatesOnWiFiOnly": "Tắt cập nhật nền khi không có WiFi",
"bgUpdatesOnWiFiOnly": "Tắt cập nhật nền khi không cóWi-Fi",
"bgUpdatesWhileChargingOnly": "Disable background updates when not charging",
"autoSelectHighestVersionCode": "Tự động chọn APK mã phiên bản cao nhất",
"versionExtractionRegEx": "Trích xuất phiên bản RegEx",

View File

@@ -255,7 +255,7 @@
"intermediateLinkNotFound": "沒有找到中間連結",
"intermediateLink": "中間連結",
"exemptFromBackgroundUpdates": "免除背景更新(若已啟用)",
"bgUpdatesOnWiFiOnly": "停用非 WiFi 的背景更新",
"bgUpdatesOnWiFiOnly": "停用非Wi-Fi 的背景更新",
"bgUpdatesWhileChargingOnly": "Disable background updates when not charging",
"autoSelectHighestVersionCode": "自動選擇最高 versionCode 的 APK",
"versionExtractionRegEx": "版本字串提取正則表達式",

View File

@@ -163,29 +163,39 @@ class GitLab extends AppSource {
apkDetailsList = json.map((e) {
var apkUrlsFromAssets = (e['assets']?['links'] as List<dynamic>? ?? [])
.map((e) {
return (e['direct_asset_url'] ?? e['url'] ?? '') as String;
var url = (e['direct_asset_url'] ?? e['url'] ?? '') as String;
var parsedUrl = url.isNotEmpty ? Uri.parse(url) : null;
return MapEntry(
(e['name'] ??
(parsedUrl != null && parsedUrl.pathSegments.isNotEmpty
? parsedUrl.pathSegments.last
: 'unknown')) as String,
(e['direct_asset_url'] ?? e['url'] ?? '') as String);
})
.where((s) => s.isNotEmpty)
.where((s) => s.key.isNotEmpty)
.toList();
List<String> uploadedAPKsFromDescription =
((e['description'] ?? '') as String)
.split('](')
.join('\n')
.split('.apk)')
.join('.apk\n')
.split('\n')
.where((s) => s.startsWith('/uploads/') && s.endsWith('apk'))
.map((s) => 'https://${hosts[0]}/-/project/$projectId$s')
.toList();
var apkUrlsSet = apkUrlsFromAssets.toSet();
apkUrlsSet.addAll(uploadedAPKsFromDescription);
var uploadedAPKsFromDescription = ((e['description'] ?? '') as String)
.split('](')
.join('\n')
.split('.apk)')
.join('.apk\n')
.split('\n')
.where((s) => s.startsWith('/uploads/') && s.endsWith('apk'))
.map((s) => 'https://${hosts[0]}/-/project/$projectId$s')
.map((l) => MapEntry(Uri.parse(l).pathSegments.last, l))
.toList();
Map<String, String> apkUrls = {};
for (var entry in apkUrlsFromAssets) {
apkUrls[entry.key] = entry.value;
}
for (var entry in uploadedAPKsFromDescription) {
apkUrls[entry.key] = entry.value;
}
var releaseDateString =
e['released_at'] ?? e['created_at'] ?? e['commit']?['created_at'];
DateTime? releaseDate =
releaseDateString != null ? DateTime.parse(releaseDateString) : null;
return APKDetails(
e['tag_name'] ?? e['name'],
getApkUrlsFromUrls(apkUrlsSet.toList()),
return APKDetails(e['tag_name'] ?? e['name'], apkUrls.entries.toList(),
AppNames(names.author, names.name.split('/').last),
releaseDate: releaseDate);
});

View File

@@ -358,10 +358,12 @@ class HTML extends AppSource {
.toString();
return APKDetails(
version,
[rel]
.map((e) =>
MapEntry('${e.hashCode}-${Uri.parse(e).pathSegments.last}', e))
.toList(),
[rel].map((e) {
var uri = Uri.parse(e);
var fileName =
uri.pathSegments.isNotEmpty ? uri.pathSegments.last : uri.origin;
return MapEntry('${e.hashCode}-$fileName', e);
}).toList(),
AppNames(uri.host, tr('app')));
}
}

View File

@@ -23,7 +23,7 @@ import 'package:easy_localization/src/localization.dart';
List<MapEntry<Locale, String>> supportedLocales = const [
MapEntry(Locale('en'), 'English'),
MapEntry(Locale('zh'), '简体中文'),
MapEntry(Locale('zh_Hant_TW'), '臺灣話'),
MapEntry(Locale('zh', 'Hant_TW'), '臺灣話'),
MapEntry(Locale('it'), 'Italiano'),
MapEntry(Locale('ja'), '日本語'),
MapEntry(Locale('hu'), 'Magyar'),
@@ -61,11 +61,11 @@ Future<void> loadTranslations() async {
var forceLocale = s.forcedLocale;
final controller = EasyLocalizationController(
saveLocale: true,
forceLocale: forceLocale != null ? Locale(forceLocale) : null,
forceLocale: forceLocale,
fallbackLocale: fallbackLocale,
supportedLocales: supportedLocales.map((e) => e.key).toList(),
assetLoader: const RootBundleAssetLoader(),
useOnlyLangCode: true,
useOnlyLangCode: false,
useFallbackTranslations: true,
path: localeDir,
onLoadError: (FlutterError e) {
@@ -119,7 +119,7 @@ void main() async {
supportedLocales: supportedLocales.map((e) => e.key).toList(),
path: localeDir,
fallbackLocale: fallbackLocale,
useOnlyLangCode: true,
useOnlyLangCode: false,
child: const Obtainium()),
));
BackgroundFetch.registerHeadlessTask(backgroundFetchHeadlessTask);
@@ -203,12 +203,9 @@ class _ObtainiumState extends State<Obtainium> {
});
}
}
if (!supportedLocales
.map((e) => e.key.languageCode)
.contains(context.locale.languageCode) ||
if (!supportedLocales.map((e) => e.key).contains(context.locale) ||
(settingsProvider.forcedLocale == null &&
context.deviceLocale.languageCode !=
context.locale.languageCode)) {
context.deviceLocale != context.locale)) {
settingsProvider.resetLocaleSafe(context);
}
}
@@ -251,17 +248,15 @@ class _ObtainiumState extends State<Obtainium> {
colorScheme: settingsProvider.theme == ThemeSettings.dark
? darkColorScheme
: lightColorScheme,
fontFamily: settingsProvider.useSystemFont
? 'SystemFont'
: 'Wix-Madefor-Display'),
fontFamily:
settingsProvider.useSystemFont ? 'SystemFont' : 'Montserrat'),
darkTheme: ThemeData(
useMaterial3: true,
colorScheme: settingsProvider.theme == ThemeSettings.light
? lightColorScheme
: darkColorScheme,
fontFamily: settingsProvider.useSystemFont
? 'SystemFont'
: 'Wix-Madefor-Display'),
fontFamily:
settingsProvider.useSystemFont ? 'SystemFont' : 'Montserrat'),
home: Shortcuts(shortcuts: <LogicalKeySet, Intent>{
LogicalKeySet(LogicalKeyboardKey.select): const ActivateIntent(),
}, child: const HomePage()));

View File

@@ -262,14 +262,14 @@ class _SettingsPageState extends State<SettingsPage> {
child: Text(tr('followSystem')),
),
...supportedLocales.map((e) => DropdownMenuItem(
value: e.key.toLanguageTag(),
value: e.key,
child: Text(e.value),
))
],
onChanged: (value) {
settingsProvider.forcedLocale = value;
if (value != null) {
context.setLocale(Locale(value));
context.setLocale(value);
} else {
settingsProvider.resetLocaleSafe(context);
}

View File

@@ -261,22 +261,24 @@ class SettingsProvider with ChangeNotifier {
notifyListeners();
}
String? get forcedLocale {
var fl = prefs?.getString('forcedLocale');
return supportedLocales
.where((element) => element.key.toLanguageTag() == fl)
.isNotEmpty
Locale? get forcedLocale {
var flSegs = prefs?.getString('forcedLocale')?.split('-');
var fl = flSegs != null && flSegs.isNotEmpty
? Locale(flSegs[0], flSegs.length > 1 ? flSegs[1] : null)
: null;
var set = supportedLocales.where((element) => element.key == fl).isNotEmpty
? fl
: null;
return set;
}
set forcedLocale(String? fl) {
set forcedLocale(Locale? fl) {
if (fl == null) {
prefs?.remove('forcedLocale');
} else if (supportedLocales
.where((element) => element.key.toLanguageTag() == fl)
.where((element) => element.key == fl)
.isNotEmpty) {
prefs?.setString('forcedLocale', fl);
prefs?.setString('forcedLocale', fl.toLanguageTag());
}
notifyListeners();
}
@@ -285,9 +287,7 @@ class SettingsProvider with ChangeNotifier {
a.length == b.length && a.union(b).length == a.length;
void resetLocaleSafe(BuildContext context) {
if (context.supportedLocales
.map((e) => e.languageCode)
.contains(context.deviceLocale.languageCode)) {
if (context.supportedLocales.contains(context.deviceLocale)) {
context.resetLocale();
} else {
context.setLocale(context.fallbackLocale!);

View File

@@ -48,10 +48,10 @@ packages:
dependency: "direct main"
description:
name: app_links
sha256: "433df2e61b10519407475d7f69e470789d23d593f28224c38ba1068597be7950"
sha256: "85ed8fc1d25a76475914fff28cc994653bd900bc2c26e4b57a49e097febb54ba"
url: "https://pub.dev"
source: hosted
version: "6.3.3"
version: "6.4.0"
app_links_linux:
dependency: transitive
description:
@@ -288,10 +288,10 @@ packages:
dependency: transitive
description:
name: ffi
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418"
url: "https://pub.dev"
source: hosted
version: "2.1.3"
version: "2.1.4"
file:
dependency: transitive
description:
@@ -304,10 +304,10 @@ packages:
dependency: "direct main"
description:
name: file_picker
sha256: "3d57312a53746ed4eb8c843dc50372454bbda37dd0c01a4d40fedc83e2ce4921"
sha256: "6f6bfa8797f296965bdc3e1f702574ab49a540c19b9237b401e7c2b25dfe594c"
url: "https://pub.dev"
source: hosted
version: "8.3.5"
version: "9.0.0"
fixnum:
dependency: transitive
description:
@@ -756,26 +756,26 @@ packages:
dependency: "direct main"
description:
name: permission_handler
sha256: "18bf33f7fefbd812f37e72091a15575e72d5318854877e0e4035a24ac1113ecb"
sha256: "59adad729136f01ea9e35a48f5d1395e25cba6cea552249ddbe9cf950f5d7849"
url: "https://pub.dev"
source: hosted
version: "11.3.1"
version: "11.4.0"
permission_handler_android:
dependency: transitive
description:
name: permission_handler_android
sha256: "71bbecfee799e65aff7c744761a57e817e73b738fedf62ab7afd5593da21f9f1"
sha256: d3971dcdd76182a0c198c096b5db2f0884b0d4196723d21a866fc4cdea057ebc
url: "https://pub.dev"
source: hosted
version: "12.0.13"
version: "12.1.0"
permission_handler_apple:
dependency: transitive
description:
name: permission_handler_apple
sha256: e6f6d73b12438ef13e648c4ae56bd106ec60d17e90a59c4545db6781229082a0
sha256: f84a188e79a35c687c132a0a0556c254747a08561e99ab933f12f6ca71ef3c98
url: "https://pub.dev"
source: hosted
version: "9.4.5"
version: "9.4.6"
permission_handler_html:
dependency: transitive
description:
@@ -788,10 +788,10 @@ packages:
dependency: transitive
description:
name: permission_handler_platform_interface
sha256: e9c8eadee926c4532d0305dff94b85bf961f16759c3af791486613152af4b4f9
sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878
url: "https://pub.dev"
source: hosted
version: "4.2.3"
version: "4.3.0"
permission_handler_windows:
dependency: transitive
description:
@@ -900,10 +900,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_android
sha256: ea86be7b7114f9e94fddfbb52649e59a03d6627ccd2387ebddcd6624719e9f16
sha256: a768fc8ede5f0c8e6150476e14f38e2417c0864ca36bb4582be8e21925a03c22
url: "https://pub.dev"
source: hosted
version: "2.4.5"
version: "2.4.6"
shared_preferences_foundation:
dependency: transitive
description:
@@ -932,10 +932,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_web
sha256: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e
sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019
url: "https://pub.dev"
source: hosted
version: "2.4.2"
version: "2.4.3"
shared_preferences_windows:
dependency: transitive
description:
@@ -1219,18 +1219,18 @@ packages:
dependency: transitive
description:
name: webview_flutter_wkwebview
sha256: "8e0593559bfecd35eb1757d6907ed6b995a41ef82607d6113df897c2805ce6be"
sha256: d7403ef4f042714c9ee2b26eaac4cadae7394cb0d4e608b1dd850c3ff96bd893
url: "https://pub.dev"
source: hosted
version: "3.18.0"
version: "3.18.2"
win32:
dependency: transitive
description:
name: win32
sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e
sha256: b89e6e24d1454e149ab20fbb225af58660f0c0bf4475544650700d8e2da54aef
url: "https://pub.dev"
source: hosted
version: "5.10.1"
version: "5.11.0"
win32_registry:
dependency: transitive
description:

View File

@@ -16,7 +16,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.41+2298
version: 1.1.43+2300
environment:
sdk: ^3.6.0
@@ -47,7 +47,7 @@ dependencies:
permission_handler: ^11.0.0
fluttertoast: ^8.0.9
device_info_plus: ^11.0.0
file_picker: ^8.0.0+1
file_picker: ^9.0.0
animations: ^2.0.4
android_package_installer: # TODO: See if PR will be accepted (dev may not be active), else remove this comment
git:
@@ -151,6 +151,6 @@ flutter:
# see https://flutter.dev/to/font-from-package
fonts:
- family: Wix-Madefor-Display
- family: Montserrat
fonts:
- asset: assets/fonts/WixMadeforDisplay-Regular.otf
- asset: assets/fonts/Montserrat-Regular.ttf