Added simple APK try auto-select by CPU arch #436

Plus minor form switch UI fixes (overflow, spacing)
This commit is contained in:
Imran Remtulla
2023-04-06 22:37:24 -04:00
parent 49affd1bd4
commit 0804e680b2
12 changed files with 37 additions and 3 deletions

View File

@ -222,6 +222,7 @@
"versionDetection": "Versionserkennung",
"standardVersionDetection": "Standardversionserkennung",
"groupByCategory": "Group by Category",
"autoApkFilterByArch": "Attempt to filter APKs by CPU architecture if possible",
"removeAppQuestion": {
"one": "App entfernen?",
"other": "App entfernen?"

View File

@ -222,6 +222,7 @@
"versionDetection": "Version Detection",
"standardVersionDetection": "Standard version detection",
"groupByCategory": "Group by Category",
"autoApkFilterByArch": "Attempt to filter APKs by CPU architecture if possible",
"removeAppQuestion": {
"one": "Remove App?",
"other": "Remove Apps?"

View File

@ -222,6 +222,7 @@
"versionDetection": "تشخیص نسخه",
"standardVersionDetection": "تشخیص نسخه استاندارد",
"groupByCategory": "Group by Category",
"autoApkFilterByArch": "Attempt to filter APKs by CPU architecture if possible",
"removeAppQuestion": {
"one": "برنامه حذف شود؟",
"other": "برنامه ها حذف شوند؟"

View File

@ -222,6 +222,7 @@
"versionDetection": "Détection des versions",
"standardVersionDetection": "Détection de version standard",
"groupByCategory": "Group by Category",
"autoApkFilterByArch": "Attempt to filter APKs by CPU architecture if possible",
"removeAppQuestion": {
"one": "Supprimer l'application ?",
"other": "Supprimer les applications ?"

View File

@ -221,6 +221,7 @@
"versionDetection": "Verzió érzékelés",
"standardVersionDetection": "Alapért. verzió érzékelés",
"groupByCategory": "Csoportosítás Kategória alapján",
"autoApkFilterByArch": "Attempt to filter APKs by CPU architecture if possible",
"removeAppQuestion": {
"one": "Eltávolítja az alkalmazást?",
"other": "Eltávolítja az alkalmazást?"

View File

@ -222,6 +222,7 @@
"versionDetection": "Rilevamento di versione",
"standardVersionDetection": "Rilevamento di versione standard",
"groupByCategory": "Group by Category",
"autoApkFilterByArch": "Attempt to filter APKs by CPU architecture if possible",
"removeAppQuestion": {
"one": "Rimuovere l'App?",
"other": "Rimuovere le App?"

View File

@ -222,6 +222,7 @@
"versionDetection": "バージョン検出",
"standardVersionDetection": "標準のバージョン検出",
"groupByCategory": "Group by Category",
"autoApkFilterByArch": "Attempt to filter APKs by CPU architecture if possible",
"removeAppQuestion": {
"one": "アプリを削除しますか?",
"other": "アプリを削除しますか?"

View File

@ -222,6 +222,7 @@
"versionDetection": "Version Detection",
"standardVersionDetection": "Standard version detection",
"groupByCategory": "Group by Category",
"autoApkFilterByArch": "Attempt to filter APKs by CPU architecture if possible",
"removeAppQuestion": {
"one": "删除应用?",
"other": "删除应用?"

View File

@ -267,7 +267,10 @@ class _GeneratedFormState extends State<GeneratedForm> {
formInputs[r][e] = Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(widget.items[r][e].label),
Flexible(child: Text(widget.items[r][e].label)),
const SizedBox(
width: 8,
),
Switch(
value: values[widget.items[r][e].key],
onChanged: (value) {

View File

@ -21,7 +21,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart';
// ignore: implementation_imports
import 'package:easy_localization/src/localization.dart';
const String currentVersion = '0.11.25';
const String currentVersion = '0.11.26';
const String currentReleaseTag =
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES

View File

@ -3,6 +3,7 @@
import 'dart:convert';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:html/dom.dart';
import 'package:http/http.dart';
@ -146,6 +147,11 @@ class App {
.toList();
}
}
// Arch based APK filter option should be disabled if it previously did not exist
if (json['additionalSettings'] != null &&
jsonDecode(json['additionalSettings'])['autoApkFilterByArch'] == null) {
additionalSettings['autoApkFilterByArch'] = false;
}
return App(
json['id'] as String,
json['url'] as String,
@ -294,6 +300,10 @@ class AppSource {
}
])
],
[
GeneratedFormSwitch('autoApkFilterByArch',
label: tr('autoApkFilterByArch'), defaultValue: true)
],
[GeneratedFormTextField('appName', label: tr('appName'), required: false)]
];
@ -442,6 +452,19 @@ class SourceProvider {
if (apk.apkUrls.isEmpty && !trackOnly) {
throw NoAPKError();
}
if (apk.apkUrls.length > 1 &&
additionalSettings['autoApkFilterByArch'] == true) {
var abis = (await DeviceInfoPlugin().androidInfo).supportedAbis;
for (var abi in abis) {
var urls2 = apk.apkUrls
.where((element) => RegExp('.*$abi.*').hasMatch(element.key))
.toList();
if (urls2.isNotEmpty && urls2.length < apk.apkUrls.length) {
apk.apkUrls = urls2;
break;
}
}
}
String apkVersion = apk.version.replaceAll('/', '-');
var name = currentApp != null ? currentApp.name.trim() : '';
name = name.isNotEmpty

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: 0.11.25+147 # When changing this, update the tag in main() accordingly
version: 0.11.26+148 # When changing this, update the tag in main() accordingly
environment:
sdk: '>=2.18.2 <3.0.0'