OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046

以下内容为反编译后的 ForgetPwdActivity.java 源代码,内容仅作参考


package com.excelliance.kxqp.ui;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.bytedance.sdk.open.aweme.common.constants.ParamKeyConstants;
import com.excelliance.kxqp.GameUtil;
import com.excelliance.kxqp.Versioning;
import java.security.MessageDigest;
import java.util.regex.Pattern;
import org.json.JSONException;
import org.json.JSONObject;

public class ForgetPwdActivity extends Activity implements View.OnClickListener {
    private EditText c;
    private EditText d;
    private Button e;
    private Button f;
    private TextView g;
    private TextView h;
    private SharedPreferences i;
    private ImageView j;
    private String k;

    boolean f13753a = false;

    Handler f13754b = new Handler() {
        @Override
        public void handleMessage(Message message) {
            switch (message.what) {
                case 0:
                    ForgetPwdActivity.this.e.setFocusable(false);
                    ForgetPwdActivity.this.e.setClickable(false);
                    ForgetPwdActivity.this.e.setEnabled(false);
                    ForgetPwdActivity.this.e.setText(ForgetPwdActivity.this.getResources().getString(ForgetPwdActivity.this.getResources().getIdentifier("forget_send", "string", ForgetPwdActivity.this.getPackageName())) + "(" + message.arg1 + ")");
                    return;
                case 1:
                    ForgetPwdActivity.this.e.setFocusable(true);
                    ForgetPwdActivity.this.e.setClickable(true);
                    ForgetPwdActivity.this.e.setEnabled(true);
                    ForgetPwdActivity.this.e.setText(ForgetPwdActivity.this.getResources().getString(ForgetPwdActivity.this.getResources().getIdentifier("forget_send", "string", ForgetPwdActivity.this.getPackageName())));
                    return;
                case 2:
                    Toast.makeText(ForgetPwdActivity.this, ForgetPwdActivity.this.getResources().getString(ForgetPwdActivity.this.getResources().getIdentifier(message.arg1 == 0 ? "forget_email_sent" : "network_error", "string", ForgetPwdActivity.this.getPackageName())), 0).show();
                    return;
                default:
                    return;
            }
        }
    };
    private int l = 0;
    private int m = 0;

    public String a(String str, String str2) {
        return "-1";
    }

    public String b() {
        return null;
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        this.l = getResources().getIdentifier("activity_forget", "layout", getPackageName());
        if (this.l > 0) {
            setContentView(this.l);
        }
        this.m = getIntent().getIntExtra(ParamKeyConstants.WebViewConstants.QUERY_FROM, 0);
        this.i = getSharedPreferences("lock_app", Build.VERSION.SDK_INT < 11 ? 0 : 4);
        a();
        if (!TextUtils.isEmpty(this.i.getString("lock_email", ""))) {
            this.c.setText(this.i.getString("lock_email", ""));
        }
        String obj = this.c.getText().toString();
        if (obj != null && obj.length() > 0) {
            this.e.setEnabled(true);
        } else {
            this.e.setEnabled(false);
        }
        String obj2 = this.d.getText().toString();
        if (obj2 != null && obj2.length() > 0) {
            this.f.setEnabled(true);
        } else {
            this.f.setEnabled(false);
        }
    }

    private void a() {
        this.l = getResources().getIdentifier("send_but", "id", getPackageName());
        this.e = (Button) findViewById(this.l);
        this.l = getResources().getIdentifier("send_edit", "id", getPackageName());
        this.c = (EditText) findViewById(this.l);
        this.c.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            }

