react-native-google-safetynet
react-native-google-safetynet copied to clipboard
Why Base64.decode for stringToBytes ?
private byte[] stringToBytes(String string) { byte[] bytes; bytes = null; try { bytes = Base64.decode(string, Base64.DEFAULT); } catch(IllegalArgumentException e) { e.printStackTrace(); } return bytes; }
Shouldn't this be - byte[] b = string.getBytes(); byte[] b = string.getBytes(Charset.forName("UTF-8")); byte[] b = string.getBytes(StandardCharsets.UTF_8); // Java 7+ only
Also shouldn't it be encode ? why decode ?