private static @ Nullable String readAccessTokenFromClipboard ( Context context ) { String text = Util . getClipboardText ( context ) ; if ( StringUtils . isNullOrEmpty ( text ) ) { return null ; } //Since the token string should never contain spaces, attempt to repair line breaks introduced in the copying process. text = text . replaceAll ( "\\s+" , "" ) ; if ( ! text . startsWith ( DEBUG_TEXT_HEADER ) ) { return null ; } // Remove the header return text . substring ( DEBUG_TEXT_HEADER . length ( ) ) ; }
Attempts to read access token from the clipboard