use of org.csploit.android.plugins.mitm.SpoofSession in project android by cSploit.
the class Hijacker method onCreate.
public void onCreate(Bundle savedInstanceState) {
SharedPreferences themePrefs = getSharedPreferences("THEME", 0);
Boolean isDark = themePrefs.getBoolean("isDark", false);
if (isDark)
setTheme(R.style.DarkTheme);
else
setTheme(R.style.AppTheme);
super.onCreate(savedInstanceState);
setTitle(System.getCurrentTarget() + " > MITM > " + getString(R.string.session_sniffer));
setContentView(R.layout.plugin_mitm_hijacker);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mHijackToggleButton = (ToggleButton) findViewById(R.id.hijackToggleButton);
mHijackProgress = (ProgressBar) findViewById(R.id.hijackActivity);
ListView mListView = (ListView) findViewById(R.id.listView);
mAdapter = new SessionListAdapter(R.layout.plugin_mitm_hijacker_list_item);
mSpoof = new SpoofSession();
mListView.setAdapter(mAdapter);
mListView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
final Session session = mAdapter.getByPosition(position);
if (session != null) {
new ConfirmDialog(getString(R.string.hijack_session), mRunning ? getString(R.string.start_hijacking) : getString(R.string.start_hijacking2), Hijacker.this, new ConfirmDialogListener() {
@Override
public void onConfirm() {
if (mRunning)
setStoppedState();
System.setCustomData(session);
startActivity(new Intent(Hijacker.this, HijackerWebView.class));
}
@Override
public void onCancel() {
}
}).show();
}
}
});
mListView.setOnItemLongClickListener(new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
final Session session = mAdapter.getByPosition(position);
if (session != null) {
new InputDialog(getString(R.string.save_session), getString(R.string.set_session_filename), session.getFileName(), true, false, Hijacker.this, new InputDialogListener() {
@Override
public void onInputEntered(String name) {
if (!name.isEmpty()) {
try {
String filename = session.save(name);
Toast.makeText(Hijacker.this, getString(R.string.session_saved_to) + filename + " .", Toast.LENGTH_SHORT).show();
} catch (IOException e) {
new ErrorDialog(getString(R.string.error), e.toString(), Hijacker.this).show();
}
} else
new ErrorDialog(getString(R.string.error), getString(R.string.invalid_session), Hijacker.this).show();
}
}).show();
}
return true;
}
});
mHijackToggleButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mRunning) {
setStoppedState();
} else {
setStartedState();
}
}
});
mRequestListener = new RequestListener();
}
Aggregations