|
|
|
|
@ -112,7 +112,7 @@ public class Util { |
|
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
|
NetworkInterface nif = NetworkInterface.getByName(name); |
|
|
|
|
for (byte b : nif.getHardwareAddress()) sb.append(String.format("%02X:", b)); |
|
|
|
|
return sb.substring(0, sb.length() - 1); |
|
|
|
|
return substring(sb.toString()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
return ""; |
|
|
|
|
} |
|
|
|
|
@ -124,6 +124,15 @@ public class Util { |
|
|
|
|
return model.startsWith(manufacturer) ? model : manufacturer + " " + model; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static String substring(String text) { |
|
|
|
|
return substring(text, 1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static String substring(String text, int num) { |
|
|
|
|
if (text != null && text.length() > num) return text.substring(0, text.length() - num); |
|
|
|
|
return text; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static long format(SimpleDateFormat format, String src) { |
|
|
|
|
try { |
|
|
|
|
return format.parse(src).getTime(); |
|
|
|
|
|