Merge branch 'dashboard-desktop-view' of https://github.com/cake-tech/cake_wallet into CW-301-desktop-side-bar-ui

This commit is contained in:
Godwin Asuquo 2023-01-31 15:12:01 +02:00
commit 4902dc8dd4
36 changed files with 448 additions and 190 deletions

4
.gitignore vendored
View file

@ -137,4 +137,6 @@ assets/images/app_logo.png
/android/app/src/main/AndroidManifest.xml
macos/Runner/Info.plist
macos/Runner/Info.plist
macos/Runner/DebugProfile.entitlements
macos/Runner/Release.entitlements

View file

@ -1,20 +0,0 @@
//
// wakeLock.swift
// Runner
//
// Created by Godwin Asuquo on 1/21/22.
//
import Foundation
import UIKit
func enableWakeScreen() -> Bool{
UIApplication.shared.isIdleTimerDisabled = true
return true
}
func disableWakeScreen() -> Bool{
UIApplication.shared.isIdleTimerDisabled = false
return true
}

View file

@ -12,7 +12,6 @@
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
20ED0868E1BD7E12278C0CB3 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B26E3F56D69167FBB1DC160A /* Pods_Runner.framework */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
5AFFEBFD279AD49C00F906A4 /* wakeLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AFFEBFC279AD49C00F906A4 /* wakeLock.swift */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@ -280,7 +279,6 @@
files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
5AFFEBFD279AD49C00F906A4 /* wakeLock.swift in Sources */,
0C9D68C9264854B60011B691 /* secRandom.swift in Sources */,
0C44A71A2518EF8000B570ED /* decrypt.swift in Sources */,
);

View file

@ -96,11 +96,6 @@ import UnstoppableDomainsResolution
result(address)
}
case "enableWakeScreen":
result(enableWakeScreen())
case "disableWakeScreen":
result(disableWakeScreen())
default:
result(FlutterMethodNotImplemented)

View file

