Ejemplo n.º 1
0
        public string GetColor(string oem)
        {
            string color;
            string manufacturer = oem.Trim();

            switch (manufacturer.ToUpper())
            {
            case "GOOGLE":
                color = ExecuteCommandSync.AndroidCommand("getprop ro.boot.hardware.color");
                break;

            case "LGE":
                color = ExecuteCommandSync.AndroidCommand("getprop ro.boot.product.lge.device_color");
                break;

            case "HUAWEI":
                color = ExecuteCommandSync.AndroidCommand("getprop ro.config.devicecolor");
                break;

            default:
                color = ExecuteCommandSync.AndroidCommand("getprop ro.boot.hardware.color");
                break;
            }

            return(color);
        }
Ejemplo n.º 2
0
        public string GetModel(string oem)
        {
            string model;
            string manufacturer = oem.Trim();

            switch (manufacturer.ToUpper())
            {
            case "HUAWEI":
                model = ExecuteCommandSync.AndroidCommand("getprop ro.product.model");
                break;

            case "LGE":
                model = ExecuteCommandSync.AndroidCommand("getprop ro.product.model");
                break;

            case "MOTOROLA":
                model = ExecuteCommandSync.AndroidCommand("getprop ro.boot.hardware.sku");
                break;

            case "SONY":
                model = ExecuteCommandSync.AndroidCommand("getprop ro.semc.product.model");
                break;

            default:
                model = ExecuteCommandSync.AndroidCommand("getprop ro.product.vendor.model");
                break;
            }
            return(model);
        }
Ejemplo n.º 3
0
        public string GetCapacity(string oem)
        {
            string capacity;
            string manufacturer = oem.Trim();

            switch (manufacturer.ToUpper())
            {
            case "GOOGLE":
                capacity = ExecuteCommandSync.AndroidCommand("getprop ro.boot.hardware.ufs");
                break;

            default:
                string capacityLine = ExecuteCommandSync.AndroidCommand("df -h");
                if (string.IsNullOrEmpty(capacityLine))
                {
                    capacity = "";
                }
                else
                {
                    capacity = CalculateCapacity(capacityLine);
                }
                break;
            }

            return(capacity);
        }
Ejemplo n.º 4
0
        public string GetSoftwareVersion(string oem)
        {
            string sv;
            string manufacturer = oem.Trim();

            switch (manufacturer.ToUpper())
            {
            case "SAMSUNG":
                sv = ExecuteCommandSync.AndroidCommand("getprop ro.bootloader");
                break;

            case "HUAWEI":
                sv = ExecuteCommandSync.AndroidCommand("getprop ro.build.display.id");
                break;

            case "LGE":
                sv = ExecuteCommandSync.AndroidCommand("getprop ro.vendor.lge.swversion");
                if (string.IsNullOrEmpty(sv.Trim()))
                {
                    sv = ExecuteCommandSync.AndroidCommand("getprop ro.lge.swversion");
                }
                break;

            default:
                sv = ExecuteCommandSync.AndroidCommand("getprop ro.build.id");
                break;
            }

            return(sv);
        }
Ejemplo n.º 5
0
 public AppleDevice()
 {
     IMEI            = ExecuteCommandSync.AppleCommand("ideviceinfo -k  InternationalMobileEquipmentIdentity");
     Model           = ExecuteCommandSync.AppleCommand("ideviceinfo -k ModelNumber");
     SoftwareVersion = ExecuteCommandSync.AppleCommand("ideviceinfo -k ProductVersion");
     OEM             = "Apple";
     SerialNumber    = ExecuteCommandSync.AppleCommand("ideviceinfo -k SerialNumber");
 }
Ejemplo n.º 6
0
        public string GetOEM()
        {
            string oem = ExecuteCommandSync.AndroidCommand("getprop ro.product.vendor.manufacturer");

            if (string.IsNullOrEmpty(oem.Trim()))
            {
                oem = ExecuteCommandSync.AndroidCommand("getprop ro.product.manufacturer");
            }
            return(oem);
        }
Ejemplo n.º 7
0
        public string GetIMEI()
        {
            string imei_query = "\"service call iphonesubinfo 1 | grep -o '[0-9a-f]\\{8\\} ' | tail -n+3 | while read a; do echo -n \\\\u${a:4:4}\\\\u${a:0:4}; done\"";
            string imei       = ExecuteCommandSync.AndroidCommand(imei_query);

            if (string.IsNullOrEmpty(imei.Trim()))
            {
                imei_query = "service call iphonesubinfo 1 | toybox cut -d \"'\" -f2 | toybox grep -Eo '[0 - 9]' | toybox xargs | toybox sed 's /\\ //g'";
                imei       = ExecuteCommandSync.AndroidCommand(imei_query);
            }
            string cleanIMEI = RemoveNonASCII(imei);

            return(cleanIMEI);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Gets and Calculates the connected device UDID which is needed to get the device property on apple devices
        /// </summary>
        /// <param name="NumberOfConnectedDevice">Number of connected device</param>
        /// <param name="connectedDeviceUDID">String array of Connected Device UDID recorded</param>
        /// <returns></returns>
        public static string GetUdid(int NumberOfConnectedDevice, List <string> connectedDeviceUDID)
        {
            string udid;

            if (NumberOfConnectedDevice <= 1)
            {
                udid = ExecuteCommandSync.AppleCommand("idevice_id -l");
            }
            else
            {
                udid = ExecuteCommandSync.AppleCommand("idevice_id -l");
                foreach (string item in connectedDeviceUDID)
                {
                    udid = udid.Replace(item, "");
                }
            }
            return(udid.Trim());
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Gets SoftwareVersion from ideviceinfo command
        /// </summary>
        /// <param name="UDID">UDID of device</param>
        /// <returns></returns>
        public static string GetSoftwareVersion(string UDID)
        {
            string res = ExecuteCommandSync.AppleCommand($"ideviceinfo -u {UDID} -k ProductVersion");

            return(res.Trim());
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Gets ModelNumber from ideviceinfo command
        /// </summary>
        /// <param name="UDID">UDID of device</param>
        /// <returns></returns>
        public static string GetModelNumber(string UDID)
        {
            string res = ExecuteCommandSync.AppleCommand($"ideviceinfo -u {UDID} -k ModelNumber");

            return(res.Trim());
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Gets IMEI from ideviceinfo command
        /// </summary>
        /// <param name="UDID">UDID of device</param>
        /// <returns></returns>
        public static string GetIMEI(string UDID)
        {
            string res = ExecuteCommandSync.AppleCommand($"ideviceinfo -u {UDID} -k InternationalMobileEquipmentIdentity");

            return(res.Trim());
        }
Ejemplo n.º 12
0
 public string GetSN()
 {
     return(ExecuteCommandSync.AndroidCommand("getprop ro.serialno"));
 }