diff --git a/README.md b/README.md
index 463fadfbc..1e7ebb458 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
# Cake Wallet
-The project description, motivation, build scripts, instructions, tests will be added soon (Spring 2020);
+The project description, motivation, build scripts, instructions, tests will be added soon (Spring 202X);
Copyright (c) 2020 Cake Technologies LLC.
diff --git a/android/app/build.gradle b/android/app/build.gradle
index 878eb27cf..7f3990150 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -41,7 +41,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.cakewallet.cake_wallet"
minSdkVersion 21
- targetSdkVersion 28
+ targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index bee0fa2b6..4513c32f6 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -1,17 +1,13 @@
-
-
+
+
+
+
+
+ android:name="io.flutter.embedding.android.SplashScreenDrawable"
+ android:resource="@drawable/launch_background"
+ />
+
+
diff --git a/android/app/src/main/java/com/cakewallet/cake_wallet/MainActivity.java b/android/app/src/main/java/com/cakewallet/cake_wallet/MainActivity.java
index 2d7ea1db7..b78897919 100644
--- a/android/app/src/main/java/com/cakewallet/cake_wallet/MainActivity.java
+++ b/android/app/src/main/java/com/cakewallet/cake_wallet/MainActivity.java
@@ -1,13 +1,15 @@
package com.cakewallet.cake_wallet;
-import android.os.Bundle;
-import io.flutter.app.FlutterFragmentActivity;
+import androidx.annotation.NonNull;
+import io.flutter.embedding.android.FlutterFragmentActivity;
+import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugins.GeneratedPluginRegistrant;
+
public class MainActivity extends FlutterFragmentActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- GeneratedPluginRegistrant.registerWith(this);
- }
-}
+
+ @Override
+ public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
+ GeneratedPluginRegistrant.registerWith(flutterEngine);
+ }
+}
\ No newline at end of file
diff --git a/android/app/src/main/kotlin/com/cakewallet/cake_wallet/MainActivity.kt b/android/app/src/main/kotlin/com/cakewallet/cake_wallet/MainActivity.kt
index 3ea4c29ad..b5c933268 100644
--- a/android/app/src/main/kotlin/com/cakewallet/cake_wallet/MainActivity.kt
+++ b/android/app/src/main/kotlin/com/cakewallet/cake_wallet/MainActivity.kt
@@ -1,6 +1,13 @@
package com.cakewallet.cake_wallet
+import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
+import io.flutter.embedding.android.FlutterFragmentActivity
+import io.flutter.embedding.engine.FlutterEngine
+import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterActivity() {
+ override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine){
+ GeneratedPluginRegistrant.registerWith(flutterEngine);
+ }
}
diff --git a/android/settings_aar.gradle b/android/settings_aar.gradle
new file mode 100644
index 000000000..e7b4def49
--- /dev/null
+++ b/android/settings_aar.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/assets/fonts/Lato-Bold.ttf b/assets/fonts/Lato-Bold.ttf
index ef5ae3b43..59c48434c 100644
Binary files a/assets/fonts/Lato-Bold.ttf and b/assets/fonts/Lato-Bold.ttf differ
diff --git a/assets/fonts/Lato-Medium.ttf b/assets/fonts/Lato-Medium.ttf
new file mode 100644
index 000000000..a208b9912
Binary files /dev/null and b/assets/fonts/Lato-Medium.ttf differ
diff --git a/assets/fonts/Lato-Regular.ttf b/assets/fonts/Lato-Regular.ttf
index adbfc467d..f01f55892 100644
Binary files a/assets/fonts/Lato-Regular.ttf and b/assets/fonts/Lato-Regular.ttf differ
diff --git a/assets/fonts/Lato-Semibold.ttf b/assets/fonts/Lato-Semibold.ttf
index 60ac82d65..0b95c6430 100644
Binary files a/assets/fonts/Lato-Semibold.ttf and b/assets/fonts/Lato-Semibold.ttf differ
diff --git a/assets/fonts/Montserrat-Bold.ttf b/assets/fonts/Montserrat-Bold.ttf
deleted file mode 100644
index eadb3b67b..000000000
Binary files a/assets/fonts/Montserrat-Bold.ttf and /dev/null differ
diff --git a/assets/fonts/Montserrat-Regular.ttf b/assets/fonts/Montserrat-Regular.ttf
deleted file mode 100644
index 211828ab7..000000000
Binary files a/assets/fonts/Montserrat-Regular.ttf and /dev/null differ
diff --git a/assets/fonts/Montserrat-SemiBold.ttf b/assets/fonts/Montserrat-SemiBold.ttf
deleted file mode 100644
index ada91a1c2..000000000
Binary files a/assets/fonts/Montserrat-SemiBold.ttf and /dev/null differ
diff --git a/assets/fonts/Poppins-Bold.ttf b/assets/fonts/Poppins-Bold.ttf
deleted file mode 100644
index b94d47f3a..000000000
Binary files a/assets/fonts/Poppins-Bold.ttf and /dev/null differ
diff --git a/assets/fonts/Poppins-Medium.ttf b/assets/fonts/Poppins-Medium.ttf
deleted file mode 100644
index e90e87ed6..000000000
Binary files a/assets/fonts/Poppins-Medium.ttf and /dev/null differ
diff --git a/assets/fonts/Poppins-Regular.ttf b/assets/fonts/Poppins-Regular.ttf
deleted file mode 100644
index be06e7fdc..000000000
Binary files a/assets/fonts/Poppins-Regular.ttf and /dev/null differ
diff --git a/assets/fonts/Poppins-SemiBold.ttf b/assets/fonts/Poppins-SemiBold.ttf
deleted file mode 100644
index dabf7c242..000000000
Binary files a/assets/fonts/Poppins-SemiBold.ttf and /dev/null differ
diff --git a/cw_monero/android/src/main/kotlin/com/cakewallet/monero/CwMoneroPlugin.kt b/cw_monero/android/src/main/kotlin/com/cakewallet/monero/CwMoneroPlugin.kt
index 593627078..37684a16a 100644
--- a/cw_monero/android/src/main/kotlin/com/cakewallet/monero/CwMoneroPlugin.kt
+++ b/cw_monero/android/src/main/kotlin/com/cakewallet/monero/CwMoneroPlugin.kt
@@ -4,7 +4,7 @@ import android.app.Activity
import android.os.AsyncTask
import android.os.Looper
import android.os.Handler
-import android.os.Process
+import android.os.Process
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
@@ -22,10 +22,10 @@ class doAsync(val handler: () -> Unit) : AsyncTask() {
class CwMoneroPlugin: MethodCallHandler {
companion object {
- val moneroApi = MoneroApi()
+// val moneroApi = MoneroApi()
val main = Handler(Looper.getMainLooper());
- init {
+ init {
System.loadLibrary("cw_monero")
}
@@ -43,31 +43,31 @@ class CwMoneroPlugin: MethodCallHandler {
val password = call.argument("password") ?: ""
val useSSL = false
val isLightWallet = false
- doAsync {
- try {
- moneroApi.setNodeAddressJNI(uri, login, password, useSSL, isLightWallet)
- main.post({
- result.success(true)
- });
- } catch(e: Throwable) {
- main.post({
- result.error("CONNECTION_ERROR", e.message, null)
- });
- }
- }.execute()
+// doAsync {
+// try {
+// moneroApi.setNodeAddressJNI(uri, login, password, useSSL, isLightWallet)
+// main.post({
+// result.success(true)
+// });
+// } catch(e: Throwable) {
+// main.post({
+// result.error("CONNECTION_ERROR", e.message, null)
+// });
+// }
+// }.execute()
}
if (call.method == "startSync") {
- doAsync {
- moneroApi.startSyncJNI()
- main.post({
- result.success(true)
- });
- }.execute()
+// doAsync {
+// moneroApi.startSyncJNI()
+// main.post({
+// result.success(true)
+// });
+// }.execute()
}
if (call.method == "loadWallet") {
val path = call.argument("path") ?: ""
val password = call.argument("password") ?: ""
- moneroApi.loadWalletJNI(path, password)
+// moneroApi.loadWalletJNI(path, password)
result.success(true)
}
}
diff --git a/cw_monero/android/src/main/kotlin/com/cakewallet/monero/MoneroApi.kt b/cw_monero/android/src/main/kotlin/com/cakewallet/monero/MoneroApi.kt
deleted file mode 100644
index 071577ad3..000000000
--- a/cw_monero/android/src/main/kotlin/com/cakewallet/monero/MoneroApi.kt
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.cakewallet.monero
-
-class MoneroApi {
- external fun setNodeAddressJNI(uri: String, login: String, password: String, use_ssl: Boolean, is_light_wallet: Boolean)
- external fun connectToNodeJNI()
- external fun startSyncJNI()
- external fun loadWalletJNI(path: String, password: String)
-
- companion object {
- init {
- System.loadLibrary("cw_monero")
- }
- }
-}
\ No newline at end of file
diff --git a/cw_monero/ios/Classes/monero_api.cpp b/cw_monero/ios/Classes/monero_api.cpp
index aa96d7656..2dfd8a0ae 100644
--- a/cw_monero/ios/Classes/monero_api.cpp
+++ b/cw_monero/ios/Classes/monero_api.cpp
@@ -87,7 +87,7 @@ extern "C"
void updated()
{
- m_need_to_refresh = true;
+ m_new_transaction = true;
}
void refreshed()
@@ -351,13 +351,11 @@ extern "C"
uint64_t get_full_balance(uint32_t account_index)
{
-// return 0;
return get_current_wallet()->balance(account_index);
}
uint64_t get_unlocked_balance(uint32_t account_index)
{
-// return 0;
return get_current_wallet()->unlockedBalance(account_index);
}
@@ -373,6 +371,7 @@ extern "C"
bool connect_to_node(char *error)
{
+ nice(19);
bool is_connected = get_current_wallet()->connectToDaemon();
if (!is_connected)
@@ -385,6 +384,7 @@ extern "C"
bool setup_node(char *address, char *login, char *password, bool use_ssl, bool is_light_wallet, char *error)
{
+ nice(19);
Monero::Wallet *wallet = get_current_wallet();
std::string _login = "";
@@ -437,7 +437,7 @@ extern "C"
{
store_mutex.lock();
get_current_wallet()->store(std::string(path));
- store_mutex.unlock();
+ store_mutex.unlock();
}
bool transaction_create(char *address, char *payment_id, char *amount,
@@ -472,7 +472,9 @@ extern "C"
return false;
}
- m_listener->m_new_transaction = true;
+ if (m_listener != nullptr) {
+ m_listener->m_new_transaction = true;
+ }
pendingTransaction = PendingTransactionRaw(transaction);
return true;
@@ -485,7 +487,7 @@ extern "C"
if (!committed)
{
error = Utf8Box(strdup(transaction->transaction->errorString().c_str()));
- } else {
+ } else if (m_listener != nullptr) {
m_listener->m_new_transaction = true;
}
@@ -508,9 +510,8 @@ extern "C"
}
uint64_t height = m_listener->height();
- uint64_t node_height = get_node_height_or_update(height);
- if (height <= 1 || node_height <= 0) {
+ if (height <= 1) {
return 0;
}
@@ -529,10 +530,8 @@ extern "C"
}
bool should_refresh = m_listener->isNeedToRefresh();
- uint64_t node_height = get_node_height_or_update(m_last_known_wallet_height);
- if (should_refresh || (node_height - m_last_known_wallet_height < MONERO_BLOCK_SIZE))
- {
+ if (should_refresh) {
m_listener->resetNeedToRefresh();
}
@@ -561,7 +560,7 @@ extern "C"
if (m_listener != nullptr)
{
- // free(m_listener);
+ free(m_listener);
}
m_listener = new MoneroWalletListener();
diff --git a/cw_monero/lib/account_list.dart b/cw_monero/lib/account_list.dart
index bf5618a1b..6e84f5931 100644
--- a/cw_monero/lib/account_list.dart
+++ b/cw_monero/lib/account_list.dart
@@ -26,7 +26,18 @@ final accountSetLabelNative = moneroApi
.lookup>('account_set_label_row')
.asFunction();
-void refreshAccounts() => accountRefreshNative();
+bool isUpdating = false;
+
+void refreshAccounts() {
+ try {
+ isUpdating = true;
+ accountRefreshNative();
+ isUpdating = false;
+ } catch (e) {
+ isUpdating = false;
+ rethrow;
+ }
+}
List getAllAccount() {
final size = accountSizeNative();
@@ -63,4 +74,4 @@ Future addAccount({String label}) async => compute(_addAccount, label);
Future setLabelForAccount({int accountIndex, String label}) async =>
compute(
- _setLabelForAccount, {'accountIndex': accountIndex, 'label': label});
+ _setLabelForAccount, {'accountIndex': accountIndex, 'label': label});
\ No newline at end of file
diff --git a/cw_monero/lib/subaddress_list.dart b/cw_monero/lib/subaddress_list.dart
index 933899e0c..97a307040 100644
--- a/cw_monero/lib/subaddress_list.dart
+++ b/cw_monero/lib/subaddress_list.dart
@@ -26,8 +26,18 @@ final subaddrressSetLabelNative = moneroApi
.lookup>('subaddress_set_label')
.asFunction();
-void refreshSubaddresses({int accountIndex}) =>
+bool isUpdating = false;
+
+void refreshSubaddresses({@required int accountIndex}) {
+ try {
+ isUpdating = true;
subaddressRefreshNative(accountIndex);
+ isUpdating = false;
+ } catch (e) {
+ isUpdating = false;
+ rethrow;
+ }
+}
List getAllSubaddresses() {
final size = subaddressSizeNative();
@@ -48,7 +58,7 @@ void addSubaddressSync({int accountIndex, String label}) {
void setLabelForSubaddressSync(
{int accountIndex, int addressIndex, String label}) {
final labelPointer = Utf8.toUtf8(label);
-
+
subaddrressSetLabelNative(accountIndex, addressIndex, labelPointer);
free(labelPointer);
}
@@ -70,7 +80,8 @@ void _setLabelForSubaddress(Map args) {
}
Future addSubaddress({int accountIndex, String label}) async =>
- compute