Skip to content

Commit

Permalink
Implement Smart Lock Shunt
Browse files Browse the repository at this point in the history
  • Loading branch information
imclint21 committed Oct 17, 2020
1 parent 6b3658a commit fb9fcb8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions InstagramAutomator.cs
Expand Up @@ -32,7 +32,7 @@ public class InstagramAutomator : BackgroundService
private static AndroidDriver<AppiumWebElement> _driver;
private List<InstagramAccountInformation> _records;

private const string ProxyId = "1B5C2EDC";
private const string ProxyId = "DA85696F";

public InstagramAutomator(ILogger<InstagramAutomator> logger, IConfiguration configuration)
{
Expand Down Expand Up @@ -83,6 +83,7 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken)
ChangeFullName(record.Fullname);
ChangeBiography(record.Bio);
RenewIp();
_driver.ResetApp();
}
}
else
Expand Down Expand Up @@ -117,6 +118,10 @@ private static string DisplayCurrentIp()

private void RegisterAccount(InstagramAccountInformation record)
{
var multiLogin = _driver.FindElements(By.Id("com.google.android.gms:id/credential_picker_layout"));
if (multiLogin.Any())
_driver.FindElement(By.Id("com.google.android.gms:id/cancel")).Click();

var signupCta = _driver.FindElements(By.Id("com.instagram.android:id/sign_up_with_email_or_phone"));
_logger.LogInformation($"Is setup CTA is present? {signupCta.Any()}");
if (signupCta.Any())
Expand Down Expand Up @@ -247,7 +252,8 @@ private string GetConfirmationCode(string email, string password)
using var imapClient = new ImapClient();
imapClient.Connect("outlook.office365.com", 993, true);
imapClient.Authenticate(email, password);

// TODO: handle login error

var inbox = imapClient.Inbox;
inbox.Open(FolderAccess.ReadOnly);

Expand Down
2 changes: 1 addition & 1 deletion appsettings.json
@@ -1,5 +1,5 @@
{
"DeviceSetup": {
"DeviceName": "EML-L29"
"DeviceName": "SM_G973F"
}
}

0 comments on commit fb9fcb8

Please sign in to comment.