换机精灵 v2.5.4版本的 MD5 值为:79a45ef9a3e238691e836db31e5f23f0
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.cx.launcher.cloud.e;
import android.text.TextUtils;
import com.c.a.d.f;
import com.c.a.d.i;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.json.JSONException;
import org.json.JSONObject;
public class a {
protected static ExecutorService e = Executors.newFixedThreadPool(3);
protected String f3163a;
protected f f3165c;
protected c f;
protected boolean f3164b = false;
protected List d = new ArrayList();
public a(f fVar, String str) {
this.f3163a = str;
this.f3165c = fVar;
}
public com.cx.launcher.cloud.e.a.b a(f fVar) {
ByteArrayOutputStream byteArrayOutputStream;
String[] split;
com.cx.launcher.cloud.e.a.b bVar = new com.cx.launcher.cloud.e.a.b();
com.cx.launcher.cloud.e.a.a aVar = new com.cx.launcher.cloud.e.a.a();
bVar.f3171c = aVar;
ByteArrayOutputStream byteArrayOutputStream2 = null;
try {
try {
com.c.a.c cVar = new com.c.a.c();
cVar.b(30000);
cVar.a(30000);
i a2 = cVar.a(com.c.a.d.b.d.POST, "http://yun.goyihu.com/cloud/api/V1.0/backup/file/fileInfoUpload", fVar);
byteArrayOutputStream = new ByteArrayOutputStream();
try {
try {
byte[] bArr = new byte[2048];
if (a2 != null) {
while (true) {
int read = a2.read(bArr);
if (read == -1) {
break;
}
byteArrayOutputStream.write(bArr, 0, read);
}
}
JSONObject jSONObject = new JSONObject(new String(byteArrayOutputStream.toByteArray()));
if (jSONObject.has("code")) {
bVar.f3169a = jSONObject.getInt("code");
}
if (jSONObject.has("msg")) {
bVar.f3170b = jSONObject.getString("msg");
}
if (jSONObject.has("data")) {
JSONObject jSONObject2 = jSONObject.getJSONObject("data");
if (jSONObject2.has("result")) {
aVar.f3166a = jSONObject2.getInt("result");
}
if (jSONObject2.has("dl_url")) {
aVar.f3167b = jSONObject2.getString("dl_url");
}
if (jSONObject2.has("uuid")) {
aVar.d = jSONObject2.getString("uuid");
}
aVar.f3168c = new ArrayList();
if (jSONObject2.has("succ_piece")) {
String string = jSONObject2.getString("succ_piece");
if (!TextUtils.isEmpty(string) && (split = string.split(",")) != null) {
for (String str : split) {
if (!TextUtils.isEmpty(str)) {
try {
Integer valueOf = Integer.valueOf(str);
aVar.f3168c.add(Integer.valueOf(valueOf == null ? 0 : valueOf.intValue()));
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
}
}
}
if (byteArrayOutputStream != null) {
try {
byteArrayOutputStream.close();
} catch (IOException e3) {
e3.printStackTrace();
}
}
} catch (Exception e4) {
e = e4;
e.printStackTrace();
bVar.f3169a = -1;
if (byteArrayOutputStream != null) {
try {
byteArrayOutputStream.close();
} catch (IOException e5) {
e5.printStackTrace();
}
}
return bVar;
}
} catch (com.c.a.c.b e6) {
e = e6;
e.printStackTrace();
bVar.f3169a = e.a();
if (byteArrayOutputStream != null) {
try {
byteArrayOutputStream.close();
} catch (IOException e7) {
e7.printStackTrace();
}
}
return bVar;
} catch (JSONException e8) {
e = e8;
e.printStackTrace();
aVar.f3166a = -1;
if (byteArrayOutputStream != null) {
try {
byteArrayOutputStream.close();
} catch (IOException e9) {
e9.printStackTrace();
}
}
return bVar;
}
} catch (Throwable th) {
th = th;
if (0 != 0) {
try {
byteArrayOutputStream2.close();
} catch (IOException e10) {
e10.printStackTrace();
}
}
throw th;
}
} catch (com.c.a.c.b e11) {
e = e11;
byteArrayOutputStream = null;
} catch (JSONException e12) {
e = e12;
byteArrayOutputStream = null;
} catch (Exception e13) {
e = e13;
byteArrayOutputStream = null;
} catch (Throwable th2) {
th = th2;
if (0 != 0) {
}
throw th;
}
return bVar;
}
public com.cx.launcher.cloud.e.a.b a(e eVar) {
ByteArrayOutputStream byteArrayOutputStream;
ByteArrayOutputStream byteArrayOutputStream2;
String[] split;
ByteArrayOutputStream byteArrayOutputStream3 = null;
com.cx.launcher.cloud.e.a.b bVar = new com.cx.launcher.cloud.e.a.b();
com.cx.launcher.cloud.e.a.c cVar = new com.cx.launcher.cloud.e.a.c();
bVar.f3171c = cVar;
if (eVar != null) {
try {
if (eVar.f3179c != null) {
try {
f fVar = new f();
JSONObject jSONObject = new JSONObject();
jSONObject.put("uuid", eVar.f3177a);
jSONObject.put("piece_num", eVar.f3178b);
jSONObject.put("piece_length", eVar.d);
fVar.a("params", jSONObject.toString());
byte[] bArr = new byte[eVar.d];
System.arraycopy(eVar.f3179c, 0, bArr, 0, eVar.d);
fVar.a("file", new ByteArrayInputStream(bArr), eVar.d, "");
com.c.a.c cVar2 = new com.c.a.c();
cVar2.b(30000);
cVar2.a(30000);
i a2 = cVar2.a(com.c.a.d.b.d.POST, "http://yun.goyihu.com/cloud/api/V1.0/backup/file/upload", fVar);
byteArrayOutputStream2 = new ByteArrayOutputStream();
try {
try {
byte[] bArr2 = new byte[2048];
if (a2 != null) {
while (true) {
int read = a2.read(bArr2);
if (read == -1) {
break;
}
byteArrayOutputStream2.write(bArr2, 0, read);
}
}
JSONObject jSONObject2 = new JSONObject(new String(byteArrayOutputStream2.toByteArray()));
if (jSONObject2.has("code")) {
bVar.f3169a = jSONObject2.getInt("code");
}
if (jSONObject2.has("msg")) {
bVar.f3170b = jSONObject2.getString("msg");
}
if (jSONObject2.has("data")) {
JSONObject jSONObject3 = jSONObject2.getJSONObject("data");
if (jSONObject3.has("result")) {
cVar.f3172a = jSONObject3.getInt("result");
}
if (jSONObject3.has("uuid")) {
cVar.f3173b = jSONObject3.getString("uuid");
}
if (jSONObject3.has("dl_url")) {
cVar.d = jSONObject3.getString("dl_url");
}
cVar.f3174c = new ArrayList();
if (jSONObject3.has("succ_piece")) {
String string = jSONObject3.getString("succ_piece");
if (!TextUtils.isEmpty(string) && (split = string.split(",")) != null) {
for (String str : split) {
if (!TextUtils.isEmpty(str)) {
try {
Integer valueOf = Integer.valueOf(str);
if (valueOf != null) {
cVar.f3174c.add(valueOf);
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
}
}
}
if (byteArrayOutputStream2 == null) {
return bVar;
}
try {
byteArrayOutputStream2.close();
return bVar;
} catch (IOException e3) {
e3.printStackTrace();
return bVar;
}
} catch (Exception e4) {
e = e4;
e.printStackTrace();
bVar.f3169a = -1;
if (byteArrayOutputStream2 == null) {
return bVar;
}
try {
byteArrayOutputStream2.close();
return bVar;
} catch (IOException e5) {
e5.printStackTrace();
return bVar;
}
}
} catch (com.c.a.c.b e6) {
e = e6;
e.printStackTrace();
cVar.f3172a = e.a();
if (byteArrayOutputStream2 == null) {
return bVar;
}
try {
byteArrayOutputStream2.close();
return bVar;
} catch (IOException e7) {
e7.printStackTrace();
return bVar;
}
} catch (IOException e8) {
e = e8;
byteArrayOutputStream3 = byteArrayOutputStream2;
try {
e.printStackTrace();
cVar.f3172a = 4;
if (byteArrayOutputStream3 == null) {
return bVar;
}
try {
byteArrayOutputStream3.close();
return bVar;
} catch (IOException e9) {
e9.printStackTrace();
return bVar;
}
} catch (Throwable th) {
th = th;
byteArrayOutputStream = byteArrayOutputStream3;
if (byteArrayOutputStream != null) {
try {
byteArrayOutputStream.close();
} catch (IOException e10) {
e10.printStackTrace();
}
}
throw th;
}
} catch (JSONException e11) {
e = e11;
e.printStackTrace();
cVar.f3172a = 4;
if (byteArrayOutputStream2 == null) {
return bVar;
}
try {
byteArrayOutputStream2.close();
return bVar;
} catch (IOException e12) {
e12.printStackTrace();
return bVar;
}
}
} catch (com.c.a.c.b e13) {
e = e13;
byteArrayOutputStream2 = null;
} catch (IOException e14) {
e = e14;
} catch (JSONException e15) {
e = e15;
byteArrayOutputStream2 = null;
} catch (Exception e16) {
e = e16;
byteArrayOutputStream2 = null;
} catch (Throwable th2) {
th = th2;
byteArrayOutputStream = null;
if (byteArrayOutputStream != null) {
}
throw th;
}
}
} catch (Throwable th3) {
th = th3;
}
}
return null;
}
public void a() {
this.f3164b = true;
}
public void a(c cVar) {
this.f = cVar;
}
public void b() {
this.f3164b = false;
if (this.f != null) {
this.f.k();
}
e.submit(new b(this));
}
}