OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 ShareForPay.java 源代码,内容仅作参考
package com.excelliance.kxqp.pay.share;
import android.app.Activity;
import android.app.Application;
import android.app.Dialog;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.excelliance.kxqp.GameUtil;
import com.excelliance.kxqp.VersionManager;
import com.excelliance.kxqp.platforms.ExcellianceAppInfo;
import com.excelliance.kxqp.sdk.StatisticOperation;
import com.excelliance.kxqp.ui.BaseActivity;
import com.excelliance.kxqp.ui.InitialData;
import com.excelliance.kxqp.ui.c;
import com.excelliance.kxqp.util.CustomNoticeDialogUtil;
import com.excelliance.kxqp.util.aj;
import com.excelliance.kxqp.util.p;
import com.excelliance.staticslio.StatisticsManager;
import com.tencent.connect.common.Constants;
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.http.protocol.HTTP;
public class ShareForPay extends BaseActivity implements View.OnClickListener {
private String e;
private Context f;
private SharedPreferences l;
private Intent m;
private Intent n;
private Map<String, ResolveInfo> o;
RelativeLayout f12664a = null;
TextView f12665b = null;
TextView c = null;
private int g = 0;
private boolean h = false;
private boolean i = false;
private Dialog j = null;
private Dialog k = null;
private int p = -1;
Handler d = new Handler() {
@Override
public void handleMessage(Message message) {
a aVar = (a) message.obj;
switch (message.what) {
case 1:
ShareForPay.this.a(aVar, ShareForPay.this.f);
if (!TextUtils.isEmpty(b.a().d(ShareForPay.this.f))) {
ShareForPay.this.f();
}
ShareForPay.this.j();
ShareForPay.this.a(aVar);
return;
case 2:
ShareForPay.this.b(aVar);
return;
default:
return;
}
}
};
private void a(Object obj) {
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.e = getPackageName();
this.f = this;
int identifier = getResources().getIdentifier("share_for_pay_layout", "layout", this.e);
if (identifier > 0) {
setContentView(identifier);
}
this.l = this.f.getSharedPreferences("alipay", Build.VERSION.SDK_INT < 11 ? 0 : 4);
k();
e();
f();
c();
}
@Override
protected void onResume() {
super.onResume();
if (this.i || this.j != null) {
return;
}
c();
}
private void c() {
int d = d();
if (!aj.a().b(this.f)) {
if (d != 0) {
this.i = true;
a(d);
return;
} else {
this.i = true;
a("no login fetch....");
h();
return;
}
}
if (!this.i) {
this.i = true;
a("login onCreate fetch....");
h();
} else if (d != 0) {
a("login onResume fetch....");
this.i = true;
h();
}
}
public void a(int i) {
String string;
if (i == 2) {
string = com.excelliance.kxqp.swipe.a.a.getString(this.f, "share_for_introduce");
} else {
string = com.excelliance.kxqp.swipe.a.a.getString(this.f, "share_for_introduce1");
}
String str = string;
String string2 = com.excelliance.kxqp.swipe.a.a.getString(this.f, "share_for_login_sure");
String string3 = com.excelliance.kxqp.swipe.a.a.getString(this.f, "share_for_login_cancle");
if (this.j != null) {
this.j.dismiss();
this.j = null;
}
this.j = CustomNoticeDialogUtil.a(this.f, str, false, string3, string2, new CustomNoticeDialogUtil.b() {
@Override
public void a(Dialog dialog) {
if (dialog != null && dialog.isShowing()) {
dialog.dismiss();
}
ShareForPay.this.g();
}
@Override
public void b(Dialog dialog) {
if (dialog != null && dialog.isShowing()) {
dialog.dismiss();
}
ShareForPay.this.i = false;
Intent intent = new Intent();
intent.setComponent(new ComponentName(ShareForPay.this.f.getPackageName(), "com.excelliance.kxqp.user.LoginActivity"));
ShareForPay.this.f.startActivity(intent);
int identifier = ShareForPay.this.f.getResources().getIdentifier("slide_right_out", "anim", ShareForPay.this.f.getPackageName());
if (identifier > 0) {
((Activity) ShareForPay.this.f).overridePendingTransition(0, identifier);
}
}
});
if (this.j != null) {
this.j.setCancelable(false);
this.j.show();
}
}
public void a(a aVar, final Context context) {
String string;
if (aVar != null) {
try {
SharedPreferences.Editor edit = this.l.edit();
String h = aVar.h();
int parseInt = (TextUtils.isEmpty(h) || h.equalsIgnoreCase("null")) ? 0 : Integer.parseInt(h);
if (parseInt > 0) {
edit.putInt("share_num", parseInt).commit();
}
String g = aVar.g();
if (!TextUtils.isEmpty(g)) {
edit.putString("share_code", g).commit();
}
int c = aVar.c();
if (c > 0) {
edit.putInt("share_time", c).commit();
}
int b2 = aVar.b();
if (b2 != 3) {
edit.putInt("share_sign", b2).commit();
}
int a2 = aVar.a();
if (a2 > 0) {
edit.putInt("share_update", a2).commit();
}
if (parseInt >= 2) {
if (aj.a().b(context)) {
if (parseInt >= 2 && parseInt < 10) {
string = com.excelliance.kxqp.swipe.a.a.getString(context, "shared_dialog_month");
} else {
string = com.excelliance.kxqp.swipe.a.a.getString(context, "shared_dialog_year");
}
String str = string;
String string2 = com.excelliance.kxqp.swipe.a.a.getString(context, "share_register_but");
if (a2 <= 0 || this.k != null) {
return;
}
this.k = CustomNoticeDialogUtil.a(context, str, true, null, string2, new CustomNoticeDialogUtil.b() {
@Override
public void a(Dialog dialog) {
}
@Override
public void b(Dialog dialog) {
if (dialog != null && dialog.isShowing()) {
dialog.dismiss();
}
aj.a().a(context, 2);
aj.a().a(context, true);
String stringExtra = ShareForPay.this.getIntent().getStringExtra("activity");
if (!TextUtils.isEmpty(stringExtra) && stringExtra.contains("MainActivity")) {
Intent intent = new Intent();
intent.setComponent(new ComponentName(context.getPackageName(), stringExtra));
intent.setFlags(268435456);
context.startActivity(intent);
return;
}
ShareForPay.this.finish();
}
});
if (this.k != null && this.k.isShowing()) {
this.k.dismiss();
}
if (this.k != null) {
this.k.setCancelable(false);
this.k.show();
return;
}
return;
}
int d = d();
if (d != 0) {
this.i = true;
a(d);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
private int d() {
String string = this.l.getString("share_code", "");
int i = this.l.getInt("share_num", 0);
int i2 = this.l.getInt("share_time", 0);
int i3 = this.l.getInt("share_sign", 3);
if (!TextUtils.isEmpty(string)) {
if (i >= 10 && (i3 == 0 || i3 == 2)) {
return 2;
}
if (i >= 2 && i2 > 1488250682 && i3 == 0) {
return 3;
}
}
return 0;
}
private void e() {
if (this.f12665b != null) {
this.f12665b.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
if (Build.VERSION.SDK_INT > 11) {
((ClipboardManager) ShareForPay.this.getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText("code_tv", ShareForPay.this.f12665b.getText()));
} else {
((android.text.ClipboardManager) ShareForPay.this.getSystemService("clipboard")).setText(ShareForPay.this.f12665b.getText());
}
int identifier = ShareForPay.this.getResources().getIdentifier("shared_toast_cope", "string", ShareForPay.this.e);
if (identifier <= 0) {
return true;
}
c.a(ShareForPay.this.f, identifier, c.f13996a);
return true;
}
});
}
}
@Override
public void onClick(View view) {
try {
switch (Integer.parseInt(view.getTag().toString())) {
case 1:
b(a(".ShareImgUI", 1));
return;
case 2:
b(a(".ShareToTimeLineUI", 2));
return;
case 3:
b(a(".JumpActivity", 3));
return;
case 4:
b(a(".QZonePublishMoodActivity", 4));
return;
case 5:
a();
return;
case 6:
a("ShareForPay", 6);
return;
case 7:
Intent intent = new Intent();
intent.setComponent(new ComponentName(getPackageName(), "com.excelliance.kxqp.pay.share.ShareForDetail"));
intent.setFlags(268435456);
int identifier = getResources().getIdentifier("zoom_in", "anim", getPackageName());
if (identifier != 0) {
overridePendingTransition(identifier, 0);
}
startActivity(intent);
return;
case 8:
h();
return;
default:
return;
}
} catch (Exception unused) {
}
}
private void b(int i) {
if (i == 0) {
c.a(this.f, getResources().getIdentifier("shared_no_app", "string", getPackageName()), c.f13996a);
} else if (i == -1) {
c.a(this.f, getResources().getIdentifier("shared_no_load_app", "string", getPackageName()), c.f13996a);
}
}
public void f() {
List<Integer> arrayList;
int i;
int i2;
FileOutputStream fileOutputStream;
int i3 = -1;
try {
this.p = -1;
this.n = new Intent("android.intent.action.SEND");
this.n.setType("image/*");
int identifier = getResources().getIdentifier("shared_for_friend", "string", getPackageName());
String string = identifier > 0 ? getResources().getString(identifier, com.excelliance.kxqp.swipe.a.a.getString(this, "app_name")) : "我在使用【双开助手】,一个设备可以同时登录多个账号(微信,qq等)。下载双开助手,填写邀请码就可以为我开通VIP会员,快点去帮帮我吧, __ 【下载链接】:http://www.multiopen.cn";
String d = b.a().d(this.f);
a((Object) (" shareCode " + d));
if (!TextUtils.isEmpty(d)) {
String str = "【邀请码】:" + d + "\n";
if (string.contains("__")) {
string = string.replace("__", str);
}
} else if (string.contains("__")) {
string = string.replace("__", "");
}
String str2 = string;
this.n.removeExtra("android.intent.extra.TEXT");
this.n.putExtra("Kdescription", str2);
this.n.putExtra("self_pkg", this.f.getPackageName());
VersionManager versionManager = VersionManager.getInstance();
versionManager.a(this.f);
File file = new File(versionManager.k() + "game_res/3rd/icon/share.jpg");
if (!file.exists()) {
file.getParentFile().mkdirs();
Bitmap decodeResource = BitmapFactory.decodeResource(getResources(), getResources().getIdentifier("adv_bg", "drawable", this.f.getPackageName()));
try {
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
} catch (Exception e) {
e.printStackTrace();
fileOutputStream = null;
}
decodeResource.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream);
try {
fileOutputStream.flush();
} catch (Exception e2) {
e2.printStackTrace();
}
try {
fileOutputStream.close();
} catch (Exception e3) {
e3.printStackTrace();
}
}
this.n.putExtra("android.intent.extra.STREAM", Uri.fromFile(file));
this.n.putExtra("Kdescription", str2);
this.n.setFlags(268435457);
Intent intent = this.n;
int intExtra = intent.getIntExtra("type", -1);
a((Object) ("origIntent: " + intent + ", getType = " + intent.getType() + ", type = " + intExtra + ", sPkg = " + GameUtil.a(intExtra)));
if (intent.getComponent() != null) {
intent.setComponent(null);
}
this.m = new Intent(intent);
this.m.setType(HTTP.PLAIN_TEXT_TYPE);
this.m.putExtra("android.intent.extra.TEXT", str2);
this.m.removeExtra("android.intent.extra.STREAM");
this.m.setComponent(null);
int i4 = Build.VERSION.SDK_INT;
this.m.setFlags(453509121);
Intent intent2 = new Intent(intent.getAction());
intent2.setType(intent.getType());
try {
if (!GameUtil.b()) {
com.excelliance.kxqp.wr.a a2 = com.excelliance.kxqp.wr.a.a();
a2.a((Application) getApplicationContext(), (Application) getApplicationContext());
a2.a((Application) getApplicationContext());
GameUtil.b(true);
}
} catch (Exception e4) {
e4.printStackTrace();
}
ArrayList arrayList2 = new ArrayList();
List<ResolveInfo> queryIntentActivities = getPackageManager().queryIntentActivities(intent2, 131072);
if (queryIntentActivities != null) {
Iterator<ResolveInfo> it = queryIntentActivities.iterator();
ArrayList arrayList3 = new ArrayList();
int i5 = 0;
while (it.hasNext()) {
ResolveInfo next = it.next();
if (next != null && "com.tencent.mm".equals(next.activityInfo.packageName) && next.activityInfo.name != null && (next.activityInfo.name.endsWith(".ShareImgUI") || next.activityInfo.name.endsWith(".ShareToTimeLineUI"))) {
new ComponentName(next.activityInfo.packageName, next.activityInfo.name);
if (next.activityInfo.name.endsWith(".ShareImgUI")) {
arrayList3.add(0, next);
i5++;
} else if (i5 > 0) {
arrayList3.add(1, next);
} else {
arrayList3.add(0, next);
}
} else if (next != null && Constants.PACKAGE_QZONE.equals(next.activityInfo.packageName) && next.activityInfo.name != null && next.activityInfo.name.endsWith(".QZonePublishMoodActivity")) {
arrayList3.add(next);
}
}
if (arrayList3.size() > 0) {
arrayList2.add(arrayList3);
}
a((Object) ("infos: " + arrayList2));
this.o = new HashMap();
int size = arrayList2.size();
a((Object) ("size: " + size));
for (int i6 = 0; i6 < size; i6++) {
List<ResolveInfo> list = (List) arrayList2.get(i6);
if (list != null) {
for (ResolveInfo resolveInfo : list) {
String str3 = resolveInfo.activityInfo.name;
if (str3 != null) {
String[] split = str3.split("\\.");
String str4 = split[split.length - 1];
a((Object) ("name:" + str4));
this.o.put("." + str4, resolveInfo);
}
}
}
}
ResolveInfo resolveInfo2 = new ResolveInfo();
resolveInfo2.activityInfo = new ActivityInfo();
this.o.put("ShareForPay", resolveInfo2);
}
if (com.excelliance.kxqp.pay.ali.b.h(this.f) | com.excelliance.kxqp.pay.ali.b.g(this.f)) {
arrayList = com.excelliance.kxqp.wr.a.a().f();
} else {
arrayList = new ArrayList<>();
arrayList.add(0);
}
Intent intent3 = new Intent(intent.getAction());
intent3.setType("*/*");
intent3.setPackage("com.tencent.mm");
Intent intent4 = new Intent(intent.getAction());
intent4.setType("*/*");
intent4.setPackage("com.tencent.mobileqq");
Iterator<Integer> it2 = arrayList.iterator();
int i7 = 0;
int i8 = 0;
int i9 = -1;
int i10 = -1;
while (it2.hasNext()) {
int intValue = it2.next().intValue();
Iterator<ExcellianceAppInfo> it3 = InitialData.a(this).a(i3, intValue).iterator();
int i11 = 0;
int i12 = 0;
while (it3.hasNext()) {
String appPackageName = it3.next().getAppPackageName();
a((Object) ("appPackageName:" + appPackageName));
if (appPackageName != null) {
if (appPackageName.equalsIgnoreCase("com.tencent.mm")) {
i12 = 1;
}
if (appPackageName.equalsIgnoreCase("com.tencent.mobileqq")) {
i11 = 1;
}
if (i11 + i12 == 2) {
break;
}
}
}
int i13 = 1;
if (i12 == 1) {
i = 0;
for (ResolveInfo resolveInfo3 : com.excelliance.kxqp.wr.a.a().a(this, intValue, intent3)) {
if (resolveInfo3.activityInfo.name != null && resolveInfo3.activityInfo.name.endsWith(".ShareImgUI")) {
i12 = 2;
}
if (resolveInfo3.activityInfo.name != null && resolveInfo3.activityInfo.name.endsWith(".ShareToTimeLineUI")) {
i = 2;
}
if (i12 + i == 4) {
break;
}
}
i13 = 1;
} else {
i = 0;
}
if (i11 == i13) {
for (ResolveInfo resolveInfo4 : com.excelliance.kxqp.wr.a.a().a(this, intValue, intent4)) {
if (resolveInfo4.activityInfo.name != null && resolveInfo4.activityInfo.name.endsWith(".JumpActivity")) {
i2 = 2;
i11 = 2;
break;
}
}
}
i2 = 2;
if (i11 == i2) {
i8++;
a((Object) ("qqNum:" + i8));
i10 = intValue;
i2 = 2;
}
if (i12 == i2 && i == i2) {
i7++;
a((Object) ("wxNum:" + i7));
i9 = intValue;
}
i3 = -1;
}
if (i7 > 0) {
if (i7 == 1) {
this.p = i9;
} else {
this.p = Integer.MAX_VALUE;
}
c(1);
return;
}
if (i8 > 0) {
if (i7 == 1) {
this.p = i10;
} else {
this.p = Integer.MAX_VALUE;
}
c(2);
return;
}
c(0);
} catch (Exception e5) {
e5.printStackTrace();
a((Object) ("initIntent e:" + e5), true);
}
}
public int a(String str, int i) {
ActivityInfo activityInfo;
try {
} catch (Resources.NotFoundException e) {
e.printStackTrace();
a((Object) ("share e :" + e), true);
}
if (this.o != null && this.o.size() != 0) {
a((Object) ("mList: " + this.o.size() + " " + str));
a((Object) ("launchIntent oneUid: " + this.p + " rule " + this.g));
if (this.p < 0) {
ResolveInfo resolveInfo = this.o.get(str);
if (resolveInfo == null || (activityInfo = resolveInfo.activityInfo) == null || this.m == null) {
return 0;
}
Intent intent = new Intent(this.m);
String str2 = activityInfo.name;
a((Object) ("name>>>" + str2));
String str3 = activityInfo.applicationInfo != null ? activityInfo.applicationInfo.packageName : null;
if (!str.contains("ShareForPay")) {
intent.setComponent(new ComponentName(str3, str2));
}
a((Object) ("new intent: " + intent));
if (str2 == null) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f, 27);
} else if (str2.endsWith(".ShareImgUI")) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f, 21);
} else if (str2.endsWith(".ShareToTimeLineUI")) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f, 22);
} else if (str2.endsWith(".JumpActivity")) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f, 25);
}
if (str2 != null && str2.endsWith(".ShareToTimeLineUI")) {
this.n.setComponent(new ComponentName(str3, str2));
a((Object) ("new mImageIntent: " + this.n));
this.f.startActivity(this.n);
return 1;
}
if (str2 != null) {
intent.setComponent(new ComponentName(str3, str2));
this.f.startActivity(intent);
return 1;
}
String string = this.f.getResources().getString(this.f.getResources().getIdentifier("ic_share", "string", this.f.getPackageName()));
intent.setComponent(null);
this.f.startActivity(Intent.createChooser(intent, string));
return 1;
}
if (this.p == Integer.MAX_VALUE) {
if (i == 1) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f.getApplicationContext(), 21);
if (a(".ShareImgUI")) {
return 1;
}
} else if (i == 2) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f.getApplicationContext(), 22);
if (a(".ShareToTimeLineUI")) {
return 1;
}
} else {
if (i == 3) {
if (this.g == 1) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f.getApplicationContext(), 23);
try {
Intent intent2 = new Intent(this.m);
intent2.setComponent(new ComponentName(this.f.getPackageName(), "com.excelliance.kxqp.ui.ShareWXActivity"));
intent2.putExtra("selectShow", ".ShareImgUI");
intent2.putExtra("friend", 0);
this.f.startActivity(intent2);
return 1;
} catch (Exception e2) {
e2.printStackTrace();
return -1;
}
}
if (this.g == 2) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f.getApplicationContext(), 25);
if (a(".JumpActivity")) {
return 1;
}
}
} else if (i == 4) {
if (this.g == 1) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f.getApplicationContext(), 24);
try {
Intent intent3 = new Intent(this.n);
intent3.setComponent(new ComponentName(this.f.getPackageName(), "com.excelliance.kxqp.ui.ShareWXActivity"));
intent3.putExtra("selectShow", ".ShareToTimeLineUI");
intent3.putExtra("friend", 1);
this.f.startActivity(intent3);
return 1;
} catch (Exception e3) {
e3.printStackTrace();
return -1;
}
}
if (this.g == 2) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f.getApplicationContext(), 26);
try {
Intent intent4 = new Intent(this.m);
intent4.setComponent(new ComponentName(this.f.getPackageName(), "com.excelliance.kxqp.ui.ShareQQActivity"));
intent4.putExtra("selectShow", ".JumpActivity");
this.f.startActivity(intent4);
return 1;
} catch (Exception e4) {
e4.printStackTrace();
return -1;
}
}
} else if (i == 6) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f, 27);
String string2 = this.f.getResources().getString(this.f.getResources().getIdentifier("ic_share", "string", this.f.getPackageName()));
Intent intent5 = new Intent(this.m);
intent5.setComponent(null);
this.f.startActivity(Intent.createChooser(intent5, string2));
return 1;
}
e.printStackTrace();
a((Object) ("share e :" + e), true);
}
} else if (i == 1) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f.getApplicationContext(), 21);
if (a(".ShareImgUI")) {
return 1;
}
} else if (i == 2) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f.getApplicationContext(), 22);
if (a(".ShareToTimeLineUI")) {
return 1;
}
} else if (i == 3) {
if (this.g == 1) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f.getApplicationContext(), 23);
Intent intent6 = new Intent(this.m);
intent6.setPackage("com.tencent.mm");
if (a(this.p, intent6, ".ShareImgUI")) {
return 1;
}
} else if (this.g == 2) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f.getApplicationContext(), 25);
if (a(".JumpActivity")) {
return 1;
}
}
} else if (i == 4) {
if (this.g == 1) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f.getApplicationContext(), 24);
Intent intent7 = new Intent(this.n);
intent7.setPackage("com.tencent.mm");
if (a(this.p, intent7, ".ShareToTimeLineUI")) {
return 1;
}
} else if (this.g == 2) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f.getApplicationContext(), 26);
Intent intent8 = new Intent(this.m);
intent8.setPackage("com.tencent.mobileqq");
if (a(this.p, intent8, ".JumpActivity")) {
return 1;
}
}
} else if (i == 6) {
StatisticOperation.getInstance();
StatisticOperation.uploadDataByType(this.f, 27);
String string3 = this.f.getResources().getString(this.f.getResources().getIdentifier("ic_share", "string", this.f.getPackageName()));
Intent intent9 = new Intent(this.m);
intent9.setComponent(null);
this.f.startActivity(Intent.createChooser(intent9, string3));
return 1;
}
return 0;
}
return 0;
}
private boolean a(int i, Intent intent, String str) {
Intent intent2;
for (ResolveInfo resolveInfo : com.excelliance.kxqp.wr.a.a().a(this, i, intent)) {
a((Object) ("name: " + resolveInfo.activityInfo.name + " " + str));
if (resolveInfo.activityInfo.name != null && resolveInfo.activityInfo.name.endsWith(str)) {
ActivityInfo activityInfo = resolveInfo.activityInfo;
if (activityInfo == null) {
return false;
}
String str2 = activityInfo.name;
a((Object) ("launchActivity: " + str2));
this.e = activityInfo.applicationInfo.packageName;
ComponentName componentName = new ComponentName(this.e, str2);
if (str.equals(".ShareToTimeLineUI")) {
intent2 = new Intent(this.n);
} else {
intent2 = new Intent(this.m);
}
intent2.setComponent(componentName);
intent2.addFlags(50331648);
if (Build.VERSION.SDK_INT >= 14) {
try {
Intent.class.getDeclaredMethod("setAllowFds", Boolean.TYPE).invoke(intent2, false);
} catch (Exception e) {
e.printStackTrace();
}
}
com.excelliance.kxqp.wr.a.a().startActivity(i, intent2);
return true;
}
}
return false;
}
private boolean a(String str) {
ResolveInfo resolveInfo;
ActivityInfo activityInfo;
Intent intent;
if (this.o == null || this.o.size() == 0 || (resolveInfo = this.o.get(str)) == null || (activityInfo = resolveInfo.activityInfo) == null) {
return false;
}
String str2 = activityInfo.name;
a((Object) ("launchActivity1: " + str2));
this.e = activityInfo.applicationInfo.packageName;
ComponentName componentName = new ComponentName(this.e, str2);
if (str.equals(".ShareToTimeLineUI")) {
intent = new Intent(this.n);
} else {
intent = new Intent(this.m);
}
intent.setComponent(componentName);
this.f.startActivity(intent);
return true;
}
public void g() {
String string = this.l.getString("share_code", "");
int i = this.l.getInt("share_num", 0);
if (string != null && string.length() == 6) {
this.f12665b.setText(string);
if (i > 0) {
this.c.setText(i + "");
return;
}
return;
}
int identifier = getResources().getIdentifier("share_fetch_fail", "string", this.e);
if (identifier > 0) {
c.a(this.f, this.f.getText(identifier).toString(), c.f13996a);
}
}
public void a(a aVar) {
String g = aVar.g();
if (g != null && g.length() == 6) {
this.f12665b.setText(g);
if (TextUtils.isEmpty(aVar.h())) {
return;
}
this.c.setText(aVar.h());
return;
}
int identifier = getResources().getIdentifier("share_fetch_fail", "string", this.e);
if (identifier > 0) {
c.a(this.f, this.f.getText(identifier).toString(), c.f13996a);
}
}
private void h() {
if (b.a().e(this.f)) {
i();
try {
final a a2 = b.a().a(this.f, "1");
a("data:" + a2.toString() + " isNet:" + a2.getType());
new Thread(new Runnable() {
@Override
public void run() {
try {
a a3 = b.a().a(a2);
Message obtainMessage = ShareForPay.this.d.obtainMessage();
if (a3 != null) {
obtainMessage.what = 1;
obtainMessage.obj = a3;
} else {
obtainMessage.what = 2;
}
ShareForPay.this.d.sendMessage(obtainMessage);
} catch (Exception e) {
e.printStackTrace();
ShareForPay.this.a((Object) e, true);
Message obtainMessage2 = ShareForPay.this.d.obtainMessage();
obtainMessage2.what = 2;
ShareForPay.this.d.sendMessage(obtainMessage2);
}
}
}).start();
} catch (Exception e) {
e.printStackTrace();
a((Object) e, true);
Message obtainMessage = this.d.obtainMessage();
obtainMessage.what = 2;
this.d.sendMessage(obtainMessage);
}
}
}
@Override
public void onBackPressed() {
a();
}
public void a() {
String stringExtra = getIntent().getStringExtra("targetActivity");
String stringExtra2 = getIntent().getStringExtra("activity");
Intent intent = new Intent();
if (stringExtra != null && stringExtra.contains("HelloActivity")) {
intent.setComponent(new ComponentName(getPackageName(), stringExtra));
intent.setFlags(268435456);
} else if (stringExtra2 != null && stringExtra2.contains("MainActivity")) {
intent.setComponent(new ComponentName(getPackageName(), stringExtra2));
intent.setFlags(268435456);
} else {
finish();
return;
}
int identifier = getResources().getIdentifier("zoom_in", "anim", getPackageName());
if (identifier != 0) {
overridePendingTransition(identifier, 0);
}
intent.setPackage(this.e);
startActivity(intent);
finish();
}
private void i() {
try {
if (this.f12664a == null || this.f12664a.getChildCount() != 3) {
return;
}
this.f12664a.setVisibility(0);
this.f12664a.setBackgroundColor(this.f.getResources().getColor(getResources().getIdentifier("bg_progress_alpha", "color", this.e)));
TextView textView = (TextView) this.f12664a.getChildAt(0);
ImageView imageView = (ImageView) this.f12664a.getChildAt(1);
((Button) this.f12664a.getChildAt(2)).setVisibility(8);
imageView.setImageResource(getResources().getIdentifier("loading_round", "drawable", this.e));
AnimationDrawable animationDrawable = (AnimationDrawable) imageView.getDrawable();
this.f12664a.setFocusable(true);
animationDrawable.start();
textView.setText(this.f.getText(getResources().getIdentifier("paying_waiting", "string", this.e)));
textView.setTextColor(this.f.getResources().getColor(getResources().getIdentifier("text_color_white", "color", this.e)));
} catch (Exception e) {
e.printStackTrace();
a((Object) e, true);
}
}
public void b(a aVar) {
int identifier;
try {
if (this.h) {
j();
if (aVar != null) {
aVar.e(b.a().d(this.f));
a(aVar);
if (TextUtils.isEmpty(aVar.g()) || aVar.g().length() != 6 || (identifier = getResources().getIdentifier("share_fetch_fail", "string", this.e)) <= 0) {
return;
}
c.a(this.f, this.f.getText(identifier).toString(), c.f13996a);
return;
}
return;
}
if (this.f12664a == null || this.f12664a.getChildCount() != 3) {
return;
}
this.h = true;
this.f12664a.setVisibility(0);
this.f12664a.setFocusable(true);
this.f12664a.setBackgroundColor(this.f.getResources().getColor(getResources().getIdentifier("app_title_white", "color", this.e)));
TextView textView = (TextView) this.f12664a.getChildAt(0);
ImageView imageView = (ImageView) this.f12664a.getChildAt(1);
Drawable drawable = imageView.getDrawable();
a("drawable1:" + (drawable instanceof AnimationDrawable));
if (drawable != null && (drawable instanceof AnimationDrawable)) {
((AnimationDrawable) drawable).stop();
}
Button button = (Button) this.f12664a.getChildAt(2);
button.setVisibility(0);
button.setTag(8);
button.setOnClickListener(this);
imageView.setImageResource(getResources().getIdentifier("loading_fail", "drawable", this.e));
textView.setText(this.f.getText(getResources().getIdentifier("share_loading_fail", "string", this.e)));
textView.setTextColor(this.f.getResources().getColor(getResources().getIdentifier("share_friend_hint", "color", this.e)));
} catch (Exception e) {
e.printStackTrace();
a((Object) e, true);
}
}
public void j() {
Drawable drawable;
try {
if (this.f12664a != null) {
this.f12664a.setVisibility(8);
ImageView imageView = (ImageView) this.f12664a.getChildAt(1);
if (imageView == null || (drawable = imageView.getDrawable()) == null || !(drawable instanceof AnimationDrawable)) {
return;
}
((AnimationDrawable) drawable).stop();
}
} catch (Exception e) {
e.printStackTrace();
a((Object) e, true);
}
}
private void k() {
String charSequence;
try {
((ImageView) a("share_nav_back", "id", 5)).setImageResource(getResources().getIdentifier("button_back_normal", "drawable", this.e));
a("share_detail_rule", "id", 7);
a("share_more_but", "id", 6);
this.f12665b = (TextView) a("invitation_code_tv", "id", 0);
this.c = (TextView) a("share_share_num", "id", 0);
a("share_more_but", "id", 6);
int color = this.f.getResources().getColor(getResources().getIdentifier("share_friend_hint", "color", this.e));
TextView textView = (TextView) a("share_pay_introduce_tv", "id", 0);
int identifier = getResources().getIdentifier("share_rule_hint", "string", this.e);
if (identifier > 0) {
charSequence = this.f.getString(identifier, com.excelliance.kxqp.swipe.a.a.getString(this.f, "app_name"));
} else {
charSequence = textView.getText().toString();
}
String[] split = charSequence.split("__");
String replace = charSequence.replace("__", "");
a("s:" + replace.length());
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(replace);
for (int i = 1; i < split.length; i += 2) {
a("content:" + i + " " + split[i]);
a("content:" + i + " " + split[i].length());
if (split[i].length() > 0) {
int indexOf = replace.indexOf(split[i]);
a("i1:" + indexOf);
spannableStringBuilder.setSpan(new ForegroundColorSpan(color), indexOf, split[i].length() + indexOf, 34);
}
}
textView.setText(spannableStringBuilder);
this.f12664a = (RelativeLayout) a("progress_layout", "id", 0);
} catch (Exception e) {
e.printStackTrace();
a((Object) e, true);
}
}
private void c(int i) {
try {
this.g = i;
int parseInt = Integer.parseInt(p.a(this.f).split(StatisticsManager.COMMA)[0]);
for (int i2 = 1; i2 <= 4; i2++) {
if (i == 1) {
TextView textView = (TextView) a("view_" + i2, "id", i2);
Drawable drawable = this.f.getResources().getDrawable(getResources().getIdentifier("share_wx_" + i2, "drawable", this.e));
drawable.setBounds(0, 0, parseInt / 8, parseInt / 8);
textView.setCompoundDrawables(null, drawable, null, null);
if (i2 > 2) {
textView.setText(getResources().getIdentifier("share_wx_" + i2, "string", this.e));
}
} else if (i == 2) {
TextView textView2 = (TextView) a("view_" + i2, "id", i2);
Drawable drawable2 = this.f.getResources().getDrawable(getResources().getIdentifier(i2 <= 2 ? "share_wx_" + i2 : "share_qq_" + i2, "drawable", this.e));
drawable2.setBounds(0, 0, parseInt / 8, parseInt / 8);
textView2.setCompoundDrawables(null, drawable2, null, null);
if (i2 > 2) {
textView2.setText(getResources().getIdentifier("share_qq", "string", this.e));
}
} else if (i == 0) {
TextView textView3 = (TextView) a("view_" + i2, "id", i2);
Drawable drawable3 = textView3.getCompoundDrawables()[1];
if (drawable3 != null) {
drawable3.setBounds(0, 0, parseInt / 8, parseInt / 8);
}
textView3.setCompoundDrawables(null, drawable3, null, null);
}
}
} catch (Exception e) {
e.printStackTrace();
a((Object) ("inflate exception:" + e));
}
}
@Override
protected void onPause() {
super.onPause();
if (this.j != null) {
this.j.dismiss();
this.j = null;
}
if (this.k != null) {
this.k.dismiss();
this.k = null;
}
}
@Override
protected void onDestroy() {
super.onDestroy();
this.h = false;
}
private View a(String str, String str2, int i) {
int identifier = getResources().getIdentifier(str, str2, this.e);
if (identifier <= 0) {
return null;
}
View findViewById = findViewById(identifier);
if (i == 0) {
return findViewById;
}
findViewById.setTag(Integer.valueOf(i));
findViewById.setOnClickListener(this);
return findViewById;
}
public void a(Object obj, boolean z) {
if (z) {
Log.e("ShareForPay", "MSG:" + obj);
}
}
@Override
public void finish() {
super.finish();
int identifier = getResources().getIdentifier("slide_right_out", "anim", getPackageName());
if (identifier > 0) {
overridePendingTransition(0, identifier);
}
}
}