Skip to content

Instantly share code, notes, and snippets.

View LinXiaoTao's full-sized avatar
👋
Hi Boy

leo LinXiaoTao

👋
Hi Boy
View GitHub Profile
@LinXiaoTao
LinXiaoTao / RuntimeInit.java
Last active April 4, 2020 09:21
getDefaultUserAgent
private static String getDefaultUserAgent() {
StringBuilder result = new StringBuilder(64);
result.append("Dalvik/");
result.append(System.getProperty("java.vm.version")); // such as 1.1.0
result.append(" (Linux; U; Android ");
String version = Build.VERSION.RELEASE; // "1.0" or "3.4b5"
result.append(version.length() > 0 ? version : "1.0");
// add the model for the release build