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

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


package com.excelliance.kxqp.pay.ali;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.AnimationDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.excelliance.kxqp.payer.ali.AliPay;
import com.excelliance.kxqp.sdk.StatisticOperation;
import com.excelliance.kxqp.ui.c;
import com.excelliance.kxqp.ui.view.MoneyView;
import com.excelliance.kxqp.user.LoginActivity;
import com.excelliance.kxqp.util.aj;
import com.umeng.analytics.pro.d;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Map;
import org.apache.http.client.utils.URLEncodedUtils;

public class PayMoreCountsActivity extends Activity implements View.OnClickListener {

    private String f12647a;

    private Context f12648b;
    private ImageView c;
    private Button d;
    private ImageView e;
    private MoneyView f;
    private RelativeLayout g;
    private RadioButton h;
    private RadioButton i;
    private SharedPreferences.Editor j;
    private long l;
    private Handler k = new Handler() {
        @Override
        public void handleMessage(Message message) {
            int identifier;
            switch (message.what) {
                case 1:
                    a aVar = new a((Map) message.obj);
                    String i = aVar.i();
                    String g = aVar.g();
                    String h = aVar.h();
                    String f = aVar.f();
                    String d = aVar.d();
                    String e = aVar.e();
                    String c = aVar.c();
                    if (TextUtils.equals(i, "9000")) {
                        StatisticOperation.getInstance();
                        StatisticOperation.uploadDataByType(PayMoreCountsActivity.this.f12648b, 19);
                        if (TextUtils.isEmpty(g) || TextUtils.isEmpty(h)) {
                            return;
                        }
                        b.a(h, g, "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB", "UTF-8");
                        int identifier2 = PayMoreCountsActivity.this.getResources().getIdentifier("pay_over_success", "string", PayMoreCountsActivity.this.f12647a);
                        if (identifier2 > 0) {
                            c.a(PayMoreCountsActivity.this.f12648b, identifier2, c.f13996a);
                        }
                        if (TextUtils.equals(c, String.valueOf("68.00"))) {
                            PayMoreCountsActivity.this.a((Object) "year match....");
                            aj.a().a(PayMoreCountsActivity.this.f12648b, 2);
                        } else if (TextUtils.equals(c, String.valueOf("6.80"))) {
                            PayMoreCountsActivity.this.a((Object) "month match....");
                            aj.a().a(PayMoreCountsActivity.this.f12648b, 3);
                        } else {
                            PayMoreCountsActivity.this.a((Object) "no match....");
                            aj.a().a(PayMoreCountsActivity.this.f12648b, 3);
                        }
                        PayMoreCountsActivity.this.j.putString("aliTrade", d).commit();
                        PayMoreCountsActivity.this.j.putString("ourTrade", e).commit();
                        PayMoreCountsActivity.this.j.putString(com.alipay.sdk.tid.b.f, f).commit();
                        PayMoreCountsActivity.this.j.putBoolean("first_pop_dialog", true).commit();
                        PayMoreCountsActivity.this.e();
                        return;
                    }
                    if (TextUtils.equals(i, "8000") || TextUtils.equals(i, "6004")) {
                        PayMoreCountsActivity.this.a(true);
                        PayMoreCountsActivity.this.d();
                        return;
                    }
                    StatisticOperation.getInstance();
                    StatisticOperation.uploadDataByType(PayMoreCountsActivity.this.f12648b, 20);
                    int identifier3 = PayMoreCountsActivity.this.getResources().getIdentifier("pay_over_exception1", "string", PayMoreCountsActivity.this.f12647a);
                    if (identifier3 > 0) {
                        c.a(PayMoreCountsActivity.this.f12648b, identifier3, c.f13996a);
                        return;
                    }
                    return;
                case 2:
                    String valueOf = String.valueOf(message.obj);
                    if (valueOf.equals("net error")) {
                        int identifier4 = PayMoreCountsActivity.this.getResources().getIdentifier("pay_over_exception3", "string", PayMoreCountsActivity.this.f12647a);
                        if (identifier4 > 0) {
                            c.a(PayMoreCountsActivity.this.f12648b, identifier4, c.f13996a);
                        }
                    } else if (valueOf.equals("sign error")) {
                        int identifier5 = PayMoreCountsActivity.this.getResources().getIdentifier("pay_over_exception4", "string", PayMoreCountsActivity.this.f12647a);
                        if (identifier5 > 0) {
                            c.a(PayMoreCountsActivity.this.f12648b, identifier5, c.f13996a);
                        }
                    } else if (valueOf.equals(d.O) && (identifier = PayMoreCountsActivity.this.getResources().getIdentifier("pay_over_exception5", "string", PayMoreCountsActivity.this.f12647a)) > 0) {
                        c.a(PayMoreCountsActivity.this.f12648b, identifier, c.f13996a);
                    }
                    PayMoreCountsActivity.this.a(false);
                    return;
                case 3:
                    int i2 = message.arg1;
                    if (i2 == 3) {
                        StatisticOperation.getInstance();
                        StatisticOperation.uploadDataByType(PayMoreCountsActivity.this.f12648b, 19);
                        PayMoreCountsActivity.this.a(false);
                        int identifier6 = PayMoreCountsActivity.this.getResources().getIdentifier("pay_over_success", "string", PayMoreCountsActivity.this.f12647a);
                        if (identifier6 > 0) {
                            c.a(PayMoreCountsActivity.this.f12648b, identifier6, c.f13996a);
                        }
                        PayMoreCountsActivity.this.e();
                        return;
                    }
                    if (i2 == 4) {
                        int identifier7 = PayMoreCountsActivity.this.getResources().getIdentifier("pay_over_exception1", "string", PayMoreCountsActivity.this.f12647a);
                        if (identifier7 > 0) {
                            c.a(PayMoreCountsActivity.this.f12648b, identifier7, c.f13996a);
                        }
                        PayMoreCountsActivity.this.a(false);
                        return;
                    }
                    int identifier8 = PayMoreCountsActivity.this.getResources().getIdentifier("pay_over_exception3", "string", PayMoreCountsActivity.this.f12647a);
                    if (identifier8 > 0) {
                        c.a(PayMoreCountsActivity.this.f12648b, identifier8, c.f13996a);
                    }
                    PayMoreCountsActivity.this.a(false);
                    return;
                default:
                    return;
            }
        }
    };
    private HttpURLConnection m = null;

