示例#1
0
        public async void StartChallengeV2(InstaChallengeLoginInfo challengeLoginInfo)
        {
            try
            {
                try
                {
                    //UserAgentHelper.SetUserAgent("Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/_BuildID_) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36");
                    UserAgentHelper.SetUserAgent($"Mozilla/5.0 (Linux; Android 10; SM-A205U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.86 Mobile Safari/537.36");
                }
                catch { }
                try
                {
                    DeleteFacebookCookies();
                }
                catch { }
                ChallengeV2Grid.Visibility = Visibility.Visible;
                SignInVM.ChallengeV2LoadingOn();
                await Task.Delay(1500);

                Uri baseUri = new Uri(challengeLoginInfo.Url);
                HttpBaseProtocolFilter filter = new HttpBaseProtocolFilter();
                var cookies = Helper.InstaApiTrash.HttpRequestProcessor.HttpHandler.CookieContainer
                              .GetCookies(Helper.InstaApiTrash.HttpRequestProcessor.Client.BaseAddress);
                foreach (System.Net.Cookie c in cookies)
                {
                    HttpCookie cookie = new HttpCookie(c.Name, baseUri.Host, "/")
                    {
                        Value = c.Value
                    };
                    filter.CookieManager.SetCookie(cookie, false);
                }

                HttpRequestMessage httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, baseUri);
                ChallengeV2kWebView.NavigateWithHttpRequestMessage(httpRequestMessage);
            }
            catch (Exception ex)
            {
                SignInVM.ChallengeV2LoadingOff();
                Helper.ShowErr("Something unexpected happened", ex);
            }
        }
示例#2
0
 private void ChallengeV2kWebViewNavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args)
 {
     SignInVM.ChallengeV2LoadingOn();
 }