Here you can find the source of isNixMashPC()
public static boolean isNixMashPC()
//package com.java2s; //License from project: Open Source License import java.net.NetworkInterface; import java.net.SocketException; import java.util.Enumeration; public class Main { public static boolean isNixMashPC() { boolean isNixMashPC = false; try {//from www . ja v a 2 s . c o m for (Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces(); e.hasMoreElements();) { NetworkInterface ni = e.nextElement(); if (ni.getDisplayName().equals("wlp5s0")) isNixMashPC = formatMac(ni.getHardwareAddress()).equals("10-FE-ED-84-9E-A9"); } } catch (SocketException e) { e.printStackTrace(); } return isNixMashPC; } private static String formatMac(byte[] mac) { if (mac == null) return "UNKNOWN"; StringBuilder sb = new StringBuilder(); for (int i = 0; i < mac.length; i++) { sb.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : "")); } return sb.toString(); } }