// Path: src/com/dexode/util/log/Logger.java
// public class Logger {
// 
// 	/**
// 	 * This method should be removed in release code by proguard
// 	 */
// 	public static void d(final String text, Object... args) {
// 		if (_log != null) {
// 			_log.d(text, args);
// 		}
// 	}
// 
// 	/**
// 	 * This method should be removed in release code by proguard
// 	 */
// 	public static void i(final String text, Object... args) {
// 		if (_log != null) {
// 			_log.i(text, args);
// 		}
// 	}
// 
// 	/**
// 	 * This method should be removed in release code by proguard
// 	 */
// 	public static void w(final String text, Object... args) {
// 		if (_log != null) {
// 			_log.w(text, args);
// 		}
// 	}
// 
// 	public static void e(final String text, Object... args) {
// 		if (_log != null) {
// 			_log.e(text, args);
// 		}
// 	}
// 
// 	public static void e(final Exception exception, @Nullable final String text) {
// 		if (_log != null) {
// 			_log.e(exception, text);
// 		}
// 	}
// 
// 	public static void e(final Exception exception) {
// 		if (_log != null) {
// 			_log.e(exception, null);
// 		}
// 	}
// 
// 
// 	public static void setLog(Log log) {
// 		_log = log;
// 	}
// 
// 	@Nullable
// 	private static Log _log;
// 
// 	public interface Log {
// 		/**
// 		 * This method should be removed in release code by proguard
// 		 */
// 		public void d(final String text, Object... args);
// 
// 		/**
// 		 * This method should be removed in release code by proguard
// 		 */
// 		public void i(final String text, Object... args);
// 
// 		/**
// 		 * This method should be removed in release code by proguard
// 		 */
// 		public void w(final String text, Object... args);
// 
// 		public void e(final String text, Object... args);
// 
// 		public void e(final Exception exception, @Nullable final String text);
// 	}
// }


import android.Manifest;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Environment;
import android.provider.Settings.Secure;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import com.dexode.util.log.Logger;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
package com.dexode.util;

/**
 * Created by Dawid Drozd aka Gelldur on 23.02.15.
 */




public class DeviceId {

	@NonNull
	public static String getDeviceId(Context appContext) throws RuntimeException {
		final String deviceId = getDeviceIdBestFit(appContext);
		return deviceId.toLowerCase();
	}

	@NonNull
	private static String getDeviceIdBestFit(Context appContext) throws RuntimeException {
		String deviceId = null;
		if (deviceId == null && checkPermission(appContext, Manifest.permission.ACCESS_WIFI_STATE)) {
			deviceId = getWiFiMacAddress(appContext);
			if (deviceId != null) {
				return deviceId;
			}
		} else {
// Path: src/com/dexode/util/log/Logger.java
// public class Logger {
// 
// 	/**
// 	 * This method should be removed in release code by proguard
// 	 */
// 	public static void d(final String text, Object... args) {
// 		if (_log != null) {
// 			_log.d(text, args);
// 		}
// 	}
// 
// 	/**
// 	 * This method should be removed in release code by proguard
// 	 */
// 	public static void i(final String text, Object... args) {
// 		if (_log != null) {
// 			_log.i(text, args);
// 		}
// 	}
// 
// 	/**
// 	 * This method should be removed in release code by proguard
// 	 */
// 	public static void w(final String text, Object... args) {
// 		if (_log != null) {
// 			_log.w(text, args);
// 		}
// 	}
// 
// 	public static void e(final String text, Object... args) {
// 		if (_log != null) {
// 			_log.e(text, args);
// 		}
// 	}
// 
// 	public static void e(final Exception exception, @Nullable final String text) {
// 		if (_log != null) {
// 			_log.e(exception, text);
// 		}
// 	}
// 
// 	public static void e(final Exception exception) {
// 		if (_log != null) {
// 			_log.e(exception, null);
// 		}
// 	}
// 
// 
// 	public static void setLog(Log log) {
// 		_log = log;
// 	}
// 
// 	@Nullable
// 	private static Log _log;
// 
// 	public interface Log {
// 		/**
// 		 * This method should be removed in release code by proguard
// 		 */
// 		public void d(final String text, Object... args);
// 
// 		/**
// 		 * This method should be removed in release code by proguard
// 		 */
// 		public void i(final String text, Object... args);
// 
// 		/**
// 		 * This method should be removed in release code by proguard
// 		 */
// 		public void w(final String text, Object... args);
// 
// 		public void e(final String text, Object... args);
// 
// 		public void e(final Exception exception, @Nullable final String text);
// 	}
// }


// Path: src/com/dexode/util/DeviceId.java
import android.Manifest;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Environment;
import android.provider.Settings.Secure;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import com.dexode.util.log.Logger;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Collections;
import java.util.List;
import java.util.UUID;

package com.dexode.util;

/**
 * Created by Dawid Drozd aka Gelldur on 23.02.15.
 */




public class DeviceId {

	@NonNull
	public static String getDeviceId(Context appContext) throws RuntimeException {
		final String deviceId = getDeviceIdBestFit(appContext);
		return deviceId.toLowerCase();
	}

	@NonNull
	private static String getDeviceIdBestFit(Context appContext) throws RuntimeException {
		String deviceId = null;
		if (deviceId == null && checkPermission(appContext, Manifest.permission.ACCESS_WIFI_STATE)) {
			deviceId = getWiFiMacAddress(appContext);
			if (deviceId != null) {
				return deviceId;
			}
		} else {
			Logger.i("Please set android.permission.ACCESS_WIFI_STATE permission to get better user id");