package Ġcom . him an shu . new sp oint . core . md m Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . pm . PackageManager Ċ import Ġandroid . os . Build Ċ import Ġcom . vin ners . new sp oint . data . models . md m . Device Information Ċ import Ġcom . vin ners . new sp oint . data . models . md m . Mobile Information Ċ import Ġcom . vin ners . new sp oint . data . models . md m . Network Info Ċ import Ġcom . vin ners . new sp oint . data . models . md m . Os Information Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . inject . Singleton ĊĊ Ċ @ Singleton Ċ class ĠDevice Info Provider Ġ@ Inject Ġconstructor ( private Ġval Ġapplication Context : ĠContext ) Ġ{ ĊĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġget DeviceInfo (): ĠMobile Information Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġmobile Information Ġ= ĠMobile Information () ĊĊĠĠĠĠĠĠĠ Ġval Ġdevice Information Ġ= ĠDevice Information () ĊĠĠĠĠĠĠĠ Ġdevice Information . set Brand Name ( DeviceInfo . B RAND ) ĊĠĠĠĠĠĠĠ Ġdevice Information . set Device Screen Size ( DeviceInfo . getDevice In ch ( application Context )) ĊĠĠĠĠĠĠĠ Ġdevice Information . set Tablet ( DeviceInfo . is Tablet ( application Context )) ĊĠĠĠĠĠĠĠ Ġdevice Information . setModel Name ( DeviceInfo . MODEL ) ĊĠĠĠĠĠĠĠ Ġdevice Information . set Total Ram ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠDevice Info . get DeviceInfo ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġapplication Context , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ_ root _ ide _ package _. com . him an shu . new sp oint . core . md m . Device . DEVICE _ TOTAL _ MEMORY ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġdevice Information . set Total Storage ( DeviceInfo . total Storage In Mb . toString () Ġ+ Ġ" MB ") ĊĠĠĠĠĠĠĠ Ġmobile Information . device Information Ġ= Ġdevice Information ĊĊĠĠĠĠĠĠĠ Ġval Ġos Information Ġ= ĠOs Information () ĊĠĠĠĠĠĠĠ Ġos Information . set Device Root ed ( DeviceInfo . is Root ed ( application Context )) ĊĠĠĠĠĠĠĠ Ġos Information . set Os Version Name ( DeviceInfo . android Version Name ) ĊĠĠĠĠĠĠĠ Ġos Information . set Version Code ( Build . VERSION . SDK _ INT ) ĊĠĠĠĠĠĠĠ Ġmobile Information . os Information Ġ= Ġos Information ĊĊĠĠĠĠĠĠĠ Ġval Ġnetwork Info Ġ= ĠNetwork Info () ĊĠĠĠĠĠĠĠ Ġval Ġnetwork Operator List Ġ= ĠDevice Info . get Network Operator ( application Context ) ĊĠĠĠĠĠĠĠ Ġnetwork Info . set Sim 1 Provider Names ( network Operator List ) ĊĠĠĠĠĠĠĠ Ġnetwork Info . set Sim Count ( network Operator List . size ) ĊĠĠĠĠĠĠĠ Ġnetwork Info . set Internet Connection Mode ( DeviceInfo . check Network Status ( application Context )) ĊĠĠĠĠĠĠĠ Ġmobile Information . network Info Ġ= Ġnetwork Info ĊĊĠĠĠĠĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval ĠpackageName Ġ= Ġapplication Context . packageName ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġp Info Ġ= Ġapplication Context . package Manager . get Package Info ( packageName , Ġ 0 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmobile Information . app Version Ġ= Ġp Info . version Name ĊĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( e : ĠPackage Manager . Name NotFoundException ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġe . printStackTrace () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġreturn Ġmobile Information ĊĠĠĠ Ġ} Ċ Ċ }