package Ġmain Ċ Ċ import Ġcom . google . gson . Gson Ċ import Ġmodel . People For B ikes Result Ċ import Ġjava . net . URL Ċ import Ġjava . security . General Security Exception Ċ import Ġjava . security . Secure Random Ċ import Ġjava . security . cert . X 5 0 9 Certificate Ċ import Ġjavax . net . ssl . Https URLConnection Ċ import Ġjavax . net . ssl . SSL Context Ċ import Ġjavax . net . ssl . Trust Manager Ċ import Ġjavax . net . ssl . X 5 0 9 Trust Manager Ċ Ċ fun Ġget Location ( args : ĠString ): ĠString Ġ{ ĊĠĠĠ Ġval Ġregex Ġ= ĠRegex (""" .* ?" (.* ) ". * """) ĊĠĠĠ Ġval Ġmatch Result Ġ= Ġregex . find ( args ) ĊĊĠĠĠ Ġreturn Ġmatch Result ?. groups ?. get ( 1 )?. value Ġ?: Ġreturn Ġ"" Ċ } Ċ Ċ fun Ġget City ( args : ĠString ) Ġ: ĠString Ġ{ ĊĠĠĠ Ġval Ġregex Ġ= ĠRegex (""" ^ ([^ , ]* ), """) ĊĠĠĠ Ġval Ġmatch Result Ġ= Ġregex . find ( args ) ĊĊĠĠĠ Ġreturn Ġmatch Result ?. groups ?. get ( 1 )?. value Ġ?: Ġreturn Ġ"" Ċ } Ċ Ċ fun ĠgetState ( args : ĠString ) Ġ: ĠString Ġ{ ĊĠĠĠ Ġval Ġregex Ġ= ĠRegex (" "", \ s (.* )$ """) ĊĠĠĠ Ġval Ġmatch Result Ġ= Ġregex . find ( args ) ĊĊĠĠĠ Ġreturn Ġmatch Result ?. groups ?. get ( 1 )?. value Ġ?: Ġreturn Ġ"" Ċ } Ċ Ċ fun ĠgetState Ac ronym ( args : ĠString ) Ġ: ĠString ? Ġ{ ĊĠĠĠ Ġval Ġmap Ġ= Ġhash Map Of < String , ĠString >() ĊĠĠĠ Ġmap [" Al ab ama "] Ġ= Ġ" AL " ĊĠĠĠ Ġmap [" Al ask a "] Ġ= Ġ" AK " ĊĠĠĠ Ġmap [" A ri zon a "] Ġ= Ġ" AZ " ĊĠĠĠ Ġmap [" Ar k ans as "] Ġ= Ġ" AR " ĊĠĠĠ Ġmap [" California "] Ġ= Ġ" CA " ĊĠĠĠ Ġmap [" Color ado "] Ġ= Ġ" CO " ĊĠĠĠ Ġmap [" Connect ic ut "] Ġ= Ġ" CT " ĊĠĠĠ Ġmap [" Del aware "] Ġ= Ġ" DE " ĊĠĠĠ Ġmap [" Fl orida "] Ġ= Ġ" FL " ĊĠĠĠ Ġmap [" Ge org ia "] Ġ= Ġ" GA " ĊĠĠĠ Ġmap [" H awai i "] Ġ= Ġ" HI " ĊĠĠĠ Ġmap [" Id aho "] Ġ= Ġ" ID " ĊĠĠĠ Ġmap [" Ill inois "] Ġ= Ġ" IL " ĊĠĠĠ Ġmap [" In di ana "] Ġ= Ġ" IN " ĊĠĠĠ Ġmap [" I owa "] Ġ= Ġ" IA " ĊĠĠĠ Ġmap [" K ans as "] Ġ= Ġ" KS " ĊĠĠĠ Ġmap [" K ent uck y "] Ġ= Ġ" KY " ĊĠĠĠ Ġmap [" L ou is iana "] Ġ= Ġ" LA " ĊĠĠĠ Ġmap [" Ma ine "] Ġ= Ġ" ME " ĊĠĠĠ Ġmap [" M ary land "] Ġ= Ġ" MD " ĊĠĠĠ Ġmap [" Mass ach uset ts "] Ġ= Ġ" MA " ĊĠĠĠ Ġmap [" M ich ig an "] Ġ= Ġ" MI " ĊĠĠĠ Ġmap [" Min nes ota "] Ġ= Ġ" MN " ĊĠĠĠ Ġmap [" Miss iss ipp i "] Ġ= Ġ" MS " ĊĠĠĠ Ġmap [" Miss our i "] Ġ= Ġ" MO " ĊĠĠĠ Ġmap [" Mont ana "] Ġ= Ġ" MT " ĊĠĠĠ Ġmap [" Ne br ask a "] Ġ= Ġ" NE " ĊĠĠĠ Ġmap [" N ev ada "] Ġ= Ġ" NV " ĊĠĠĠ Ġmap [" New ĠH amp sh ire "] Ġ= Ġ" NH " ĊĠĠĠ Ġmap [" New ĠJ ersey "] Ġ= Ġ" NJ " ĊĠĠĠ Ġmap [" New ĠM ex ico "] Ġ= Ġ" NM " ĊĠĠĠ Ġmap [" New ĠYork "] Ġ= Ġ" NY " ĊĠĠĠ Ġmap [" North ĠCar ol ina "] Ġ= Ġ" NC " ĊĠĠĠ Ġmap [" North ĠD ak ota "] Ġ= Ġ" ND " ĊĠĠĠ Ġmap [" Oh io "] Ġ= Ġ" OH " ĊĠĠĠ Ġmap [" Ok lah oma "] Ġ= Ġ" OK " ĊĠĠĠ Ġmap [" O reg on "] Ġ= Ġ" OR " ĊĠĠĠ Ġmap [" Pen ns y lv ania "] Ġ= Ġ" PA " ĊĠĠĠ Ġmap [" Rh ode ĠIsland "] Ġ= Ġ" RI " ĊĠĠĠ Ġmap [" South ĠCar ol ina "] Ġ= Ġ" SC " ĊĠĠĠ Ġmap [" South ĠD ak ota "] Ġ= Ġ" SD " ĊĠĠĠ Ġmap [" T enn es see "] Ġ= Ġ" TN " ĊĠĠĠ Ġmap [" Tex as "] Ġ= Ġ" TX " ĊĠĠĠ Ġmap [" U ta h "] Ġ= Ġ" UT " ĊĠĠĠ Ġmap [" V erm ont "] Ġ= Ġ" VT " ĊĠĠĠ Ġmap [" V irgin ia "] Ġ= Ġ" VA " ĊĠĠĠ Ġmap [" W ashington "] Ġ= Ġ" WA " ĊĠĠĠ Ġmap [" West ĠV irgin ia "] Ġ= Ġ" WV " ĊĠĠĠ Ġmap [" W is cons in "] Ġ= Ġ" WI " ĊĠĠĠ Ġmap [" Wy om ing "] Ġ= Ġ" WY " ĊĊĠĠĠ Ġreturn Ġmap [ args ] Ċ } Ċ Ċ fun Ġtrust All Ssl () Ċ { ĊĠĠĠ Ġ// ĠCreate Ġa Ġtrust Ġmanager Ġthat Ġdoes Ġnot Ġvalidate Ġcertificate Ġchains ĊĠĠĠ Ġval Ġtrust All Certs : ĠArray < Trust Manager > Ġ= ĠarrayOf < Trust Manager >( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġobject Ġ: ĠX 5 0 9 Trust Manager Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġcheck Client Trusted ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcerts : ĠArray < X 5 0 9 Certificate ?> ?, Ġauth Type : ĠString ?) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġcheck Server Trusted ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcerts : ĠArray < X 5 0 9 Certificate ?> ?, Ġauth Type : ĠString ?) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġget Accepted Iss u ers (): ĠArray < X 5 0 9 Certificate > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġempty Array < X 5 0 9 Certificate >() ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsc : ĠSSL Context Ġ= ĠSSL Context . getInstance (" SSL ") ĊĠĠĠĠĠĠĠ Ġsc . init ( null , Ġtrust All Certs , ĠSecure Random ()) ĊĠĠĠĠĠĠĠ ĠHttp s URLConnection . setDefault SS LS ocket Factory ( sc . socket Factory ) ĊĠĠĠ Ġ} Ġcatch Ġ( e : ĠGeneral Security Exception ) Ġ{ ĊĠĠĠ Ġ} Ċ } Ċ