Merge pull request #7 from fuwa0529/dev

Try to fix fdroid build failure caused by openssl hash mismatch
master v0.7.0.0-l
jw 4 years ago committed by GitHub
commit cc5f0a6882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -41,8 +41,8 @@ android {
applicationId "org.wownero.cyberwow" applicationId "org.wownero.cyberwow"
minSdkVersion 26 minSdkVersion 26
targetSdkVersion 29 targetSdkVersion 29
versionCode 24 versionCode 25
versionName "0.7.0.0-k" versionName "0.7.0.0-l"
} }
if(project.hasProperty("RELEASE_STORE_FILE")) { if(project.hasProperty("RELEASE_STORE_FILE")) {

@ -44,9 +44,9 @@ class MainActivity: FlutterActivity() {
} }
internal fun handleSendText(intent:Intent) { internal fun handleSendText(intent:Intent) {
val text:String = intent.getStringExtra(Intent.EXTRA_TEXT) val text:String? = intent.getStringExtra(Intent.EXTRA_TEXT)
if (initialIntentSet == false) { if (initialIntentSet == false) {
initialIntentText = text initialIntentText = text ?: "";
} }
} }

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists 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 host = isEmu ? emuHost : '127.0.0.1';
const stdoutLineBufferSize = 100; const stdoutLineBufferSize = 200;
const bannerShownKey = 'banner-shown'; const bannerShownKey = 'banner-shown';
const int maxPoolTxSize = 5000;

@ -95,6 +95,7 @@ final config = CryptoConfig
'--no-igd', '--no-igd',
'--check-updates=disabled', '--check-updates=disabled',
'--disable-dns-checkpoints', '--disable-dns-checkpoints',
'--log-file=/dev/null',
'--max-log-file-size=0', '--max-log-file-size=0',
'--p2p-use-ipv6', '--p2p-use-ipv6',
], ],

@ -27,11 +27,14 @@ import 'package:http/http.dart' as http;
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import '../../../helper.dart'; import '../../../helper.dart';
import '../../../config.dart' as config;
import '../../../logging.dart'; import '../../../logging.dart';
import '../../interface/rpc/rpc2.dart' as rpc2; import '../../interface/rpc/rpc2.dart' as rpc2;
Future<http.Response> getTransactionPool() async => rpc2.rpc2('get_transaction_pool'); Future<http.Response> getTransactionPool() async => rpc2.rpc2('get_transaction_pool');
Map<String, String> txInOutCache = {};
Future<List<Map<String, dynamic>>> getTransactionPoolSimple() async { Future<List<Map<String, dynamic>>> getTransactionPoolSimple() async {
final response = await getTransactionPool(); final response = await getTransactionPool();
@ -57,12 +60,31 @@ Future<List<Map<String, dynamic>>> getTransactionPoolSimple() async {
final _decodedPool = await Stream.fromIterable(_sortedPool).asyncMap final _decodedPool = await Stream.fromIterable(_sortedPool).asyncMap
( (
(x) async { (x) async {
final String _tx_json = x['tx_json']; if (txInOutCache.length > config.maxPoolTxSize) {
final _tx_json_decoded = await compute(jsonDecode, _tx_json); 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 { return {
...x, ...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 final _formattedConn = _filteredConn.map
( (
(k, v) { (k, v) {
if (k == 'connection_id') { switch (k) {
return MapEntry(k, trimHash(v)); case 'connection_id': {
} return MapEntry(k, trimHash(v));
}
const speedField = case 'live_time': {
[ final _duration = Duration(seconds: v);
'avg_download', format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
'avg_upload', return MapEntry(k, format(_duration));
'current_download', }
'current_upload', default: {
]; const speedField =
if (speedField.contains(k)) { [
return MapEntry(k, '${v} kB/s'); 'avg_download',
} 'avg_upload',
'current_download',
else if (k == 'live_time') { 'current_upload',
final _duration = Duration(seconds: v); ];
format(Duration d) => d.toString().split('.').first.padLeft(8, "0"); if (speedField.contains(k)) {
return MapEntry(k, format(_duration)); return MapEntry(k, '${v} kB/s');
} }
else {
else { return MapEntry(k, v);
return MapEntry(k, v); }
}
} }
} }
); );
@ -171,38 +172,39 @@ Map<String, dynamic> getInfoView(Map<String, dynamic> x) {
final _formattedInfo = _ammendedInfo.map final _formattedInfo = _ammendedInfo.map
( (
(k, v) { (k, v) {
if (k == 'top_block_hash') { switch (k) {
return MapEntry(k, trimHash(v)); case 'top_block_hash': {
} return MapEntry(k, trimHash(v));
}
const sizeField = case 'start_time': {
[ final _receive_time = DateTime.fromMillisecondsSinceEpoch(v * 1000);
'block_size_limit', final _diff = DateTime.now().difference(_receive_time);
'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 { format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
return MapEntry(k, v); 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 final _formattedTx = _filteredTx.map
( (
(k, v) { (k, v) {
if (k == 'id_hash') { switch (k) {
return MapEntry('id', trimHash(v)); 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);
format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
return MapEntry('age', format(_diff));
}
default:
return MapEntry(k, v);
} }
}
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);
}
}
); );
final List<String> keys = final List<String> keys =

@ -25,49 +25,53 @@ import '../state.dart';
import '../config.dart' as config; import '../config.dart' as config;
Widget build(BuildContext context, ReSyncingState state) { 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 return Scaffold
( (
// appBar: AppBar
// (
// // title: Text(widget.title),
// title: Text('CyberWOW'),
// ),
body: Container body: Container
( (
// padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child: Align child: Column
( (
alignment: Alignment.topLeft, mainAxisAlignment: MainAxisAlignment.center,
child: Column crossAxisAlignment: CrossAxisAlignment.stretch,
( children: <Widget>
mainAxisAlignment: MainAxisAlignment.center, [
children: <Widget> Spacer
[ (
Spacer flex: 10,
( ),
flex: 1, ] +
), progressWidget +
Expanded [
( Spacer
flex: 1, (
child: SingleChildScrollView flex: 10,
( ),
scrollDirection: Axis.vertical, ]
reverse: true,
child: Text
(
state.stdout.last,
style: Theme.of(context).textTheme.body1,
)
)
),
Spacer
(
flex: 1,
),
],
),
), ),
), )
); );
} }

@ -1,7 +1,7 @@
name: cyberwow name: cyberwow
description: A new Flutter project. description: A new Flutter project.
version: 0.7.0+24 version: 0.7.0+25
environment: environment:
sdk: ">=2.1.0 <3.0.0" sdk: ">=2.1.0 <3.0.0"

@ -53,7 +53,7 @@ with nixpkgs;
# openjdk # openjdk
# jetbrains.jdk # jetbrains.jdk
# zulu # zulu
jdk12 jdk13
# dart_dev # dart_dev
gnumake gnumake
gcc gcc

@ -37,7 +37,7 @@ build_root=$BUILD_ROOT
src_root=$BUILD_ROOT_SRC src_root=$BUILD_ROOT_SRC
name=openssl name=openssl
version=1.1.1d version=1.1.1f
cd $src_root/${name}-${version} cd $src_root/${name}-${version}

@ -36,8 +36,8 @@ source etc/scripts/build-external-libs/env.sh
cd $BUILD_ROOT_SRC cd $BUILD_ROOT_SRC
name=openssl name=openssl
version=1.1.1d version=1.1.1f
hash=1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2 hash=186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35
rm -rf ${name}-${version} rm -rf ${name}-${version}

Loading…
Cancel
Save