Skip to content

Commit

Permalink
V4.8.1 v1.5.1 (#1038)
Browse files Browse the repository at this point in the history
* Revert "Cw 397 chatwoot live support (#1011)"

This reverts commit af9b5ff.

* Add Version 4.8.1 configs

* Update macos build version [skip ci]
  • Loading branch information
OmarHatem28 authored Aug 14, 2023
1 parent f4fad4d commit ad6edd9
Show file tree
Hide file tree
Showing 68 changed files with 274 additions and 789 deletions.
1 change: 0 additions & 1 deletion .github/workflows/pr_test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ jobs:
echo "const fiatApiKey = '${{ secrets.FIAT_API_KEY }}';" >> lib/.secrets.g.dart
echo "const payfuraApiKey = '${{ secrets.PAYFURA_API_KEY }}';" >> lib/.secrets.g.dart
echo "const etherScanApiKey = '${{ secrets.ETHER_SCAN_API_KEY }}';" >> cw_ethereum/lib/.secrets.g.dart
echo "const chatwootWebsiteToken = '${{ secrets.CHATWOOT_WEBSITE_TOKEN }}';" >> lib/.secrets.g.dart
- name: Rename app
run: echo -e "id=com.cakewallet.test\nname=$GITHUB_HEAD_REF" > /opt/android/cake_wallet/android/app.properties
Expand Down
Binary file removed assets/images/live_support.png
Binary file not shown.
Binary file removed assets/images/more_links.png
Binary file not shown.
Binary file removed assets/images/wallet_guides.png
Binary file not shown.
10 changes: 2 additions & 8 deletions assets/text/Monerocom_Release_Notes.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
Monero background syncing! See https://guides.cakewallet.com/docs/monero/#background-syncing
Cake 2FA access control settings! See https://guides.cakewallet.com/docs/advanced-features/authentication/#cake-2fa-presets-and-access-control-settings
Support Monero node proxy
UI improvements when sending to Address Book entry
Allow renaming Monero account names
Send templates now support multiple recipients (try using to make Monero change)
Onramper improvements
Scan node QR codes (for Umbrel)
Bug fixes
Fiat Onramp improvements
11 changes: 2 additions & 9 deletions assets/text/Release_Notes.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
Ethereum! Store ETH and ERC-20 tokens
Monero background syncing! See https://guides.cakewallet.com/docs/monero/#background-syncing
Cake 2FA access control settings! See https://guides.cakewallet.com/docs/advanced-features/authentication/#cake-2fa-presets-and-access-control-settings
Support Monero node proxy
UI improvements when sending to Address Book entry
Allow renaming Monero/Haven account names
Send templates now support multiple recipients (try using to make Monero change)
Onramper improvements
Scan node QR codes (for Umbrel)
Bug fixes
Fiat Onramp improvements
4 changes: 0 additions & 4 deletions cw_core/lib/cake_hive.dart

This file was deleted.

3 changes: 1 addition & 2 deletions cw_core/lib/erc20_token.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:cw_core/crypto_currency.dart';
import 'package:cw_core/hive_type_ids.dart';
import 'package:hive/hive.dart';

part 'erc20_token.g.dart';
Expand Down Expand Up @@ -54,7 +53,7 @@ class Erc20Token extends CryptoCurrency with HiveObjectMixin {
iconPath: icon,
);

static const typeId = ERC20_TOKEN_TYPE_ID;
static const typeId = 12;
static const boxName = 'Erc20Tokens';

@override
Expand Down
13 changes: 0 additions & 13 deletions cw_core/lib/hive_type_ids.dart

This file was deleted.

3 changes: 1 addition & 2 deletions cw_core/lib/node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:cw_core/keyable.dart';
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:hive/hive.dart';
import 'package:cw_core/hive_type_ids.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:http/io_client.dart' as ioc;

Expand Down Expand Up @@ -38,7 +37,7 @@ class Node extends HiveObject with Keyable {
trusted = map['trusted'] as bool? ?? false,
socksProxyAddress = map['socksProxyPort'] as String?;

static const typeId = NODE_TYPE_ID;
static const typeId = 1;
static const boxName = 'Nodes';

@HiveField(0, defaultValue: '')
Expand Down
5 changes: 2 additions & 3 deletions cw_core/lib/unspent_coins_info.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:cw_core/hive_type_ids.dart';
import 'package:hive/hive.dart';

part 'unspent_coins_info.g.dart';
Expand All @@ -15,7 +14,7 @@ class UnspentCoinsInfo extends HiveObject {
required this.vout,
required this.value});

static const typeId = UNSPENT_COINS_INFO_TYPE_ID;
static const typeId = 9;
static const boxName = 'Unspent';
static const boxKey = 'unspentBoxKey';

Expand Down Expand Up @@ -46,4 +45,4 @@ class UnspentCoinsInfo extends HiveObject {
String get note => noteRaw ?? '';

set note(String value) => noteRaw = value;
}
}
8 changes: 4 additions & 4 deletions cw_core/lib/wallet_info.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:async';
import 'package:cw_core/hive_type_ids.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:flutter/foundation.dart';
import 'package:hive/hive.dart';
import 'package:cw_core/wallet_type.dart';
import 'dart:async';

