Search in sources :

Example 6 with ProtectedString

use of com.keepassdroid.database.security.ProtectedString in project KeePassDX by Kunzisoft.

the class EntryEditActivity method fillData.

protected void fillData() {
    ImageButton currIconButton = findViewById(R.id.icon_button);
    App.getDB().drawFactory.assignDrawableTo(currIconButton, getResources(), mEntry.getIcon());
    entryTitleView.setText(mEntry.getTitle());
    entryUserNameView.setText(mEntry.getUsername());
    entryUrlView.setText(mEntry.getUrl());
    String password = mEntry.getPassword();
    entryPasswordView.setText(password);
    entryConfirmationPasswordView.setText(password);
    entryCommentView.setText(mEntry.getNotes());
    boolean visibilityFontActivated = PreferencesUtil.fieldFontIsInVisibility(this);
    if (visibilityFontActivated) {
        Util.applyFontVisibilityTo(entryUserNameView);
        Util.applyFontVisibilityTo(entryPasswordView);
        Util.applyFontVisibilityTo(entryConfirmationPasswordView);
        Util.applyFontVisibilityTo(entryCommentView);
    }
    if (mEntry.allowExtraFields()) {
        LinearLayout container = findViewById(R.id.advanced_container);
        for (Map.Entry<String, ProtectedString> pair : mEntry.getExtraProtectedFields().entrySet()) {
            EntryEditNewField entryEditNewField = new EntryEditNewField(EntryEditActivity.this);
            entryEditNewField.setData(pair.getKey(), pair.getValue());
            entryEditNewField.setFontVisibility(visibilityFontActivated);
            container.addView(entryEditNewField);
        }
    }
}
Also used : ImageButton(android.widget.ImageButton) ProtectedString(com.keepassdroid.database.security.ProtectedString) ProtectedString(com.keepassdroid.database.security.ProtectedString) EntryEditNewField(com.keepassdroid.view.EntryEditNewField) Map(java.util.Map) LinearLayout(android.widget.LinearLayout)

Example 7 with ProtectedString

use of com.keepassdroid.database.security.ProtectedString in project KeePassDX by Kunzisoft.

the class PwEntryV4 method getExtraFields.

@Override
public Map<String, String> getExtraFields() {
    Map<String, String> extraFields = super.getExtraFields();
    SprEngineV4 spr = new SprEngineV4();
    // Display custom fields
    if (fields.size() > 0) {
        for (Map.Entry<String, ProtectedString> pair : fields.entrySet()) {
            String key = pair.getKey();
            // TODO Add hidden style for protection field
            if (!PwEntryV4.isStandardField(key)) {
                extraFields.put(key, spr.compile(pair.getValue().toString(), this, mDatabase));
            }
        }
    }
    return extraFields;
}
Also used : SprEngineV4(com.keepassdroid.utils.SprEngineV4) ProtectedString(com.keepassdroid.database.security.ProtectedString) ProtectedString(com.keepassdroid.database.security.ProtectedString) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

ProtectedString (com.keepassdroid.database.security.ProtectedString)7 EntryEditNewField (com.keepassdroid.view.EntryEditNewField)3 PwDatabase (com.keepassdroid.database.PwDatabase)2 PwIconStandard (com.keepassdroid.database.PwIconStandard)2 Map (java.util.Map)2 Intent (android.content.Intent)1 Toolbar (android.support.v7.widget.Toolbar)1 View (android.view.View)1 ImageButton (android.widget.ImageButton)1 LinearLayout (android.widget.LinearLayout)1 ScrollView (android.widget.ScrollView)1 AutoType (com.keepassdroid.database.AutoType)1 Database (com.keepassdroid.database.Database)1 PwDate (com.keepassdroid.database.PwDate)1 PwEntry (com.keepassdroid.database.PwEntry)1 PwEntryV4 (com.keepassdroid.database.PwEntryV4)1 PwGroup (com.keepassdroid.database.PwGroup)1 PwGroupId (com.keepassdroid.database.PwGroupId)1 PwGroupV4 (com.keepassdroid.database.PwGroupV4)1 PwIconCustom (com.keepassdroid.database.PwIconCustom)1