Search in sources :

Example 1 with SprEngineV4

use of com.keepassdroid.utils.SprEngineV4 in project KeePassDX by Kunzisoft.

the class SprEngineTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    Context ctx = getContext();
    AssetManager am = ctx.getAssets();
    InputStream is = am.open("test.kdbx", AssetManager.ACCESS_STREAMING);
    ImporterV4 importer = new ImporterV4();
    db = importer.openDatabase(is, "12345", null);
    is.close();
    spr = new SprEngineV4();
}
Also used : Context(android.content.Context) AssetManager(android.content.res.AssetManager) InputStream(java.io.InputStream) ImporterV4(com.keepassdroid.database.load.ImporterV4) SprEngineV4(com.keepassdroid.utils.SprEngineV4)

Example 2 with SprEngineV4

use of com.keepassdroid.utils.SprEngineV4 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

SprEngineV4 (com.keepassdroid.utils.SprEngineV4)2 Context (android.content.Context)1 AssetManager (android.content.res.AssetManager)1 ImporterV4 (com.keepassdroid.database.load.ImporterV4)1 ProtectedString (com.keepassdroid.database.security.ProtectedString)1 InputStream (java.io.InputStream)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1