This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
sample_code:passwordvault [2022/07/24 21:50] al4he6 database path added, to make it work as APK |
sample_code:passwordvault [2022/07/26 11:37] (current) al4he6 |
||
---|---|---|---|
Line 11: | Line 11: | ||
Requires the Biometric plugin (or you could comment out that code)\\ | Requires the Biometric plugin (or you could comment out that code)\\ | ||
- | <code> | + | <file js passwordvault.js> |
app.LoadPlugin( " | app.LoadPlugin( " | ||
var mpw // plaintext master password | var mpw // plaintext master password | ||
Line 63: | Line 63: | ||
} // fn | } // fn | ||
function opendb () { | function opendb () { | ||
+ | add = app.AddButton(lay," | ||
+ | add.SetOnTouch(insert) | ||
+ | lst = app.AddList(lay,"", | ||
+ | lst.SetTextSize2(18," | ||
+ | lst.SetOnTouch(show) | ||
+ | |||
// db = app.OpenDatabase( " | // db = app.OpenDatabase( " | ||
- | db = app.OpenDatabase(app.GetSpecialFolder(" | + | db = app.OpenDatabase(app.GetPrivateFolder(" |
- | db.ExecuteSql(" | + | |
// | // | ||
//epw = crpt.Encrypt(" | //epw = crpt.Encrypt(" | ||
// | // | ||
db.ExecuteSql( " | db.ExecuteSql( " | ||
- | | + | |
} // fn | } // fn | ||
function display(results) { | function display(results) { | ||
- | add = app.AddButton(lay," | ||
- | add.SetOnTouch(insert) | ||
var str = ""; | var str = ""; | ||
for (var i = 0; i < results.rows.length; | for (var i = 0; i < results.rows.length; | ||
Line 84: | Line 88: | ||
str += site+":" | str += site+":" | ||
} // for | } // for | ||
- | lst = app.AddList(lay,str,0.8) | + | lst.SetList(str) |
- | lst.SetTextSize2(18," | + | |
- | lst.SetOnTouch(show) | + | |
} // fn | } // fn | ||
function insert() { | function insert() { | ||
Line 167: | Line 169: | ||
app.Exit() | app.Exit() | ||
} | } | ||
- | + | </file> | |
- | </code> | + |