From ec07428e6de77365e6746f1aa85a7babd1d30004 Mon Sep 17 00:00:00 2001 From: fuwa Date: Wed, 19 Feb 2020 04:59:20 +0800 Subject: [PATCH 01/25] update zsh config in shell.nix --- etc/nix/shell.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/nix/shell.nix b/etc/nix/shell.nix index baddbb1..4a58ce1 100644 --- a/etc/nix/shell.nix +++ b/etc/nix/shell.nix @@ -38,7 +38,7 @@ let with nixpkgs; (buildFHSUserEnv { - name = "sora-tuner-env" + name = "cyberwow-build-env" ; targetPkgs = pkgs: (with pkgs; [ bash @@ -82,7 +82,7 @@ with nixpkgs; ; profile = '' export ANDROID_HOME=~/SDK/Android/Sdk - PATH=~/local/sdk/flutter/bin:$PATH + PATH=~/local/sdk/flutter/stable/bin:$PATH PATH=~/SDK/Android/android-studio/bin:$PATH export ANDROID_NDK_VERSION=r20 @@ -93,12 +93,12 @@ with nixpkgs; export PATH_NCURSES=${nixpkgs.ncurses5} export PATH - export _JAVA_AWT_WM_NONREPARENTING=1 export DART_VM_OPTIONS=--root-certs-file=/etc/ssl/certs/ca-certificates.crt export ANDROID_NDK_VERSION_WOW=r17c export ANDROID_NDK_ROOT_WOW=~/SDK/Android/ndk-archive/android-ndk-$ANDROID_NDK_VERSION_WOW + export ZSH_INIT=${nixpkgs.oh-my-zsh}/share/oh-my-zsh/oh-my-zsh.sh exec zsh '' From fa4e1458e2bcc41c5c798edaf6daff9cae6ebad4 Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 18 Feb 2020 16:47:15 +0800 Subject: [PATCH 02/25] add watch-build task --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 1b4c563..00611d5 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,10 @@ watch: find cyberwow/lib/ -name '*.dart' | \ entr kill -USR1 `cat /tmp/flutter.pid` +watch-build: + find cyberwow/lib/ -name '*.dart' | \ + entr $(MAKE) build-debug + run: cd cyberwow && \ flutter run --debug --pid-file /tmp/flutter.pid From 9d52582552ce96d4c975dccf0f04253e2f7557ed Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 18 Feb 2020 16:49:18 +0800 Subject: [PATCH 03/25] remove unused helper --- cyberwow/lib/controller/helper.dart | 36 ------------------------ cyberwow/lib/controller/process/run.dart | 1 - cyberwow/lib/state/loading.dart | 1 - 3 files changed, 38 deletions(-) delete mode 100644 cyberwow/lib/controller/helper.dart diff --git a/cyberwow/lib/controller/helper.dart b/cyberwow/lib/controller/helper.dart deleted file mode 100644 index 9513d25..0000000 --- a/cyberwow/lib/controller/helper.dart +++ /dev/null @@ -1,36 +0,0 @@ -/* - -Copyright 2019 fuwa - -This file is part of CyberWOW. - -CyberWOW is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -CyberWOW is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with CyberWOW. If not, see . - -*/ - -import 'dart:async'; -import 'dart:io'; - -import 'package:path_provider/path_provider.dart'; -import 'package:flutter/foundation.dart'; - -Future getBinaryPath(final String name) async { - final tmpDir = await getTemporaryDirectory(); - return tmpDir.path + '/' + name; -} - -Future binaryExists(final String name) async { - final binPath = await getBinaryPath(name); - return new File(binPath).exists(); -} diff --git a/cyberwow/lib/controller/process/run.dart b/cyberwow/lib/controller/process/run.dart index e74490f..5aa2850 100644 --- a/cyberwow/lib/controller/process/run.dart +++ b/cyberwow/lib/controller/process/run.dart @@ -26,7 +26,6 @@ import 'dart:io'; import 'dart:async'; import 'dart:convert'; -import '../helper.dart'; import '../../config.dart' as config; import '../../logging.dart'; import '../../logic/sensor/helper.dart' as helper; diff --git a/cyberwow/lib/state/loading.dart b/cyberwow/lib/state/loading.dart index 3c9bd38..2fd8751 100644 --- a/cyberwow/lib/state/loading.dart +++ b/cyberwow/lib/state/loading.dart @@ -21,7 +21,6 @@ along with CyberWOW. If not, see . import 'package:shared_preferences/shared_preferences.dart'; -import '../controller/helper.dart'; import '../config.dart' as config; import '../logging.dart'; import '../helper.dart'; From bf652633f828764922af254e5cfecacb61c85205 Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 18 Feb 2020 16:53:21 +0800 Subject: [PATCH 04/25] move controller to logic --- cyberwow/lib/{ => logic}/controller/daemon.dart | 4 ++-- cyberwow/lib/{ => logic}/controller/process/run.dart | 6 +++--- cyberwow/lib/{ => logic}/controller/refresh.dart | 6 +++--- cyberwow/lib/{ => logic}/controller/rpc/rpc.dart | 6 +++--- cyberwow/lib/{ => logic}/controller/rpc/rpc2.dart | 6 +++--- .../lib/{ => logic}/controller/rpc/rpc2View.dart | 4 ++-- cyberwow/lib/{ => logic}/controller/rpc/rpcView.dart | 4 ++-- cyberwow/lib/main.dart | 2 +- cyberwow/lib/state/resyncing.dart | 6 +++--- cyberwow/lib/state/synced.dart | 12 ++++++------ cyberwow/lib/state/syncing.dart | 6 +++--- 11 files changed, 31 insertions(+), 31 deletions(-) rename cyberwow/lib/{ => logic}/controller/daemon.dart (95%) rename cyberwow/lib/{ => logic}/controller/process/run.dart (95%) rename cyberwow/lib/{ => logic}/controller/refresh.dart (93%) rename cyberwow/lib/{ => logic}/controller/rpc/rpc.dart (96%) rename cyberwow/lib/{ => logic}/controller/rpc/rpc2.dart (96%) rename cyberwow/lib/{ => logic}/controller/rpc/rpc2View.dart (97%) rename cyberwow/lib/{ => logic}/controller/rpc/rpcView.dart (98%) diff --git a/cyberwow/lib/controller/daemon.dart b/cyberwow/lib/logic/controller/daemon.dart similarity index 95% rename from cyberwow/lib/controller/daemon.dart rename to cyberwow/lib/logic/controller/daemon.dart index 810b4e5..b98c587 100644 --- a/cyberwow/lib/controller/daemon.dart +++ b/cyberwow/lib/logic/controller/daemon.dart @@ -23,8 +23,8 @@ import 'dart:async'; import 'dart:convert'; import 'rpc/rpc.dart' as rpc; -import '../config.dart' as config; -import '../logging.dart'; +import '../../config.dart' as config; +import '../../logging.dart'; Future isConnected() async { final _outPeers = await rpc.outgoingConnectionsCount(); diff --git a/cyberwow/lib/controller/process/run.dart b/cyberwow/lib/logic/controller/process/run.dart similarity index 95% rename from cyberwow/lib/controller/process/run.dart rename to cyberwow/lib/logic/controller/process/run.dart index 5aa2850..659d61c 100644 --- a/cyberwow/lib/controller/process/run.dart +++ b/cyberwow/lib/logic/controller/process/run.dart @@ -26,9 +26,9 @@ import 'dart:io'; import 'dart:async'; import 'dart:convert'; -import '../../config.dart' as config; -import '../../logging.dart'; -import '../../logic/sensor/helper.dart' as helper; +import '../../../config.dart' as config; +import '../../../logging.dart'; +import '../../sensor/helper.dart' as helper; typedef ShouldExit = bool Function(); diff --git a/cyberwow/lib/controller/refresh.dart b/cyberwow/lib/logic/controller/refresh.dart similarity index 93% rename from cyberwow/lib/controller/refresh.dart rename to cyberwow/lib/logic/controller/refresh.dart index 855e70c..8b6699b 100644 --- a/cyberwow/lib/controller/refresh.dart +++ b/cyberwow/lib/logic/controller/refresh.dart @@ -25,9 +25,9 @@ import 'dart:ui'; import 'dart:async'; import 'rpc/rpc.dart' as rpc; -import '../config.dart'; -import '../logging.dart'; -import '../helper.dart'; +import '../../config.dart'; +import '../../logging.dart'; +import '../../helper.dart'; typedef GetNotificationFunc = AppLifecycleState Function(); diff --git a/cyberwow/lib/controller/rpc/rpc.dart b/cyberwow/lib/logic/controller/rpc/rpc.dart similarity index 96% rename from cyberwow/lib/controller/rpc/rpc.dart rename to cyberwow/lib/logic/controller/rpc/rpc.dart index f3be620..40f721a 100644 --- a/cyberwow/lib/controller/rpc/rpc.dart +++ b/cyberwow/lib/logic/controller/rpc/rpc.dart @@ -25,9 +25,9 @@ import 'dart:convert'; import 'package:http/http.dart' as http; import 'package:flutter/foundation.dart'; -import '../../config.dart' as config; -import '../../helper.dart'; -import '../../logging.dart'; +import '../../../config.dart' as config; +import '../../../helper.dart'; +import '../../../logging.dart'; int rpcID = 0; diff --git a/cyberwow/lib/controller/rpc/rpc2.dart b/cyberwow/lib/logic/controller/rpc/rpc2.dart similarity index 96% rename from cyberwow/lib/controller/rpc/rpc2.dart rename to cyberwow/lib/logic/controller/rpc/rpc2.dart index de7e471..ee920d4 100644 --- a/cyberwow/lib/controller/rpc/rpc2.dart +++ b/cyberwow/lib/logic/controller/rpc/rpc2.dart @@ -27,9 +27,9 @@ import 'package:http/http.dart' as http; import 'package:flutter/foundation.dart'; import 'package:intl/intl.dart'; -import '../../config.dart' as config; -import '../../helper.dart'; -import '../../logging.dart'; +import '../../../config.dart' as config; +import '../../../helper.dart'; +import '../../../logging.dart'; Future rpc2(final String method) async { final url = 'http://${config.host}:${config.c.port}/${method}'; diff --git a/cyberwow/lib/controller/rpc/rpc2View.dart b/cyberwow/lib/logic/controller/rpc/rpc2View.dart similarity index 97% rename from cyberwow/lib/controller/rpc/rpc2View.dart rename to cyberwow/lib/logic/controller/rpc/rpc2View.dart index cd260e6..4d8d7af 100644 --- a/cyberwow/lib/controller/rpc/rpc2View.dart +++ b/cyberwow/lib/logic/controller/rpc/rpc2View.dart @@ -23,8 +23,8 @@ import 'dart:math'; import 'package:intl/intl.dart'; -import '../../config.dart' as config; -import '../../helper.dart'; +import '../../../config.dart' as config; +import '../../../helper.dart'; Map txView(Map x) { const _remove = diff --git a/cyberwow/lib/controller/rpc/rpcView.dart b/cyberwow/lib/logic/controller/rpc/rpcView.dart similarity index 98% rename from cyberwow/lib/controller/rpc/rpcView.dart rename to cyberwow/lib/logic/controller/rpc/rpcView.dart index a92d5e6..7fc0427 100644 --- a/cyberwow/lib/controller/rpc/rpcView.dart +++ b/cyberwow/lib/logic/controller/rpc/rpcView.dart @@ -21,8 +21,8 @@ along with CyberWOW. If not, see . import 'package:intl/intl.dart'; -import '../../config.dart' as config; -import '../../helper.dart'; +import '../../../config.dart' as config; +import '../../../helper.dart'; Map getConnectionView(Map x) { const _remove = diff --git a/cyberwow/lib/main.dart b/cyberwow/lib/main.dart index 02f5702..a440236 100644 --- a/cyberwow/lib/main.dart +++ b/cyberwow/lib/main.dart @@ -28,7 +28,7 @@ import 'dart:io'; import 'dart:async'; import 'config.dart' as config; -import 'controller/process/run.dart' as process; +import 'logic/controller/process/run.dart' as process; import 'logging.dart'; import 'state.dart' as state; import 'widget.dart' as widget; diff --git a/cyberwow/lib/state/resyncing.dart b/cyberwow/lib/state/resyncing.dart index 6196111..7354e31 100644 --- a/cyberwow/lib/state/resyncing.dart +++ b/cyberwow/lib/state/resyncing.dart @@ -22,9 +22,9 @@ along with CyberWOW. If not, see . import 'dart:async'; import 'dart:collection'; -import '../controller/rpc/rpc.dart' as rpc; -import '../controller/daemon.dart' as daemon; -import '../controller/refresh.dart' as refresh; +import '../logic/controller/rpc/rpc.dart' as rpc; +import '../logic/controller/daemon.dart' as daemon; +import '../logic/controller/refresh.dart' as refresh; import '../config.dart' as config; import '../logging.dart'; diff --git a/cyberwow/lib/state/synced.dart b/cyberwow/lib/state/synced.dart index ac3e9b7..3de2760 100644 --- a/cyberwow/lib/state/synced.dart +++ b/cyberwow/lib/state/synced.dart @@ -26,12 +26,12 @@ import 'dart:collection'; import 'package:flutter/material.dart'; import '../config.dart' as config; -import '../controller/daemon.dart' as daemon; -import '../controller/refresh.dart' as refresh; -import '../controller/rpc/rpc.dart' as rpc; -import '../controller/rpc/rpc2.dart' as rpc; -import '../controller/rpc/rpc2View.dart' as rpc2View; -import '../controller/rpc/rpcView.dart' as rpcView; +import '../logic/controller/daemon.dart' as daemon; +import '../logic/controller/refresh.dart' as refresh; +import '../logic/controller/rpc/rpc.dart' as rpc; +import '../logic/controller/rpc/rpc2.dart' as rpc; +import '../logic/controller/rpc/rpc2View.dart' as rpc2View; +import '../logic/controller/rpc/rpcView.dart' as rpcView; import '../helper.dart'; import '../logging.dart'; diff --git a/cyberwow/lib/state/syncing.dart b/cyberwow/lib/state/syncing.dart index 3cc10a8..4204f87 100644 --- a/cyberwow/lib/state/syncing.dart +++ b/cyberwow/lib/state/syncing.dart @@ -22,9 +22,9 @@ along with CyberWOW. If not, see . import 'dart:async'; import 'dart:collection'; -import '../controller/rpc/rpc.dart' as rpc; -import '../controller/daemon.dart' as daemon; -import '../controller/refresh.dart' as refresh; +import '../logic/controller/rpc/rpc.dart' as rpc; +import '../logic/controller/daemon.dart' as daemon; +import '../logic/controller/refresh.dart' as refresh; import '../config.dart' as config; import '../logging.dart'; From 329f3d996a02d2f6bbd77be08a5ad82df627981a Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 18 Feb 2020 16:56:32 +0800 Subject: [PATCH 05/25] move daemon to sensor --- cyberwow/lib/logic/{controller => sensor}/daemon.dart | 2 +- cyberwow/lib/state/syncing.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename cyberwow/lib/logic/{controller => sensor}/daemon.dart (96%) diff --git a/cyberwow/lib/logic/controller/daemon.dart b/cyberwow/lib/logic/sensor/daemon.dart similarity index 96% rename from cyberwow/lib/logic/controller/daemon.dart rename to cyberwow/lib/logic/sensor/daemon.dart index b98c587..f40180f 100644 --- a/cyberwow/lib/logic/controller/daemon.dart +++ b/cyberwow/lib/logic/sensor/daemon.dart @@ -22,7 +22,7 @@ along with CyberWOW. If not, see . import 'dart:async'; import 'dart:convert'; -import 'rpc/rpc.dart' as rpc; +import '../controller/rpc/rpc.dart' as rpc; import '../../config.dart' as config; import '../../logging.dart'; diff --git a/cyberwow/lib/state/syncing.dart b/cyberwow/lib/state/syncing.dart index 4204f87..e83b587 100644 --- a/cyberwow/lib/state/syncing.dart +++ b/cyberwow/lib/state/syncing.dart @@ -23,7 +23,7 @@ import 'dart:async'; import 'dart:collection'; import '../logic/controller/rpc/rpc.dart' as rpc; -import '../logic/controller/daemon.dart' as daemon; +import '../logic/sensor/daemon.dart' as daemon; import '../logic/controller/refresh.dart' as refresh; import '../config.dart' as config; import '../logging.dart'; From 7fa0c4d249cd82ed99f5fc54a17b1de2499a61bf Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 18 Feb 2020 17:00:48 +0800 Subject: [PATCH 06/25] move rpc to sensor --- cyberwow/lib/logic/controller/refresh.dart | 1 - cyberwow/lib/logic/sensor/daemon.dart | 2 +- cyberwow/lib/logic/{controller => sensor}/rpc/rpc.dart | 0 .../lib/logic/{controller => sensor}/rpc/rpc2.dart | 0 .../lib/logic/{controller => sensor}/rpc/rpc2View.dart | 0 .../lib/logic/{controller => sensor}/rpc/rpcView.dart | 0 cyberwow/lib/state/resyncing.dart | 4 ++-- cyberwow/lib/state/synced.dart | 10 +++++----- cyberwow/lib/state/syncing.dart | 2 +- 9 files changed, 9 insertions(+), 10 deletions(-) rename cyberwow/lib/logic/{controller => sensor}/rpc/rpc.dart (100%) rename cyberwow/lib/logic/{controller => sensor}/rpc/rpc2.dart (100%) rename cyberwow/lib/logic/{controller => sensor}/rpc/rpc2View.dart (100%) rename cyberwow/lib/logic/{controller => sensor}/rpc/rpcView.dart (100%) diff --git a/cyberwow/lib/logic/controller/refresh.dart b/cyberwow/lib/logic/controller/refresh.dart index 8b6699b..8f6c20d 100644 --- a/cyberwow/lib/logic/controller/refresh.dart +++ b/cyberwow/lib/logic/controller/refresh.dart @@ -23,7 +23,6 @@ import 'package:logging/logging.dart'; import 'dart:ui'; import 'dart:async'; -import 'rpc/rpc.dart' as rpc; import '../../config.dart'; import '../../logging.dart'; diff --git a/cyberwow/lib/logic/sensor/daemon.dart b/cyberwow/lib/logic/sensor/daemon.dart index f40180f..b98c587 100644 --- a/cyberwow/lib/logic/sensor/daemon.dart +++ b/cyberwow/lib/logic/sensor/daemon.dart @@ -22,7 +22,7 @@ along with CyberWOW. If not, see . import 'dart:async'; import 'dart:convert'; -import '../controller/rpc/rpc.dart' as rpc; +import 'rpc/rpc.dart' as rpc; import '../../config.dart' as config; import '../../logging.dart'; diff --git a/cyberwow/lib/logic/controller/rpc/rpc.dart b/cyberwow/lib/logic/sensor/rpc/rpc.dart similarity index 100% rename from cyberwow/lib/logic/controller/rpc/rpc.dart rename to cyberwow/lib/logic/sensor/rpc/rpc.dart diff --git a/cyberwow/lib/logic/controller/rpc/rpc2.dart b/cyberwow/lib/logic/sensor/rpc/rpc2.dart similarity index 100% rename from cyberwow/lib/logic/controller/rpc/rpc2.dart rename to cyberwow/lib/logic/sensor/rpc/rpc2.dart diff --git a/cyberwow/lib/logic/controller/rpc/rpc2View.dart b/cyberwow/lib/logic/sensor/rpc/rpc2View.dart similarity index 100% rename from cyberwow/lib/logic/controller/rpc/rpc2View.dart rename to cyberwow/lib/logic/sensor/rpc/rpc2View.dart diff --git a/cyberwow/lib/logic/controller/rpc/rpcView.dart b/cyberwow/lib/logic/sensor/rpc/rpcView.dart similarity index 100% rename from cyberwow/lib/logic/controller/rpc/rpcView.dart rename to cyberwow/lib/logic/sensor/rpc/rpcView.dart diff --git a/cyberwow/lib/state/resyncing.dart b/cyberwow/lib/state/resyncing.dart index 7354e31..fd2569e 100644 --- a/cyberwow/lib/state/resyncing.dart +++ b/cyberwow/lib/state/resyncing.dart @@ -22,9 +22,9 @@ along with CyberWOW. If not, see . import 'dart:async'; import 'dart:collection'; -import '../logic/controller/rpc/rpc.dart' as rpc; -import '../logic/controller/daemon.dart' as daemon; import '../logic/controller/refresh.dart' as refresh; +import '../logic/sensor/rpc/rpc.dart' as rpc; +import '../logic/sensor/daemon.dart' as daemon; import '../config.dart' as config; import '../logging.dart'; diff --git a/cyberwow/lib/state/synced.dart b/cyberwow/lib/state/synced.dart index 3de2760..61b748a 100644 --- a/cyberwow/lib/state/synced.dart +++ b/cyberwow/lib/state/synced.dart @@ -26,12 +26,12 @@ import 'dart:collection'; import 'package:flutter/material.dart'; import '../config.dart' as config; -import '../logic/controller/daemon.dart' as daemon; +import '../logic/sensor/daemon.dart' as daemon; import '../logic/controller/refresh.dart' as refresh; -import '../logic/controller/rpc/rpc.dart' as rpc; -import '../logic/controller/rpc/rpc2.dart' as rpc; -import '../logic/controller/rpc/rpc2View.dart' as rpc2View; -import '../logic/controller/rpc/rpcView.dart' as rpcView; +import '../logic/sensor/rpc/rpc.dart' as rpc; +import '../logic/sensor/rpc/rpc2.dart' as rpc; +import '../logic/sensor/rpc/rpc2View.dart' as rpc2View; +import '../logic/sensor/rpc/rpcView.dart' as rpcView; import '../helper.dart'; import '../logging.dart'; diff --git a/cyberwow/lib/state/syncing.dart b/cyberwow/lib/state/syncing.dart index e83b587..9b21db6 100644 --- a/cyberwow/lib/state/syncing.dart +++ b/cyberwow/lib/state/syncing.dart @@ -22,7 +22,7 @@ along with CyberWOW. If not, see . import 'dart:async'; import 'dart:collection'; -import '../logic/controller/rpc/rpc.dart' as rpc; +import '../logic/sensor/rpc/rpc.dart' as rpc; import '../logic/sensor/daemon.dart' as daemon; import '../logic/controller/refresh.dart' as refresh; import '../config.dart' as config; From a258f7ee9e3a4c055e3e3d1bfdaeb507ccb86498 Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 18 Feb 2020 17:03:52 +0800 Subject: [PATCH 07/25] add logic/view/rpc --- .../lib/logic/{sensor/rpc/rpcView.dart => view/rpc/rpc.dart} | 0 .../logic/{sensor/rpc/rpc2View.dart => view/rpc/rpc2.dart} | 0 cyberwow/lib/state/synced.dart | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename cyberwow/lib/logic/{sensor/rpc/rpcView.dart => view/rpc/rpc.dart} (100%) rename cyberwow/lib/logic/{sensor/rpc/rpc2View.dart => view/rpc/rpc2.dart} (100%) diff --git a/cyberwow/lib/logic/sensor/rpc/rpcView.dart b/cyberwow/lib/logic/view/rpc/rpc.dart similarity index 100% rename from cyberwow/lib/logic/sensor/rpc/rpcView.dart rename to cyberwow/lib/logic/view/rpc/rpc.dart diff --git a/cyberwow/lib/logic/sensor/rpc/rpc2View.dart b/cyberwow/lib/logic/view/rpc/rpc2.dart similarity index 100% rename from cyberwow/lib/logic/sensor/rpc/rpc2View.dart rename to cyberwow/lib/logic/view/rpc/rpc2.dart diff --git a/cyberwow/lib/state/synced.dart b/cyberwow/lib/state/synced.dart index 61b748a..35aa741 100644 --- a/cyberwow/lib/state/synced.dart +++ b/cyberwow/lib/state/synced.dart @@ -30,8 +30,8 @@ import '../logic/sensor/daemon.dart' as daemon; import '../logic/controller/refresh.dart' as refresh; import '../logic/sensor/rpc/rpc.dart' as rpc; import '../logic/sensor/rpc/rpc2.dart' as rpc; -import '../logic/sensor/rpc/rpc2View.dart' as rpc2View; -import '../logic/sensor/rpc/rpcView.dart' as rpcView; +import '../logic/view/rpc/rpc2.dart' as rpc2View; +import '../logic/view/rpc/rpc.dart' as rpcView; import '../helper.dart'; import '../logging.dart'; From ecd17336ada4d276c0e46f65b73fd5c7b1f7e5b1 Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 18 Feb 2020 17:09:52 +0800 Subject: [PATCH 08/25] add interface/rpc --- cyberwow/lib/logic/interface/rpc/rpc.dart | 79 ++++++++++++++++++++++ cyberwow/lib/logic/interface/rpc/rpc2.dart | 64 ++++++++++++++++++ cyberwow/lib/logic/sensor/rpc/rpc.dart | 57 +--------------- cyberwow/lib/logic/sensor/rpc/rpc2.dart | 37 +--------- 4 files changed, 146 insertions(+), 91 deletions(-) create mode 100644 cyberwow/lib/logic/interface/rpc/rpc.dart create mode 100644 cyberwow/lib/logic/interface/rpc/rpc2.dart diff --git a/cyberwow/lib/logic/interface/rpc/rpc.dart b/cyberwow/lib/logic/interface/rpc/rpc.dart new file mode 100644 index 0000000..741417d --- /dev/null +++ b/cyberwow/lib/logic/interface/rpc/rpc.dart @@ -0,0 +1,79 @@ +/* + +Copyright 2019 fuwa + +This file is part of CyberWOW. + +CyberWOW is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +CyberWOW is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with CyberWOW. If not, see . + +*/ + +import 'dart:async'; +import 'dart:convert'; + +import 'package:http/http.dart' as http; +import 'package:flutter/foundation.dart'; + +import '../../../config.dart' as config; +import '../../../helper.dart'; +import '../../../logging.dart'; + +Future rpcHTTP(final String method) async { + final url = 'http://${config.host}:${config.c.port}/json_rpc'; + + final body = json.encode + ( + { + 'jsonrpc': '2.0', + 'method': method, + } + ); + + try { + final response = await http.post + ( url, + body: body + ); + return response; + } + catch (e) { + log.warning(e); + return null; + } +} + +dynamic jsonDecode(final String responseBody) => json.decode(responseBody); + +Future rpc(final String method, {final String field}) async { + final response = await rpcHTTP(method); + + if (response == null) return null; + + if (response.statusCode != 200) { + return null; + } else { + final _body = await compute(jsonDecode, response.body); + final _result = _body['result']; + if (_result == null) return null; + + final _field = field == null ? _result : _result[field]; + + return _field; + } +} + +Future rpcString(final String method, {final String field}) async { + final _field = await rpc(method, field: field); + return pretty(_field); +} diff --git a/cyberwow/lib/logic/interface/rpc/rpc2.dart b/cyberwow/lib/logic/interface/rpc/rpc2.dart new file mode 100644 index 0000000..58c28d4 --- /dev/null +++ b/cyberwow/lib/logic/interface/rpc/rpc2.dart @@ -0,0 +1,64 @@ +/* + +Copyright 2019 fuwa + +This file is part of CyberWOW. + +CyberWOW is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +CyberWOW is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with CyberWOW. If not, see . + +*/ + +import 'dart:async'; +import 'dart:convert'; +import 'dart:math'; + +import 'package:http/http.dart' as http; +import 'package:flutter/foundation.dart'; +import 'package:intl/intl.dart'; + +import '../../../config.dart' as config; +import '../../../helper.dart'; +import '../../../logging.dart'; + +Future rpc2(final String method) async { + final url = 'http://${config.host}:${config.c.port}/${method}'; + + try { + final response = await http.post + ( url, + ); + return response; + } + catch (e) { + log.warning(e); + return null; + } +} + +dynamic jsonDecode(final String responseBody) => json.decode(responseBody); + +Future rpc2String(final String method, {final String field}) async { + final response = await rpc2(method); + + if (response == null) return ''; + + if (response.statusCode != 200) { + return ''; + } else { + final _body = await compute(jsonDecode, response.body); + final _field = field == null ? _body: _body[field]; + + return pretty(_field); + } +} diff --git a/cyberwow/lib/logic/sensor/rpc/rpc.dart b/cyberwow/lib/logic/sensor/rpc/rpc.dart index 40f721a..c806768 100644 --- a/cyberwow/lib/logic/sensor/rpc/rpc.dart +++ b/cyberwow/lib/logic/sensor/rpc/rpc.dart @@ -23,65 +23,10 @@ import 'dart:async'; import 'dart:convert'; import 'package:http/http.dart' as http; -import 'package:flutter/foundation.dart'; -import '../../../config.dart' as config; import '../../../helper.dart'; import '../../../logging.dart'; - -int rpcID = 0; - -Future rpcHTTP(final String method) async { - final url = 'http://${config.host}:${config.c.port}/json_rpc'; - - rpcID += 1; - - final body = json.encode - ( - { - 'jsonrpc': '2.0', - 'id': rpcID.toString(), - 'method': method, - } - ); - - try { - final response = await http.post - ( url, - body: body - ); - return response; - } - catch (e) { - log.warning(e); - return null; - } -} - -dynamic jsonDecode(final String responseBody) => json.decode(responseBody); - -Future rpc(final String method, {final String field}) async { - final response = await rpcHTTP(method); - - if (response == null) return null; - - if (response.statusCode != 200) { - return null; - } else { - final _body = await compute(jsonDecode, response.body); - final _result = _body['result']; - if (_result == null) return null; - - final _field = field == null ? _result : _result[field]; - - return _field; - } -} - -Future rpcString(final String method, {final String field}) async { - final _field = await rpc(method, field: field); - return pretty(_field); -} +import '../../interface/rpc/rpc.dart'; Future syncInfo() => rpc('sync_info'); Future syncInfoString() => rpcString('sync_info'); diff --git a/cyberwow/lib/logic/sensor/rpc/rpc2.dart b/cyberwow/lib/logic/sensor/rpc/rpc2.dart index ee920d4..59cfd23 100644 --- a/cyberwow/lib/logic/sensor/rpc/rpc2.dart +++ b/cyberwow/lib/logic/sensor/rpc/rpc2.dart @@ -25,45 +25,12 @@ import 'dart:math'; import 'package:http/http.dart' as http; import 'package:flutter/foundation.dart'; -import 'package:intl/intl.dart'; -import '../../../config.dart' as config; import '../../../helper.dart'; import '../../../logging.dart'; +import '../../interface/rpc/rpc2.dart' as rpc2; -Future rpc2(final String method) async { - final url = 'http://${config.host}:${config.c.port}/${method}'; - - try { - final response = await http.post - ( url, - ); - return response; - } - catch (e) { - log.warning(e); - return null; - } -} - -dynamic jsonDecode(final String responseBody) => json.decode(responseBody); - -Future rpc2String(final String method, {final String field}) async { - final response = await rpc2(method); - - if (response == null) return ''; - - if (response.statusCode != 200) { - return ''; - } else { - final _body = await compute(jsonDecode, response.body); - final _field = field == null ? _body: _body[field]; - - return pretty(_field); - } -} - -Future getTransactionPool() async => rpc2('get_transaction_pool'); +Future getTransactionPool() async => rpc2.rpc2('get_transaction_pool'); Future>> getTransactionPoolSimple() async { final response = await getTransactionPool(); From f5f457bd65ea5e87f750d9aa541eb964e5c13df3 Mon Sep 17 00:00:00 2001 From: fuwa Date: Wed, 19 Feb 2020 11:14:56 +0800 Subject: [PATCH 09/25] add sdk tools to path --- etc/nix/shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/nix/shell.nix b/etc/nix/shell.nix index 4a58ce1..1d0749d 100644 --- a/etc/nix/shell.nix +++ b/etc/nix/shell.nix @@ -84,6 +84,7 @@ with nixpkgs; PATH=~/local/sdk/flutter/stable/bin:$PATH PATH=~/SDK/Android/android-studio/bin:$PATH + PATH=~/SDK/Android/Sdk/tools/bin:$PATH export ANDROID_NDK_VERSION=r20 export ANDROID_NDK_ROOT=~/SDK/Android/ndk-archive/android-ndk-$ANDROID_NDK_VERSION From c7972d63a5ad4957f6778927a559d4c199677cd9 Mon Sep 17 00:00:00 2001 From: fuwa Date: Fri, 21 Feb 2020 08:07:42 +0800 Subject: [PATCH 10/25] update shell --- Makefile | 4 ++-- etc/nix/shell.nix | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 00611d5..f23be95 100644 --- a/Makefile +++ b/Makefile @@ -71,11 +71,11 @@ collect: build: cd cyberwow && \ - flutter build apk --target-platform android-arm64 + flutter build apk --target-platform android-arm64 -v build-debug: cd cyberwow && \ - flutter build apk --debug --target-platform android-arm64 + flutter build apk --debug --target-platform android-arm64 -v install: build cd cyberwow && \ diff --git a/etc/nix/shell.nix b/etc/nix/shell.nix index 1d0749d..6c915bd 100644 --- a/etc/nix/shell.nix +++ b/etc/nix/shell.nix @@ -94,6 +94,7 @@ with nixpkgs; export PATH_NCURSES=${nixpkgs.ncurses5} export PATH + export _JAVA_AWT_WM_NONREPARENTING=1 export DART_VM_OPTIONS=--root-certs-file=/etc/ssl/certs/ca-certificates.crt export ANDROID_NDK_VERSION_WOW=r17c From 98ab9869aaf008e1007df48832d702fd1cfb7214 Mon Sep 17 00:00:00 2001 From: fuwa Date: Fri, 21 Feb 2020 16:12:32 +0800 Subject: [PATCH 11/25] update wow-fake-build --- Makefile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f23be95..bf0a369 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ script := etc/scripts/build-external-libs wow: clean-external-libs collect-wownero build -wow-fake: clean-external-libs collect-wownero-fake build +wow-no-native: build clean-external-libs: $(script)/clean.sh @@ -126,10 +126,6 @@ wownero: openssl boost sodium toolchain-wow collect-wownero: wownero $(script)/collect.sh -collect-wownero-fake: - $(script)/collect-fake.sh - - # etc remove-exif: From 54baa98ae3dd54dac09f84ff2bd10122df842404 Mon Sep 17 00:00:00 2001 From: fuwa Date: Fri, 21 Feb 2020 16:18:55 +0800 Subject: [PATCH 12/25] add libvirt for fdroid --- etc/nix/fdroid.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/nix/fdroid.nix b/etc/nix/fdroid.nix index 291c92c..b45fb70 100644 --- a/etc/nix/fdroid.nix +++ b/etc/nix/fdroid.nix @@ -22,6 +22,7 @@ let qrcode requests ruamel_yaml + libvirt ] ; python-with-fdroid-packages = pkgs.python3.withPackages fdroid-python-packages From e5b128310394e8068851049ce10ead90e3403d9f Mon Sep 17 00:00:00 2001 From: fuwa Date: Fri, 21 Feb 2020 23:10:04 +0800 Subject: [PATCH 13/25] update flutter deps --- cyberwow/pubspec.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cyberwow/pubspec.lock b/cyberwow/pubspec.lock index 1a5481f..9017cd9 100644 --- a/cyberwow/pubspec.lock +++ b/cyberwow/pubspec.lock @@ -78,7 +78,7 @@ packages: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.12.0+2" + version: "0.12.0+4" http_parser: dependency: transitive description: @@ -99,14 +99,14 @@ packages: name: intl url: "https://pub.dartlang.org" source: hosted - version: "0.16.0" + version: "0.16.1" logging: dependency: "direct main" description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "0.11.3+2" + version: "0.11.4" matcher: dependency: transitive description: @@ -134,7 +134,7 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.6.1" pedantic: dependency: transitive description: @@ -169,28 +169,28 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "0.5.6+1" + version: "0.5.6+2" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+4" + version: "0.0.1+6" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.3" shared_preferences_web: dependency: transitive description: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.2+3" + version: "0.1.2+4" sky_engine: dependency: transitive description: flutter @@ -260,5 +260,5 @@ packages: source: hosted version: "3.5.0" sdks: - dart: ">=2.4.0 <3.0.0" + dart: ">=2.5.0 <3.0.0" flutter: ">=1.12.13+hotfix.4 <2.0.0" From e316b7b897a58d554f39ffedca3715b4a0033e5f Mon Sep 17 00:00:00 2001 From: fuwa Date: Sat, 22 Feb 2020 11:08:29 +0800 Subject: [PATCH 14/25] update ndk to r20b --- etc/nix/shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/nix/shell.nix b/etc/nix/shell.nix index 6c915bd..ea5acf6 100644 --- a/etc/nix/shell.nix +++ b/etc/nix/shell.nix @@ -86,7 +86,7 @@ with nixpkgs; PATH=~/SDK/Android/android-studio/bin:$PATH PATH=~/SDK/Android/Sdk/tools/bin:$PATH - export ANDROID_NDK_VERSION=r20 + export ANDROID_NDK_VERSION=r20b export ANDROID_NDK_ROOT=~/SDK/Android/ndk-archive/android-ndk-$ANDROID_NDK_VERSION export NDK=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64 PATH=$NDK/bin:$PATH From c31df8bf2f2e272a4cc1c20764b137d4d98b7c91 Mon Sep 17 00:00:00 2001 From: fuwa Date: Sat, 22 Feb 2020 12:00:02 +0800 Subject: [PATCH 15/25] use jdk12 --- etc/nix/shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/nix/shell.nix b/etc/nix/shell.nix index ea5acf6..1077b8a 100644 --- a/etc/nix/shell.nix +++ b/etc/nix/shell.nix @@ -53,7 +53,7 @@ with nixpkgs; # openjdk # jetbrains.jdk # zulu - jdk + jdk12 # dart_dev gnumake gcc From deb2d961c43defcdbad342acf9546fe3951b2096 Mon Sep 17 00:00:00 2001 From: fuwa Date: Sun, 23 Feb 2020 22:16:57 +0800 Subject: [PATCH 16/25] fix a null switch --- cyberwow/lib/widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyberwow/lib/widget.dart b/cyberwow/lib/widget.dart index 89ac2dc..c289470 100644 --- a/cyberwow/lib/widget.dart +++ b/cyberwow/lib/widget.dart @@ -37,6 +37,6 @@ Widget build(final BuildContext context, final AppState state) { case SyncedState: return synced.build(context, state); case ReSyncingState: return resyncing.build(context, state); case ExitingState: return exiting.build(context, state); - default: Placeholder(); + default: return Placeholder(); } } From 1c61f7c8d576505cb6cfeebe3cd8f0e680ac8a39 Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 25 Feb 2020 16:47:25 +0800 Subject: [PATCH 17/25] disable keyboard suggestions --- cyberwow/lib/widget/synced.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cyberwow/lib/widget/synced.dart b/cyberwow/lib/widget/synced.dart index 0334cd3..b04cd16 100644 --- a/cyberwow/lib/widget/synced.dart +++ b/cyberwow/lib/widget/synced.dart @@ -205,6 +205,8 @@ Widget terminalView(BuildContext context, String title, SyncedState state) { textInputAction: TextInputAction.next, autofocus: true, autocorrect: false, + enableSuggestions: false, + keyboardType: TextInputType.visiblePassword, decoration: InputDecoration ( From 12b41c1d54d6554f5821b7c6854f3ee02217cf53 Mon Sep 17 00:00:00 2001 From: fuwa Date: Thu, 27 Feb 2020 21:13:18 +0800 Subject: [PATCH 18/25] add libvirt to fdroid.shell --- etc/nix/fdroid.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/nix/fdroid.nix b/etc/nix/fdroid.nix index b45fb70..6af7a6a 100644 --- a/etc/nix/fdroid.nix +++ b/etc/nix/fdroid.nix @@ -18,6 +18,7 @@ let pyasn1 pyasn1-modules python-vagrant + libvirt pyyaml qrcode requests From fad608003550b904bf5b843c70a73fe3e4770647 Mon Sep 17 00:00:00 2001 From: fuwa Date: Fri, 28 Feb 2020 02:22:32 +0800 Subject: [PATCH 19/25] use beta channel --- etc/nix/shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/nix/shell.nix b/etc/nix/shell.nix index 1077b8a..725acd7 100644 --- a/etc/nix/shell.nix +++ b/etc/nix/shell.nix @@ -82,7 +82,7 @@ with nixpkgs; ; profile = '' export ANDROID_HOME=~/SDK/Android/Sdk - PATH=~/local/sdk/flutter/stable/bin:$PATH + PATH=~/local/sdk/flutter/beta/bin:$PATH PATH=~/SDK/Android/android-studio/bin:$PATH PATH=~/SDK/Android/Sdk/tools/bin:$PATH From 5f63666ab708a28b0374b50a193643746ca19bac Mon Sep 17 00:00:00 2001 From: fuwa Date: Wed, 11 Mar 2020 04:23:46 +0800 Subject: [PATCH 20/25] add a link to fdroid build status --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a45172e..c64e22d 100644 --- a/README.md +++ b/README.md @@ -64,3 +64,7 @@ The resulting apk is `cyberwow/build/app/outputs/apk/release/app-release.apk`. Sending the arguments to an unopened CyberWOW app will cause `wownerod` to use them on start up, for example: `--add-exclusive-node 192.168.1.3` + +## F-droid build status + + From 5d850823cacb4af96e308e1884d9e1a7c8d09f96 Mon Sep 17 00:00:00 2001 From: fuwa Date: Thu, 19 Mar 2020 07:57:08 +0800 Subject: [PATCH 21/25] update to flutter beta-1.15.17 --- cyberwow/pubspec.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyberwow/pubspec.lock b/cyberwow/pubspec.lock index 9017cd9..36ad66a 100644 --- a/cyberwow/pubspec.lock +++ b/cyberwow/pubspec.lock @@ -237,7 +237,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.11" + version: "0.2.15" typed_data: dependency: transitive description: From a35249348f6fbe718fe44a1459a7b485651ead30 Mon Sep 17 00:00:00 2001 From: fuwa Date: Fri, 27 Mar 2020 11:00:29 +0800 Subject: [PATCH 22/25] fix checking for connections --- cyberwow/lib/logic/sensor/daemon.dart | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cyberwow/lib/logic/sensor/daemon.dart b/cyberwow/lib/logic/sensor/daemon.dart index b98c587..e8ee278 100644 --- a/cyberwow/lib/logic/sensor/daemon.dart +++ b/cyberwow/lib/logic/sensor/daemon.dart @@ -27,12 +27,9 @@ import '../../config.dart' as config; import '../../logging.dart'; Future isConnected() async { - final _outPeers = await rpc.outgoingConnectionsCount(); - final _inPeers = await rpc.incomingConnectionsCount(); - - log.finest('outPeers: ${_outPeers}'); - log.finest('inPeers: ${_inPeers}'); - return _outPeers + _inPeers > 0; + final _connections = await rpc.getConnectionsSimple(); + log.finer('cyberwow: _connections: ${_connections}'); + return !_connections.isEmpty; } Future isSynced() async { From 094417ac68042b925d2ec70a8f9a12f1de4305b0 Mon Sep 17 00:00:00 2001 From: fuwa Date: Sat, 28 Mar 2020 23:22:23 +0800 Subject: [PATCH 23/25] use linesplitter on stdout --- Makefile | 2 +- cyberwow/lib/logic/controller/process/run.dart | 6 +++++- cyberwow/lib/state/synced.dart | 2 +- cyberwow/lib/state/syncing.dart | 2 +- cyberwow/lib/widget/synced.dart | 2 +- cyberwow/lib/widget/syncing.dart | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index bf0a369..9843398 100644 --- a/Makefile +++ b/Makefile @@ -75,7 +75,7 @@ build: build-debug: cd cyberwow && \ - flutter build apk --debug --target-platform android-arm64 -v + flutter build apk --debug --target-platform android-arm64 install: build cd cyberwow && \ diff --git a/cyberwow/lib/logic/controller/process/run.dart b/cyberwow/lib/logic/controller/process/run.dart index 659d61c..b572fd4 100644 --- a/cyberwow/lib/logic/controller/process/run.dart +++ b/cyberwow/lib/logic/controller/process/run.dart @@ -79,7 +79,11 @@ Stream runBinary if (input != null) { printInput(); } - await for (final line in outputProcess.stdout.transform(utf8.decoder)) { + + final _stdout = outputProcess.stdout + .transform(utf8.decoder).transform(const LineSplitter()); + + await for (final line in _stdout) { log.finest('process output: ' + line); yield line; } diff --git a/cyberwow/lib/state/synced.dart b/cyberwow/lib/state/synced.dart index 35aa741..15d4f0d 100644 --- a/cyberwow/lib/state/synced.dart +++ b/cyberwow/lib/state/synced.dart @@ -66,7 +66,7 @@ class SyncedState extends AppState { } void appendInput(final String line) { - stdout.addLast(config.c.promptString + line + '\n'); + stdout.addLast(config.c.promptString + line); syncState(); processInput.add(line); diff --git a/cyberwow/lib/state/syncing.dart b/cyberwow/lib/state/syncing.dart index 9b21db6..80cf59b 100644 --- a/cyberwow/lib/state/syncing.dart +++ b/cyberwow/lib/state/syncing.dart @@ -34,7 +34,7 @@ import 'exiting.dart'; class SyncingState extends AppState { - final Queue stdout = Queue.from(['']); + final Queue stdout = Queue(); bool synced = false; diff --git a/cyberwow/lib/widget/synced.dart b/cyberwow/lib/widget/synced.dart index b04cd16..a3db0a6 100644 --- a/cyberwow/lib/widget/synced.dart +++ b/cyberwow/lib/widget/synced.dart @@ -278,7 +278,7 @@ Widget terminalView(BuildContext context, String title, SyncedState state) { Text ( - state.stdout.join(), + state.stdout.join('\n'), style: Theme.of(context).textTheme.body2, ) ], diff --git a/cyberwow/lib/widget/syncing.dart b/cyberwow/lib/widget/syncing.dart index 4e50b2c..2df3d62 100644 --- a/cyberwow/lib/widget/syncing.dart +++ b/cyberwow/lib/widget/syncing.dart @@ -52,7 +52,7 @@ Widget build(BuildContext context, SyncingState state) { reverse: true, child: Text ( - state.stdout.join(), + state.stdout.join('\n'), style: Theme.of(context).textTheme.body1, ) ) From 4759e76b3281d240ed21a4b1b5e6e44f438ff763 Mon Sep 17 00:00:00 2001 From: fuwa Date: Sat, 28 Mar 2020 23:33:08 +0800 Subject: [PATCH 24/25] update pub --- cyberwow/pubspec.lock | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/cyberwow/pubspec.lock b/cyberwow/pubspec.lock index 36ad66a..1ec6745 100644 --- a/cyberwow/pubspec.lock +++ b/cyberwow/pubspec.lock @@ -85,7 +85,7 @@ packages: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "3.1.3" + version: "3.1.4" image: dependency: transitive description: @@ -134,14 +134,28 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.6.1" + version: "1.6.5" + path_provider_macos: + dependency: transitive + description: + name: path_provider_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.8.0+1" + version: "1.9.0" petitparser: dependency: transitive description: @@ -156,6 +170,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.2.1" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" quiver: dependency: transitive description: @@ -169,7 +190,7 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "0.5.6+2" + version: "0.5.6+3" shared_preferences_macos: dependency: transitive description: From 52867a79d42e09ac09e43a10747b852d34071913 Mon Sep 17 00:00:00 2001 From: fuwa Date: Sat, 28 Mar 2020 23:34:59 +0800 Subject: [PATCH 25/25] up version --- cyberwow/android/app/build.gradle | 4 ++-- cyberwow/pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cyberwow/android/app/build.gradle b/cyberwow/android/app/build.gradle index 63160d1..26a5cfe 100644 --- a/cyberwow/android/app/build.gradle +++ b/cyberwow/android/app/build.gradle @@ -41,8 +41,8 @@ android { applicationId "org.wownero.cyberwow" minSdkVersion 26 targetSdkVersion 29 - versionCode 23 - versionName "0.7.0.0-j" + versionCode 24 + versionName "0.7.0.0-k" } if(project.hasProperty("RELEASE_STORE_FILE")) { diff --git a/cyberwow/pubspec.yaml b/cyberwow/pubspec.yaml index 447d4f2..4106a47 100644 --- a/cyberwow/pubspec.yaml +++ b/cyberwow/pubspec.yaml @@ -1,7 +1,7 @@ name: cyberwow description: A new Flutter project. -version: 0.7.0+23 +version: 0.7.0+24 environment: sdk: ">=2.1.0 <3.0.0"