@ -1,10 +1,10 @@
import 'package:cake_wallet/core/yat_service.dart';
import 'package:cake_wallet/entities/parse_address_from_domain.dart';
import 'package:cake_wallet/entities/wake_lock.dart';
import 'package:cake_wallet/ionia/ionia_anypay.dart';
import 'package:cake_wallet/ionia/ionia_gift_card.dart';
import 'package:cake_wallet/ionia/ionia_tip.dart';
import 'package:cake_wallet/src/screens/buy/onramper_page.dart';
import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart';
import 'package:cake_wallet/src/screens/settings/display_settings_page.dart';
import 'package:cake_wallet/src/screens/settings/other_settings_page.dart';
import 'package:cake_wallet/src/screens/settings/privacy_page.dart';
@ -704,8 +704,6 @@ Future setup(
param1: item, param2: unspentCoinsListViewModel));
});
getIt.registerFactory(() => WakeLock());
getIt.registerFactory(() => YatService());
getIt.registerFactory(() => AddressResolver(yatService: getIt.get<YatService>(),
@ -819,6 +817,8 @@ Future setup(
getIt.registerFactory(() => IoniaAccountCardsPage(getIt.get<IoniaAccountViewModel>()));
getIt.registerFactory(() => DesktopWalletSelectionDropDown(getIt.get<WalletListViewModel>()));
getIt.registerFactoryParam<IoniaPaymentStatusViewModel, IoniaAnyPayPaymentInfo, AnyPayPaymentCommittedInfo>(
(IoniaAnyPayPaymentInfo paymentInfo, AnyPayPaymentCommittedInfo committedInfo)
=> IoniaPaymentStatusViewModel(

View file

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/services.dart';
const channel = MethodChannel('com.cake_wallet/native_utils');
@ -6,13 +8,18 @@ Future<String> fetchUnstoppableDomainAddress(String domain, String ticker) async
var address = '';
try {
address = await channel.invokeMethod<String>(
'getUnstoppableDomainAddress',
<String, String> {
'domain' : domain,
'ticker' : ticker
}
) ?? '';
if (Platform.isAndroid || Platform.isIOS) {
address = await channel.invokeMethod<String>(
'getUnstoppableDomainAddress',
<String, String> {
'domain' : domain,
'ticker' : ticker
}
) ?? '';
} else {
// TODO: Integrate with Unstoppable domains resolution API
return address;
}
} catch (e) {
print('Unstoppable domain error: ${e.toString()}');
address = '';

View file

@ -1,21 +0,0 @@
import 'package:flutter/services.dart';
class WakeLock {
static const _utils = const MethodChannel('com.cake_wallet/native_utils');
Future<void> enableWake() async {
try {
await _utils.invokeMethod<bool>('enableWakeScreen');
} on PlatformException catch (_) {
print('Failed enabling screen wakelock');
}
}
Future<void> disableWake() async {
try {
await _utils.invokeMethod<bool>('disableWakeScreen');
} on PlatformException catch (_) {
print('Failed enabling screen wakelock');
}
}
}

View file

@ -1,6 +1,4 @@
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/entities/update_haven_rate.dart';
import 'package:cake_wallet/entities/wake_lock.dart';
import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:mobx/mobx.dart';
@ -9,7 +7,7 @@ import 'package:cw_core/wallet_base.dart';
import 'package:cw_core/balance.dart';
import 'package:cw_core/transaction_info.dart';
import 'package:cw_core/sync_status.dart';
import 'package:flutter/services.dart';
import 'package:wakelock/wakelock.dart';
ReactionDisposer? _onWalletSyncStatusChangeReaction;
@ -17,7 +15,6 @@ void startWalletSyncStatusChangeReaction(
WalletBase<Balance, TransactionHistoryBase<TransactionInfo>,
TransactionInfo> wallet,
FiatConversionStore fiatConversionStore) {
final _wakeLock = getIt.get<WakeLock>();
_onWalletSyncStatusChangeReaction?.reaction.dispose();
_onWalletSyncStatusChangeReaction =
reaction((_) => wallet.syncStatus, (SyncStatus status) async {
@ -30,10 +27,10 @@ void startWalletSyncStatusChangeReaction(
}
}
if (status is SyncingSyncStatus) {
await _wakeLock.enableWake();
await Wakelock.enable();
}
if (status is SyncedSyncStatus || status is FailedSyncStatus) {
await _wakeLock.disableWake();
await Wakelock.disable();
}
} catch(e) {
print(e.toString());

View file

@ -1,5 +1,7 @@
import 'dart:async';
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/entities/main_actions.dart';
import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart';
import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_dashboard_view.dart';
import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu.dart';
import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_controller.dart';
@ -171,6 +173,15 @@ class _DashboardPage extends BasePage {
@override
Widget get endDrawer => MenuWidget(walletViewModel);
@override
Widget? leading(BuildContext context) {
if (!ResponsiveLayoutUtil.instance.isMobile(context)) {
return getIt<DesktopWalletSelectionDropDown>();
}
return null;
}
@override
Widget middle(BuildContext context) {
return SyncIndicator(

View file

@ -0,0 +1,163 @@
import 'package:another_flushbar/flushbar.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/utils/show_bar.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/wallet_list/wallet_list_item.dart';
import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:flutter/material.dart';
class DesktopWalletSelectionDropDown extends StatefulWidget {
final WalletListViewModel walletListViewModel;
DesktopWalletSelectionDropDown(this.walletListViewModel, {Key? key}) : super(key: key);
@override
State<DesktopWalletSelectionDropDown> createState() => _DesktopWalletSelectionDropDownState();
}
class _DesktopWalletSelectionDropDownState extends State<DesktopWalletSelectionDropDown> {
final moneroIcon = Image.asset('assets/images/monero_logo.png', height: 24, width: 24);
final bitcoinIcon = Image.asset('assets/images/bitcoin.png', height: 24, width: 24);
final litecoinIcon = Image.asset('assets/images/litecoin_icon.png', height: 24, width: 24);
final havenIcon = Image.asset('assets/images/haven_logo.png', height: 24, width: 24);
final nonWalletTypeIcon = Image.asset('assets/images/close.png', height: 24, width: 24);
final double tileHeight = 60;
Flushbar<void>? _progressBar;
@override
Widget build(BuildContext context) {
final themeData = Theme.of(context);
return DropdownButton<WalletListItem>(
items: widget.walletListViewModel.wallets
.map((wallet) => DropdownMenuItem(
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: 500),
child: walletListItemTile(wallet),
),
value: wallet,
))
.toList(),
onChanged: (selectedWallet) async {
if (selectedWallet!.isCurrent || !selectedWallet.isEnabled) {
return;
}
final confirmed = await showPopUp<bool>(
context: context,
builder: (dialogContext) {
return AlertWithTwoActions(
alertTitle: S.of(context).change_wallet_alert_title,
alertContent: S.of(context).change_wallet_alert_content(selectedWallet.name),
leftButtonText: S.of(context).cancel,
rightButtonText: S.of(context).change,
actionLeftButton: () => Navigator.of(context).pop(false),
actionRightButton: () => Navigator.of(context).pop(true));
}) ??
false;
if (confirmed) {
await _loadWallet(selectedWallet);
}
},
dropdownColor: themeData.textTheme.bodyText1?.decorationColor,
style: TextStyle(color: themeData.primaryTextTheme.headline6?.color),
selectedItemBuilder: (context) => widget.walletListViewModel.wallets
.map((wallet) => ConstrainedBox(
constraints: BoxConstraints(maxWidth: 500),
child: walletListItemTile(wallet),
))
.toList(),
value: widget.walletListViewModel.wallets.firstWhere((element) => element.isCurrent),
underline: const SizedBox(),
focusColor: Colors.transparent,
);
}
Widget walletListItemTile(WalletListItem wallet) {
return Container(
height: tileHeight,
padding: EdgeInsets.symmetric(horizontal: 20),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
wallet.isEnabled ? _imageFor(type: wallet.type) : nonWalletTypeIcon,
SizedBox(width: 10),
Flexible(
child: Text(
wallet.name,
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryTextTheme.headline6!.color!,
),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
)
],
),
);
}
Image _imageFor({required WalletType type}) {
switch (type) {
case WalletType.bitcoin:
return bitcoinIcon;
case WalletType.monero:
return moneroIcon;
case WalletType.litecoin:
return litecoinIcon;
case WalletType.haven:
return havenIcon;
default:
return nonWalletTypeIcon;
}
}
Future<void> _loadWallet(WalletListItem wallet) async {
if (await widget.walletListViewModel.checkIfAuthRequired()) {
await Navigator.of(context).pushNamed(Routes.auth,
arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) async {
if (!isAuthenticatedSuccessfully) {
return;
}
try {
auth.changeProcessText(S.of(context).wallet_list_loading_wallet(wallet.name));
await widget.walletListViewModel.loadWallet(wallet);
auth.hideProgressText();
auth.close();
setState(() {});
} catch (e) {
auth.changeProcessText(
S.of(context).wallet_list_failed_to_load(wallet.name, e.toString()));
}
});
} else {
try {
changeProcessText(S.of(context).wallet_list_loading_wallet(wallet.name));
await widget.walletListViewModel.loadWallet(wallet);
hideProgressText();
setState(() {});
} catch (e) {
changeProcessText(S.of(context).wallet_list_failed_to_load(wallet.name, e.toString()));
}
}
}
void changeProcessText(String text) {
_progressBar = createBar<void>(text, duration: null)..show(context);
}
void hideProgressText() {
_progressBar?.dismiss();
_progressBar = null;
}
}

View file

@ -1,8 +1,9 @@
import 'dart:io';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/utils/show_bar.dart';
import 'package:device_display_brightness/device_display_brightness.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/generated/i18n.dart';
@ -59,22 +60,17 @@ class QRWidget extends StatelessWidget {
builder: (_) => Flexible(
flex: 5,
child: GestureDetector(
onTap: () async {
// Get the current brightness:
final double brightness = await DeviceDisplayBrightness.getBrightness();
// ignore: unawaited_futures
DeviceDisplayBrightness.setBrightness(1.0);
await Navigator.pushNamed(
context,
Routes.fullscreenQR,
arguments: {
'qrData': addressListViewModel.uri.toString(),
'isLight': isLight,
},
);
// ignore: unawaited_futures
DeviceDisplayBrightness.setBrightness(brightness);
onTap: () {
changeBrightnessForRoute(() async {
await Navigator.pushNamed(
context,
Routes.fullscreenQR,
arguments: {
'qrData': addressListViewModel.uri.toString(),
'isLight': isLight,
},
);
});
},
child: Hero(
tag: Key(addressListViewModel.uri.toString()),
@ -173,4 +169,25 @@ class QRWidget extends StatelessWidget {
],
);
}
Future<void> changeBrightnessForRoute(Future<void> Function() navigation) async {
final isMobile = Platform.isIOS || Platform.isAndroid;
// if not mobile, just navigate
if (!isMobile) {
navigation();
return;
}
// Get the current brightness:
final brightness = await DeviceDisplayBrightness.getBrightness();
// ignore: unawaited_futures
DeviceDisplayBrightness.setBrightness(1.0);
await navigation();
// ignore: unawaited_futures
DeviceDisplayBrightness.setBrightness(brightness);
}
}

View file

@ -1,5 +1,5 @@
import 'package:cake_wallet/utils/constants.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget {
factory NavBar(
@ -63,10 +63,24 @@ class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget {
final paddingTop = pad / 2;
final _paddingBottom = (pad / 2);
if (MediaQuery.of(context).size.width > ConstValues.minimumDesktopWidth) {
return PreferredSize(
preferredSize: Size.fromHeight(height),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if (leading != null) Flexible(child: leading!),
if (middle != null) middle!,
if (trailing != null) trailing!,
],
),
);
}
return Container(
decoration: decoration ?? BoxDecoration(color: backgroundColor),
padding:
EdgeInsetsDirectional.only(bottom: _paddingBottom, top: paddingTop),
padding: EdgeInsetsDirectional.only(bottom: _paddingBottom, top: paddingTop),
child: CupertinoNavigationBar(
leading: leading,
automaticallyImplyLeading: false,

3
lib/utils/constants.dart Normal file
View file

@ -0,0 +1,3 @@
class ConstValues {
static const int minimumDesktopWidth = 900;
}

View file

@ -0,0 +1,16 @@
import Foundation
import CryptoSwift
func decrypt(data: Data, key: String, salt: String) -> String? {
let keyBytes = key.data(using: .utf8)?.bytes ?? []
let saltBytes = salt.data(using: .utf8)?.bytes ?? []
guard let PBKDF2key = try? PKCS5.PBKDF2(password: keyBytes, salt: saltBytes, iterations: 4096, variant: .sha256).calculate(),
let cipher = try? Blowfish(key: PBKDF2key, padding: .pkcs7),
let decryptedBytes = try? cipher.decrypt(data.bytes) else {
return nil
}
let decryptedData = Data(decryptedBytes)
return String(data: decryptedData, encoding: .utf8)
}

View file

@ -0,0 +1,12 @@
import Foundation
func secRandom(count: Int) -> Data? {
var bytes = [Int8](repeating: 0, count: count)
let status = SecRandomCopyBytes(kSecRandomDefault, bytes.count, &bytes)
if status == errSecSuccess {
return Data(bytes: bytes, count: bytes.count)
}
return nil
}

View file

@ -10,18 +10,19 @@ import cw_monero
import devicelocale
import flutter_secure_storage_macos
import package_info
import path_provider_macos
import path_provider_foundation
import platform_device_id
import platform_device_id_macos
import share_plus_macos
import shared_preferences_foundation
import url_launcher_macos
import wakelock_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
CwMoneroPlugin.register(with: registry.registrar(forPlugin: "CwMoneroPlugin"))
DevicelocalePlugin.register(with: registry.registrar(forPlugin: "DevicelocalePlugin"))
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
FlutterSecureStorageMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStorageMacosPlugin"))
FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
PlatformDeviceIdMacosPlugin.register(with: registry.registrar(forPlugin: "PlatformDeviceIdMacosPlugin"))
@ -29,4 +30,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
}

View file

@ -31,6 +31,9 @@ target 'Runner' do
use_modular_headers!
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
# Cake Wallet (Legacy)
pod 'CryptoSwift'
end
post_install do |installer|

View file

@ -2,6 +2,7 @@ PODS:
- connectivity_macos (0.0.1):
- FlutterMacOS
- Reachability
- CryptoSwift (1.3.1)
- cw_monero (0.0.1):
- cw_monero/Boost (= 0.0.1)
- cw_monero/Monero (= 0.0.1)
@ -21,12 +22,13 @@ PODS:
- FlutterMacOS
- devicelocale (0.0.1):
- FlutterMacOS
- flutter_secure_storage_macos (6.1.1):
- flutter_secure_storage_macos (3.3.1):
- FlutterMacOS
- FlutterMacOS (1.0.0)
- package_info (0.0.1):
- FlutterMacOS
- path_provider_macos (0.0.1):
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- platform_device_id (0.0.1):
- FlutterMacOS
@ -40,23 +42,28 @@ PODS:
- FlutterMacOS
- url_launcher_macos (0.0.1):
- FlutterMacOS
- wakelock_macos (0.0.1):
- FlutterMacOS
DEPENDENCIES:
- connectivity_macos (from `Flutter/ephemeral/.symlinks/plugins/connectivity_macos/macos`)
- CryptoSwift
- cw_monero (from `Flutter/ephemeral/.symlinks/plugins/cw_monero/macos`)
- devicelocale (from `Flutter/ephemeral/.symlinks/plugins/devicelocale/macos`)
- flutter_secure_storage_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- package_info (from `Flutter/ephemeral/.symlinks/plugins/package_info/macos`)
- path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/macos`)
- platform_device_id (from `Flutter/ephemeral/.symlinks/plugins/platform_device_id/macos`)
- platform_device_id_macos (from `Flutter/ephemeral/.symlinks/plugins/platform_device_id_macos/macos`)
- share_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
- wakelock_macos (from `Flutter/ephemeral/.symlinks/plugins/wakelock_macos/macos`)
SPEC REPOS:
trunk:
- CryptoSwift
- Reachability
EXTERNAL SOURCES:
@ -72,8 +79,8 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral
package_info:
:path: Flutter/ephemeral/.symlinks/plugins/package_info/macos
path_provider_macos:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos
path_provider_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/macos
platform_device_id:
:path: Flutter/ephemeral/.symlinks/plugins/platform_device_id/macos
platform_device_id_macos:
@ -84,22 +91,26 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
wakelock_macos:
:path: Flutter/ephemeral/.symlinks/plugins/wakelock_macos/macos
SPEC CHECKSUMS:
connectivity_macos: 5dae6ee11d320fac7c05f0d08bd08fc32b5514d9
CryptoSwift: f12f037f6d0fcd6d48c96db0071b653de64e6c4d
cw_monero: f8b7f104508efba2591548e76b5c058d05cba3f0
devicelocale: 9f0f36ac651cabae2c33f32dcff4f32b61c38225
flutter_secure_storage_macos: 75c8cadfdba05ca007c0fa4ea0c16e5cf85e521b
flutter_secure_storage_macos: 6ceee8fbc7f484553ad17f79361b556259df89aa
FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811
package_info: 6eba2fd8d3371dda2d85c8db6fe97488f24b74b2
path_provider_macos: 05fb0ef0cedf3e5bd179b9e41a638682b37133ea
path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852
platform_device_id: 3e414428f45df149bbbfb623e2c0ca27c545b763
platform_device_id_macos: f763bb55f088be804d61b96eb4710b8ab6598e94
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
share_plus_macos: 853ee48e7dce06b633998ca0735d482dd671ade4
shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca
url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3
url_launcher_macos: c04e4fa86382d4f94f6b38f14625708be3ae52e2
wakelock_macos: bc3f2a9bd8d2e6c89fee1e1822e7ddac3bd004a9
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
PODFILE CHECKSUM: 63bac006751af51321f57697a4b72bbfa0947124
COCOAPODS: 1.11.3

View file

@ -24,9 +24,11 @@
328F945957E1041662291EC5 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C84AA35EA80D710889C68D81 /* Pods_Runner.framework */; };
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
9F31AE4A2988022C00765327 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
9F3F7550298098120030A1D7 /* secRandom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F3F754D298098120030A1D7 /* secRandom.swift */; };
9F3F7551298098120030A1D7 /* decrypt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F3F754E298098120030A1D7 /* decrypt.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -57,7 +59,7 @@
135D3AD0276D31F62BBEDDBF /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
33CC10ED2044A3C60003C045 /* cake_wallet_new.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = cake_wallet_new.app; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10ED2044A3C60003C045 /* Cake Wallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Cake Wallet.app"; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
@ -72,6 +74,8 @@
359F2F22842E234537DED5E3 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
9F3F754D298098120030A1D7 /* secRandom.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = secRandom.swift; path = CakeWallet/secRandom.swift; sourceTree = "<group>"; };
9F3F754E298098120030A1D7 /* decrypt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = decrypt.swift; path = CakeWallet/decrypt.swift; sourceTree = "<group>"; };
C84AA35EA80D710889C68D81 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FF499CFF131B036E3C5638D0 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
@ -102,6 +106,8 @@
33CC10E42044A3C60003C045 = {
isa = PBXGroup;
children = (
9F3F754E298098120030A1D7 /* decrypt.swift */,
9F3F754D298098120030A1D7 /* secRandom.swift */,
33FAB671232836740065AC1E /* Runner */,
33CEB47122A05771004F2AC0 /* Flutter */,
33CC10EE2044A3C60003C045 /* Products */,
@ -113,7 +119,7 @@
33CC10EE2044A3C60003C045 /* Products */ = {
isa = PBXGroup;
children = (
33CC10ED2044A3C60003C045 /* cake_wallet_new.app */,
33CC10ED2044A3C60003C045 /* Cake Wallet.app */,
);
name = Products;
sourceTree = "<group>";
@ -194,7 +200,7 @@
);
name = Runner;
productName = Runner;
productReference = 33CC10ED2044A3C60003C045 /* cake_wallet_new.app */;
productReference = 33CC10ED2044A3C60003C045 /* Cake Wallet.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
@ -247,7 +253,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */,
9F31AE4A2988022C00765327 /* Assets.xcassets in Resources */,
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -338,6 +344,8 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9F3F7550298098120030A1D7 /* secRandom.swift in Sources */,
9F3F7551298098120030A1D7 /* decrypt.swift in Sources */,
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */,
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */,
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */,
@ -425,12 +433,13 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_ON_DEMAND_RESOURCES = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11;
MACOSX_DEPLOYMENT_TARGET = 10.11;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
@ -555,12 +564,13 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_ON_DEMAND_RESOURCES = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11;
MACOSX_DEPLOYMENT_TARGET = 10.11;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
@ -579,12 +589,13 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_ON_DEMAND_RESOURCES = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11;
MACOSX_DEPLOYMENT_TARGET = 10.11;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};

View file

@ -15,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "cake_wallet_new.app"
BuildableName = "Cake Wallet.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
@ -31,7 +31,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "cake_wallet_new.app"
BuildableName = "Cake Wallet.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
@ -54,7 +54,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "cake_wallet_new.app"
BuildableName = "Cake Wallet.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
@ -71,7 +71,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "cake_wallet_new.app"
BuildableName = "Cake Wallet.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>

View file

@ -1,9 +1,33 @@
import Cocoa
import FlutterMacOS
import IOKit.pwr_mgt
@NSApplicationMain
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}
override func applicationDidFinishLaunching(_ notification: Notification) {
let controller : FlutterViewController = mainFlutterWindow?.contentViewController as! FlutterViewController
let utilsChannel = FlutterMethodChannel(
name: "com.cake_wallet/native_utils",
binaryMessenger: controller.engine.binaryMessenger)
utilsChannel.setMethodCallHandler({ [weak self] (call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in
switch call.method {
case "sec_random":
guard let args = call.arguments as? Dictionary<String, Any>,
let count = args["count"] as? Int else {
result(nil)
return
}
result(secRandom(count: count))
default:
result(FlutterMethodNotImplemented)
}
})
}
}

View file

@ -1,68 +1,68 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "app_icon_16.png",
"scale" : "1x"
"info": {
"version": 1,
"author": "xcode"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "app_icon_32.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "app_icon_32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "app_icon_64.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "app_icon_128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "app_icon_256.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "app_icon_256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "app_icon_512.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "app_icon_512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "app_icon_1024.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
"images": [
{
"size": "16x16",
"idiom": "mac",
"filename": "app_icon_16.png",
"scale": "1x"
},
{
"size": "16x16",
"idiom": "mac",
"filename": "app_icon_32.png",
"scale": "2x"
},
{
"size": "32x32",
"idiom": "mac",
"filename": "app_icon_32.png",
"scale": "1x"
},
{
"size": "32x32",
"idiom": "mac",
"filename": "app_icon_64.png",
"scale": "2x"
},
{
"size": "128x128",
"idiom": "mac",
"filename": "app_icon_128.png",
"scale": "1x"
},
{
"size": "128x128",
"idiom": "mac",
"filename": "app_icon_256.png",
"scale": "2x"
},
{
"size": "256x256",
"idiom": "mac",
"filename": "app_icon_256.png",
"scale": "1x"
},
{
"size": "256x256",
"idiom": "mac",
"filename": "app_icon_512.png",
"scale": "2x"
},
{
"size": "512x512",
"idiom": "mac",
"filename": "app_icon_512.png",
"scale": "1x"
},
{
"size": "512x512",
"idiom": "mac",
"filename": "app_icon_1024.png",
"scale": "2x"
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 B

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -5,10 +5,10 @@
// 'flutter create' template.
// The application's name. By default this is also the title of the Flutter window.
PRODUCT_NAME = cake_wallet_new
PRODUCT_NAME = Cake Wallet
// The application's bundle identifier
PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakeWalletNew
PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet
// The copyright displayed in application information
PRODUCT_COPYRIGHT = Copyright © 2022 com.fotolockr. All rights reserved.

View file

@ -10,7 +10,7 @@
<true/>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.cakewallet.macos</string>
<string>$(AppIdentifierPrefix)${BUNDLE_ID}</string>
</array>
<key>com.apple.security.network.client</key>
<true/>

View file

@ -6,7 +6,7 @@
<true/>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.cakewallet.macos</string>
<string>$(AppIdentifierPrefix)${BUNDLE_ID}</string>
</array>
<key>com.apple.security.network.client</key>
<true/>

View file

@ -9,13 +9,12 @@ dependencies:
qr: ^3.0.1
uuid: 3.0.6
shared_preferences: ^2.0.15
flutter_secure_storage: ^7.0.1
# flutter_secure_storage:
# git:
# url: https://github.com/cake-tech/flutter_secure_storage.git
# path: flutter_secure_storage
# ref: cake-6.0.0
# version: 6.0.0
flutter_secure_storage:
git:
url: https://github.com/cake-tech/flutter_secure_storage.git
path: flutter_secure_storage
ref: cake-6.0.0
version: 6.0.0
# provider: ^6.0.3
rxdart: ^0.27.4
yaml: ^3.1.1
@ -62,6 +61,7 @@ dependencies:
permission_handler: ^10.0.0
device_display_brightness: ^0.0.6
platform_device_id: ^1.0.1
wakelock: ^0.6.2
cake_backup:
git:
url: https://github.com/cake-tech/cake_backup.git
@ -75,7 +75,7 @@ dev_dependencies:
mobx_codegen: ^2.0.7
build_resolvers: ^2.0.9
hive_generator: ^1.1.3
flutter_launcher_icons: ^0.9.3
flutter_launcher_icons: ^0.11.0
# check flutter_launcher_icons for usage
pedantic: ^1.8.0
# replace https://github.com/dart-lang/lints#migrating-from-packagepedantic
@ -84,6 +84,9 @@ flutter_icons:
image_path: "assets/images/app_logo.png"
android: true
ios: true
macos:
generate: true
image_path: "assets/images/app_logo.png"
flutter:
uses-material-design: true

View file

@ -13,6 +13,12 @@ cp -rf ./macos/Runner/InfoBase.plist ./macos/Runner/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier ${APP_MACOS_BUNDLE_ID}" ./macos/Runner/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${APP_MACOS_VERSION}" ./macos/Runner/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${APP_MACOS_BUILD_NUMBER}" ./macos/Runner/Info.plist
# Fill entitlements Bundle ID
cp -rf ./macos/Runner/DebugProfileBase.entitlements ./macos/Runner/DebugProfile.entitlements
cp -rf ./macos/Runner/ReleaseBase.entitlements ./macos/Runner/Release.entitlements
sed -i '' "s/\${BUNDLE_ID}/${APP_MACOS_BUNDLE_ID}/g" ./macos/Runner/DebugProfile.entitlements
sed -i '' "s/\${BUNDLE_ID}/${APP_MACOS_BUNDLE_ID}/g" ./macos/Runner/Release.entitlements
CONFIG_ARGS=""
case $APP_MACOS_TYPE in

View file

@ -17,7 +17,7 @@ fi
CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="1.0.0"
CAKEWALLET_BUILD_NUMBER=1
CAKEWALLET_BUNDLE_ID="com.cakewallet.macos"
CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then
echo "Wrong app type."

View file

@ -32,6 +32,10 @@ export CMAKE_INCLUDE_PATH="${PREFIX}/include"
export CMAKE_LIBRARY_PATH="${PREFIX}/lib"
rm -r monero/build > /dev/null
if [ "${ARCH}" == "x86_64" ]; then
ARCH="x86-64"
fi
mkdir -p monero/build/${BUILD_TYPE}
pushd monero/build/${BUILD_TYPE}
cmake -DARCH=${ARCH} \