package Ġcom . t ange m . operations . read Ċ Ċ import Ġcom . squareup . mos hi . Json Class Ċ import Ġcom . t ange m . Log Ċ import Ġcom . t ange m . common . ap du . Command Ap du Ċ import Ġcom . t ange m . common . ap du . Instruction Ċ import Ġcom . t ange m . common . ap du . Response Ap du Ċ import Ġcom . t ange m . common . card . Card Ċ import Ġcom . t ange m . common . card . Card Wallet Ċ import Ġcom . t ange m . common . card . Firmware Version Ċ import Ġcom . t ange m . common . core .* Ċ import Ġcom . t ange m . common . de serialization . Wallet Deserializer Ċ import Ġcom . t ange m . common . hd Wallet . Der ivation Path Ċ import Ġcom . t ange m . common . tl v . T lv Builder Ċ import Ġcom . t ange m . common . tl v . T lv Decoder Ċ import Ġcom . t ange m . common . tl v . T lv Tag Ċ import Ġcom . t ange m . operations . Command Ċ import Ġcom . t ange m . operations . Command Response Ċ import Ġcom . t ange m . operations . Pref light Read Mode Ċ Ċ /** Ċ Ġ* ĠCreated Ġby ĠAnt on ĠZ hil enk ov Ġon Ġ 2 6 / 0 3 / 2 0 2 1 . Ċ Ġ*/ Ċ @ Json Class ( generate Adapter Ġ= Ġtrue ) Ċ class ĠRead Wallet Response ( ĊĠĠĠ Ġval Ġcard Id : ĠString , ĊĠĠĠ Ġval Ġwallet : ĠCard Wallet Ċ ) Ġ: ĠCommand Response Ċ Ċ /** Ċ Ġ* ĠRead Ġsign le Ġwallet Ġon Ġcard . ĠThis Ġcommand Ġexecutes Ġbefore Ġinteracting Ġwith Ġspecific Ġwallet Ġto Ġretrieve Ċ Ġ* Ġinformation Ġabout Ġit Ġand Ġperform Ġpre checks Ċ Ġ*/ Ċ class ĠRead Wallet Command ( ĊĠĠĠ Ġprivate Ġval Ġwallet Index : ĠInt , ĊĠĠĠ Ġprivate Ġval Ġder ivation Path : ĠDer ivation Path ? Ġ= Ġnull Ċ ) Ġ: ĠCommand < Read Wallet Response >() Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġpref light Read Mode (): ĠPref light Read Mode Ġ= ĠPref light Read Mode . Read Card Only ĊĊĠĠĠ Ġoverride Ġfun Ġperform Pre Check ( card : ĠCard ): ĠT ange m Error ? Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( card . firmware Version Ġ< ĠF irmware Version . Multi Wallet Available ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠT ange m Sdk Error . NotSupported Firmware Version () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġif Ġ( der ivation Path Ġ!= Ġnull Ġ&& Ġ! card . settings . is HD Wallet Allowed ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠT ange m Sdk Error . HD Wallet Disabled () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġreturn Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġrun ( session : ĠCard Session , Ġcallback : ĠCompletion Callback < Read Wallet Response >) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . debug Ġ{ Ġ" Attempt Ġto Ġread Ġwallet Ġwith Ġindex : Ġ$ wallet Index " Ġ} ĊĠĠĠĠĠĠĠ Ġsuper . run ( session , Ġcallback ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġserialize ( environment : ĠSession Environment ): ĠCommand Ap du Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġt lv Builder Ġ= ĠT lv Builder () ĊĠĠĠĠĠĠĠ Ġt lv Builder . append ( T lv Tag . Pin , Ġenvironment . access Code . value ) ĊĠĠĠĠĠĠĠ Ġt lv Builder . append ( T lv Tag . Card Id , Ġenvironment . card ?. card Id ) ĊĠĠĠĠĠĠĠ Ġt lv Builder . append ( T lv Tag . Interaction Mode , ĠRead Mode . Wallet ) ĊĠĠĠĠĠĠĠ Ġt lv Builder . append ( T lv Tag . Wallet Index , Ġwallet Index ) ĊĠĠĠĠĠĠĠ Ġt lv Builder . append ( T lv Tag . Wallet HD Path , Ġder ivation Path ) ĊĊĠĠĠĠĠĠĠ Ġreturn ĠCommand Ap du ( Instruction . Read , Ġt lv Builder . serialize ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġdeserialize ( environment : ĠSession Environment , Ġap du : ĠResponse Ap du ): ĠRead Wallet Response Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcard Ġ= Ġenvironment . card Ġ?: Ġthrow ĠT ange m Sdk Error . Unknown Error () ĊĠĠĠĠĠĠĠ Ġval Ġt lv Data Ġ= Ġap du . getT lv Data ( environment . encryption Key ) Ġ?: Ġthrow ĠT ange m Sdk Error . Deserialize Ap du Failed () ĊĊĠĠĠĠĠĠĠ Ġval Ġdecoder Ġ= ĠT lv Decoder ( tl v Data ) ĊĠĠĠĠĠĠĠ Ġval Ġwallet Ġ= Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠWallet Deserializer ( card . settings . is Permanent Wallet ). deserialize Wallet ( decoder ) ĊĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthrow ĠT ange m Sdk Error . Wallet NotFound () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ ĠLog . debug Ġ{ Ġ" Read Ġwallet : Ġ$ wallet " Ġ} ĊĠĠĠĠĠĠĠ Ġreturn ĠRead Wallet Response ( decoder . decode ( T lv Tag . Card Id ), Ġwallet ) ĊĠĠĠ Ġ} Ċ }