mirror of
https://github.com/wownero/cyberwow.git
synced 2026-10-17 15:31:47 +02:00
Merge pull request #7 from fuwa0529/dev
Try to fix fdroid build failure caused by openssl hash mismatch
This commit is contained in:
@@ -41,8 +41,8 @@ android {
|
||||
applicationId "org.wownero.cyberwow"
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 29
|
||||
versionCode 24
|
||||
versionName "0.7.0.0-k"
|
||||
versionCode 25
|
||||
versionName "0.7.0.0-l"
|
||||
}
|
||||
|
||||
if(project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
|
||||
@@ -44,9 +44,9 @@ class MainActivity: FlutterActivity() {
|
||||
}
|
||||
|
||||
internal fun handleSendText(intent:Intent) {
|
||||
val text:String = intent.getStringExtra(Intent.EXTRA_TEXT)
|
||||
val text:String? = intent.getStringExtra(Intent.EXTRA_TEXT)
|
||||
if (initialIntentSet == false) {
|
||||
initialIntentText = text
|
||||
initialIntentText = text ?: "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
|
||||
|
||||
@@ -35,6 +35,8 @@ const emuHost = '192.168.10.100';
|
||||
|
||||
const host = isEmu ? emuHost : '127.0.0.1';
|
||||
|
||||
const stdoutLineBufferSize = 100;
|
||||
const stdoutLineBufferSize = 200;
|
||||
const bannerShownKey = 'banner-shown';
|
||||
|
||||
const int maxPoolTxSize = 5000;
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ final config = CryptoConfig
|
||||
'--no-igd',
|
||||
'--check-updates=disabled',
|
||||
'--disable-dns-checkpoints',
|
||||
'--log-file=/dev/null',
|
||||
'--max-log-file-size=0',
|
||||
'--p2p-use-ipv6',
|
||||
],
|
||||
|
||||
@@ -27,11 +27,14 @@ import 'package:http/http.dart' as http;
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import '../../../helper.dart';
|
||||
import '../../../config.dart' as config;
|
||||
import '../../../logging.dart';
|
||||
import '../../interface/rpc/rpc2.dart' as rpc2;
|
||||
|
||||
Future<http.Response> getTransactionPool() async => rpc2.rpc2('get_transaction_pool');
|
||||
|
||||
Map<String, String> txInOutCache = {};
|
||||
|
||||
Future<List<Map<String, dynamic>>> getTransactionPoolSimple() async {
|
||||
final response = await getTransactionPool();
|
||||
|
||||
@@ -57,12 +60,31 @@ Future<List<Map<String, dynamic>>> getTransactionPoolSimple() async {
|
||||
final _decodedPool = await Stream.fromIterable(_sortedPool).asyncMap
|
||||
(
|
||||
(x) async {
|
||||
final String _tx_json = x['tx_json'];
|
||||
final _tx_json_decoded = await compute(jsonDecode, _tx_json);
|
||||
if (txInOutCache.length > config.maxPoolTxSize) {
|
||||
txInOutCache = {};
|
||||
}
|
||||
|
||||
final _txid = x['id_hash'];
|
||||
|
||||
if (txInOutCache[_txid] == null) {
|
||||
final String _tx_json = x['tx_json'];
|
||||
final _tx_json_decoded = await compute(jsonDecode, _tx_json);
|
||||
|
||||
final _inOut =
|
||||
{
|
||||
'vin': _tx_json_decoded['vin'].length,
|
||||
'vout': _tx_json_decoded['vout'].length,
|
||||
};
|
||||
|
||||
final _inOutString = _inOut['vin'].toString() + '/' + _inOut['vout'].toString();
|
||||
|
||||
txInOutCache[_txid] = _inOutString;
|
||||
log.fine('cached tx_json in pool for: ${_txid}');
|
||||
}
|
||||
|
||||
return {
|
||||
...x,
|
||||
...{'tx_decoded': _tx_json_decoded},
|
||||
...{'i/o': txInOutCache[_txid]},
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
@@ -58,29 +58,30 @@ Map<String, dynamic> getConnectionView(Map<String, dynamic> x) {
|
||||
final _formattedConn = _filteredConn.map
|
||||
(
|
||||
(k, v) {
|
||||
if (k == 'connection_id') {
|
||||
return MapEntry(k, trimHash(v));
|
||||
}
|
||||
|
||||
const speedField =
|
||||
[
|
||||
'avg_download',
|
||||
'avg_upload',
|
||||
'current_download',
|
||||
'current_upload',
|
||||
];
|
||||
if (speedField.contains(k)) {
|
||||
return MapEntry(k, '${v} kB/s');
|
||||
}
|
||||
|
||||
else if (k == 'live_time') {
|
||||
final _duration = Duration(seconds: v);
|
||||
format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
|
||||
return MapEntry(k, format(_duration));
|
||||
}
|
||||
|
||||
else {
|
||||
return MapEntry(k, v);
|
||||
switch (k) {
|
||||
case 'connection_id': {
|
||||
return MapEntry(k, trimHash(v));
|
||||
}
|
||||
case 'live_time': {
|
||||
final _duration = Duration(seconds: v);
|
||||
format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
|
||||
return MapEntry(k, format(_duration));
|
||||
}
|
||||
default: {
|
||||
const speedField =
|
||||
[
|
||||
'avg_download',
|
||||
'avg_upload',
|
||||
'current_download',
|
||||
'current_upload',
|
||||
];
|
||||
if (speedField.contains(k)) {
|
||||
return MapEntry(k, '${v} kB/s');
|
||||
}
|
||||
else {
|
||||
return MapEntry(k, v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -171,38 +172,39 @@ Map<String, dynamic> getInfoView(Map<String, dynamic> x) {
|
||||
final _formattedInfo = _ammendedInfo.map
|
||||
(
|
||||
(k, v) {
|
||||
if (k == 'top_block_hash') {
|
||||
return MapEntry(k, trimHash(v));
|
||||
}
|
||||
switch (k) {
|
||||
case 'top_block_hash': {
|
||||
return MapEntry(k, trimHash(v));
|
||||
}
|
||||
case 'start_time': {
|
||||
final _receive_time = DateTime.fromMillisecondsSinceEpoch(v * 1000);
|
||||
final _diff = DateTime.now().difference(_receive_time);
|
||||
|
||||
const sizeField =
|
||||
[
|
||||
'block_size_limit',
|
||||
'block_size_median',
|
||||
'block_weight_limit',
|
||||
'block_weight_median',
|
||||
'difficulty',
|
||||
'tx_count',
|
||||
'cumulative_difficulty',
|
||||
'free_space',
|
||||
'database_size',
|
||||
'hash_rate',
|
||||
];
|
||||
if (sizeField.contains(k)) {
|
||||
final formatter = NumberFormat.compact();
|
||||
return MapEntry(k, formatter.format(v));
|
||||
}
|
||||
|
||||
else if (k == 'start_time') {
|
||||
final _receive_time = DateTime.fromMillisecondsSinceEpoch(v * 1000);
|
||||
final _diff = DateTime.now().difference(_receive_time);
|
||||
|
||||
format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
|
||||
return MapEntry('uptime', format(_diff));
|
||||
}
|
||||
|
||||
else {
|
||||
return MapEntry(k, v);
|
||||
format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
|
||||
return MapEntry('uptime', format(_diff));
|
||||
}
|
||||
default: {
|
||||
const sizeField =
|
||||
[
|
||||
'block_size_limit',
|
||||
'block_size_median',
|
||||
'block_weight_limit',
|
||||
'block_weight_median',
|
||||
'difficulty',
|
||||
'tx_count',
|
||||
'cumulative_difficulty',
|
||||
'free_space',
|
||||
'database_size',
|
||||
'hash_rate',
|
||||
];
|
||||
if (sizeField.contains(k)) {
|
||||
final formatter = NumberFormat.compact();
|
||||
return MapEntry(k, formatter.format(v));
|
||||
}
|
||||
else {
|
||||
return MapEntry(k, v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -53,45 +53,33 @@ Map<String, dynamic> txView(Map<String, dynamic> x) {
|
||||
final _formattedTx = _filteredTx.map
|
||||
(
|
||||
(k, v) {
|
||||
if (k == 'id_hash') {
|
||||
return MapEntry('id', trimHash(v));
|
||||
}
|
||||
switch (k) {
|
||||
case 'id_hash':
|
||||
return MapEntry('id', trimHash(v));
|
||||
case 'blob_size':
|
||||
return MapEntry('size', (v / 1024).toStringAsFixed(2) + ' kB');
|
||||
case 'fee': {
|
||||
final formatter = NumberFormat.currency
|
||||
(
|
||||
symbol: '',
|
||||
decimalDigits: 2,
|
||||
);
|
||||
return MapEntry(k, formatter.format(v / pow(10, 11)) + ' ⍵');
|
||||
}
|
||||
case 'receive_time': {
|
||||
final _receive_time = DateTime.fromMillisecondsSinceEpoch(v * 1000);
|
||||
final _diff = DateTime.now().difference(_receive_time);
|
||||
|
||||
else if (k == 'blob_size') {
|
||||
return MapEntry('size', (v / 1024).toStringAsFixed(2) + ' kB');
|
||||
}
|
||||
|
||||
else if (k == 'fee') {
|
||||
final formatter = NumberFormat.currency
|
||||
(
|
||||
symbol: '',
|
||||
decimalDigits: 2,
|
||||
);
|
||||
return MapEntry(k, formatter.format(v / pow(10, 11)) + ' ⍵');
|
||||
}
|
||||
|
||||
else if (k == 'receive_time') {
|
||||
final _receive_time = DateTime.fromMillisecondsSinceEpoch(v * 1000);
|
||||
final _diff = DateTime.now().difference(_receive_time);
|
||||
|
||||
format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
|
||||
return MapEntry('age', format(_diff));
|
||||
}
|
||||
|
||||
else if (k == 'tx_decoded') {
|
||||
final _out =
|
||||
{
|
||||
'vin': v['vin'].length,
|
||||
'vout': v['vout'].length,
|
||||
};
|
||||
final _outString = _out['vin'].toString() + '/' + _out['vout'].toString();
|
||||
return MapEntry('i/o', _outString);
|
||||
}
|
||||
|
||||
else {
|
||||
return MapEntry(k, v);
|
||||
format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
|
||||
return MapEntry('age', format(_diff));
|
||||
}
|
||||
default:
|
||||
return MapEntry(k, v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
||||
final List<String> keys =
|
||||
|
||||
@@ -25,49 +25,53 @@ import '../state.dart';
|
||||
import '../config.dart' as config;
|
||||
|
||||
Widget build(BuildContext context, ReSyncingState state) {
|
||||
final progressWidget =
|
||||
[
|
||||
Spacer
|
||||
(
|
||||
flex: 3,
|
||||
),
|
||||
LinearProgressIndicator(),
|
||||
Spacer
|
||||
(
|
||||
flex: 2,
|
||||
),
|
||||
Expanded
|
||||
(
|
||||
flex: 5,
|
||||
child: Text
|
||||
(
|
||||
state.stdout.last,
|
||||
style: Theme.of(context).textTheme.body1,
|
||||
)
|
||||
),
|
||||
];
|
||||
|
||||
return Scaffold
|
||||
(
|
||||
// appBar: AppBar
|
||||
// (
|
||||
// // title: Text(widget.title),
|
||||
// title: Text('CyberWOW'),
|
||||
// ),
|
||||
body: Container
|
||||
(
|
||||
// padding: const EdgeInsets.all(10.0),
|
||||
child: Align
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column
|
||||
(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Column
|
||||
(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>
|
||||
[
|
||||
Spacer
|
||||
(
|
||||
flex: 1,
|
||||
),
|
||||
Expanded
|
||||
(
|
||||
flex: 1,
|
||||
child: SingleChildScrollView
|
||||
(
|
||||
scrollDirection: Axis.vertical,
|
||||
reverse: true,
|
||||
child: Text
|
||||
(
|
||||
state.stdout.last,
|
||||
style: Theme.of(context).textTheme.body1,
|
||||
)
|
||||
)
|
||||
),
|
||||
Spacer
|
||||
(
|
||||
flex: 1,
|
||||
),
|
||||
],
|
||||
),
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>
|
||||
[
|
||||
Spacer
|
||||
(
|
||||
flex: 10,
|
||||
),
|
||||
] +
|
||||
progressWidget +
|
||||
[
|
||||
Spacer
|
||||
(
|
||||
flex: 10,
|
||||
),
|
||||
]
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: cyberwow
|
||||
description: A new Flutter project.
|
||||
|
||||
version: 0.7.0+24
|
||||
version: 0.7.0+25
|
||||
|
||||
environment:
|
||||
sdk: ">=2.1.0 <3.0.0"
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ with nixpkgs;
|
||||
# openjdk
|
||||
# jetbrains.jdk
|
||||
# zulu
|
||||
jdk12
|
||||
jdk13
|
||||
# dart_dev
|
||||
gnumake
|
||||
gcc
|
||||
|
||||
@@ -37,7 +37,7 @@ build_root=$BUILD_ROOT
|
||||
src_root=$BUILD_ROOT_SRC
|
||||
|
||||
name=openssl
|
||||
version=1.1.1d
|
||||
version=1.1.1f
|
||||
|
||||
cd $src_root/${name}-${version}
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ source etc/scripts/build-external-libs/env.sh
|
||||
cd $BUILD_ROOT_SRC
|
||||
|
||||
name=openssl
|
||||
version=1.1.1d
|
||||
hash=1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2
|
||||
version=1.1.1f
|
||||
hash=186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35
|
||||
|
||||
rm -rf ${name}-${version}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user