Some another fixes for Android. Never ask us about that.

wownero
M 3 years ago
parent 0774ce18ca
commit 5631961e47

@ -3,7 +3,8 @@
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.USE_FINGERPRINT"/> <uses-permission android:name="android.permission.USE_FINGERPRINT"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application <application
android:label="Cake Wallet" android:label="Cake Wallet"
android:allowBackup="false" android:allowBackup="false"
@ -17,15 +18,6 @@
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize" android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait"> android:screenOrientation="portrait">
<!-- <meta-data-->
<!-- android:name="io.flutter.embedding.android.NormalTheme"-->
<!-- android:resource="@style/NormalTheme"-->
<!-- />-->
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data <meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable" android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" android:resource="@drawable/launch_background"

@ -5,7 +5,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.5.0' classpath 'com.android.tools.build:gradle:3.5.4'
} }
} }

@ -9,7 +9,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.5.0' classpath 'com.android.tools.build:gradle:3.5.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }

@ -696,7 +696,7 @@ extern "C"
void on_startup() void on_startup()
{ {
Monero::Utils::onStartup(); Monero::Utils::onStartup();
Monero::WalletManagerFactory::setLogLevel(4); Monero::WalletManagerFactory::setLogLevel(0);
} }
void rescan_blockchain() void rescan_blockchain()

@ -1,3 +1,4 @@
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -91,17 +92,46 @@ class BackupPage extends BasePage {
context: context, context: context,
builder: (dialogContext) { builder: (dialogContext) {
return AlertWithTwoActions( return AlertWithTwoActions(
alertTitle: S.of(context).export_backup, alertTitle: S.of(context).export_backup,
alertContent: S.of(context).save_backup_password, alertContent: S.of(context).save_backup_password,
rightButtonText: S.of(context).seed_alert_yes, rightButtonText: S.of(context).seed_alert_yes,
leftButtonText: S.of(context).seed_alert_back, leftButtonText: S.of(context).seed_alert_back,
actionRightButton: () async { actionRightButton: () async {
Navigator.of(dialogContext).pop(); Navigator.of(dialogContext).pop();
final backup = await backupViewModelBase.exportBackup(); final backup = await backupViewModelBase.exportBackup();
await Share.file( await backupViewModelBase.saveToDownload(
S.of(context).backup_file, backup.name, backup.content, 'text'); backup.name, backup.content);
},
actionLeftButton: () => Navigator.of(dialogContext).pop()); if (Platform.isAndroid) {
onExportAndroid(context, backup);
} else {
await Share.file(S.of(context).backup_file, backup.name,
backup.content, 'application/*');
}
},
actionLeftButton: () => Navigator.of(dialogContext).pop());
});
}
void onExportAndroid(BuildContext context, BackupExportFile backup) {
showPopUp<void>(
context: context,
builder: (dialogContext) {
return AlertWithTwoActions(
alertTitle: S.of(context).export_backup,
alertContent: 'Please select destination for the backup file.',
rightButtonText: 'Save to Downloads',
leftButtonText: 'Share',
actionRightButton: () async {
Navigator.of(dialogContext).pop();
await backupViewModelBase.saveToDownload(
backup.name, backup.content);
},
actionLeftButton: () {
Navigator.of(dialogContext).pop();
Share.file(S.of(context).backup_file, backup.name,
backup.content, 'application/*');
});
}); });
} }
} }

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:cake_wallet/core/backup_service.dart'; import 'package:cake_wallet/core/backup_service.dart';
import 'package:cake_wallet/core/execution_state.dart'; import 'package:cake_wallet/core/execution_state.dart';
import 'package:cake_wallet/entities/secret_store_key.dart'; import 'package:cake_wallet/entities/secret_store_key.dart';
@ -66,4 +68,12 @@ abstract class BackupViewModelBase with Store {
@action @action
void showMasterPassword() => isBackupPasswordVisible = true; void showMasterPassword() => isBackupPasswordVisible = true;
@action
Future<void> saveToDownload(String name, List<int> content) async {
const downloadDirPath = '/storage/emulated/0/Download'; // For Android
final filePath = '$downloadDirPath/${name}';
final file = File(filePath);
await file.writeAsBytes(content);
}
} }

@ -11,7 +11,7 @@ description: Cake Wallet.
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 4.1.0+34 version: 4.1.0+37
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save