    public void a(Object obj) {
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        this.f12648b = this;
        this.f12647a = getPackageName();
        int identifier = getResources().getIdentifier("pay_main", "layout", this.f12647a);
        if (identifier > 0) {
            setContentView(identifier);
        }
        this.j = this.f12648b.getSharedPreferences("alipay", Build.VERSION.SDK_INT < 11 ? 0 : 4).edit();
        a();
    }

    private void a() {
        this.c = (ImageView) findViewById(getResources().getIdentifier("pay_nav_back", "id", this.f12647a));
        this.c.setImageResource(getResources().getIdentifier("button_back_normal", "drawable", this.f12647a));
        this.c.setOnClickListener(this);
        this.c.setTag(1);
        this.d = (Button) findViewById(getResources().getIdentifier("pay_but", "id", this.f12647a));
        this.d.setOnClickListener(this);
        this.d.setTag(2);
        this.g = (RelativeLayout) findViewById(getResources().getIdentifier("progress_layout", "id", this.f12647a));
        this.e = (ImageView) findViewById(getResources().getIdentifier("progerss_img", "id", this.f12647a));
        this.f = (MoneyView) findViewById(getResources().getIdentifier("moneyView", "id", this.f12647a));
        ((TextView) findViewById(getResources().getIdentifier("month_charge_tv", "id", this.f12647a))).getPaint().setFlags(17);
        ((TextView) findViewById(getResources().getIdentifier("year_charge_tv", "id", this.f12647a))).getPaint().setFlags(17);
        this.i = (RadioButton) findViewById(getResources().getIdentifier("yearRadio", "id", this.f12647a));
        this.i.setTag(3);
        this.i.setOnClickListener(this);
        this.i.setChecked(true);
        this.h = (RadioButton) findViewById(getResources().getIdentifier("monthRadio", "id", this.f12647a));
        this.h.setTag(4);
        this.h.setOnClickListener(this);
        RelativeLayout relativeLayout = (RelativeLayout) findViewById(getResources().getIdentifier("yearRelative", "id", this.f12647a));
        relativeLayout.setTag(3);
        relativeLayout.setOnClickListener(this);
        RelativeLayout relativeLayout2 = (RelativeLayout) findViewById(getResources().getIdentifier("monthRelative", "id", this.f12647a));
        relativeLayout2.setTag(4);
        relativeLayout2.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (Integer.valueOf(view.getTag().toString()).intValue()) {
            case 1:
                a("BACK_TAG.....");
                finish();
                return;
            case 2:
                if (aj.a().b(this.f12648b)) {
                    String c = c();
                    if ("68.00".equals(c)) {
                        StatisticOperation.getInstance();
                        StatisticOperation.uploadDataByType(this.f12648b, 18);
                    } else if ("6.80".equals(c)) {
                        StatisticOperation.getInstance();
                        StatisticOperation.uploadDataByType(this.f12648b, 17);
                    }
                    Map<String, String> a2 = b.a(this.f12648b, "", c);
                    a("PAY_TAG.....");
                    if (a2 == null || a2.size() <= 0) {
                        return;
                    }
                    a(true);
                    this.l = 0L;
                    this.l = System.currentTimeMillis();
                    a(a2);
                    return;
                }
                this.f12648b.startActivity(new Intent(this.f12648b, (Class<?>) LoginActivity.class));
                overridePendingTransition(getResources().getIdentifier("slide_left_in", "anim", getPackageName()), 0);
                return;
            case 3:
                a(3);
                return;
            case 4:
                a(4);
                return;
            default:
                return;
        }
    }

