示例#1
0
        public static Hashtable GetDeviceInfo()
        {
            Hashtable data = Johny.HashtablePool.Claim();

            data["os"] = SystemInfo.operatingSystem;
#if UNITY_IPHONE && !UNITY_EDITOR
            var mac = _GetMACAddress();
            if (!string.IsNullOrEmpty(mac))
            {
                var bytes = Encoding.FromHexString(mac);
                data["mac"]   = mac;
                data["odin1"] = Encoding.ToHexString(Digest.Sha1().Update(bytes).Final());
            }
            data["model"]    = _GetModel();
            data["openudid"] = _GetOpenUDID();
            data["udid"]     = _GetUDID();
            data["ifa"]      = _GetIFA();
#elif UNITY_ANDROID && !UNITY_EDITOR
            data["mac"]       = GetMACAddress();
            data["device_id"] = GetAndroidDeviceID();
            data["model"]     = SystemInfo.deviceModel;
#elif UNITY_EDITOR
            data["mac"]       = GetMACAddress();
            data["device_id"] = SystemInfo.deviceName;
            data["model"]     = EB.Sparx.Device.DeviceModel;
            data["gpu"]       = EB.Sparx.Device.DeviceGPU;
            data["caps"]      = EB.Sparx.Device.DeviceCaps;
#endif
            return(data);
        }
示例#2
0
 public static Hmac Sha1(byte[] key)
 {
     return(new Hmac(Digest.Sha1(), key));
 }