use of org.csploit.android.net.Target.Exploit in project android by cSploit.
the class ExploitFinder method setStartedState.
private void setStartedState() {
mSearchProgress.setVisibility(View.VISIBLE);
final Target target = System.getCurrentTarget();
job = Search.searchExploitForServices(target, new Search.Receiver<Exploit>() {
private boolean somethingFound = false;
@Override
public void onItemFound(final Exploit exploit) {
somethingFound = true;
ExploitFinder.this.runOnUiThread(new Runnable() {
@Override
public void run() {
target.addExploit(exploit);
mAdapter.notifyDataSetChanged();
}
});
}
@Override
public void onFoundItemChanged(Exploit exploit) {
ExploitFinder.this.runOnUiThread(new Runnable() {
@Override
public void run() {
mAdapter.notifyDataSetChanged();
}
});
}
@Override
public void onEnd() {
ExploitFinder.this.runOnUiThread(new Runnable() {
@Override
public void run() {
mSearchProgress.setVisibility(View.GONE);
mSearchFloatingActionButton.setImageDrawable(ContextCompat.getDrawable(getBaseContext(), R.drawable.ic_stop_24dp));
buttonPlayed = true;
if (System.getCurrentExploits().size() == 0) {
new FinishDialog(getString(R.string.warning), getString(R.string.no_exploits_found), ExploitFinder.this).show();
} else if (!somethingFound) {
new ErrorDialog(getString(R.string.warning), getString(R.string.no_exploits_found), ExploitFinder.this).show();
}
}
});
}
});
}
Aggregations