From edc04c7b3b3521d08b37bc19a5667c713bca03bf Mon Sep 17 00:00:00 2001
From: cebgcontract <99630598+cebgcontract@users.noreply.github.com>
Date: Tue, 26 Jul 2022 13:32:03 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=9F=E7=89=A9=E8=AE=A4?=
=?UTF-8?q?=E8=AF=81=E7=9A=84=E5=8C=85=E5=92=8C=E6=9D=83=E9=99=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/AndroidManifest.xml | 1 +
app/build.gradle | 1 +
js/main.js | 10 ++++++++++
3 files changed, 12 insertions(+)
diff --git a/app/AndroidManifest.xml b/app/AndroidManifest.xml
index 78b7544..cd3ba49 100644
--- a/app/AndroidManifest.xml
+++ b/app/AndroidManifest.xml
@@ -48,4 +48,5 @@
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 818fbcd..6029298 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -108,5 +108,6 @@ dependencies {
implementation project(':libcocos2dx')
implementation "androidx.appcompat:appcompat:1.0.2"
+ implementation "androidx.biometric:biometric:1.1.0"
implementation files('../libs/unity-classes.jar')
}
\ No newline at end of file
diff --git a/js/main.js b/js/main.js
index 705b433..d1852da 100644
--- a/js/main.js
+++ b/js/main.js
@@ -200,3 +200,13 @@ function sendErc20(funId, address, to, amount) {
})
}
+function restoreFromMnemonic(mnemonic, password) {
+ try {
+ diameter = parseFloat(diameter);
+ let result = jc.wallet.restoreFromMnemonic(mnemonic, password);
+ return JSON.stringify({errcode: 0, data: result});
+ } catch(err) {
+ return JSON.stringify({errcode: 1, errmsg: err});
+ }
+}
+