I use web3j to create my ethereum wallet.the Code just like down
import org.web3j.crypto.Bip39Wallet;
import org.web3j.crypto.Credentials;
import org.web3j.crypto.ECKeyPair;
import org.web3j.crypto.WalletUtils;
wallet = WalletUtils.generateBip39Wallet(password, new File(keystorePath));
// keystore's file name
String keystoreFileName = wallet.getFilename();
// my mnemonic
String mnemonic = wallet.getMnemonic();
I can use this code get my address
Credentials credentials = WalletUtils.loadBip39Credentials(password, mnemonic);
String address = credentials.getAddress();
I can import my wallet by this:
Credentials credentials = WalletUtils.loadBip39Credentials(password, mnemonic);
but in this way I need password & mnemonic,How I import or recovery my wallet by mnemonic without password,because some wallet app just like metamask or imtoken , they don't need the old password that I create my wallet and the can reset a new password.
In other words,recovery or import the wallet just need mnemonic,how I do it by web3j
Is ereryone can tell me how to do it by web3j.thank u very much.