OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 MyVipActivity.java 源代码,内容仅作参考
package com.excelliance.kxqp.user;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Color;
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.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.excelliance.kxqp.gs.g.aa;
import com.excelliance.kxqp.sdk.StatisticOperation;
import com.excelliance.kxqp.ui.c;
import com.excelliance.kxqp.util.ToastUtil;
import com.excelliance.kxqp.util.ac;
import com.excelliance.kxqp.util.aj;
import com.excelliance.kxqp.util.as;
import com.excelliance.kxqp.util.n;
import com.excelliance.kxqp.util.t;
import com.umeng.analytics.pro.d;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.File;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import org.apache.http.HttpStatus;
import org.apache.http.client.utils.URLEncodedUtils;
import org.json.JSONException;
import org.json.JSONObject;
public class MyVipActivity extends Activity implements View.OnClickListener {
private Context f14789b;
private String c;
private View d;
private TextView e;
private TextView f;
private RelativeLayout g;
private ImageView h;
private TextView i;
private TextView j;
private SharedPreferences k;
private ImageView l;
private ImageView m;
private ImageView n;
private TextView o;
private long p;
private SharedPreferences.Editor q;
private TextView r;
RelativeLayout f14788a = null;
private Handler s = new Handler() {
@Override
public void handleMessage(Message message) {
int identifier;
switch (message.what) {
case 1:
com.excelliance.kxqp.pay.ali.a aVar = new com.excelliance.kxqp.pay.ali.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(MyVipActivity.this.f14789b, 11);
if (TextUtils.isEmpty(g) || TextUtils.isEmpty(h)) {
return;
}
com.excelliance.kxqp.pay.ali.b.a(h, g, "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB", "UTF-8");
int identifier2 = MyVipActivity.this.getResources().getIdentifier("pay_over_success", "string", MyVipActivity.this.c);
if (identifier2 > 0) {
c.a(MyVipActivity.this.f14789b, identifier2, c.f13996a);
}
if (TextUtils.equals(c, String.valueOf("68.00"))) {
MyVipActivity.this.a((Object) "year match....");
MyVipActivity.this.d("68.00");
aj.a().a(MyVipActivity.this.f14789b, 2);
} else if (TextUtils.equals(c, String.valueOf("6.80"))) {
MyVipActivity.this.a((Object) "month match....");
MyVipActivity.this.d("6.80");
aj.a().a(MyVipActivity.this.f14789b, 3);
} else {
MyVipActivity.this.a((Object) "no match....");
MyVipActivity.this.d("6.80");
aj.a().a(MyVipActivity.this.f14789b, 3);
}
MyVipActivity.this.k.edit().putInt("HASEXPIRATION", 0).commit();
MyVipActivity.this.q.putString("aliTrade", d).commit();
MyVipActivity.this.q.putString("ourTrade", e).commit();
MyVipActivity.this.q.putString(com.alipay.sdk.tid.b.f, f).commit();
MyVipActivity.this.q.putBoolean("first_pop_dialog", true).commit();
MyVipActivity.this.e();
return;
}
if (TextUtils.equals(i, "8000") || TextUtils.equals(i, "6004")) {
MyVipActivity.this.a(true);
MyVipActivity.this.d();
return;
}
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(MyVipActivity.this.f14789b, 12);
int identifier3 = MyVipActivity.this.getResources().getIdentifier("pay_over_exception1", "string", MyVipActivity.this.c);
if (identifier3 > 0) {
c.a(MyVipActivity.this.f14789b, identifier3, c.f13996a);
return;
}
return;
case 2:
String valueOf = String.valueOf(message.obj);
if (valueOf.equals("net error")) {
int identifier4 = MyVipActivity.this.getResources().getIdentifier("pay_over_exception3", "string", MyVipActivity.this.c);
if (identifier4 > 0) {
c.a(MyVipActivity.this.f14789b, identifier4, c.f13996a);
}
} else if (valueOf.equals("sign error")) {
int identifier5 = MyVipActivity.this.getResources().getIdentifier("pay_over_exception4", "string", MyVipActivity.this.c);
if (identifier5 > 0) {
c.a(MyVipActivity.this.f14789b, identifier5, c.f13996a);
}
} else if (valueOf.equals(d.O) && (identifier = MyVipActivity.this.getResources().getIdentifier("pay_over_exception5", "string", MyVipActivity.this.c)) > 0) {
c.a(MyVipActivity.this.f14789b, identifier, c.f13996a);
}
MyVipActivity.this.a(false);
return;
case 3:
int i2 = message.arg1;
if (i2 == 3) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(MyVipActivity.this.f14789b, 11);
MyVipActivity.this.a(false);
int identifier6 = MyVipActivity.this.getResources().getIdentifier("pay_over_success", "string", MyVipActivity.this.c);
if (identifier6 > 0) {
c.a(MyVipActivity.this.f14789b, identifier6, c.f13996a);
}
MyVipActivity.this.e();
return;
}
if (i2 == 4) {
int identifier7 = MyVipActivity.this.getResources().getIdentifier("pay_over_exception1", "string", MyVipActivity.this.c);
if (identifier7 > 0) {
c.a(MyVipActivity.this.f14789b, identifier7, c.f13996a);
}
MyVipActivity.this.a(false);
return;
}
int identifier8 = MyVipActivity.this.getResources().getIdentifier("pay_over_exception3", "string", MyVipActivity.this.c);
if (identifier8 > 0) {
c.a(MyVipActivity.this.f14789b, identifier8, c.f13996a);
}
MyVipActivity.this.a(false);
return;
default:
return;
}
}
};
private HttpURLConnection t = null;
public void a(Object obj) {
}
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.f14789b = this;
this.c = getPackageName();
this.k = getSharedPreferences("USERINFO", Build.VERSION.SDK_INT < 11 ? 0 : 4);
this.q = getSharedPreferences("alipay", Build.VERSION.SDK_INT < 11 ? 0 : 4).edit();
this.d = com.excelliance.kxqp.swipe.a.a.getLayout(this.f14789b, "activity_my_vip");
if (this.d != null) {
setContentView(this.d);
c();
a(this.k);
}
}
public String b(String str) {
return new SimpleDateFormat("yyyy.MM.dd").format(new Date(Long.parseLong(str + "000")));
}
@Override
protected void onResume() {
super.onResume();
if (aj.a().c(this.k, n.c)) {
boolean c = aj.a().c(this.f14789b);
Bitmap a2 = com.excelliance.kxqp.photo_selector.c.a.a(com.excelliance.kxqp.photo_selector.c.a.b(this.f14789b) + File.separator + "usericon" + aj.a().a(this.f14789b), HttpStatus.SC_BAD_REQUEST, HttpStatus.SC_BAD_REQUEST);
if (a2 != null) {
Log.d("MyVipActivity", "头像已存在,直接设置");
this.h.setImageBitmap(com.excelliance.kxqp.photo_selector.c.a.a(a2, HttpStatus.SC_BAD_REQUEST, HttpStatus.SC_BAD_REQUEST, 0, 0));
} else {
this.h.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(this.f14789b, "icon_login"));
}
if (this.l != null) {
int b2 = aj.a().b(this.k, n.e);
if (b2 == 1) {
this.l.setVisibility(0);
this.l.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(this.f14789b, "man_superscript"));
} else if (b2 == 2) {
this.l.setVisibility(0);
this.l.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(this.f14789b, "woman_superscript"));
} else {
this.l.setVisibility(8);
}
}
if (this.r != null) {
if (c) {
this.r.setText(com.excelliance.kxqp.swipe.a.a.getString(this.f14789b, "has_power"));
return;
} else {
this.r.setText(com.excelliance.kxqp.swipe.a.a.getString(this.f14789b, "vip_power"));
return;
}
}
return;
}
this.h.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(this.f14789b, "icon_unlogin"));
}
private void c() {
t a2 = t.a(this.f14789b);
this.m = (ImageView) a2.a(this.d, "iv_back", 0);
this.m.setOnClickListener(this);
this.e = (TextView) a2.a(this.d, "tv_year_pay", 1);
if (this.e != null) {
this.e.setOnClickListener(this);
}
this.f = (TextView) a2.a(this.d, "tv_month_pay", 2);
if (this.f != null) {
this.f.setOnClickListener(this);
}
this.g = (RelativeLayout) a2.a(this.d, "rl_common_question", 3);
if (this.g != null) {
this.g.setOnClickListener(this);
}
this.o = (TextView) a2.a("tv_nickname", this.d);
if (this.o != null) {
String a3 = aj.a().a(this.k, n.d);
this.o.setVisibility(0);
this.o.setText(a3);
}
this.h = (ImageView) a2.a("iv_icon", this.d);
this.i = (TextView) a2.a("tv_pre", this.d);
this.j = (TextView) a2.a("tv_time", this.d);
this.l = (ImageView) a2.a("iv_sex", this.d);
((TextView) a2.a("tv_old_year", this.d)).getPaint().setFlags(16);
((TextView) a2.a("tv_old_month", this.d)).getPaint().setFlags(16);
this.f14788a = (RelativeLayout) a2.a("progress_layout", this.d);
this.n = (ImageView) a2.a("progerss_img", this.d);
this.r = (TextView) a2.a("tv_power", this.d);
TextView textView = (TextView) a2.a("price_year", this.d);
textView.setText(" " + textView.getText().toString() + " ");
TextView textView2 = (TextView) a2.a("price_month", this.d);
textView2.setText(" " + textView2.getText().toString() + " ");
}
@Override
public void onClick(View view) {
switch (Integer.valueOf(view.getTag().toString()).intValue()) {
case 0:
finish();
return;
case 1:
c("68.00");
return;
case 2:
c("6.80");
return;
case 3:
startActivity(new Intent(this.f14789b, (Class<?>) VipCommonQuestionAskActivity.class));
overridePendingTransition(getResources().getIdentifier("slide_left_int", "anim", getPackageName()), getResources().getIdentifier("slide_left_out", "anim", getPackageName()));
return;
default:
return;
}
}
private void c(String str) {
if (aj.a().b(this.f14789b)) {
if ("68.00".equals(str)) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f14789b, 10);
} else if ("6.80".equals(str)) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f14789b, 9);
}
Map<String, String> a2 = com.excelliance.kxqp.pay.ali.b.a(this.f14789b, "", str);
if (a2 == null || a2.size() <= 0) {
return;
}
a(true);
this.p = 0L;
this.p = System.currentTimeMillis();
a(a2);
return;
}
this.f14789b.startActivity(new Intent(this.f14789b, (Class<?>) LoginActivity.class));
overridePendingTransition(getResources().getIdentifier("slide_left_int", "anim", getPackageName()), 0);
}
private void a(Map<String, String> map) {
final String a2 = com.excelliance.kxqp.pay.ali.b.a(map);
String b2 = com.excelliance.kxqp.pay.ali.b.b(map);
a((Object) ("orderParam: " + b2));
final String c = com.excelliance.kxqp.pay.ali.b.c(b2);
a((Object) ("encodeOrderParam: " + c));
new Thread(new Runnable() {
@Override
public void run() {
try {
boolean a3 = MyVipActivity.this.a("http://mto.multiopen.cn/alipay_rsasign.php");
MyVipActivity.this.a((Object) ("b: " + a3));
if (a3 && MyVipActivity.this.t != null) {
if (c != null) {
DataOutputStream dataOutputStream = new DataOutputStream(MyVipActivity.this.t.getOutputStream());
MyVipActivity.this.a((Object) ("out: " + dataOutputStream));
dataOutputStream.writeBytes(c);
dataOutputStream.flush();
dataOutputStream.close();
}
if (MyVipActivity.this.t.getResponseCode() == 200) {
String str = "";
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(MyVipActivity.this.t.getInputStream()));
while (true) {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
}
str = str + readLine;
}
bufferedReader.close();
if (!TextUtils.isEmpty(str)) {
MyVipActivity.this.a("sign=" + URLEncoder.encode(com.excelliance.kxqp.pay.ali.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("MyVipActivity", "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;
}
MyVipActivity.this.s.sendMessage(message);
}
}
}).start();
}
public void a(String str, String str2) {
try {
long currentTimeMillis = System.currentTimeMillis() - this.p;
Message message = new Message();
message.what = 2;
message.obj = "cancle";
this.s.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.s.sendMessage(message2);
} catch (Exception e) {
e.printStackTrace();
a((Object) ("e:" + e));
Message message3 = new Message();
message3.what = 2;
message3.obj = d.O;
this.s.sendMessage(message3);
}
}
public void d() {
final Message obtainMessage = this.s.obtainMessage();
obtainMessage.what = 3;
try {
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(5000L);
com.excelliance.kxqp.pay.ali.a b2 = com.excelliance.kxqp.pay.share.b.a().b(MyVipActivity.this.f14789b);
int b3 = b2.b();
int a2 = b2.a();
MyVipActivity.this.a((Object) ("type:" + b3));
if (a2 > 0) {
if (b3 != 0 && b3 < 4) {
aj.a().a(MyVipActivity.this.f14789b, b3);
if (b3 == 2) {
MyVipActivity.this.d("68.00");
} else {
MyVipActivity.this.d("6.80");
}
MyVipActivity.this.k.edit().putInt("HASEXPIRATION", 0).commit();
obtainMessage.arg1 = 3;
} else {
obtainMessage.arg1 = 4;
}
MyVipActivity.this.s.sendMessage(obtainMessage);
}
} catch (Exception e) {
e.printStackTrace();
obtainMessage.arg1 = 4;
MyVipActivity.this.s.sendMessage(obtainMessage);
}
}
}).start();
} catch (Exception e) {
e.printStackTrace();
obtainMessage.arg1 = 4;
this.s.sendMessage(obtainMessage);
}
}
public void d(String str) {
int max = Math.max(a(), b());
if (max == 0) {
return;
}
if (str.equals("68.00")) {
this.j.setText(b((max + 31104000) + ""));
return;
}
this.j.setText(b((max + 2592000) + ""));
}
public boolean a(String str) {
try {
this.t = 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.t = httpURLConnection;
return true;
} catch (Exception unused) {
return false;
}
}
public void a(boolean z) {
if (this.f14788a == null || this.n == null) {
return;
}
AnimationDrawable animationDrawable = (AnimationDrawable) this.n.getDrawable();
if (z) {
this.f14788a.setVisibility(0);
this.f14788a.setFocusable(true);
animationDrawable.start();
} else {
this.f14788a.setVisibility(8);
this.f14788a.setFocusable(false);
animationDrawable.stop();
}
}
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.f14789b, true);
finish();
return;
}
} else if (stringExtra2 != null) {
intent.setComponent(new ComponentName(getPackageName(), stringExtra2));
} else {
aj.a().a(this.f14789b, true);
finish();
return;
}
intent.setPackage(this.c);
startActivity(intent);
int identifier = this.f14789b.getResources().getIdentifier("zoom_in", "anim", this.f14789b.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 finish() {
super.finish();
overridePendingTransition(0, getResources().getIdentifier("slide_right_out", "anim", getPackageName()));
}
@Override
public void onBackPressed() {
super.onBackPressed();
finish();
}
private void a(SharedPreferences sharedPreferences) {
String a2 = as.a().a(sharedPreferences, this.f14789b);
if (TextUtils.isEmpty(a2)) {
ToastUtil.showToast(this.f14789b, com.excelliance.kxqp.swipe.a.a.getString(this.f14789b, "server_exception"));
return;
}
Log.d("MyVipActivity", "requestParams = " + a2);
String a3 = com.excelliance.kxqp.util.b.a(a2);
a(true);
ac.a().a("http://folder.appota.cn/difflogin.php", a3, new ac.a() {
@Override
public void a(String str) {
Log.d("MyVipActivity", "success " + str);
if (TextUtils.isEmpty(str)) {
Log.d("MyVipActivity", "server return empty");
MyVipActivity.this.a(false);
return;
}
try {
JSONObject jSONObject = new JSONObject(str);
int optInt = jSONObject.optInt("flag");
int optInt2 = jSONObject.optInt("vip");
Log.d("MyVipActivity", "flag = " + optInt + "v_p = " + optInt2);
String optString = jSONObject.optString("endtime");
String optString2 = jSONObject.optString("current");
if (!TextUtils.isEmpty(optString)) {
MyVipActivity.this.b(Integer.parseInt(optString));
}
if (!TextUtils.isEmpty(optString2)) {
MyVipActivity.this.a(Integer.parseInt(optString2));
}
if (optInt == 1) {
aa.a(MyVipActivity.this.f14789b).a(optInt2);
Log.d("MyVipActivity", "无其他设备登录该账号");
if (optInt2 == 4) {
MyVipActivity.this.i.setVisibility(0);
MyVipActivity.this.i.setTextColor(Color.parseColor("#FF0000"));
String string = com.excelliance.kxqp.swipe.a.a.getString(MyVipActivity.this.f14789b, "has_due_time");
if (!TextUtils.isEmpty(string)) {
MyVipActivity.this.i.setText(string);
}
} else if (optInt2 <= 1) {
MyVipActivity.this.i.setVisibility(8);
MyVipActivity.this.j.setVisibility(8);
} else {
Log.d("MyVipActivity", "endtime = " + optString);
if (!TextUtils.isEmpty(optString)) {
String b2 = MyVipActivity.this.b(optString);
MyVipActivity.this.i.setVisibility(0);
MyVipActivity.this.j.setVisibility(0);
MyVipActivity.this.j.setText(b2);
}
}
MyVipActivity.this.a(false);
return;
}
Log.d("MyVipActivity", "先不管");
MyVipActivity.this.a(false);
} catch (JSONException e) {
e.printStackTrace();
Log.d("MyVipActivity", "json exception");
MyVipActivity.this.a(false);
}
}
@Override
public void b(String str) {
Log.d("MyVipActivity", "failed = " + str);
MyVipActivity.this.a(false);
}
});
}
public void a(int i) {
this.k.edit().putInt("vip_current_time", i).commit();
}
public void b(int i) {
this.k.edit().putInt("vip_close_time", i).commit();
}
public int a() {
return this.k.getInt("vip_current_time", 0);
}
public int b() {
return this.k.getInt("vip_close_time", 0);
}
}