package Ġcom . she ve lev . com ics _ viewer . key _ value _ storage Ċ Ċ import Ġcom . she ve lev . com ics _ viewer . core . di _ scopes . Cl ar ification Ċ import Ġcom . she ve lev . com ics _ viewer . core . shared _ interfaces . Encrypt or Ċ import Ġcom . she ve lev . com ics _ viewer . core . shared _ interfaces . KeyValue Storage Facade Ċ import Ġcom . she ve lev . com ics _ viewer . key _ value _ storage . storage s . Storage Ċ import Ġcom . she ve lev . com ics _ viewer . utils . extent ions . from Bytes Ċ import Ġcom . she ve lev . com ics _ viewer . utils . extent ions . to Bytes Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . inject . Named Ċ Ċ /** Ċ Ġ* ĠHelper Ġclass Ġfor Ġaccess Ġto ĠApp - level Ġprivate Ġshared Ġpreferences Ċ Ġ*/ Ċ class ĠKey Value Storage Facade Impl Ċ @ Inject Ċ constructor ( ĊĠĠĠ Ġ@ Named ( Cl ar ification . COMB IN ED ) ĊĠĠĠ Ġprivate Ġval Ġkey Value Combined Storage : ĠStorage , ĊĠĠĠ Ġ@ Named ( Cl ar ification . IN _ MEMORY ) ĊĠĠĠ Ġprivate Ġval Ġkey Value InMemory Storage : ĠStorage , ĊĠĠĠ Ġprivate Ġval Ġencrypt or : ĠEncrypt or Ċ ) Ġ: ĠKey Value Storage Facade Ġ{ ĊĠĠĠĠ Ġoverride Ġfun Ġsave Password Entered ( value : ĠBoolean ) Ġ= ĊĠĠĠĠĠĠĠ Ġkey Value InMemory Storage . update Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . put Boolean (" PASSWORD _ ENTER ED ", Ġvalue ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Password Entered (): ĠBoolean ? Ġ= ĊĠĠĠĠĠĠĠ Ġkey Value InMemory Storage . read Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . read Boolean (" PASSWORD _ ENTER ED ") ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġsave Password ( value : ĠString ) Ġ= ĊĠĠĠĠĠĠĠ Ġkey Value Combined Storage . update Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . put Bytes (" PASSWORD ", Ġencrypt or . encrypt ( value . to Bytes ()) !! ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Password (): ĠString ? Ġ= ĊĠĠĠĠĠĠĠ Ġkey Value Combined Storage . read Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġencrypt or . decrypt ( it . read Bytes (" PASSWORD ")) ?. from Bytes () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġsave Password Hint ( value : ĠString ) Ġ= ĊĠĠĠĠĠĠĠ Ġkey Value Combined Storage . update Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . putString (" PASSWORD _ HINT ", Ġvalue ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Password Hint (): ĠString ? Ġ= ĊĠĠĠĠĠĠĠ Ġkey Value Combined Storage . read Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . readString (" PASSWORD _ HINT ") ĊĠĠĠĠĠĠĠ Ġ} Ċ }