Beispiel #1
0
        public static string SamsungFirmwareOrgFetch2(string model, string region)
        {
            string str = FWFetch.SamsungFirmwareOrgFetch(model, region);

            if (!string.IsNullOrEmpty(str))
            {
                string[] strArray = str.Split('/');
                str = strArray[0] + "/" + strArray[2] + "/" + strArray[1];
            }
            return(str);
        }
Beispiel #2
0
 public static string SamMobileFetch1(string model, string region)
 {
     try
     {
         FWFetch.SamMobileHtml = Utility.GetHtml("http://www.sammobile.com/firmwares/database/" + model + "/" + region + "/");
         return(FWFetch.SamMobileFetch(model, region, 0));
     }
     catch (Exception ex)
     {
         return(string.Empty);
     }
 }
Beispiel #3
0
        public static string SamMobileFetch(string model, string region, int index)
        {
            string samMobileHtml = FWFetch.SamMobileHtml;

            if (string.IsNullOrEmpty(samMobileHtml) || samMobileHtml.Contains("Device model not found"))
            {
                return(string.Empty);
            }
            int num = 0;

            while (index-- >= 0 && num >= 0)
            {
                num = samMobileHtml.IndexOf("<a class=\"firmware-table-row\" href=\"", num + 1);
            }
            if (num < 0)
            {
                return(string.Empty);
            }
            string str1  = samMobileHtml.Substring(num + 36);
            string html  = Utility.GetHtml(str1.Substring(0, str1.IndexOf('"')));
            string input = string.Empty;

            using (StringReader stringReader = new StringReader(html))
            {
                bool   flag = false;
                string line;
                while ((line = stringReader.ReadLine()) != null)
                {
                    string str2 = FWFetch.tdExtract(line).Trim();
                    if (str2 == "PDA" || str2 == "CSC")
                    {
                        flag = true;
                    }
                    else if (flag)
                    {
                        input = input + str2 + "/";
                        flag  = false;
                    }
                }
            }
            return(Regex.Replace(input, "^(.*)/(.*)/$", "$1/$2/$1"));
        }
Beispiel #4
0
        public static string SamsungFirmwareOrgFetch(string model, string region)
        {
            string samsungFirmwareOrgHtml = FWFetch.SamsungFirmwareOrgHtml;
            int    startIndex             = samsungFirmwareOrgHtml.IndexOf("\"/model/" + model + "/\"");

            if (startIndex < 0)
            {
                return(string.Empty);
            }
            string s   = samsungFirmwareOrgHtml.Substring(startIndex);
            string url = "https://samsung-firmware.org";

            using (StringReader stringReader = new StringReader(s))
            {
                string str;
                while ((str = stringReader.ReadLine()) != null)
                {
                    if (str.Contains("Download"))
                    {
                        int num    = str.IndexOf('"');
                        int length = str.Substring(num + 1).IndexOf('"');
                        url += str.Substring(num + 1, length);
                        break;
                    }
                }
            }
            string html     = Utility.GetHtml(url);
            string infoSfo1 = FWFetch.GetInfoSFO(html, "PDA Version");
            string infoSfo2 = FWFetch.GetInfoSFO(html, "CSC Version");
            string infoSfo3 = FWFetch.GetInfoSFO(html, "PHONE Version");

            if (string.IsNullOrEmpty(infoSfo1) || string.IsNullOrEmpty(infoSfo2) || string.IsNullOrEmpty(infoSfo3))
            {
                return(string.Empty);
            }
            return(infoSfo1 + "/" + infoSfo2 + "/" + infoSfo3);
        }
Beispiel #5
0
 public static string SamsungFirmwareOrgFetch1(string model, string region)
 {
     FWFetch.SamsungFirmwareOrgHtml = Utility.GetHtml("https://samsung-firmware.org/model/" + model + "/region/" + region + "/");
     return(FWFetch.SamsungFirmwareOrgFetch(model, region));
 }
Beispiel #6
0
 public static string SamMobileFetch2(string model, string region)
 {
     return(FWFetch.SamMobileFetch(model, region, 1));
 }
Beispiel #7
0
 public static string FOTAInfoFetch2(string model, string region)
 {
     return(FWFetch.FOTAInfoFetch(model, region, false));
 }
Beispiel #8
0
 public static string FOTAInfoFetch1(string model, string region)
 {
     return(FWFetch.FOTAInfoFetch(model, region, true));
 }