package Ġcom . just ai . aim y box . speech kit . google . cloud Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroidx . annotation . Raw Res Ċ import Ġcom . google . auth . Credentials Ċ import Ġcom . google . auth . oauth 2 . ServiceAccount Credentials Ċ import Ġjava . io . InputStream Ċ Ċ class ĠGoogle Cloud Credentials Ġprivate Ġconstructor ( internal Ġval Ġcredentials : ĠCredentials ) Ġ{ ĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġfrom Asset ( context : ĠContext , Ġasset File : ĠString ) Ġ= ĠGoogle Cloud Credentials ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠService Account Credentials . from Stream ( context . assets . open ( asset File ). buffered ()) ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġfun Ġfrom Raw Resource ( context : ĠContext , Ġ@ Raw Res Ġresource : ĠInt ) Ġ= ĠGoogle Cloud Credentials ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠService Account Credentials . from Stream ( context . resources . open Raw Resource ( resource )) ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġfun Ġfrom InputStream ( inputStream : ĠInputStream ) Ġ= ĠGoogle Cloud Credentials ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠService Account Credentials . from Stream ( inputStream ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ }