Skip to content

Commit 97b7dca

Browse files
committed
Check password length when keystore exists too
1 parent 7249e8a commit 97b7dca

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/processing/mode/android/KeyStoreManager.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ private void createLayout() {
6464
okButton.setPreferredSize(dim);
6565
okButton.addActionListener(new ActionListener() {
6666
public void actionPerformed(ActionEvent e) {
67-
if(keyStore == null) {
68-
if(checkRequiredFields()) {
67+
if(checkRequiredFields()) {
68+
if(keyStore == null) {
6969
try {
7070
AndroidKeyStore.generateKeyStore(new String(passwordField.getPassword()),
7171
commonName.getText(), organizationalUnit.getText(), organizationName.getText(),
@@ -76,10 +76,10 @@ public void actionPerformed(ActionEvent e) {
7676
} catch (Exception e1) {
7777
e1.printStackTrace();
7878
}
79+
} else {
80+
setVisible(false);
81+
editor.startExportPackage(new String(passwordField.getPassword()));
7982
}
80-
} else {
81-
setVisible(false);
82-
editor.startExportPackage(new String(passwordField.getPassword()));
8383
}
8484
}
8585
});
@@ -173,6 +173,8 @@ private void showKeystorePasswordLayout(Box pain) {
173173

174174
private boolean checkRequiredFields() {
175175
if(passwordField.getPassword().length > 5) {
176+
if(keyStore != null) return true;
177+
176178
if(Arrays.equals(passwordField.getPassword(), repeatPasswordField.getPassword())) {
177179
return true;
178180
} else {

0 commit comments

Comments
 (0)