diff --git a/.github/workflows/mobile-release.yml b/.github/workflows/mobile-release.yml index 3868da64a2..fc910fbb89 100644 --- a/.github/workflows/mobile-release.yml +++ b/.github/workflows/mobile-release.yml @@ -39,7 +39,9 @@ jobs: encodedString: ${{ secrets.SIGNING_KEY_PHOTOS }} - name: Build independent APK - run: flutter build apk --release --flavor independent && mv build/app/outputs/flutter-apk/app-independent-release.apk build/app/outputs/flutter-apk/ente.apk + run: | + flutter build apk --release --flavor independent + mv build/app/outputs/flutter-apk/app-independent-release.apk build/app/outputs/flutter-apk/ente-${{ github.ref_name }}.apk env: SIGNING_KEY_PATH: "/home/runner/work/_temp/keystore/ente_photos_key.jks" SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS_PHOTOS }} @@ -52,5 +54,5 @@ jobs: - name: Create a draft GitHub release uses: ncipollo/release-action@v1 with: - artifacts: "mobile/build/app/outputs/flutter-apk/ente.apk,mobile/build/app/outputs/flutter-apk/sha256sum" + artifacts: "mobile/build/app/outputs/flutter-apk/ente-${{ github.ref_name }}.apk,mobile/build/app/outputs/flutter-apk/sha256sum" draft: true diff --git a/mobile/lib/ui/settings/app_update_dialog.dart b/mobile/lib/ui/settings/app_update_dialog.dart index 124b87927c..8038b7fa58 100644 --- a/mobile/lib/ui/settings/app_update_dialog.dart +++ b/mobile/lib/ui/settings/app_update_dialog.dart @@ -1,8 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:logging/logging.dart'; -import 'package:photos/core/configuration.dart'; -import 'package:photos/core/network/network.dart'; -import 'package:photos/ente_theme_data.dart'; import "package:photos/generated/l10n.dart"; import 'package:photos/services/update_service.dart'; import 'package:photos/theme/ente_theme.dart'; @@ -66,16 +62,12 @@ class _AppUpdateDialogState extends State { const Padding(padding: EdgeInsets.all(8)), ButtonWidget( buttonType: ButtonType.primary, - labelText: S.of(context).update, + labelText: S.of(context).download, onTap: () async { - Navigator.pop(context); // ignore: unawaited_futures - showDialog( - context: context, - builder: (BuildContext context) { - return ApkDownloaderDialog(widget.latestVersionInfo); - }, - barrierDismissible: false, + launchUrlString( + widget.latestVersionInfo!.url, + mode: LaunchMode.externalApplication, ); }, ), @@ -87,22 +79,6 @@ class _AppUpdateDialogState extends State { Navigator.of(context).pop(); }, ), - const Padding(padding: EdgeInsets.all(8)), - Center( - child: InkWell( - child: Text( - S.of(context).installManually, - style: Theme.of(context) - .textTheme - .bodySmall! - .copyWith(decoration: TextDecoration.underline), - ), - onTap: () => launchUrlString( - widget.latestVersionInfo!.url, - mode: LaunchMode.externalApplication, - ), - ), - ), ], ); final shouldForceUpdate = @@ -135,114 +111,3 @@ class _AppUpdateDialogState extends State { ); } } - -class ApkDownloaderDialog extends StatefulWidget { - final LatestVersionInfo? versionInfo; - - const ApkDownloaderDialog(this.versionInfo, {Key? key}) : super(key: key); - - @override - State createState() => _ApkDownloaderDialogState(); -} - -class _ApkDownloaderDialogState extends State { - String? _saveUrl; - double? _downloadProgress; - - @override - void initState() { - super.initState(); - _saveUrl = Configuration.instance.getTempDirectory() + - "ente-" + - widget.versionInfo!.name + - ".apk"; - _downloadApk(); - } - - @override - Widget build(BuildContext context) { - return WillPopScope( - onWillPop: () async => false, - child: AlertDialog( - title: Text( - S.of(context).downloading, - style: const TextStyle( - fontSize: 16, - ), - textAlign: TextAlign.center, - ), - content: LinearProgressIndicator( - value: _downloadProgress, - valueColor: AlwaysStoppedAnimation( - Theme.of(context).colorScheme.greenAlternative, - ), - ), - ), - ); - } - - Future _downloadApk() async { - try { - await NetworkClient.instance.getDio().download( - widget.versionInfo!.url, - _saveUrl, - onReceiveProgress: (count, _) { - setState(() { - _downloadProgress = count / widget.versionInfo!.size; - }); - }, - ); - Navigator.of(context, rootNavigator: true).pop('dialog'); - // OpenFile.open(_saveUrl); - } catch (e) { - Logger("ApkDownloader").severe(e); - final AlertDialog alert = AlertDialog( - title: Text(S.of(context).sorry), - content: Text(S.of(context).theDownloadCouldNotBeCompleted), - actions: [ - TextButton( - child: Text( - S.of(context).ignoreUpdate, - style: const TextStyle( - color: Colors.white, - ), - ), - onPressed: () { - Navigator.of(context, rootNavigator: true).pop('dialog'); - Navigator.of(context, rootNavigator: true).pop('dialog'); - }, - ), - TextButton( - child: Text( - S.of(context).retry, - style: TextStyle( - color: Theme.of(context).colorScheme.greenAlternative, - ), - ), - onPressed: () { - Navigator.of(context, rootNavigator: true).pop('dialog'); - Navigator.of(context, rootNavigator: true).pop('dialog'); - showDialog( - context: context, - builder: (BuildContext context) { - return ApkDownloaderDialog(widget.versionInfo); - }, - barrierDismissible: false, - ); - }, - ), - ], - ); - - // ignore: unawaited_futures - showDialog( - context: context, - builder: (BuildContext context) { - return alert; - }, - barrierColor: Colors.black87, - ); - return; - } - } -} diff --git a/mobile/pubspec.yaml b/mobile/pubspec.yaml index 2ea9bb3cef..ccee2aae9c 100644 --- a/mobile/pubspec.yaml +++ b/mobile/pubspec.yaml @@ -122,8 +122,6 @@ dependencies: motionphoto: git: "https://github.com/ente-io/motionphoto.git" move_to_background: ^1.0.2 - - # open_file: ^3.2.1 onnxruntime: git: url: https://github.com/ente-io/onnxruntime.git