Ejemplo n.º 1
0
        public void ProcessResponseStream(Stream stream)
        {
            if (stream == null)
            {
                return;
            }

            using (var reader = new StreamReader(stream)) {
                var json = reader.ReadToEnd();
                CurrentStatus = JsonConvert.DeserializeObject <ClientStatus> (json);
                UpdateUI(CurrentStatus);
            }
        }
Ejemplo n.º 2
0
        void UpdateUI(ClientStatus status)
        {
            if (status == null)
            {
                return;
            }

            tlsVersion.Text             = status.TlsVersion;
            splitting.Text              = status.AbleToDetectNMinusOneSplitting.ToString();
            beastVuln.Text              = status.BeastVuln.ToString();
            cipherSuite.Text            = status.UnknownCipherSuiteSupported.ToString();
            tlsCompression.Text         = status.TlsCompressionSupported.ToString();
            ticketSupported.Text        = status.SessionTicketSupported.ToString();
            ephemeralKeysSupported.Text = status.EphemeralKeysSupported.ToString();
        }
Ejemplo n.º 3
0
        void UpdateUI(ClientStatus status, string rawJson)
        {
            if (status == null)
            {
                return;
            }

            tlsVersion.Text             = status.TlsVersion;
            splitting.Text              = status.AbleToDetectNMinusOneSplitting.ToString();
            beastVuln.Text              = status.BeastVuln.ToString();
            cipherSuite.Text            = status.UnknownCipherSuiteSupported.ToString();
            tlsCompression.Text         = status.TlsCompressionSupported.ToString();
            ticketSupported.Text        = status.SessionTicketSupported.ToString();
            ephemeralKeysSupported.Text = status.EphemeralKeysSupported.ToString();
            rating.Text = status.Rating;

            diagnosticResponse.Text = JObject.Parse(rawJson).ToString();
        }
Ejemplo n.º 4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);

            var netRequestButton = FindViewById <Button> (Resource.Id.NetRequestButton);

            netRequestButton.Click += async delegate {
                netRequestButton.Enabled = !netRequestButton.Enabled;

                string json = await RunRequest();

                CurrentStatus = JsonConvert.DeserializeObject <ClientStatus> (json);
                UpdateUI(CurrentStatus, json);

                netRequestButton.Enabled = !netRequestButton.Enabled;
            };

            var nativeRequestButton = FindViewById <Button> (Resource.Id.NativeRequestButton);

            nativeRequestButton.Click += async delegate {
                nativeRequestButton.Enabled = !nativeRequestButton.Enabled;

                string json = await RunNativeRequest();

                CurrentStatus = JsonConvert.DeserializeObject <ClientStatus>(json);
                UpdateUI(CurrentStatus, json);

                nativeRequestButton.Enabled = !nativeRequestButton.Enabled;
            };

            layout                 = FindViewById(Resource.Id.sample_main_layout);
            tlsVersion             = FindViewById <TextView> (Resource.Id.TlsVersion);
            splitting              = FindViewById <TextView> (Resource.Id.Splitting);
            beastVuln              = FindViewById <TextView> (Resource.Id.BeastVuln);
            cipherSuite            = FindViewById <TextView> (Resource.Id.CipherSuite);
            tlsCompression         = FindViewById <TextView> (Resource.Id.TlsCompression);
            ticketSupported        = FindViewById <TextView> (Resource.Id.TicketSupported);
            ephemeralKeysSupported = FindViewById <TextView> (Resource.Id.EphemeralKeysSupported);
            rating                 = FindViewById <TextView> (Resource.Id.Rating);
            diagnosticResponse     = FindViewById <TextView> (Resource.Id.FullResponseText);
        }
Ejemplo n.º 5
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.Main);

			var netRequestButton = FindViewById<Button> (Resource.Id.NetRequestButton);
			netRequestButton.Click += async delegate {
				netRequestButton.Enabled = !netRequestButton.Enabled;

				string json = await RunRequest ();
				CurrentStatus = JsonConvert.DeserializeObject<ClientStatus> (json);
				UpdateUI (CurrentStatus);

				netRequestButton.Enabled = !netRequestButton.Enabled;
			};

			var nativeRequestButton = FindViewById<Button> (Resource.Id.NativeRequestButton);
			nativeRequestButton.Click += async delegate {
				nativeRequestButton.Enabled = !nativeRequestButton.Enabled;

				string json = await RunNativeRequest ();
				CurrentStatus = JsonConvert.DeserializeObject<ClientStatus>(json);
				UpdateUI (CurrentStatus);

				nativeRequestButton.Enabled = !nativeRequestButton.Enabled;
			};

			layout = FindViewById (Resource.Id.sample_main_layout);
			tlsVersion = FindViewById<TextView> (Resource.Id.TlsVersion);
			splitting = FindViewById<TextView> (Resource.Id.Splitting);
			beastVuln = FindViewById<TextView> (Resource.Id.BeastVuln);
			cipherSuite = FindViewById<TextView> (Resource.Id.CipherSuite);
			tlsCompression = FindViewById<TextView> (Resource.Id.TlsCompression);
			ticketSupported = FindViewById<TextView> (Resource.Id.TicketSupported);
			ephemeralKeysSupported = FindViewById<TextView> (Resource.Id.EphemeralKeysSupported);
		}
Ejemplo n.º 6
0
		void UpdateUI (ClientStatus status)
		{
			if (status == null)
				return;

			tlsVersion.Text = status.TlsVersion;
			splitting.Text = status.AbleToDetectNMinusOneSplitting.ToString ();
			beastVuln.Text = status.BeastVuln.ToString ();
			cipherSuite.Text = status.UnknownCipherSuiteSupported.ToString ();
			tlsCompression.Text = status.TlsCompressionSupported.ToString ();
			ticketSupported.Text = status.SessionTicketSupported.ToString ();
			ephemeralKeysSupported.Text = status.EphemeralKeysSupported.ToString ();
		}
Ejemplo n.º 7
0
		public void ProcessResponseStream (Stream stream)
		{
			if (stream == null)
				return;

			using (var reader = new StreamReader (stream)) {
				var json = reader.ReadToEnd ();
				CurrentStatus = JsonConvert.DeserializeObject<ClientStatus> (json);
				UpdateUI (CurrentStatus);
			}
		}