mirror of
https://github.com/m2049r/xmrwallet
synced 2025-09-04 17:28:42 +02:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6678222202 | ||
![]() |
793d984200 | ||
![]() |
cc46dc06c4 | ||
![]() |
be236cce1b | ||
![]() |
af18a89a5e |
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -37,7 +37,7 @@
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
@@ -8,8 +8,8 @@ android {
|
||||
applicationId "com.m2049r.xmrwallet"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 25
|
||||
versionCode 13
|
||||
versionName "0.8"
|
||||
versionCode 17
|
||||
versionName "0.8.0.4"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
|
@@ -531,8 +531,7 @@ Java_com_m2049r_xmrwallet_model_Wallet_setPassword(JNIEnv *env, jobject instance
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_com_m2049r_xmrwallet_model_Wallet_getAddressJ(JNIEnv *env, jobject instance) {
|
||||
Bitmonero::Wallet *wallet = getHandle<Bitmonero::Wallet>(env, instance);
|
||||
const char *address = wallet->address().c_str();
|
||||
return env->NewStringUTF(address);
|
||||
return env->NewStringUTF(wallet->address().c_str());
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
|
@@ -40,7 +40,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
@@ -76,12 +75,13 @@ public class LoginActivity extends AppCompatActivity
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
Log.d(TAG, "onCreate()");
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.login_activity);
|
||||
if (savedInstanceState != null) {
|
||||
return;
|
||||
// we don't store anything ourselves
|
||||
}
|
||||
|
||||
setContentView(R.layout.login_activity);
|
||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
@@ -187,13 +187,10 @@ public class LoginActivity extends AppCompatActivity
|
||||
}
|
||||
|
||||
private class AsyncRename extends AsyncTask<String, Void, Boolean> {
|
||||
ProgressDialog progressDialog = new MyProgressDialog(LoginActivity.this, R.string.rename_progress);
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
super.onPreExecute();
|
||||
progressDialog.show();
|
||||
LoginActivity.this.asyncWaitTask = this;
|
||||
showProgressDialog(R.string.rename_progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -207,13 +204,15 @@ public class LoginActivity extends AppCompatActivity
|
||||
@Override
|
||||
protected void onPostExecute(Boolean result) {
|
||||
super.onPostExecute(result);
|
||||
progressDialog.dismiss();
|
||||
if (isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
dismissProgressDialog();
|
||||
if (result) {
|
||||
reloadWalletList();
|
||||
} else {
|
||||
Toast.makeText(LoginActivity.this, getString(R.string.rename_failed), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
LoginActivity.this.asyncWaitTask = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,13 +282,10 @@ public class LoginActivity extends AppCompatActivity
|
||||
|
||||
|
||||
private class AsyncBackup extends AsyncTask<String, Void, Boolean> {
|
||||
ProgressDialog progressDialog = new MyProgressDialog(LoginActivity.this, R.string.backup_progress);
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
super.onPreExecute();
|
||||
progressDialog.show();
|
||||
LoginActivity.this.asyncWaitTask = this;
|
||||
showProgressDialog(R.string.backup_progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -301,11 +297,13 @@ public class LoginActivity extends AppCompatActivity
|
||||
@Override
|
||||
protected void onPostExecute(Boolean result) {
|
||||
super.onPostExecute(result);
|
||||
progressDialog.dismiss();
|
||||
if (isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
dismissProgressDialog();
|
||||
if (!result) {
|
||||
Toast.makeText(LoginActivity.this, getString(R.string.backup_failed), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
LoginActivity.this.asyncWaitTask = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,13 +333,10 @@ public class LoginActivity extends AppCompatActivity
|
||||
}
|
||||
|
||||
private class AsyncArchive extends AsyncTask<String, Void, Boolean> {
|
||||
ProgressDialog progressDialog = new MyProgressDialog(LoginActivity.this, R.string.archive_progress);
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
super.onPreExecute();
|
||||
progressDialog.show();
|
||||
LoginActivity.this.asyncWaitTask = this;
|
||||
showProgressDialog(R.string.archive_progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -358,13 +353,15 @@ public class LoginActivity extends AppCompatActivity
|
||||
@Override
|
||||
protected void onPostExecute(Boolean result) {
|
||||
super.onPostExecute(result);
|
||||
progressDialog.dismiss();
|
||||
if (isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
dismissProgressDialog();
|
||||
if (result) {
|
||||
reloadWalletList();
|
||||
} else {
|
||||
Toast.makeText(LoginActivity.this, getString(R.string.archive_failed), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
LoginActivity.this.asyncWaitTask = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -530,7 +527,26 @@ public class LoginActivity extends AppCompatActivity
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
AsyncTask asyncWaitTask = null; // TODO should this really be set from all AsyncTasks here?
|
||||
ProgressDialog progressDialog = null;
|
||||
|
||||
private void showProgressDialog(int msgId) {
|
||||
dismissProgressDialog(); // just in case
|
||||
progressDialog = new MyProgressDialog(LoginActivity.this, msgId);
|
||||
progressDialog.show();
|
||||
}
|
||||
|
||||
private void dismissProgressDialog() {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
progressDialog = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
dismissProgressDialog();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
@@ -538,7 +554,7 @@ public class LoginActivity extends AppCompatActivity
|
||||
Log.d(TAG, "onResume()");
|
||||
setTitle(getString(R.string.login_activity_name));
|
||||
// wait for WalletService to finish
|
||||
if (WalletService.Running && (asyncWaitTask == null)) {
|
||||
if (WalletService.Running && (progressDialog == null)) {
|
||||
// and show a progress dialog, but only if there isn't one already
|
||||
new AsyncWaitForService().execute();
|
||||
}
|
||||
@@ -562,13 +578,10 @@ public class LoginActivity extends AppCompatActivity
|
||||
|
||||
|
||||
private class AsyncWaitForService extends AsyncTask<Void, Void, Void> {
|
||||
ProgressDialog progressDialog = new MyProgressDialog(LoginActivity.this, R.string.service_progress);
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
super.onPreExecute();
|
||||
progressDialog.show();
|
||||
LoginActivity.this.asyncWaitTask = this;
|
||||
showProgressDialog(R.string.service_progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -586,12 +599,13 @@ public class LoginActivity extends AppCompatActivity
|
||||
@Override
|
||||
protected void onPostExecute(Void result) {
|
||||
super.onPostExecute(result);
|
||||
progressDialog.dismiss();
|
||||
LoginActivity.this.asyncWaitTask = null;
|
||||
if (isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
dismissProgressDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void startWallet(String walletName, String walletPassword) {
|
||||
Log.d(TAG, "startWallet()");
|
||||
Intent intent = new Intent(getApplicationContext(), WalletActivity.class);
|
||||
@@ -707,6 +721,7 @@ public class LoginActivity extends AppCompatActivity
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
super.onPreExecute();
|
||||
showProgressDialog(R.string.generate_wallet_creating);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -747,6 +762,10 @@ public class LoginActivity extends AppCompatActivity
|
||||
@Override
|
||||
protected void onPostExecute(Boolean result) {
|
||||
super.onPostExecute(result);
|
||||
if (isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
dismissProgressDialog();
|
||||
if (result) {
|
||||
startDetails(newWalletFile, walletPassword, GenerateReviewFragment.VIEW_TYPE_ACCEPT);
|
||||
} else {
|
||||
@@ -754,7 +773,6 @@ public class LoginActivity extends AppCompatActivity
|
||||
getString(R.string.generate_wallet_create_failed), Toast.LENGTH_LONG).show();
|
||||
walletGenerateError();
|
||||
}
|
||||
LoginActivity.this.asyncWaitTask = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -150,14 +150,16 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
Log.d(TAG, "onCreate()");
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.wallet_activity);
|
||||
if (savedInstanceState != null) {
|
||||
return;
|
||||
// we don't store anything ourselves
|
||||
}
|
||||
|
||||
setContentView(R.layout.wallet_activity);
|
||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
toolbar.setTitle(R.string.app_name);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
toolbar.setTitle(R.string.app_name);
|
||||
|
||||
boolean testnet = WalletManager.getInstance().isTestNet();
|
||||
if (testnet) {
|
||||
toolbar.setBackgroundResource(R.color.colorPrimaryDark);
|
||||
|
@@ -50,8 +50,6 @@ public class Wallet {
|
||||
ConnectionStatus_WrongVersion
|
||||
}
|
||||
|
||||
//public native long createWalletListenerJ();
|
||||
|
||||
public native String getSeed();
|
||||
|
||||
public native String getSeedLanguage();
|
||||
@@ -68,11 +66,11 @@ public class Wallet {
|
||||
|
||||
public native boolean setPassword(String password);
|
||||
|
||||
private String address = null;
|
||||
|
||||
public String getAddress() {
|
||||
String address = getAddressJ();
|
||||
if (!Wallet.isAddressValid(address, WalletManager.getInstance().isTestNet())) {
|
||||
// just die!
|
||||
throw new IllegalStateException("Wallet returned invalid address!");
|
||||
if (address == null) {
|
||||
address = getAddressJ();
|
||||
}
|
||||
return address;
|
||||
}
|
||||
|
@@ -1,107 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etWalletName"
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="0dp"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:hint="@string/generate_name_hint"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:textAlignment="center" />
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etWalletName"
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:hint="@string/generate_name_hint"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:textAlignment="center" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etWalletPassword"
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:hint="@string/generate_password_hint"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="text"
|
||||
android:textAlignment="center" />
|
||||
</LinearLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etWalletPassword"
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:hint="@string/generate_password_hint"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="text"
|
||||
android:textAlignment="center" />
|
||||
</LinearLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etWalletMnemonic"
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/generate_mnemonic_hint"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="textMultiLine"
|
||||
android:textAlignment="center" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etWalletAddress"
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/generate_address_hint"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="textMultiLine"
|
||||
android:textAlignment="center" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llRestoreKeys"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etWalletViewKey"
|
||||
android:id="@+id/etWalletMnemonic"
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/generate_viewkey_hint"
|
||||
android:hint="@string/generate_mnemonic_hint"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="textMultiLine"
|
||||
android:textAlignment="center" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etWalletSpendKey"
|
||||
android:id="@+id/etWalletAddress"
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/generate_spendkey_hint"
|
||||
android:hint="@string/generate_address_hint"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="textMultiLine"
|
||||
android:textAlignment="center"/>
|
||||
android:textAlignment="center" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llRestoreKeys"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etWalletViewKey"
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/generate_viewkey_hint"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="textMultiLine"
|
||||
android:textAlignment="center" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etWalletSpendKey"
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/generate_spendkey_hint"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="textMultiLine"
|
||||
android:textAlignment="center" />
|
||||
</LinearLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etWalletRestoreHeight"
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/generate_restoreheight_hint"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="number"
|
||||
android:textAlignment="center"
|
||||
android:visibility="gone" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bGenerate"
|
||||
style="@style/MoneroButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:enabled="false"
|
||||
android:text="@string/generate_buttonGenerate" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etWalletRestoreHeight"
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/generate_restoreheight_hint"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="number"
|
||||
android:textAlignment="center"
|
||||
android:visibility="gone" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bGenerate"
|
||||
style="@style/MoneroButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:enabled="false"
|
||||
android:text="@string/generate_buttonGenerate" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,6 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar" />
|
||||
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
@@ -7,7 +7,6 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar" />
|
||||
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
@@ -97,6 +97,7 @@
|
||||
|
||||
<string name="generate_wallet_exists">Wallet exists! Choose another name</string>
|
||||
<string name="generate_wallet_dot">Wallet name may not begin with \'.\'</string>
|
||||
<string name="generate_wallet_creating">Creating wallet</string>
|
||||
<string name="generate_wallet_created">Wallet created</string>
|
||||
<string name="generate_wallet_create_failed">Wallet create failed</string>
|
||||
<string name="generate_wallet_create_failed_1">Wallet create failed (1/2)</string>
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user