From 5cf4c21ce391b243ea1b5222a502ba9c0f0dfb4d Mon Sep 17 00:00:00 2001 From: iDazai <50296346+iDazai@users.noreply.github.com> Date: Thu, 14 Sep 2023 08:37:46 +0200 Subject: [PATCH 1/3] Update de.json Translated latest strings --- assets/translations/de.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/translations/de.json b/assets/translations/de.json index 5ab4801..3c11e3d 100644 --- a/assets/translations/de.json +++ b/assets/translations/de.json @@ -247,14 +247,14 @@ "verifyLatestTag": "Überprüfe das 'latest' Tag", "exemptFromBackgroundUpdates": "Ausschluss von Hintergrundaktualisierungen (falls aktiviert)", "bgUpdatesOnWiFiOnly": "Hintergrundaktualisierungen deaktivieren, wenn kein WLAN vorhanden ist", - "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", - "versionExtractionRegEx": "Version Extraction RegEx", - "matchGroupToUse": "Match Group to Use", - "highlightTouchTargets": "Highlight less obvious touch targets", - "pickExportDir": "Pick Export Directory", - "autoExportOnChanges": "Auto-export on changes", - "filterVersionsByRegEx": "Filter Versions by Regular Expression", - "trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK", + "autoSelectHighestVersionCode": "Automatische Auswahl der höchsten APK Version", + "versionExtractionRegEx": "Versionsextrahierung mit Regulärem Ausdruck", + "matchGroupToUse": "Zu verwendende Gruppe abgleichen", + "highlightTouchTargets": "Weniger offensichtliche Touch-Ziele hervorheben", + "pickExportDir": "Wähle Export Verzeichnis", + "autoExportOnChanges": "Automatischer Export bei Änderungen", + "filterVersionsByRegEx": "Versionen nach Regulärem Ausdruck filtern", + "trySelectingSuggestedVersionCode": "Versuchen die vorgeschlagene APK-Version auszuwählen", "removeAppQuestion": { "one": "App entfernen?", "other": "Apps entfernen?" From 8c82f53dd271462dcc549f16a75208f77d47895b Mon Sep 17 00:00:00 2001 From: bluefly000 <101441707+bluefly000@users.noreply.github.com> Date: Thu, 14 Sep 2023 15:44:27 +0900 Subject: [PATCH 2/3] Update ja.json --- assets/translations/ja.json | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/assets/translations/ja.json b/assets/translations/ja.json index 9093e15..be3e9c8 100644 --- a/assets/translations/ja.json +++ b/assets/translations/ja.json @@ -144,7 +144,7 @@ "updatesAvailable": "アップデートが利用可能", "updatesAvailableNotifDescription": "Obtainiumが追跡している1つまたは複数のアプリのアップデートが利用可能であることをユーザーに通知する", "noNewUpdates": "新しいアップデートはありません", - "xHasAnUpdate": "{} のアップデートが利用可能です", + "xHasAnUpdate": "{} のアップデートが利用可能です。", "appsUpdated": "アプリをアップデートしました", "appsUpdatedNotifDescription": "1つまたは複数のAppのアップデートがバックグラウンドで適用されたことをユーザーに通知する", "xWasUpdatedToY": "{} が {} にアップデートされました", @@ -241,21 +241,23 @@ "customLinkFilterRegex": "正規表現によるカスタムリンクフィルター (デフォルト '.apk$')", "appsPossiblyUpdated": "アプリのアップデートを試行", "appsPossiblyUpdatedNotifDescription": "1つまたは複数のアプリのアップデートがバックグラウンドで適用された可能性があることをユーザーに通知する", - "xWasPossiblyUpdatedToY": "{} が {} にアップデートされた可能性があります", + "xWasPossiblyUpdatedToY": "{} が {} にアップデートされた可能性があります。", "enableBackgroundUpdates": "バックグラウンドアップデートを有効化する", "backgroundUpdateReqsExplanation": "バックグラウンドアップデートは、すべてのアプリで可能とは限りません。", "backgroundUpdateLimitsExplanation": "バックグラウンドアップデートが成功したかどうかは、Obtainiumを起動したときにしか判断できません。", "verifyLatestTag": "'latest'タグを確認する", + "intermediateLinkRegex": "最初にアクセスする「中間」リンクをフィルタリングする", + "intermediateLinkNotFound": "中間リンクが見つかりませんでした", "exemptFromBackgroundUpdates": "バックグラウンドアップデートを行わない (有効な場合)", "bgUpdatesOnWiFiOnly": "WiFiを使用していない場合,バックグラウンドアップデートを無効にする", - "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", - "versionExtractionRegEx": "Version Extraction RegEx", - "matchGroupToUse": "Match Group to Use", - "highlightTouchTargets": "Highlight less obvious touch targets", - "pickExportDir": "Pick Export Directory", - "autoExportOnChanges": "Auto-export on changes", - "filterVersionsByRegEx": "Filter Versions by Regular Expression", - "trySelectingSuggestedVersionCode": "Try selecting suggested versionCode APK", + "autoSelectHighestVersionCode": "最も高いバージョンコードのAPKを自動で選択する", + "versionExtractionRegEx": "バージョン抽出の正規表現", + "matchGroupToUse": "使用するマッチしたグループ", + "highlightTouchTargets": "目立たないタップ可能な対象をハイライトする", + "pickExportDir": "エクスポートディレクトリを選択", + "autoExportOnChanges": "変更があった際に自動でエクスポートする", + "filterVersionsByRegEx": "正規表現でバージョンをフィルタリングする", + "trySelectingSuggestedVersionCode": "提案されたバージョンコードのAPKを選択する", "removeAppQuestion": { "one": "アプリを削除しますか?", "other": "アプリを削除しますか?" @@ -297,15 +299,15 @@ "other": "{n} 個のログをクリアしました (前 = {before}, 後 = {after})" }, "xAndNMoreUpdatesAvailable": { - "one": "{} とさらに {} 個のアプリのアップデートが利用可能です", - "other": "{} とさらに {} 個のアプリのアップデートが利用可能です" + "one": "{} とさらに {} 個のアプリのアップデートが利用可能です。", + "other": "{} とさらに {} 個のアプリのアップデートが利用可能です。" }, "xAndNMoreUpdatesInstalled": { - "one": "{} とさらに {} 個のアプリがアップデートされました", - "other": "{} とさらに {} 個のアプリがアップデートされました" + "one": "{} とさらに {} 個のアプリがアップデートされました。", + "other": "{} とさらに {} 個のアプリがアップデートされました。" }, "xAndNMoreUpdatesPossiblyInstalled": { - "one": "{} とさらに 1 個のアプリがアップデートされた可能性があります", - "other": "{} とさらに {} 個のアプリがアップデートされた可能性があります" + "one": "{} とさらに 1 個のアプリがアップデートされた可能性があります。", + "other": "{} とさらに {} 個のアプリがアップデートされた可能性があります。" } } From e1f2baeeda640982b7b84a25e201d228d9daa855 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sat, 16 Sep 2023 04:31:03 -0400 Subject: [PATCH 3/3] Fix background update issue (#896) --- lib/main.dart | 2 +- lib/providers/apps_provider.dart | 45 ++++++++++++++++++++------------ pubspec.lock | 8 +++--- pubspec.yaml | 2 +- 4 files changed, 34 insertions(+), 23 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 14276a1..e9a4888 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -19,7 +19,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart'; // ignore: implementation_imports import 'package:easy_localization/src/localization.dart'; -const String currentVersion = '0.14.14'; +const String currentVersion = '0.14.15'; const String currentReleaseTag = 'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES diff --git a/lib/providers/apps_provider.dart b/lib/providers/apps_provider.dart index a9b5edd..7d08656 100644 --- a/lib/providers/apps_provider.dart +++ b/lib/providers/apps_provider.dart @@ -430,8 +430,8 @@ class AppsProvider with ChangeNotifier { zipFile: File(filePath), destinationDir: Directory(destinationPath)); } - Future installXApkDir( - DownloadedXApkDir dir, BuildContext? context) async { + Future installXApkDir(DownloadedXApkDir dir, + {bool needsBGWorkaround = false}) async { // We don't know which APKs in an XAPK are supported by the user's device // So we try installing all of them and assume success if at least one installed // If 0 APKs installed, throw the first install error encountered @@ -444,7 +444,8 @@ class AppsProvider with ChangeNotifier { if (file.path.toLowerCase().endsWith('.apk')) { try { somethingInstalled = somethingInstalled || - await installApk(DownloadedApk(dir.appId, file), context); + await installApk(DownloadedApk(dir.appId, file), + needsBGWorkaround: needsBGWorkaround); } catch (e) { logs.add( 'Could not install APK from XAPK \'${file.path}\': ${e.toString()}'); @@ -464,7 +465,8 @@ class AppsProvider with ChangeNotifier { } } - Future installApk(DownloadedApk file, BuildContext? context) async { + Future installApk(DownloadedApk file, + {bool needsBGWorkaround = false}) async { var newInfo = await pm.getPackageArchiveInfo(archiveFilePath: file.file.path); PackageInfo? appInfo = await getInstalledInfo(apps[file.appId]!.app.id); @@ -473,16 +475,19 @@ class AppsProvider with ChangeNotifier { !(await canDowngradeApps())) { throw DowngradeError(); } - int? code; - if (context == null) { - // In background installs, 'installApk' never returns so don't wait for it - // TODO: Find a fix to make this work synchronously without context - AndroidPackageInstaller.installApk(apkFilePath: file.file.path); - code = 0; // Be optimistic (ver. det. will get most wrong ones anyways) - } else { - code = - await AndroidPackageInstaller.installApk(apkFilePath: file.file.path); + if (needsBGWorkaround) { + // The below 'await' will never return if we are in a background process + // To work around this, we should assume the install will be successful + // So we update the app's installed version first as we will never get to the later code + // We can't conditionally get rid of the 'await' as this causes install fails (BG process times out) - see #896 + // TODO: When fixed, update this function and the calls to it accordingly + apps[file.appId]!.app.installedVersion = + apps[file.appId]!.app.latestVersion; + await saveApps([apps[file.appId]!.app], + attemptToCorrectInstallStatus: false); } + int? code = + await AndroidPackageInstaller.installApk(apkFilePath: file.file.path); bool installed = false; if (code != null && code != 0 && code != 3) { throw InstallError(code); @@ -649,11 +654,17 @@ class AppsProvider with ChangeNotifier { notifyListeners(); try { if (downloadedFile != null) { - // ignore: use_build_context_synchronously - await installApk(downloadedFile, context); + if (willBeSilent && context == null) { + installApk(downloadedFile, needsBGWorkaround: true); + } else { + await installApk(downloadedFile); + } } else { - // ignore: use_build_context_synchronously - await installXApkDir(downloadedDir!, context); + if (willBeSilent && context == null) { + installXApkDir(downloadedDir!, needsBGWorkaround: true); + } else { + await installXApkDir(downloadedDir!); + } } if (willBeSilent && context == null) { notificationsProvider?.notify(SilentUpdateAttemptNotification( diff --git a/pubspec.lock b/pubspec.lock index ef2647c..33758ce 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -198,10 +198,10 @@ packages: dependency: "direct main" description: name: dynamic_color - sha256: de4798a7069121aee12d5895315680258415de9b00e717723a1bd73d58f0126d + sha256: "96bff3df72e3d428bda2b874c7a521e8c86f592cae626ea594922fcc8d166e0c" url: "https://pub.dev" source: hosted - version: "1.6.6" + version: "1.6.7" easy_localization: dependency: "direct main" description: @@ -887,10 +887,10 @@ packages: dependency: transitive description: name: webview_flutter_android - sha256: "9427774649fd3c8b7ff53523051395d13aed2ca355822b822e6493d79f5fc05a" + sha256: ddc167c6676f57c8b367d19fcbee267d6dc6adf81bd6c3cb87981d30746e0a6d url: "https://pub.dev" source: hosted - version: "3.10.0" + version: "3.10.1" webview_flutter_platform_interface: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index db5c5ca..66170d7 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: 0.14.14+206 # When changing this, update the tag in main() accordingly +version: 0.14.15+207 # When changing this, update the tag in main() accordingly environment: sdk: '>=3.0.0 <4.0.0'