package Ġcom . mono 0 9 2 6 . mono _ kit Ċ Ċ import Ġio . flutter . plugin . common . MethodCall Ċ import Ġio . flutter . plugin . common . Method Channel Ċ import Ġio . flutter . plugin . common . Method Channel . MethodCall Handler Ċ import Ġio . flutter . plugin . common . Method Channel . Result Ċ import Ġio . flutter . plugin . common . Plugin Registry . Registrar Ċ import Ġandroid . content . pm . PackageManager Ċ import Ġandroid . app . Activity Ċ import Ġandroid . content . Context Ċ import Ġandroidx . annotation . NonNull Ċ import Ġio . flutter . embedding . engine . plugins . Flutter Plugin Ċ import Ġio . flutter . embedding . engine . plugins . activity . Activity Aware Ċ import Ġio . flutter . embedding . engine . plugins . activity . Activity Plugin Binding Ċ Ċ public Ġclass ĠMono Kit Plugin : ĠFlutter Plugin , ĠMethod Call Handler , ĠActivity Aware Ġ{ ĊĊĠ Ġprivate Ġlateinit Ġvar Ġactivity : ĠActivity ĊĊĠ Ġoverride Ġfun Ġon Attached To Engine (@ NonNull Ġflutter Plugin Binding : ĠFlutter Plugin . Flutter Plugin Binding ) Ġ{ ĊĠĠĠ Ġval Ġchannel Ġ= ĠMethod Channel ( flutter Plugin Binding . binary Messenger , Ġ" mono _ kit ") ĊĠĠĠ Ġchannel . set MethodCall Handler ( this ); ĊĠ Ġ} ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġ@ Jvm Static ĊĠĠĠ Ġfun Ġregister With ( regist rar : ĠRegist rar ) Ġ{ ĊĠĠĠĠĠ Ġval Ġchannel Ġ= ĠMethod Channel ( regist rar . messenger (), Ġ" mono _ kit ") ĊĠĠĠĠĠ Ġval Ġplugin Ġ= ĠMono Kit Plugin () ĊĠĠĠĠĠ Ġplugin . activity Ġ= Ġregist rar . activity () ĊĠĠĠĠĠ Ġchannel . set MethodCall Handler ( plugin ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġon MethodCall ( call : ĠMethod Call , Ġresult : ĠResult ) Ġ{ ĊĠĠĠ Ġval Ġmethod Ġ= Ġcall . method ĊĠĠĠ Ġval Ġinfo Ġ= Ġmethod . split ('/'); ĊĠĠĠ Ġval Ġgroup Ġ= Ġinfo [ 0 ] ĊĠĠĠ Ġval Ġpath Ġ= Ġinfo [ 1 ] ĊĠĠĠ Ġval Ġarguments Ġ= Ġcall . arguments Ġas ĠMap < String , ĠString > ĊĠĠĠ Ġwhen Ġ( group ) Ġ{ ĊĠĠĠĠĠ Ġ" installation _ checker " Ġ-> Ġwhen Ġ( path ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ" is _ installed " Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġval ĠpackageName Ġ= Ġarguments . getValue (" package _ name ") ĊĠĠĠĠĠĠĠĠĠ Ġval Ġis Installed Ġ= Ġis Installed ( packageName , Ġactivity . package Manager ); ĊĠĠĠĠĠĠĠĠĠ Ġresult . success ( is Installed ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġelse Ġ-> Ġresult . not Implemented () ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġelse Ġ-> Ġresult . not Implemented () ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġon Detached From Engine ( binding : ĠFlutter Plugin . Flutter Plugin Binding ) Ġ{} ĊĊĠ Ġoverride Ġfun Ġon Detached From Activity () Ġ{} ĊĠ Ġoverride Ġfun Ġon Re attached To Activity For Config Changes ( binding : ĠActivity Plugin Binding ) Ġ{} ĊĠ Ġoverride Ġfun Ġon Attached To Activity ( binding : ĠActivity Plugin Binding ) Ġ{ ĊĠĠĠ Ġactivity Ġ= Ġbinding . activity ĊĠ Ġ} ĊĠ Ġoverride Ġfun Ġon Detached From Activity For Config Changes () Ġ{} Ċ } Ċ Ċ private Ġfun Ġis Installed ( packageName : ĠString , Ġpackage Manager : ĠPackage Manager ): ĠBoolean Ġ{ ĊĠ Ġreturn Ġtry Ġ{ ĊĠĠĠ Ġpackage Manager . get Package Info ( packageName , Ġ 0 ) ĊĠĠĠ Ġtrue ĊĠ Ġ} Ġcatch Ġ( e : ĠPackage Manager . Name NotFoundException ) Ġ{ ĊĠĠĠ Ġfalse ĊĠ Ġ} Ċ }