OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 c.java 源代码,内容仅作参考
package com.excelliance.kxqp;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import com.android.spush.FakeServiceHelper;
import com.excelliance.kxqp.gs.util.an;
import com.excelliance.kxqp.gs.util.by;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringBufferInputStream;
import java.io.StringWriter;
import java.io.Writer;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import java.util.zip.GZIPOutputStream;
import org.apache.http.protocol.HTTP;
public class c extends g {
private static final String f3022a = "c";
private static final Object f3023b = new Object();
private Context c;
private com.excelliance.kxqp.b d;
public c(com.excelliance.kxqp.b bVar, Context context) {
super(context);
this.c = context;
this.d = bVar;
}
public void a(Intent intent) {
int i;
int i2;
String b2;
String b3;
String b4;
NetworkInfo activeNetworkInfo;
String[] split;
String[] split2;
String[] split3;
PackageInfo packageInfo;
Log.d(f3022a, "onHandleIntent: intent " + intent);
if (intent != null && TextUtils.equals(intent.getAction(), "com.excelliance.kxqp.platform.action.CRASH_REPORT")) {
String stringExtra = intent.getStringExtra("extra.crashreport.arg.pkgname");
String stringExtra2 = intent.getStringExtra("extra.crashreport.arg.pkgversion");
String stringExtra3 = intent.getStringExtra("extra.crashreport.arg.report");
String stringExtra4 = intent.getStringExtra("extra.crashreport.arg.tombstone");
if (TextUtils.equals(stringExtra, "com.ea.gp.apexlegendsmobilefps") && !TextUtils.isEmpty(stringExtra3) && stringExtra3.contains("name: RHIThread >>> com.ea.gp.apexlegendsmobilefps <<<") && stringExtra3.contains("signal 11 (SIGSEGV), code 0 (SI_USER), fault addr 0x3")) {
an.c(this.c.getExternalFilesDir(null).getParent() + File.separator + "gameplugins" + File.separator + stringExtra + File.separator + "files" + File.separator + "ProgramBinaryCache");
}
int i3 = -1;
try {
packageInfo = g().getPackageInfo(f(), 128);
ApplicationInfo applicationInfo = packageInfo.applicationInfo;
if (applicationInfo.metaData != null) {
int i4 = applicationInfo.metaData.getInt("MainChId", 0);
try {
i = applicationInfo.metaData.getInt("SubChId", 0);
i3 = i4;
} catch (Exception e) {
e = e;
i3 = i4;
i = -1;
e.printStackTrace();
i2 = 0;
String format = String.format("%s_%s_%s_%s_%s_%s.log", Integer.valueOf(i3), Integer.valueOf(i), this.c.getPackageName(), Integer.valueOf(i2), stringExtra, stringExtra2);
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter((Writer) stringWriter, false);
printWriter.println("---------------------------------------- HEADER ----------------------------------------");
printWriter.println("mainChId:" + i3);
printWriter.println("subChId:" + i);
GameUtil intance = GameUtil.getIntance();
printWriter.println("compver:" + intance.t(this.c));
printWriter.println("mainver:" + intance.m());
printWriter.println("vercode:" + GameUtil.g(this.c));
printWriter.println("vername:" + GameUtil.h(this.c));
printWriter.println("clientPkgName:" + this.c.getPackageName());
printWriter.println("multiPkgName:" + stringExtra);
b2 = by.a(this.c, "sp_key_config_vpn_ip_and_port_in_lb").b("sp_key_config_vpn_ip_and_port_in_lb", "");
b3 = by.a(this.c, "sp_key_config_vpn_id_and_port_for_gp_in_lb").b("sp_key_config_vpn_id_and_port_for_gp_in_lb", "");
b4 = by.a(this.c, "sp_key_config_vpn_ip_and_port_in_lb").b(stringExtra, "");
if (!TextUtils.isEmpty(b2)) {
}
if (!TextUtils.isEmpty(b3)) {
}
if (!TextUtils.isEmpty(b4)) {
}
printWriter.print("\n\n");
new b(format, stringWriter.toString(), stringExtra3, stringExtra4).start();
ConnectivityManager connectivityManager = (ConnectivityManager) a(FakeServiceHelper.CONNECTIVITY_SERVICE);
if (connectivityManager != null) {
}
if (activeNetworkInfo != null) {
}
}
} else {
i = -1;
}
} catch (Exception e2) {
e = e2;
}
try {
i2 = packageInfo.versionCode;
} catch (Exception e3) {
e = e3;
e.printStackTrace();
i2 = 0;
String format2 = String.format("%s_%s_%s_%s_%s_%s.log", Integer.valueOf(i3), Integer.valueOf(i), this.c.getPackageName(), Integer.valueOf(i2), stringExtra, stringExtra2);
StringWriter stringWriter2 = new StringWriter();
PrintWriter printWriter2 = new PrintWriter((Writer) stringWriter2, false);
printWriter2.println("---------------------------------------- HEADER ----------------------------------------");
printWriter2.println("mainChId:" + i3);
printWriter2.println("subChId:" + i);
GameUtil intance2 = GameUtil.getIntance();
printWriter2.println("compver:" + intance2.t(this.c));
printWriter2.println("mainver:" + intance2.m());
printWriter2.println("vercode:" + GameUtil.g(this.c));
printWriter2.println("vername:" + GameUtil.h(this.c));
printWriter2.println("clientPkgName:" + this.c.getPackageName());
printWriter2.println("multiPkgName:" + stringExtra);
b2 = by.a(this.c, "sp_key_config_vpn_ip_and_port_in_lb").b("sp_key_config_vpn_ip_and_port_in_lb", "");
b3 = by.a(this.c, "sp_key_config_vpn_id_and_port_for_gp_in_lb").b("sp_key_config_vpn_id_and_port_for_gp_in_lb", "");
b4 = by.a(this.c, "sp_key_config_vpn_ip_and_port_in_lb").b(stringExtra, "");
if (!TextUtils.isEmpty(b2)) {
split3 = b2.split(":");
if (split3.length == 2) {
}
}
if (!TextUtils.isEmpty(b3)) {
split2 = b3.split(":");
if (split2.length == 2) {
}
}
if (!TextUtils.isEmpty(b4)) {
split = b4.split(":");
if (split.length == 2) {
}
}
printWriter2.print("\n\n");
new b(format2, stringWriter2.toString(), stringExtra3, stringExtra4).start();
ConnectivityManager connectivityManager2 = (ConnectivityManager) a(FakeServiceHelper.CONNECTIVITY_SERVICE);
if (connectivityManager2 != null) {
}
if (activeNetworkInfo != null) {
return;
} else {
return;
}
}
String format22 = String.format("%s_%s_%s_%s_%s_%s.log", Integer.valueOf(i3), Integer.valueOf(i), this.c.getPackageName(), Integer.valueOf(i2), stringExtra, stringExtra2);
StringWriter stringWriter22 = new StringWriter();
PrintWriter printWriter22 = new PrintWriter((Writer) stringWriter22, false);
printWriter22.println("---------------------------------------- HEADER ----------------------------------------");
printWriter22.println("mainChId:" + i3);
printWriter22.println("subChId:" + i);
GameUtil intance22 = GameUtil.getIntance();
printWriter22.println("compver:" + intance22.t(this.c));
printWriter22.println("mainver:" + intance22.m());
printWriter22.println("vercode:" + GameUtil.g(this.c));
printWriter22.println("vername:" + GameUtil.h(this.c));
printWriter22.println("clientPkgName:" + this.c.getPackageName());
printWriter22.println("multiPkgName:" + stringExtra);
b2 = by.a(this.c, "sp_key_config_vpn_ip_and_port_in_lb").b("sp_key_config_vpn_ip_and_port_in_lb", "");
b3 = by.a(this.c, "sp_key_config_vpn_id_and_port_for_gp_in_lb").b("sp_key_config_vpn_id_and_port_for_gp_in_lb", "");
b4 = by.a(this.c, "sp_key_config_vpn_ip_and_port_in_lb").b(stringExtra, "");
if (!TextUtils.isEmpty(b2) && b2.contains(":")) {
split3 = b2.split(":");
if (split3.length == 2) {
printWriter22.println("proxyIp:" + split3[0]);
printWriter22.println("proxyPort:" + split3[1]);
}
}
if (!TextUtils.isEmpty(b3) && b3.contains(":")) {
split2 = b3.split(":");
if (split2.length == 2) {
printWriter22.println("proxyIpForGp:" + split2[0]);
printWriter22.println("proxyPortForGp:" + split2[1]);
}
}
if (!TextUtils.isEmpty(b4) && b4.contains(":")) {
split = b4.split(":");
if (split.length == 2) {
printWriter22.println("DLProxyIp:" + split[0]);
printWriter22.println("DLProxyPort:" + split[1]);
}
}
printWriter22.print("\n\n");
new b(format22, stringWriter22.toString(), stringExtra3, stringExtra4).start();
ConnectivityManager connectivityManager22 = (ConnectivityManager) a(FakeServiceHelper.CONNECTIVITY_SERVICE);
activeNetworkInfo = connectivityManager22 != null ? connectivityManager22.getActiveNetworkInfo() : null;
if (activeNetworkInfo != null && activeNetworkInfo.isConnected() && activeNetworkInfo.getType() == 1) {
d();
}
}
}
public File c() {
File externalFilesDir = this.c.getExternalFilesDir("ma_crash_logs");
if (externalFilesDir == null) {
return null;
}
externalFilesDir.mkdirs();
if (externalFilesDir.exists() && externalFilesDir.canWrite()) {
return externalFilesDir;
}
return null;
}
private void d() {
File c = c();
if (c == null || !c.exists()) {
return;
}
synchronized (f3023b) {
HashMap hashMap = new HashMap();
File[] listFiles = c.listFiles();
if (listFiles != null) {
for (File file : listFiles) {
String name = file.getName();
int indexOf = name.indexOf("@@@@");
if (name.startsWith("CRASHLOG_") && indexOf > 0) {
String substring = name.substring(indexOf + "@@@@".length());
File file2 = new File(c, name.replace("CRASHLOG_", "processedlog_"));
if (file2.exists()) {
file2.delete();
}
file.renameTo(file2);
Log.d(f3022a, "Rename " + file + " to " + file2);
hashMap.put(file2.getAbsolutePath(), substring);
}
}
}
new a(hashMap).start();
}
}
public class a extends C0120c {
final HashMap<String, String> f3024a;
a(HashMap hashMap) {
super("FileUploadThread**");
this.f3024a = hashMap;
}
@Override
public void run() {
if (this.f3024a == null || this.f3024a.size() <= 0) {
return;
}
c.this.d.a(this);
for (Map.Entry<String, String> entry : this.f3024a.entrySet()) {
File file = new File(entry.getKey());
String value = entry.getValue();
if (!file.exists()) {
Log.e(c.f3022a, "file " + file + " doesn't exist");
} else {
try {
sleep(2000L);
} catch (Exception e) {
e.printStackTrace();
}
byte[] bArr = null;
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try {
try {
b(byteArrayOutputStream, file.getAbsolutePath());
byteArrayOutputStream.flush();
byte[] byteArray = byteArrayOutputStream.toByteArray();
try {
byteArrayOutputStream.close();
} catch (Exception e2) {
e2.printStackTrace();
}
bArr = byteArray;
} catch (Exception e3) {
e3.printStackTrace();
try {
byteArrayOutputStream.close();
} catch (Exception e4) {
e4.printStackTrace();
}
}
if (bArr == null) {
Log.e(c.f3022a, "finalReport is empty in " + getName());
} else {
a(value, bArr, getName() + file.getAbsolutePath());
}
file.delete();
c.this.d.b(this);
} catch (Throwable th) {
try {
byteArrayOutputStream.close();
} catch (Exception e5) {
e5.printStackTrace();
}
throw th;
}
}
}
}
}
class b extends C0120c {
private final String f3027b;
private final String d;
private final String e;
private final String f;
b(String str, String str2, String str3, String str4) {
super("LogUploadThread**" + str);
this.f3027b = str;
this.d = str2;
this.e = str3;
this.f = str4;
}
@Override
public void run() {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try {
try {
if (this.d != null) {
a(byteArrayOutputStream, this.d);
}
if (this.e != null) {
a(byteArrayOutputStream, this.e);
}
if (this.f != null) {
b(byteArrayOutputStream, this.f);
}
byteArrayOutputStream.flush();
byte[] byteArray = byteArrayOutputStream.toByteArray();
try {
byteArrayOutputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
if (byteArray == null) {
return;
}
if (a(this.f3027b, byteArray, "thread " + getName())) {
return;
}
a(this.f3027b, byteArray);
} catch (Throwable th) {
try {
byteArrayOutputStream.close();
} catch (Exception e2) {
e2.printStackTrace();
}
throw th;
}
} catch (Exception e3) {
e3.printStackTrace();
try {
byteArrayOutputStream.close();
} catch (Exception e4) {
e4.printStackTrace();
}
}
}
private void a(String str, byte[] bArr) {
File c;
FileOutputStream fileOutputStream;
Throwable th;
Exception e;
if (TextUtils.isEmpty(str) || bArr == null || (c = c.this.c()) == null) {
return;
}
synchronized (c.f3023b) {
File file = new File(c, String.format("%s%s%s%s", "CRASHLOG_", Long.valueOf(System.currentTimeMillis()), "@@@@", str));
if (file.exists()) {
return;
}
Log.d(c.f3022a, "saveToFile: save " + str + " to file " + file);
try {
fileOutputStream = new FileOutputStream(file);
try {
try {
fileOutputStream.write(bArr, 0, bArr.length);
fileOutputStream.flush();
} catch (Exception e2) {
e = e2;
e.printStackTrace();
file.delete();
if (fileOutputStream != null) {
try {
fileOutputStream.close();
} catch (Exception e3) {
e = e3;
e.printStackTrace();
}
}
}
try {
fileOutputStream.close();
} catch (Exception e4) {
e = e4;
e.printStackTrace();
}
} catch (Throwable th2) {
th = th2;
if (fileOutputStream != null) {
try {
fileOutputStream.close();
} catch (Exception e5) {
e5.printStackTrace();
}
}
throw th;
}
} catch (Exception e6) {
fileOutputStream = null;
e = e6;
} catch (Throwable th3) {
fileOutputStream = null;
th = th3;
if (fileOutputStream != null) {
}
throw th;
}
}
}
}
class C0120c extends Thread {
C0120c(String str) {
super(str);
}
boolean a(String str, byte[] bArr, String str2) {
if (bArr == null || bArr.length <= 0) {
return false;
}
int i = 0;
while (true) {
i++;
if (i > 2) {
return false;
}
try {
Log.i(c.f3022a, "try uploading finalReport: " + str + " (try " + i + "), tag: " + str2);
a(str, bArr);
return true;
} catch (Exception e) {
Log.e(c.f3022a, "", e);
}
}
}
private void a(String str, byte[] bArr) throws IOException {
GZIPOutputStream gZIPOutputStream;
Exception e;
byte[] bArr2;
boolean z;
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
gZIPOutputStream = new GZIPOutputStream(byteArrayOutputStream);
try {
try {
gZIPOutputStream.write(bArr, 0, bArr.length);
gZIPOutputStream.finish();
bArr2 = byteArrayOutputStream.toByteArray();
Log.d(c.f3022a, String.format("gzip: log size %d vs. %d", Integer.valueOf(bArr.length), Integer.valueOf(bArr2.length)));
try {
gZIPOutputStream.close();
} catch (Exception e2) {
e2.printStackTrace();
}
z = true;
} catch (Exception e3) {
e = e3;
e.printStackTrace();
if (gZIPOutputStream != null) {
try {
gZIPOutputStream.close();
} catch (Exception e4) {
e4.printStackTrace();
}
}
bArr2 = bArr;
z = false;
StringBuilder sb = new StringBuilder(!com.excelliance.kxqp.pay.ali.b.h(c.this.c) ? "http://log.ourplay.com.cn/uploadlogvip_multiaccount.php" : "http://log.ourplay.com.cn/uploadlog_multiaccount.php");
sb.append("?&brand=" + URLEncoder.encode(Build.BRAND, "UTF-8").replaceAll("\\+", "%20"));
sb.append("&manufacturer=" + URLEncoder.encode(Build.MANUFACTURER, "UTF-8").replaceAll("\\+", "%20"));
sb.append("&model=" + URLEncoder.encode(Build.MODEL, "UTF-8").replaceAll("\\+", "%20"));
sb.append("&sdkint=" + URLEncoder.encode(Integer.toString(Build.VERSION.SDK_INT), "UTF-8").replaceAll("\\+", "%20"));
sb.append("&release=" + URLEncoder.encode(Build.VERSION.RELEASE, "UTF-8").replaceAll("\\+", "%20"));
sb.append("&hostpackage=" + URLEncoder.encode(c.this.c.getPackageName(), "UTF-8").replaceAll("\\+", "%20"));
StringBuilder sb2 = new StringBuilder();
sb2.append("&gzip=");
sb2.append(URLEncoder.encode(!z ? "1" : "0", "UTF-8").replaceAll("\\+", "%20"));
sb.append(sb2.toString());
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(sb.toString()).openConnection();
httpURLConnection.setConnectTimeout(6000);
httpURLConnection.setChunkedStreamingMode(4096);
httpURLConnection.setDoInput(true);
httpURLConnection.setDoOutput(true);
httpURLConnection.setUseCaches(false);
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setRequestProperty("Connection", HTTP.CONN_KEEP_ALIVE);
httpURLConnection.setRequestProperty("Charset", "UTF-8");
httpURLConnection.setRequestProperty("Content-Type", "multipart/form-data;boundary=**UploadThread**");
DataOutputStream dataOutputStream = new DataOutputStream(httpURLConnection.getOutputStream());
dataOutputStream.writeBytes("--**UploadThread**\r\n");
dataOutputStream.writeBytes("Content-Disposition: form-data; name=\"uploadedfile\";filename=\"" + str + "\"\r\n");
dataOutputStream.writeBytes("\r\n");
dataOutputStream.write(bArr2, 0, bArr2.length);
dataOutputStream.writeBytes("\r\n");
dataOutputStream.writeBytes("--**UploadThread**--\r\n");
dataOutputStream.flush();
int responseCode = httpURLConnection.getResponseCode();
String responseMessage = httpURLConnection.getResponseMessage();
Log.d(c.f3022a, "responseCode:" + responseCode + " responseMessage:" + responseMessage);
httpURLConnection.disconnect();
dataOutputStream.close();
}
} catch (Throwable th) {
th = th;
if (gZIPOutputStream != null) {
try {
gZIPOutputStream.close();
} catch (Exception e5) {
e5.printStackTrace();
}
}
throw th;
}
} catch (Exception e6) {
gZIPOutputStream = null;
e = e6;
} catch (Throwable th2) {
th = th2;
gZIPOutputStream = null;
if (gZIPOutputStream != null) {
}
throw th;
}
StringBuilder sb3 = new StringBuilder(!com.excelliance.kxqp.pay.ali.b.h(c.this.c) ? "http://log.ourplay.com.cn/uploadlogvip_multiaccount.php" : "http://log.ourplay.com.cn/uploadlog_multiaccount.php");
try {
sb3.append("?&brand=" + URLEncoder.encode(Build.BRAND, "UTF-8").replaceAll("\\+", "%20"));
sb3.append("&manufacturer=" + URLEncoder.encode(Build.MANUFACTURER, "UTF-8").replaceAll("\\+", "%20"));
sb3.append("&model=" + URLEncoder.encode(Build.MODEL, "UTF-8").replaceAll("\\+", "%20"));
sb3.append("&sdkint=" + URLEncoder.encode(Integer.toString(Build.VERSION.SDK_INT), "UTF-8").replaceAll("\\+", "%20"));
sb3.append("&release=" + URLEncoder.encode(Build.VERSION.RELEASE, "UTF-8").replaceAll("\\+", "%20"));
sb3.append("&hostpackage=" + URLEncoder.encode(c.this.c.getPackageName(), "UTF-8").replaceAll("\\+", "%20"));
StringBuilder sb22 = new StringBuilder();
sb22.append("&gzip=");
sb22.append(URLEncoder.encode(!z ? "1" : "0", "UTF-8").replaceAll("\\+", "%20"));
sb3.append(sb22.toString());
} catch (Exception e7) {
e7.printStackTrace();
}
HttpURLConnection httpURLConnection2 = (HttpURLConnection) new URL(sb3.toString()).openConnection();
httpURLConnection2.setConnectTimeout(6000);
httpURLConnection2.setChunkedStreamingMode(4096);
httpURLConnection2.setDoInput(true);
httpURLConnection2.setDoOutput(true);
httpURLConnection2.setUseCaches(false);
httpURLConnection2.setRequestMethod("POST");
httpURLConnection2.setRequestProperty("Connection", HTTP.CONN_KEEP_ALIVE);
httpURLConnection2.setRequestProperty("Charset", "UTF-8");
httpURLConnection2.setRequestProperty("Content-Type", "multipart/form-data;boundary=**UploadThread**");
DataOutputStream dataOutputStream2 = new DataOutputStream(httpURLConnection2.getOutputStream());
dataOutputStream2.writeBytes("--**UploadThread**\r\n");
dataOutputStream2.writeBytes("Content-Disposition: form-data; name=\"uploadedfile\";filename=\"" + str + "\"\r\n");
dataOutputStream2.writeBytes("\r\n");
dataOutputStream2.write(bArr2, 0, bArr2.length);
dataOutputStream2.writeBytes("\r\n");
dataOutputStream2.writeBytes("--**UploadThread**--\r\n");
dataOutputStream2.flush();
int responseCode2 = httpURLConnection2.getResponseCode();
String responseMessage2 = httpURLConnection2.getResponseMessage();
Log.d(c.f3022a, "responseCode:" + responseCode2 + " responseMessage:" + responseMessage2);
try {
httpURLConnection2.disconnect();
dataOutputStream2.close();
} catch (Exception unused) {
}
}
int a(OutputStream outputStream, String str) throws IOException {
if (TextUtils.isEmpty(str)) {
return 0;
}
byte[] bArr = new byte[4096];
StringBufferInputStream stringBufferInputStream = new StringBufferInputStream(str);
int i = 0;
for (int read = stringBufferInputStream.read(bArr, 0, 4096); read > 0; read = stringBufferInputStream.read(bArr, 0, 4096)) {
outputStream.write(bArr, 0, read);
i += read;
}
stringBufferInputStream.close();
return i;
}
int b(OutputStream outputStream, String str) throws IOException {
if (TextUtils.isEmpty(str)) {
return 0;
}
File file = new File(str);
if (!file.exists()) {
return 0;
}
byte[] bArr = new byte[4096];
FileInputStream fileInputStream = new FileInputStream(file);
int i = 0;
for (int read = fileInputStream.read(bArr, 0, 4096); read > 0; read = fileInputStream.read(bArr, 0, 4096)) {
outputStream.write(bArr, 0, read);
i += read;
}
fileInputStream.close();
return i;
}
}
}