Beispiel #1
0
 private static string HttpUploadFile(
     string url,
     string file,
     string paramName,
     string contentType,
     Dictionary <string, string> headers,
     Dictionary <string, string> data)
 {
     try
     {
         if (Features.IsFeatureEnabled(536870912UL) && url.Contains(RegistryManager.Instance.Host))
         {
             url = url.Replace(RegistryManager.Instance.Host, RegistryManager.Instance.Host2);
         }
         return(BstHttpClient.HttpUploadFileInternal(url, file, paramName, contentType, headers, data));
     }
     catch (Exception ex)
     {
         if (url.Contains(RegistryManager.Instance.Host))
         {
             Logger.Error(ex.Message);
             url = url.Replace(RegistryManager.Instance.Host, RegistryManager.Instance.Host2);
             return(BstHttpClient.HttpUploadFileInternal(url, file, paramName, contentType, headers, data));
         }
         if (url.Contains(RegistryManager.Instance.Host2))
         {
             Logger.Error(ex.Message);
             url = url.Replace(RegistryManager.Instance.Host2, RegistryManager.Instance.Host);
             return(BstHttpClient.HttpUploadFileInternal(url, file, paramName, contentType, headers, data));
         }
         throw;
     }
 }
        public static bool IsFeatureEnabled(ulong featureMask)
        {
            ulong features = Features.GetEnabledFeatures();

            if (features == 0UL)
            {
                features = Oem.Instance.WindowsOEMFeatures;
            }
            return(Features.IsFeatureEnabled(featureMask, features));
        }
Beispiel #3
0
 public static string Post(
     string url,
     Dictionary <string, string> data,
     Dictionary <string, string> headers = null,
     bool gzip                  = false,
     string vmName              = "Android",
     int timeout                = 0,
     int retries                = 1,
     int sleepTimeMSec          = 0,
     bool isOnUIThreadOnPurpose = false,
     string oem                 = "bgp")
 {
     try
     {
         if (oem == null)
         {
             oem = "bgp";
         }
         if (url != null && Features.IsFeatureEnabled(536870912UL) && url.Contains(RegistryManager.Instance.Host))
         {
             url = url.Replace(RegistryManager.Instance.Host, RegistryManager.Instance.Host2);
         }
         return(BstHttpClient.PostInternal(url, data, headers, gzip, retries, sleepTimeMSec, timeout, vmName, isOnUIThreadOnPurpose, oem));
     }
     catch (Exception ex)
     {
         if (url == null)
         {
             throw new Exception("url cannot be  null");
         }
         if (oem == null)
         {
             oem = "bgp";
         }
         if (url.Contains(RegistryManager.Instance.Host))
         {
             Logger.Error(ex.Message);
             url = url.Replace(RegistryManager.Instance.Host, RegistryManager.Instance.Host2);
             return(BstHttpClient.PostInternal(url, data, headers, gzip, retries, sleepTimeMSec, timeout, vmName, isOnUIThreadOnPurpose, oem));
         }
         if (url.Contains(RegistryManager.Instance.Host2))
         {
             Logger.Error(ex.Message);
             url = url.Replace(RegistryManager.Instance.Host2, RegistryManager.Instance.Host);
             return(BstHttpClient.PostInternal(url, data, headers, gzip, retries, sleepTimeMSec, timeout, vmName, isOnUIThreadOnPurpose, oem));
         }
         throw;
     }
 }
Beispiel #4
0
 public static string HTTPGaeFileUploader(
     string url,
     Dictionary <string, string> data,
     Dictionary <string, string> headers,
     string filepath,
     string contentType,
     bool gzip,
     string vmName)
 {
     if (data == null)
     {
         data = new Dictionary <string, string>();
     }
     try
     {
         if (url != null && Features.IsFeatureEnabled(536870912UL) && url.Contains(RegistryManager.Instance.Host))
         {
             url = url.Replace(RegistryManager.Instance.Host, RegistryManager.Instance.Host2);
         }
         return(BstHttpClient.HTTPGaeFileUploaderInternal(url, data, headers, filepath, contentType, gzip, vmName));
     }
     catch (Exception ex)
     {
         if (url == null)
         {
             throw new Exception("url cannot be  null");
         }
         if (url.Contains(RegistryManager.Instance.Host))
         {
             Logger.Error(ex.Message);
             url = url.Replace(RegistryManager.Instance.Host, RegistryManager.Instance.Host2);
             return(BstHttpClient.HTTPGaeFileUploaderInternal(url, data, headers, filepath, contentType, gzip, vmName));
         }
         if (url.Contains(RegistryManager.Instance.Host2))
         {
             Logger.Error(ex.Message);
             url = url.Replace(RegistryManager.Instance.Host2, RegistryManager.Instance.Host);
             return(BstHttpClient.HTTPGaeFileUploaderInternal(url, data, headers, filepath, contentType, gzip, vmName));
         }
         throw;
     }
 }
 public static bool UseDefaultNetworkText()
 {
     return(Features.IsFeatureEnabled(1048576UL));
 }
 public static bool UpdateFrontendAppTitle()
 {
     return(Features.IsFeatureEnabled(524288UL));
 }
 public static bool ExitOnHome()
 {
     return(Features.IsFeatureEnabled(131072UL));
 }
 public static bool IsGraphicsDriverReminderEnabled()
 {
     return(Features.IsFeatureEnabled(65536UL));
 }
 public static bool IsHomeButtonEnabled()
 {
     return(Features.IsFeatureEnabled(32768UL));
 }
 public static bool IsFullScreenToggleEnabled()
 {
     return(Features.IsFeatureEnabled(2097152UL));
 }