part 'wallet_info.g.dart';

Expand Down Expand Up @@ -30,7 +30,7 @@ class WalletInfo extends HiveObject {
yatEid, yatLastUsedAddressRaw, showIntroCakePayCard);
}

static const typeId = WALLET_INFO_TYPE_ID;
static const typeId = 4;
static const boxName = 'WalletInfo';

@HiveField(0, defaultValue: '')
Expand Down
4 changes: 2 additions & 2 deletions cw_core/lib/wallet_type.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:cw_core/crypto_currency.dart';
import 'package:cw_core/hive_type_ids.dart';
import 'package:hive/hive.dart';

part 'wallet_type.g.dart';
Expand All @@ -11,8 +10,9 @@ const walletTypes = [
WalletType.haven,
WalletType.ethereum,
];
const walletTypeTypeId = 5;

@HiveType(typeId: WALLET_TYPE_TYPE_ID)
@HiveType(typeId: walletTypeTypeId)
enum WalletType {
@HiveField(0)
monero,
Expand Down
7 changes: 3 additions & 4 deletions cw_ethereum/lib/ethereum_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'dart:io';
import 'dart:math';

import 'package:cw_core/crypto_currency.dart';
import 'package:cw_core/cake_hive.dart';
import 'package:cw_core/node.dart';
import 'package:cw_core/pathForWallet.dart';
import 'package:cw_core/pending_transaction.dart';
Expand Down Expand Up @@ -59,8 +58,8 @@ abstract class EthereumWalletBase
this.walletInfo = walletInfo;
transactionHistory = EthereumTransactionHistory(walletInfo: walletInfo, password: password);

if (!CakeHive.isAdapterRegistered(Erc20Token.typeId)) {
CakeHive.registerAdapter(Erc20TokenAdapter());
if (!Hive.isAdapterRegistered(Erc20Token.typeId)) {
Hive.registerAdapter(Erc20TokenAdapter());
}

_sharedPrefs.complete(SharedPreferences.getInstance());
Expand Down Expand Up @@ -96,7 +95,7 @@ abstract class EthereumWalletBase
Completer<SharedPreferences> _sharedPrefs = Completer();

Future<void> init() async {
erc20TokensBox = await CakeHive.openBox<Erc20Token>(Erc20Token.boxName);
erc20TokensBox = await Hive.openBox<Erc20Token>(Erc20Token.boxName);
await walletAddresses.init();
await transactionHistory.init();
_privateKey = await getPrivateKey(_mnemonic, _password);
Expand Down
3 changes: 1 addition & 2 deletions lib/anonpay/anonpay_invoice_info.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:cake_wallet/anonpay/anonpay_info_base.dart';
import 'package:cw_core/hive_type_ids.dart';
import 'package:cw_core/keyable.dart';
import 'package:hive/hive.dart';

Expand Down Expand Up @@ -36,7 +35,7 @@ class AnonpayInvoiceInfo extends HiveObject with Keyable implements AnonpayInfoB
@HiveField(13)
final String provider;

static const typeId = ANONPAY_INVOICE_INFO_TYPE_ID;
static const typeId = 10;
static const boxName = 'AnonpayInvoiceInfo';

AnonpayInvoiceInfo({
Expand Down
7 changes: 3 additions & 4 deletions lib/buy/order.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'package:cake_wallet/buy/buy_provider_description.dart';
import 'package:hive/hive.dart';
import 'package:cake_wallet/exchange/trade_state.dart';
import 'package:cw_core/format_amount.dart';
import 'package:cw_core/hive_type_ids.dart';
import 'package:hive/hive.dart';

part 'order.g.dart';

Expand All @@ -27,7 +26,7 @@ class Order extends HiveObject {
}
}

static const typeId = ORDER_TYPE_ID;
static const typeId = 8;
static const boxName = 'Orders';
static const boxKey = 'ordersBoxKey';

Expand Down Expand Up @@ -67,4 +66,4 @@ class Order extends HiveObject {
BuyProviderDescription.deserialize(raw: providerRaw);

String amountFormatted() => formatAmount(amount);
}
}
13 changes: 6 additions & 7 deletions lib/core/backup_service.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'package:cake_wallet/entities/cake_2fa_preset_options.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:flutter/foundation.dart';
import 'package:hive/hive.dart';
Expand All @@ -9,15 +10,13 @@ import 'package:path_provider/path_provider.dart';
import 'package:cryptography/cryptography.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:archive/archive_io.dart';
import 'package:cw_core/cake_hive.dart';
import 'package:cake_wallet/core/key_service.dart';
import 'package:cake_wallet/entities/encrypt.dart';
import 'package:cake_wallet/entities/preferences_key.dart';
import 'package:cake_wallet/entities/secret_store_key.dart';
import 'package:cw_core/wallet_info.dart';
import 'package:cake_wallet/.secrets.g.dart' as secrets;
import 'package:cake_wallet/wallet_types.g.dart';

import 'package:cake_backup/backup.dart' as cake_backup;

class BackupService {
Expand Down Expand Up @@ -171,14 +170,14 @@ class BackupService {

Future<Box<WalletInfo>> _reloadHiveWalletInfoBox() async {
final appDir = await getApplicationDocumentsDirectory();
await CakeHive.close();
CakeHive.init(appDir.path);
await Hive.close();
Hive.init(appDir.path);

if (!CakeHive.isAdapterRegistered(WalletInfo.typeId)) {
CakeHive.registerAdapter(WalletInfoAdapter());
if (!Hive.isAdapterRegistered(WalletInfo.typeId)) {
Hive.registerAdapter(WalletInfoAdapter());
}

return await CakeHive.openBox<WalletInfo>(WalletInfo.boxName);
return await Hive.openBox<WalletInfo>(WalletInfo.boxName);
}

Future<void> _importPreferencesDump() async {
Expand Down
8 changes: 0 additions & 8 deletions lib/di.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ import 'package:cake_wallet/src/screens/setup_2fa/modify_2fa_page.dart';
import 'package:cake_wallet/src/screens/setup_2fa/setup_2fa_qr_page.dart';
import 'package:cake_wallet/src/screens/setup_2fa/setup_2fa.dart';
import 'package:cake_wallet/src/screens/setup_2fa/setup_2fa_enter_code_page.dart';
import 'package:cake_wallet/src/screens/support_chat/support_chat_page.dart';
import 'package:cake_wallet/src/screens/support_other_links/support_other_links_page.dart';
import 'package:cake_wallet/src/screens/wallet/wallet_edit_page.dart';
import 'package:cake_wallet/themes/theme_list.dart';
import 'package:cake_wallet/utils/device_info.dart';
Expand Down Expand Up @@ -871,12 +869,6 @@ Future setup({

getIt.registerFactory(() => SupportPage(getIt.get<SupportViewModel>()));

getIt.registerFactory(() =>
SupportChatPage(
getIt.get<SupportViewModel>(), secureStorage: getIt.get<FlutterSecureStorage>()));

getIt.registerFactory(() => SupportOtherLinksPage(getIt.get<SupportViewModel>()));

getIt.registerFactory(() {
final wallet = getIt.get<AppStore>().wallet;

Expand Down
7 changes: 4 additions & 3 deletions lib/entities/contact.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import 'package:flutter/foundation.dart';
import 'package:hive/hive.dart';
import 'package:cw_core/crypto_currency.dart';
import 'package:cw_core/hive_type_ids.dart';
import 'package:cake_wallet/utils/mobx.dart';
import 'package:cw_core/keyable.dart';
import 'package:hive/hive.dart';

part 'contact.g.dart';

Expand All @@ -13,7 +14,7 @@ class Contact extends HiveObject with Keyable {
}
}

static const typeId = CONTACT_TYPE_ID;
static const typeId = 0;
static const boxName = 'Contacts';

@HiveField(0, defaultValue: '')
Expand Down
17 changes: 11 additions & 6 deletions lib/entities/get_encryption_key.dart
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:cw_core/cake_hive.dart';
import 'package:hive/hive.dart';

Future<List<int>> getEncryptionKey(
{required String forKey, required FlutterSecureStorage secureStorage}) async {
final stringifiedKey = await secureStorage.read(key: 'transactionDescriptionsBoxKey');
final stringifiedKey =
await secureStorage.read(key: 'transactionDescriptionsBoxKey');
List<int> key;

if (stringifiedKey == null) {
key = CakeHive.generateSecureKey();
key = Hive.generateSecureKey();
final keyStringified = key.join(',');
await secureStorage.write(key: 'transactionDescriptionsBoxKey', value: keyStringified);
await secureStorage.write(
key: 'transactionDescriptionsBoxKey', value: keyStringified);
} else {
key = stringifiedKey.split(',').map((i) => int.parse(i)).toList();
key = stringifiedKey
.split(',')
.map((i) => int.parse(i))
.toList();
}

return key;
}
}
3 changes: 1 addition & 2 deletions lib/entities/template.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:cw_core/hive_type_ids.dart';
import 'package:hive/hive.dart';

part 'template.g.dart';
Expand All @@ -15,7 +14,7 @@ class Template extends HiveObject {
required this.amountFiatRaw,
this.additionalRecipientsRaw});

static const typeId = TEMPLATE_TYPE_ID;
static const typeId = 6;
static const boxName = 'Template';

@HiveField(0)
Expand Down
3 changes: 1 addition & 2 deletions lib/entities/transaction_description.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:cw_core/hive_type_ids.dart';
import 'package:hive/hive.dart';

part 'transaction_description.g.dart';
Expand All @@ -7,7 +6,7 @@ part 'transaction_description.g.dart';
class TransactionDescription extends HiveObject {
TransactionDescription({required this.id, this.recipientAddress, this.transactionNote});

static const typeId = TRANSACTION_TYPE_ID;
static const typeId = 2;
static const boxName = 'TransactionDescriptions';
static const boxKey = 'transactionDescriptionsBoxKey';

Expand Down
3 changes: 1 addition & 2 deletions lib/exchange/exchange_template.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:cw_core/hive_type_ids.dart';
import 'package:hive/hive.dart';

part 'exchange_template.g.dart';
Expand All @@ -15,7 +14,7 @@ class ExchangeTemplate extends HiveObject {
required this.depositCurrencyTitleRaw,
required this.receiveCurrencyTitleRaw});

static const typeId = EXCHANGE_TEMPLATE_TYPE_ID;
static const typeId = 7;
static const boxName = 'ExchangeTemplate';

@HiveField(0)
Expand Down
5 changes: 2 additions & 3 deletions lib/exchange/trade.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'package:hive/hive.dart';
import 'package:cw_core/crypto_currency.dart';
import 'package:cake_wallet/exchange/exchange_provider_description.dart';
import 'package:cake_wallet/exchange/trade_state.dart';
import 'package:cw_core/format_amount.dart';
import 'package:cw_core/hive_type_ids.dart';
import 'package:hive/hive.dart';

part 'trade.g.dart';

Expand Down Expand Up @@ -42,7 +41,7 @@ class Trade extends HiveObject {
}
}

static const typeId = TRADE_TYPE_ID;
static const typeId = 3;
static const boxName = 'Trades';
static const boxKey = 'tradesBoxKey';

Expand Down
Loading

0 comments on commit ad6edd9

Please sign in to comment.