            @Override
            public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            }

            @Override
            public void afterTextChanged(Editable editable) {
                if (ForgetPwdActivity.this.f13753a) {
                    return;
                }
                String obj = ForgetPwdActivity.this.c.getText().toString();
                if (obj == null || obj.length() <= 0) {
                    ForgetPwdActivity.this.e.setEnabled(false);
                } else {
                    ForgetPwdActivity.this.e.setEnabled(true);
                }
            }
        });
        this.l = getResources().getIdentifier("code_but", "id", getPackageName());
        this.f = (Button) findViewById(this.l);
        this.l = getResources().getIdentifier("code_edit", "id", getPackageName());
        this.d = (EditText) findViewById(this.l);
        this.d.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            }

            @Override
            public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            }

            @Override
            public void afterTextChanged(Editable editable) {
                String obj = ForgetPwdActivity.this.d.getText().toString();
                if (obj == null || obj.length() <= 0) {
                    ForgetPwdActivity.this.f.setEnabled(false);
                } else {
                    ForgetPwdActivity.this.f.setEnabled(true);
                }
            }
        });
        this.l = getResources().getIdentifier("ib_back", "id", getPackageName());
        this.j = (ImageView) findViewById(this.l);
        this.l = getResources().getIdentifier("button_back_normal", "drawable", getPackageName());
        this.j.setImageResource(this.l);
        this.j.setOnClickListener(this);
        this.j.setTag("LockAppActivity_back");
        this.l = getResources().getIdentifier("hint_tv_forget", "id", getPackageName());
        this.g = (TextView) findViewById(this.l);
        this.l = getResources().getIdentifier("hint_tv_code", "id", getPackageName());
        this.h = (TextView) findViewById(this.l);
        this.e.setTag("send_but");
        this.f.setTag("code_but");
        this.l = getResources().getIdentifier("lock_but_bg", "drawable", getPackageName());
        Versioning.setBackground(this.e, getResources().getDrawable(this.l));
        this.l = getResources().getIdentifier("lock_but_bg", "drawable", getPackageName());
        Versioning.setBackground(this.f, getResources().getDrawable(this.l));
        this.e.setOnClickListener(this);
        this.f.setOnClickListener(this);
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        if (intent != null) {
            this.m = intent.getIntExtra(ParamKeyConstants.WebViewConstants.QUERY_FROM, 0);
        }
        this.d.setText("");
    }

    @Override
    public void onClick(View view) {
        boolean z;
        if (view.getTag() == "send_but") {
            String obj = this.c.getText().toString();
            if (a(obj)) {
                this.g.setVisibility(8);
                final JSONObject jSONObject = new JSONObject();
                this.f13753a = true;
                String string = this.i.getString("lock_email", null);
                if (string == null || string.length() == 0) {
                    this.i.edit().putString("lock_email", obj).commit();
                }
                try {
                    new Thread() {
                        @Override
                        public void run() {
                            int i = 60;
                            while (ForgetPwdActivity.this.f13753a) {
                                if (i <= 1) {
                                    try {
                                        ForgetPwdActivity.this.f13753a = false;
                                    } catch (InterruptedException e) {
                                        e.printStackTrace();
                                    }
                                }
                                i--;
                                Message obtain = Message.obtain();
                                obtain.arg1 = i;
                                obtain.what = 0;
                                ForgetPwdActivity.this.f13754b.sendMessage(obtain);
                                Thread.sleep(1000L);
                            }
                            ForgetPwdActivity.this.f13754b.sendEmptyMessage(1);
                        }
                    }.start();
                    jSONObject.put("lang", getResources().getConfiguration().locale.toString());
                    jSONObject.put("email", obj);
                    jSONObject.put("emId", "1");
                    new Thread() {
                        @Override
                        public void run() {
                            ForgetPwdActivity.this.a("http://password.goforandroid.com/password_service/api/v1/sendVerifyCodeEmail?prodKey=c9c404de&prodSecret=1a11e681db005056&clientVersion=" + GameUtil.g(ForgetPwdActivity.this), jSONObject.toString());
                            ForgetPwdActivity.this.k = ForgetPwdActivity.this.b();
                        }
                    }.start();
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            } else {
                this.g.setVisibility(0);
            }
            InputMethodManager inputMethodManager = (InputMethodManager) getSystemService("input_method");
            if (Build.VERSION.SDK_INT >= 3) {
                inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
                return;
            }
            return;
        }
        if (view.getTag() == "code_but") {
            String obj2 = this.d.getText().toString();
            this.k = "1";
            String string2 = this.i.getString("verify_code", null);
            if (!TextUtils.isEmpty(obj2) && !TextUtils.isEmpty(string2)) {
                try {
                    MessageDigest messageDigest = MessageDigest.getInstance("MD5");
                    messageDigest.update(obj2.getBytes());
                    byte[] digest = messageDigest.digest();
                    StringBuffer stringBuffer = new StringBuffer();
                    for (byte b2 : digest) {
                        stringBuffer.append(Integer.toString((b2 & 255) + 256, 16).substring(1));
                    }
                    z = string2.equals(stringBuffer.toString());
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
                if (!z) {
                    this.h.setVisibility(8);
                    this.i.edit().putString("lock_password", "").commit();
                    Intent intent = new Intent(this, (Class<?>) LockAppActivity.class);
                    Bundle extras = getIntent().getExtras();
                    if (extras != null) {
                        intent.putExtras(extras);
                    }
                    intent.putExtra(ParamKeyConstants.WebViewConstants.QUERY_FROM, this.m);
                    startActivity(intent);
                    InputMethodManager inputMethodManager2 = (InputMethodManager) getSystemService("input_method");
                    if (Build.VERSION.SDK_INT >= 3) {
                        inputMethodManager2.hideSoftInputFromWindow(this.d.getWindowToken(), 0);
                    }
                    finish();
                    return;
                }
                this.h.setVisibility(0);
                return;
            }
            z = false;
            if (!z) {
            }
        } else if ("LockAppActivity_back".equals(view.getTag())) {
            InputMethodManager inputMethodManager3 = (InputMethodManager) getSystemService("input_method");
            if (Build.VERSION.SDK_INT >= 3) {
                inputMethodManager3.hideSoftInputFromWindow(view.getWindowToken(), 0);
            }
            finish();
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        this.f13753a = false;
        if (this.f13754b != null) {
            this.f13754b.removeMessages(0);
            this.f13754b.removeMessages(1);
        }
    }

    public boolean a(String str) {
        return Pattern.compile("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$").matcher(str).matches();
    }
}