Beispiel #1
0
        private void LuhnUI()
        {
            string IMEI;
            int    LuhnDigit;

            IMEI = textBoxDeviceIMEI.Text.ToString();

            if (IMEI.Length == 15)
            {
                LuhnDigit = Mod10(IMEI.Substring(0, 14));
                var checkDigit = Int32.Parse(IMEI[IMEI.Length - 1].ToString());
                if (LuhnDigit == checkDigit)
                {
                    label7.ForeColor = System.Drawing.Color.LimeGreen;
                }
                else
                {
                    label7.ForeColor = System.Drawing.Color.Red;
                }
            }
            else
            {
                label7.ForeColor = System.Drawing.Color.Black;
            }
        }
Beispiel #2
0
        public ActionResult IMEI(ImeiVM model)
        {
            ViewData["product"] = new List <SelectListItem>();
            if (ModelState.IsValid)
            {
                if (rpimei.Any(x => x.IMEINumber == model.IMEINumber))
                {
                    ViewBag.IslemDurum = EnumIslemDurum.IsimMevcut;
                    var paymentInfoList = rppaymentinfo.GetListWithQuery(x => x.IMEICount > 0 && x.SupplierID == model.SupplierID);
                    ViewBag.count      = model.ProductID != 0 ? paymentInfoList.Where(x => x.ProductID == model.ProductID).Sum(x => x.IMEICount) : paymentInfoList.Sum(x => x.IMEICount);
                    ViewBag.supplierId = model.SupplierID;
                    GetProducts(model.SupplierID, paymentInfoList);
                    GetAllSuppliers();
                    return(View(model));
                }
                else
                {
                    var paymentInfo = rppaymentinfo.FirstOrDefault(x => x.IMEICount > 0 && x.SupplierID == model.SupplierID && x.ProductID == model.ProductID);
                    paymentInfo.IMEICount--;

                    var imei = new IMEI
                    {
                        IMEINumber    = model.IMEINumber,
                        SupplierID    = model.SupplierID,
                        PaymentInfoID = paymentInfo.ID,
                        ProductID     = model.ProductID
                    };
                    rpimei.Add(imei);
                    rppaymentinfo.SaveChanges();

                    var paymentInfoList = rppaymentinfo.GetListWithQuery(x => x.IMEICount > 0 && x.SupplierID == model.SupplierID && x.ProductID == model.ProductID);
                    ViewBag.count      = paymentInfoList.Sum(x => x.IMEICount);
                    ViewBag.supplierId = model.SupplierID;
                    ViewBag.IslemDurum = EnumIslemDurum.Basarili;

                    var paymentInfoListforProducts = rppaymentinfo.GetListWithQuery(x => x.IMEICount > 0 && x.SupplierID == model.SupplierID);
                    GetProducts(model.SupplierID, paymentInfoListforProducts);

                    GetAllSuppliers();
                    return(View(model));
                }
            }
            else
            {
                var paymentInfoList = rppaymentinfo.GetListWithQuery(x => x.IMEICount > 0 && x.SupplierID == model.SupplierID);
                ViewBag.count      = model.ProductID != 0 ? paymentInfoList.Where(x => x.ProductID == model.ProductID).Sum(x => x.IMEICount) : paymentInfoList.Sum(x => x.IMEICount);
                ViewBag.supplierId = model.SupplierID;
                ViewBag.IslemDurum = EnumIslemDurum.ValidationHata;
                GetProducts(model.SupplierID, paymentInfoList);
                GetAllSuppliers();
                return(View(model));
            }
        }
Beispiel #3
0
        public virtual List <string> GetInfo()
        {
            List <string> info = new List <string>()
            {
                "Модель: " + ModelName,
                "Операционная система: " + OS,
                "IMEI: " + IMEI.ToString(),
                "Номер телефона: " + PhoneNumber.ToString(),
                "Количество сим-карт: " + SimCount.ToString(),
                "Количество памяти: " + MemorySize.ToString(),
                "Модель: " + MobileStatus
            };

            return(info);
        }
