예제 #1
0
        private static Task <string> GetDeviceFingerprint()
        {
            string publisherApps = FingerprintDataProvider.GetPublisherApps();
            ulong  bootTime      = DateTime.UtcNow.ToUnixTime() - (ulong)Environment.TickCount / 1000UL;

            FingerprintDataProvider.DiskSpace diskSpace = FingerprintDataProvider.GetDiskSpace();
            ulong?nullable1;

            if (diskSpace == null)
            {
                nullable1 = new ulong?();
            }
            else
            {
                ulong?totalSpace = diskSpace.TotalSpace;
                ulong num        = 1024;
                nullable1 = totalSpace.HasValue ? new ulong?(totalSpace.GetValueOrDefault() / num) : new ulong?();
            }
            ulong?nullable2 = nullable1;
            ulong?nullable3;

            if (diskSpace == null)
            {
                nullable3 = new ulong?();
            }
            else
            {
                ulong?freeSpace = diskSpace.FreeSpace;
                ulong num       = 1024;
                nullable3 = freeSpace.HasValue ? new ulong?(freeSpace.GetValueOrDefault() / num) : new ulong?();
            }
            ulong?nullable4 = nullable3;

            object[] objArray  = new object[4];
            ulong?   nullable5 = nullable2;

            objArray[0] = (object)(ulong)(nullable5.HasValue ? (long)nullable5.GetValueOrDefault() : 0L);
            nullable5   = nullable4;
            objArray[1] = (object)(ulong)(nullable5.HasValue ? (long)nullable5.GetValueOrDefault() : 0L);
            objArray[2] = (object)bootTime;
            objArray[3] = (object)publisherApps;
            return(Task.FromResult(string.Format("{{\n    \"dfid\": {{\n        \"tds\": {0},\n        \"fds\": {1},\n        \"boot_time\": {2},\n        \"apps\": {{\n                \"version\": 0,\n                \"names\": [{3}]\n                }}\n    }}\n}}", objArray)));
        }
예제 #2
0
 protected override Task <string> ProvideOrThrowException()
 {
     return(FingerprintDataProvider.GetDeviceFingerprint());
 }