Modify Import Hd Account Failed Duplicated
MODIFY
bither-android/src/net/bither/factory/ImportHDSeedAndroid.java
bither-android/src/net/bither/factory/ImportHDSeedAndroid.java
@@ -37,7 +37,6 @@ import net.bither.ui.base.dialog.DialogProgress;
import net.bither.util.BackupUtil;
import net.bither.util.KeyUtil;
import net.bither.util.ThreadUtil;
-
import java.util.List;
public class ImportHDSeedAndroid extends ImportHDSeed {
@@ -189,7 +188,6 @@ public class ImportHDSeedAndroid extends ImportHDSeed {
dp.dismiss();
}
switch (errorCode) {
-
case PASSWORD_IS_DIFFEREND_LOCAL:
DropdownMessage.showDropdownMessage(activity,
R.string.import_private_key_qr_code_failed_different_password);
@@ -201,6 +199,11 @@ public class ImportHDSeedAndroid extends ImportHDSeed {
case NOT_HD_ACCOUNT_SEED:
DropdownMessage.showDropdownMessage(activity,
R.string.import_hd_account_seed_format_error);
+ break;
+ case DUPLICATED_HD_ACCOUNT_SEED:
+ DropdownMessage.showDropdownMessage(activity,
+ R.string.import_hd_account_failed_duplicated);
+ break;
default:
DropdownMessage.showDropdownMessage(activity, R.string.import_private_key_qr_code_failed);
break;

MODIFY
bither-android/src/net/bither/fragment/hot/OptionHotFragment.java
bither-android/src/net/bither/fragment/hot/OptionHotFragment.java
@@ -607,6 +607,10 @@ public class OptionHotFragment extends Fragment implements Selectable,
if (dp.isShowing()) {
dp.dismiss();
}
+ if (isRepeatHD(firstAddress)) {
+ DropdownMessage
+ .showDropdownMessage(getActivity(), R.string.monitor_cold_hd_account_failed_duplicated);
+ }
new DialogHDMonitorFirstAddressValidation(getActivity
(), firstAddress, new Runnable() {
@@ -704,6 +708,18 @@ public class OptionHotFragment extends Fragment implements Selectable,
}
+ private boolean isRepeatHD(String firstAddress) {
+ HDAccount hdAccountHot = AddressManager.getInstance().getHDAccountHot();
+ if (hdAccountHot == null) {
+ return false;
+ }
+ HDAccount.HDAccountAddress addressHot = hdAccountHot.addressForPath(AbstractHD.PathType.EXTERNAL_ROOT_PATH, 0);
+ if (firstAddress.equals(addressHot.getAddress())) {
+ return true;
+ }
+ return false;
+ }
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

MODIFY
bitherj
bitherj
-Subproject commit a661df9484b7e43bce07eb4ce7015053b1b136c8
+Subproject commit 59cc552cded5b2717d6a6ab0a30f00cba1669df5

Modify Import Hd Account Failed Duplicated