Beispiel #4
0
        private bool Validate()
        {
            Valid = false;

            // La trama debe poseer exactamente 20 componentes una vez tokenizada; caso contrario esta mal formada.
            if (TokenizedDatagram.Length != 20)
            {
                return(false);
            }

            // La trama debe comenzar y terminar exactamente con marcas puntuales. ($B y $E, respectivamente).
            if (!TokenizedDatagram[0].Equals("$B"))
            {
                return(false);
            }

            if (!TokenizedDatagram[19].Equals("$E"))
            {
                return(false);
            }

            // Verifico los tipos de datos de la trama.
            if (!IMEI.All(char.IsDigit) || IMEI.Count() != 15)
            {
                return(false);
            }

            if (!PacketNumber.All(char.IsDigit) || PacketNumber.Count() != 4 || Convert.ToInt16(PacketNumber) < 1 || Convert.ToInt16(PacketNumber) > 1440)
            {
                return(false);
            }

            Valid = true;

            return(true);
        }
Beispiel #5
0
        private void Button1_Click(object sender, EventArgs e)
        {
            //bool DeviceFound = false;
            //int counter = 0;
            if (System.IO.File.Exists(@"Tools\adb.exe"))
            {
                if (ADBCheck() == true)
                {
                    textBoxDeviceIMEI.Clear();
                    textBoxDeviceBrand.Clear();
                    textBoxDeviceModel.Clear();

                    var device   = AdbClient.Instance.GetDevices().FirstOrDefault();
                    var receiver = new ConsoleOutputReceiver();

                    //ADB IMEI Methods
                    Dictionary <int, string> imei = new Dictionary <int, string>()
                    {
                        { 1, "content query --uri content://settings/system --where " + '"' + "name='" + "bd_setting_i'" + '"' + " | sed '" + "s/[^=0-9]*//g' | sed 's/[0-9]*=//g'" },
                        { 2, "service call iphonesubinfo 1" },
                        { 3, "getprop persist.radio.device.imei" }
                    };

                    string manufacturer = @"getprop ro.product.manufacturer";
                    string model        = @"getprop ro.product.model";

                    //Instance.ExecuteRemoteCommand is adb shell ->
                    AdbClient.Instance.ExecuteRemoteCommand(manufacturer, device, receiver);
                    AdbClient.Instance.ExecuteRemoteCommand(model, device, receiver);
                    AdbClient.Instance.ExecuteRemoteCommand(imei[1], device, receiver);

                    var           received = receiver.ToString().ToUpper();
                    List <string> s        = new List <string>(received.Split(new string[] { "\n" }, StringSplitOptions.None));

                    textBoxDeviceBrand.Text = s[0].Trim();
                    textBoxDeviceModel.Text = s[1].Trim();
                    try
                    {
                        // OLD Android

                        var intIMEI = Int32.Parse(s[2].Trim());
                        textBoxDeviceIMEI.Text = s[2].Trim();
                    }
                    catch (Exception)
                    {
                        // New Version Android

                        AdbClient.Instance.ExecuteRemoteCommand(imei[2], device, receiver);
                        received = receiver.ToString().ToUpper();
                        s        = new List <string>(received.Split(new string[] { "\n" }, StringSplitOptions.None));

                        string method1IMEI = ExtractIMEIfromMethod2(s);
                        if (method1IMEI != "-1")
                        {
                            textBoxDeviceIMEI.Text = method1IMEI.Trim();
                        }
                        else
                        {
                            //ASUS ZENFONE
                        }
                    }

                    LuhnUI();
                }
                else
                {
                    if (iDeviceCheck())
                    {
                        Dictionary <string, string> data = new Dictionary <string, string>()
                        {
                            { "x86_64", "Simulator" },
                            { "i386", "Simulator" },
                            { "iPod1,1", "iPod Touch 1st Gen" },
                            { "iPod2,1", "iPod Touch 2nd Gen" },
                            { "iPod3,1", "iPod Touch 3rd Gen" },
                            { "iPod4,1", "iPod Touch 4th Gen" },
                            { "iPod5,1", "iPod Touch 5th Gen" },
                            { "iPod7,1", "iPod Touch 6th Gen" },
                            { "iPod9,1", "iPod Touch 7th Gen" },
                            { "iPhone1,1", "iPhone" },
                            { "iPhone1,2", "iPhone 3G" },
                            { "iPhone2,1", "iPhone 3GS" },
                            { "iPhone3,1", "iPhone 4" },
                            { "iPhone3,2", "iPhone 4" },
                            { "iPhone3,3", "iPhone 4" },
                            { "iPhone4,1", "iPhone 4S" },
                            { "iPhone5,1", "iPhone 5 model A1428" },
                            { "iPhone5,2", "iPhone 5 model A1429" },
                            { "iPhone5,3", "iPhone 5C" },
                            { "iPhone5,4", "iPhone 5C" },
                            { "iPhone6,1", "iPhone 5S" },
                            { "iPhone6,2", "iPhone 5S" },
                            { "iPhone7,2", "iPhone 6" },
                            { "iPhone7,1", "iPhone 6 Plus" },
                            { "iPhone8,1", "iPhone 6S" },
                            { "iPhone8,2", "iPhone 6S Plus" },
                            { "iPhone8,4", "iPhone SE" },
                            { "iPhone9,1", "iPhone 7" },
                            { "iPhone9,2", "iPhone 7 Plus" },
                            { "iPhone9,3", "iPhone 7" },
                            { "iPhone9,4", "iPhone 7 Plus" },
                            { "iPhone10,1", "iPhone 8" },
                            { "iPhone10,4", "iPhone 8" },
                            { "iPhone10,2", "iPhone 8 Plus" },
                            { "iPhone10,5", "iPhone 8 Plus" },
                            { "iPhone10,3", "iPhone X" },
                            { "iPhone10,6", "iPhone X" },
                            { "iPhone11,2", "iPhone XS" },
                            { "iPhone11,4", "iPhone XS Max" },
                            { "iPhone11,6", "iPhone XS Max" },
                            { "iPhone11,8", "iPhone XR" },
                            { "iPhone12,1", "iPhone 11" },
                            { "iPhone12,3", "iPhone 11 Pro" },
                            { "iPhone12,5", "iPhone 11 Pro Max" },
                            { "iPad1,1", "iPad" },
                            { "iPad2,1", "iPad 2" },
                            { "iPad2,2", "iPad 2" },
                            { "iPad2,3", "iPad 2" },
                            { "iPad2,4", "iPad 2" },
                            { "iPad3,1", "iPad 3rd Gen" },
                            { "iPad3,2", "iPad 3rd Gen" },
                            { "iPad3,3", "iPad 3rd Gen" },
                            { "iPad3,4", "iPad 4th Gen" },
                            { "iPad3,5", "iPad 4th Gen" },
                            { "iPad3,6", "iPad 4th Gen" },
                            { "iPad4,1", "iPad Air" },
                            { "iPad4,2", "iPad Air" },
                            { "iPad4,3", "iPad Air" },
                            { "iPad2,5", "iPad Mini 1st Gen" },
                            { "iPad2,6", "iPad Mini 1st Gen" },
                            { "iPad2,7", "iPad Mini 1st Gen" },
                            { "iPad4,4", "iPad Mini 2nd Gen" },
                            { "iPad4,5", "iPad Mini 2nd Gen" },
                            { "iPad4,6", "iPad Mini 2nd Gen" },
                            { "iPad4,7", "iPad Mini 3rd Gen" },
                            { "iPad4,8", "iPad Mini 3rd Gen" },
                            { "iPad4,9", "iPad Mini 3rd Gen" },
                            { "iPad5,1", "iPad Mini 4" },
                            { "iPad5,2", "iPad Mini 4" },
                            { "iPad5,3", "iPad Air 2" },
                            { "iPad5,4", "iPad Air 2" },
                            { "iPad6,3", "iPad Pro 9.7 inch" },
                            { "iPad6,4", "iPad Pro 9.7 inch" },
                            { "iPad6,7", "iPad Pro 12.9 inch" },
                            { "iPad6,8", "iPad Pro 12.9 inch" },
                            { "iPad7,1", "iPad Pro 12.9 inch 2nd Gen" },
                            { "iPad7,2", "iPad Pro 12.9 inch 2nd Gen" },
                            { "iPad7,3", "iPad Pro 10.5 inch" },
                            { "iPad7,4", "iPad Pro 10.5 inch" },
                            { "iPad8,1", "iPad Pro 11 inch" },
                            { "iPad8,2", "iPad Pro 11 inch" },
                            { "iPad8,3", "iPad Pro 11 inch" },
                            { "iPad8,4", "iPad Pro 11 inch" },
                            { "iPad8,5", "iPad Pro 12.9 inch 3rd Gen" },
                            { "iPad8,6", "iPad Pro 12.9 inch 3rd Gen" },
                            { "iPad8,7", "iPad Pro 12.9 inch 3rd Gen" },
                            { "iPad8,8", "iPad Pro 12.9 inch 3rd Gen" },
                            { "iPad11,1", "iPad mini 5th Gen(WiFi)" },
                            { "iPad11,2", "iPad mini 5th Gen" },
                            { "iPad11,3", "iPad Air 3rd Gen(WiFi)" },
                            { "iPad11,4", "iPad Air 3rd Gen" }
                        };

                        textBoxDeviceIMEI.Clear();
                        textBoxDeviceBrand.Clear();
                        textBoxDeviceModel.Clear();

                        NativeLibraries.Load();

                        int count = 0;

                        var idevice  = LibiMobileDevice.Instance.iDevice;
                        var lockdown = LibiMobileDevice.Instance.Lockdown;
                        var ret      = idevice.idevice_get_device_list(out ReadOnlyCollection <string> udids, ref count);
                        if (ret == iDeviceError.NoDevice)
                        {
                            // Not actually an error in our case
                            return;
                        }

                        ret.ThrowOnError();

                        // Get the device name
                        foreach (var udid in udids)
                        {
                            idevice.idevice_new(out iDeviceHandle deviceHandle, udid).ThrowOnError();

                            lockdown.lockdownd_client_new_with_handshake(deviceHandle, out LockdownClientHandle lockdownHandle, "Quamotion").ThrowOnError();
                            lockdown.lockdownd_get_device_name(lockdownHandle, out string deviceName).ThrowOnError();

                            //Find serial number in plist
                            lockdown.lockdownd_get_value(lockdownHandle, null, "InternationalMobileEquipmentIdentity", out PlistHandle PlistIMEI);

                            //Find Product Type version in plist
                            lockdown.lockdownd_get_value(lockdownHandle, null, "ProductType", out PlistHandle PlistProductType);

                            //Get string values from plist
                            PlistIMEI.Api.Plist.plist_get_string_val(PlistIMEI, out string IMEI);
                            PlistProductType.Api.Plist.plist_get_string_val(PlistProductType, out string ProductType);

                            //Place data in textboxes
                            textBoxDeviceIMEI.Text = IMEI.Trim();
                            if (data.TryGetValue(ProductType.Trim(), out string FProductType))
                            {
                                textBoxDeviceBrand.Text = "APPLE";
                                textBoxDeviceModel.Text = FProductType;
                            }
                            deviceHandle.Dispose();
                            lockdownHandle.Dispose();
                        }
                    }
                }
            }
        }
Beispiel #6
0
 void Awake()
 {
     instance = this;
 }