    private void a(int i) {
        if (this.i == null || this.h == null || this.f == null) {
            return;
        }
        b();
        if (i == 3) {
            this.i.setChecked(true);
            this.f.setMenoy("¥" + String.valueOf("68.00"));
            this.f.requestLayout();
            return;
        }
        this.h.setChecked(true);
        this.f.setMenoy("¥" + String.valueOf("6.80"));
        this.f.requestLayout();
    }

    private void b() {
        this.i.setChecked(false);
        this.h.setChecked(false);
    }

    private String c() {
        if (this.i.isChecked()) {
            return "68.00";
        }
        if (this.h.isChecked()) {
            return "6.80";
        }
        return null;
    }

    private void a(Map<String, String> map) {
        final String a2 = b.a(map);
        String b2 = b.b(map);
        a((Object) ("orderParam: " + b2));
        final String c = b.c(b2);
        a((Object) ("encodeOrderParam: " + c));
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    boolean a3 = PayMoreCountsActivity.this.a("http://mto.multiopen.cn/alipay_rsasign.php");
                    PayMoreCountsActivity.this.a((Object) ("b: " + a3));
                    if (a3 && PayMoreCountsActivity.this.m != null) {
                        if (c != null) {
                            DataOutputStream dataOutputStream = new DataOutputStream(PayMoreCountsActivity.this.m.getOutputStream());
                            PayMoreCountsActivity.this.a((Object) ("out: " + dataOutputStream));
                            dataOutputStream.writeBytes(c);
                            dataOutputStream.flush();
                            dataOutputStream.close();
                        }
                        if (PayMoreCountsActivity.this.m.getResponseCode() == 200) {
                            String str = "";
                            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(PayMoreCountsActivity.this.m.getInputStream()));
                            while (true) {
                                String readLine = bufferedReader.readLine();
                                if (readLine == null) {
                                    break;
                                }
                                str = str + readLine;
                            }
                            bufferedReader.close();
                            if (!TextUtils.isEmpty(str)) {
                                PayMoreCountsActivity.this.a("sign=" + URLEncoder.encode(b.c(str, "base64"), "UTF-8"), a2);
                                return;
                            }
                            throw new Exception("sign error");
                        }
                        throw new Exception("net error");
                    }
                    throw new Exception("net error");
                } catch (Exception e) {
                    Log.d(AliPay.TAG, "e:" + e);
                    Message message = new Message();
                    message.what = 2;
                    if (e.equals("net error")) {
                        message.obj = "net error";
                    } else if (e.equals("sign error")) {
                        message.obj = "sign error";
                    } else {
                        message.obj = d.O;
                    }
                    PayMoreCountsActivity.this.k.sendMessage(message);
                }
            }
        }).start();
    }

    public void a(String str, String str2) {
        try {
            long currentTimeMillis = System.currentTimeMillis() - this.l;
            Message message = new Message();
            message.what = 2;
            message.obj = "cancle";
            this.k.sendMessageDelayed(message, currentTimeMillis > 1000 ? 0L : 1000 - currentTimeMillis);
            a((Object) ("sign: " + str));
            a((Object) ("orderParamUTF: " + str2));
            String str3 = str2 + com.alipay.sdk.sys.a.f472b + str;
            Object a2 = a(new Class[]{Activity.class}, new Object[]{this}, "com.alipay.sdk.app.PayTask");
            a((Object) ("payTask:" + a2));
            Map map = (Map) a(new Class[]{String.class, Boolean.TYPE}, new Object[]{str3, true}, "payV2", a2);
            a((Object) ("result:" + map));
            Message message2 = new Message();
            message2.what = 1;
            message2.obj = map;
            this.k.sendMessage(message2);
        } catch (Exception e) {
            e.printStackTrace();
            a((Object) ("e:" + e));
            Message message3 = new Message();
            message3.what = 2;
            message3.obj = d.O;
            this.k.sendMessage(message3);
        }
    }

    public boolean a(String str) {
        try {
            this.m = null;
            HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
            httpURLConnection.setDoOutput(true);
            httpURLConnection.setDoInput(true);
            httpURLConnection.setRequestMethod("POST");
            httpURLConnection.setUseCaches(false);
            httpURLConnection.setInstanceFollowRedirects(true);
            httpURLConnection.setConnectTimeout(30000);
            httpURLConnection.setReadTimeout(30000);
            httpURLConnection.setRequestProperty("Content-Type", URLEncodedUtils.CONTENT_TYPE);
            this.m = httpURLConnection;
            return true;
        } catch (Exception unused) {
            return false;
        }
    }

    public void a(boolean z) {
        if (this.g == null || this.e == null) {
            return;
        }
        AnimationDrawable animationDrawable = (AnimationDrawable) this.e.getDrawable();
        if (z) {
            this.g.setVisibility(0);
            this.g.setFocusable(true);
            animationDrawable.start();
        } else {
            this.g.setVisibility(8);
            this.g.setFocusable(false);
            animationDrawable.stop();
        }
    }

    public void d() {
        final Message obtainMessage = this.k.obtainMessage();
        obtainMessage.what = 3;
        try {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    try {
                        Thread.sleep(5000L);
                        a b2 = com.excelliance.kxqp.pay.share.b.a().b(PayMoreCountsActivity.this.f12648b);
                        int b3 = b2.b();
                        int a2 = b2.a();
                        PayMoreCountsActivity.this.a((Object) ("type:" + b3));
                        if (a2 > 0) {
                            if (b3 != 0 && b3 < 4) {
                                aj.a().a(PayMoreCountsActivity.this.f12648b, b3);
                                obtainMessage.arg1 = 3;
                            } else {
                                obtainMessage.arg1 = 4;
                            }
                            PayMoreCountsActivity.this.k.sendMessage(obtainMessage);
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                        obtainMessage.arg1 = 4;
                        PayMoreCountsActivity.this.k.sendMessage(obtainMessage);
                    }
                }
            }).start();
        } catch (Exception e) {
            e.printStackTrace();
            obtainMessage.arg1 = 4;
            this.k.sendMessage(obtainMessage);
        }
    }

    public void e() {
        String stringExtra = getIntent().getStringExtra("targetActivity");
        String stringExtra2 = getIntent().getStringExtra("activity");
        Intent intent = new Intent();
        if (stringExtra != null) {
            if (stringExtra.contains("HelloActivity")) {
                intent.setComponent(new ComponentName(getPackageName(), stringExtra));
            } else {
                aj.a().a(this.f12648b, true);
                finish();
                return;
            }
        } else if (stringExtra2 != null) {
            intent.setComponent(new ComponentName(getPackageName(), stringExtra2));
        } else {
            aj.a().a(this.f12648b, true);
            finish();
            return;
        }
        intent.setPackage(this.f12647a);
        startActivity(intent);
        int identifier = this.f12648b.getResources().getIdentifier("zoom_in", "anim", this.f12648b.getPackageName());
        if (identifier != 0) {
            overridePendingTransition(identifier, 0);
        }
        finish();
    }

    private Object a(Class[] clsArr, Object[] objArr, String str) throws Exception {
        return Class.forName(str, false, getApplication().getClassLoader()).getDeclaredConstructor(clsArr).newInstance(objArr);
    }

    private Object a(Class[] clsArr, Object[] objArr, String str, Object obj) throws Exception {
        return obj.getClass().getMethod(str, clsArr).invoke(obj, objArr);
    }

    @Override
    public void onBackPressed() {
        String stringExtra = getIntent().getStringExtra("activity");
        Intent intent = new Intent();
        if (stringExtra != null) {
            if (stringExtra.contains("MainActivity")) {
                intent.setComponent(new ComponentName(getPackageName(), stringExtra));
                intent.setFlags(268435456);
                intent.setPackage(this.f12647a);
                startActivity(intent);
                finish();
                return;
            }
            finish();
            return;
        }
        finish();
    }
}