移除 eth0 MAC 地址读取逻辑,统一改用 getAndroid7MAC 获取
This commit is contained in:
1 parent
90988b0d0f
commit
70f5b28481
1 file changed
+7
-8
@@ -9,7 +9,6 @@ import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
|
||||
import com.fuying.sn.core.common.system.AppEnvironment;
|
||||
import com.fuying.sn.core.common.util.FileUtils;
|
||||
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.LineNumberReader;
|
||||
@@ -134,13 +133,13 @@ public class DeviceIdUtils {
|
||||
Log.e(TAG, "getMac: " + ex.getMessage(), ex);
|
||||
}
|
||||
if (macSerial == null || "".equals(macSerial)) {
|
||||
try {
|
||||
return FileUtils.loadFileAsString("/sys/class/net/eth0/address")
|
||||
.toUpperCase().substring(0, 17);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "getMac: " + e.getMessage(), e);
|
||||
macSerial = getAndroid7MAC();
|
||||
}
|
||||
// try {
|
||||
// return FileUtils.loadFileAsString("/sys/class/net/eth0/address")
|
||||
// .toUpperCase().substring(0, 17);
|
||||
// } catch (Exception e) {
|
||||
// Log.e(TAG, "getMac: " + e.getMessage(), e);
|
||||
// }
|
||||
macSerial = getAndroid7MAC();
|
||||
}
|
||||
return macSerial;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user