package Ġcom . all at . m bo ych enko . silver thread . utils Ċ Ċ import Ġandroid . app . Notification Manager Ċ import Ġandroid . content . Context Ċ import Ġandroid . os . Build Ċ import Ġandroidx . work . Work Manager Ċ import Ġcom . all at . m bo ych enko . silver thread . Build Config Ċ import Ġcom . all at . m bo ych enko . silver thread . data . storage . preferences . Storage Ċ import Ġcom . all at . m bo ych enko . silver thread . data . storage . preferences . Storage Implementation Ċ import Ġcom . all at . m bo ych enko . silver thread . domain . inter actor . File Loader Details Interactor Ċ import Ġcom . all at . m bo ych enko . silver thread . presentation . helpers .* Ċ import Ġcom . all at . m bo ych enko . silver thread . presentation . services . Every Day Work . Companion . DA IL Y _ TIM ERS _ CHECK ER _ WORK _ TAG Ċ Ċ fun Ġupdate Version ( context : ĠContext , Ġwork Manager : ĠWork Manager ) Ġ{ ĊĠĠĠ Ġrun Task On Background ( Executor Thread . IO ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġstorage : ĠStorage Ġ= ĠStorage Implementation ( context ) ĊĠĠĠĠĠĠĠ Ġval Ġlast Updated Version Ġ= Ġstorage . getInt Default ( LAST _ UPDATE _ VERSION _ PRE F , Ġ 0 ) ĊĊĠĠĠĠĠĠĠ Ġif Ġ( last Updated Version Ġ< ĠBuild Config . VERSION _ CODE ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġupdate Script ( context , Ġstorage , Ġwork Manager ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġstorage . put Int ( LAST _ UPDATE _ VERSION _ PRE F , ĠBuild Config . VERSION _ CODE ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ private Ġfun Ġupdate Script ( context : ĠContext , Ġstorage : ĠStorage , Ġwork Manager : ĠWork Manager ) Ġ{ ĊĊĠĠĠ Ġif Ġ(! storage . getBoolean ( PATCH _ 2 5 _ APP LIED _ PRE F _ KEY , Ġfalse )) Ġ{ ĊĠĠĠĠĠĠĠ Ġapply Patch Ver 2 5 ( context , Ġstorage ) ĊĠĠĠĠĠĠĠ Ġstorage . put Boolean ( PATCH _ 2 5 _ APP LIED _ PRE F _ KEY , Ġtrue ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġif Ġ(! storage . getBoolean ( PATCH _ 4 5 _ APP LIED _ PRE F _ KEY , Ġfalse )) Ġ{ ĊĠĠĠĠĠĠĠ Ġapply Patch Ver 4 5 ( work Manager ) ĊĠĠĠĠĠĠĠ Ġstorage . put Boolean ( PATCH _ 4 5 _ APP LIED _ PRE F _ KEY , Ġtrue ) ĊĠĠĠ Ġ} Ċ Ċ } Ċ Ċ private Ġfun Ġapply Patch Ver 2 5 ( context : ĠContext , Ġstorage : ĠStorage ) Ġ{ ĊĠĠĠ Ġval Ġdeprecated Pref Ġ= Ġ" BOOK S _ DOWNLOAD S _ IDS _ PRE F _ KEY " ĊĠĠĠ Ġval Ġold Downloads : ĠMap < String , ĠLong > Ġ= Ġstorage . getMap ( deprecated Pref ) ĊĠĠĠ Ġold Downloads . isEmpty (). let Ġ{ Ġempty Ġ-> ĊĠĠĠĠĠĠĠ Ġif (! empty ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠFile Loader Details Interactor ( storage ). put All Loading Ids ( old Downloads ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġstorage . remove ( deprecated Pref ) ĊĊĠĠĠ Ġif Ġ( Build . VERSION . SDK _ INT Ġ>= ĠBuild . VERSION _ CODES . O ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġn Manager Ġ= Ġcontext . getSystem Service ( Context . NOTIFICATION _ SERVICE ) Ġas ĠNotification Manager ĊĠĠĠĠĠĠĠ Ġn Manager . delete Notification Channel (" quotes _ notif ") ĊĠĠĠ Ġ} Ċ } Ċ Ċ private Ġfun Ġapply Patch Ver 4 5 ( wm : ĠWork Manager ) Ġ{ ĊĠĠĠĠ Ġwm . cancel Unique Work ( DA IL Y _ TIM ERS _ CHECK ER _ WORK _ TAG ) Ċ } ĊĊ Ċ private Ġconst Ġval ĠLAST _ UPDATE _ VERSION _ PRE F Ġ= Ġ" LAST _ UPDATE _ VERSION _ PRE F " Ċ Ċ private Ġconst Ġval ĠP ATCH _ 2 5 _ APP LIED _ PRE F _ KEY Ġ= Ġ" PATCH _ 2 5 _ APP LIED _ PRE F _ KEY " Ċ private Ġconst Ġval ĠP ATCH _ 4 5 _ APP LIED _ PRE F _ KEY Ġ= Ġ" PATCH _ 4 5 _ APP LIED _ PRE F _ KEY " Ċ