public static string GetAppUserAgent() { PhoneBrand brand = GetRandomPhoneBrand(false); string osVersion = GetRandomAndroidVersion(); string modelName = brand.GetRandomModel(osVersion); return("Linux; U; Android " + osVersion + "; " + modelName); }
public static string GetMobileUserAgent() { PhoneBrand brand = GetRandomPhoneBrand(); if (brand == PhoneBrand.Apple) { return("Mozilla/5.0 (iPhone; CPU iPhone OS " + GetRandomIOSVersion() + " like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/" + BrowserBrand.Safari.GetRandomVersion() + " Mobile/15E148 Safari/604.1"); } string osVersion = GetRandomAndroidVersion(); BrowserBrand browser = GetRandomBrowserBrand(); string browserVersion = browser.GetRandomVersion(); if (browser == BrowserBrand.Firefox) { return("Mozilla/5.0 (Android " + osVersion + "; Mobile; rv:" + browserVersion + ") Gecko/" + browserVersion + " Firefox/" + browserVersion); } string modelName = brand.GetRandomModel(osVersion); return("Mozilla/5.0 (Linux; Android " + osVersion + "; " + modelName + " AppleWebKit/537.36 (KHTML, like Gecko) Chrome/" + browserVersion + " Mobile Safari/537.36"); }