Android Open Source - PasswordDroid Saltable






From Project

Back to project page PasswordDroid.

License

The source code is released under:

GNU General Public License

If you think the Android project PasswordDroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.wuthoehle.passworddroid.service.model.entries;
//ww w .j ava 2s . c  om
/* Copyright (c) 2015 Marco Huenseler <marcoh.huenseler+git@gmail.com>
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class Saltable extends ArrayList<String> implements EntryElement {

    private Entry parent;
    private List<String> salts;

    public Saltable(Entry parent) {
        super();
        this.parent = parent;
        this.salts = new ArrayList<>();
    }

    public Saltable(Entry parent, List<String> salts) {
        super();
        this.parent = parent;
        this.addAll(salts);

        this.parent.setPassword_known(false);
    }

    public List<String> getSalts() {
        return this;
    }

    public void setSalts(List<String> salts) {
        this.clear();
        this.addAll(salts);
        this.parent.setPassword_known(false);
    }

    @Override
    public void accept(EntryVisitor visitor) {
        visitor.visit(this);
    }

    /**
     * *******************************************************************************************
     * Override ArrayList methods to notify parent that PW could no longer be valid
     * ********************************************************************************************
     */
    @Override
    public boolean add(String object) {
        this.parent.setPassword_known(false);
        return super.add(object);
    }

    @Override
    public void add(int index, String object) {
        this.parent.setPassword_known(false);
        super.add(index, object);
    }

    @Override
    public boolean addAll(Collection<? extends String> collection) {
        this.parent.setPassword_known(false);
        return super.addAll(collection);
    }

    @Override
    public boolean addAll(int index, Collection<? extends String> collection) {
        this.parent.setPassword_known(false);
        return super.addAll(index, collection);
    }

    @Override
    public void clear() {
        this.parent.setPassword_known(false);
        super.clear();
    }

    @Override
    public String remove(int index) {
        this.parent.setPassword_known(false);
        return super.remove(index);
    }

    @Override
    public boolean remove(Object object) {
        this.parent.setPassword_known(false);
        return super.remove(object);
    }

    @Override
    protected void removeRange(int fromIndex, int toIndex) {
        this.parent.setPassword_known(false);
        super.removeRange(fromIndex, toIndex);
    }

    @Override
    public String set(int index, String object) {
        this.parent.setPassword_known(false);
        return super.set(index, object);
    }

    @Override
    public boolean removeAll(Collection<?> collection) {
        this.parent.setPassword_known(false);
        return super.removeAll(collection);
    }

    @Override
    public boolean retainAll(Collection<?> collection) {
        this.parent.setPassword_known(false);
        return super.retainAll(collection);
    }
}




Java Source Code List

com.lambdaworks.crypto.PBKDF.java
com.lambdaworks.crypto.SCrypt.java
de.wuthoehle.passworddroid.ApplicationTest.java
de.wuthoehle.passworddroid.PasswordDerivateActivity.java
de.wuthoehle.passworddroid.crypto.AESprng.java
de.wuthoehle.passworddroid.crypto.DerivationRunnableFactory.java
de.wuthoehle.passworddroid.crypto.Util.java
de.wuthoehle.passworddroid.crypto.SCryptParameters.SCryptParametersFactory.java
de.wuthoehle.passworddroid.crypto.SCryptParameters.SCryptParameters.java
de.wuthoehle.passworddroid.service.PasswordDroidService.java
de.wuthoehle.passworddroid.service.model.Category.java
de.wuthoehle.passworddroid.service.model.Container.java
de.wuthoehle.passworddroid.service.model.Database.java
de.wuthoehle.passworddroid.service.model.DerivatorCategory.java
de.wuthoehle.passworddroid.service.model.DerivatorDatabase.java
de.wuthoehle.passworddroid.service.model.FileFormat.java
de.wuthoehle.passworddroid.service.model.entries.Commentable.java
de.wuthoehle.passworddroid.service.model.entries.Countable.java
de.wuthoehle.passworddroid.service.model.entries.Customizable.java
de.wuthoehle.passworddroid.service.model.entries.DerivatorEntry.java
de.wuthoehle.passworddroid.service.model.entries.EntryElement.java
de.wuthoehle.passworddroid.service.model.entries.EntryFactory.java
de.wuthoehle.passworddroid.service.model.entries.EntryVisitor.java
de.wuthoehle.passworddroid.service.model.entries.Entry.java
de.wuthoehle.passworddroid.service.model.entries.GetBundleVisitor.java
de.wuthoehle.passworddroid.service.model.entries.SaltVisitor.java
de.wuthoehle.passworddroid.service.model.entries.Saltable.java
de.wuthoehle.passworddroid.service.model.entries.WriteVisitor.java