天津出行司机端 v6.9.3版本的 MD5 值为:b7a18e0f0e865860fd80aa9ed7cf4ae1
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.iflytek.idata.extension;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Base64;
import androidx.core.app.NotificationCompat;
import com.iflytek.cloud.SpeechConstant;
import com.iflytek.idata.extension.b;
import java.io.BufferedOutputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import org.json.JSONObject;
public class a implements Runnable {
private b.a a = new C0088a();
protected Context b;
private boolean c;
public a(Context context, boolean z) {
this.b = context;
this.c = z;
}
private boolean b() {
SharedPreferences b;
if (this.c || (b = com.iflytek.idata.extension.d.b.b(this.b)) == null) {
return true;
}
return System.currentTimeMillis() - b.getLong("last_check_time", 0L) > 604800000;
}
@Override
public void run() {
a();
}
private void a() {
try {
SystemClock.sleep(10000L);
if (b() && com.iflytek.idata.extension.d.b.a(this.b)) {
b bVar = new b();
bVar.b(20000);
bVar.a(1);
JSONObject jSONObject = new JSONObject();
jSONObject.put(SpeechConstant.APPID, IFlyCollectorExt.getInstance(this.b).getAppId());
jSONObject.put("ver", IFlyCollectorExt.getInstance(this.b).a());
jSONObject.put("impl", 2);
jSONObject.put("pkg", this.b.getPackageName());
bVar.a("https://logconf.iflytek.com/hotupdate", null, jSONObject.toString().getBytes("utf-8"));
bVar.b(this.a);
}
} catch (Throwable th) {
com.iflytek.idata.extension.d.a.c("Collector", "exception occur while update");
}
}
class C0088a implements b.a {
C0088a() {
}
@Override
public void a(b bVar, byte[] bArr) {
if (bArr != null) {
try {
a.this.a(new JSONObject(new String(bArr, "utf-8")));
} catch (Exception e) {
a(e);
}
}
}
@Override
public void a(Exception exc) {
com.iflytek.idata.extension.d.a.b("Collector", "update error:" + exc);
}
}
public void a(JSONObject jSONObject) {
if ("yes".equalsIgnoreCase(jSONObject.optString("update"))) {
String optString = jSONObject.optString(NotificationCompat.CATEGORY_MESSAGE);
if (!TextUtils.isEmpty(optString)) {
a(Base64.decode(optString, 0));
}
} else {
com.iflytek.idata.extension.d.a.a("Collector", "no need to update");
}
SharedPreferences.Editor edit = com.iflytek.idata.extension.d.b.b(this.b).edit();
edit.putLong("last_check_time", System.currentTimeMillis());
edit.apply();
}
private void a(byte[] bArr) {
BufferedOutputStream bufferedOutputStream;
IFlyCollectorExt iFlyCollectorExt = IFlyCollectorExt.getInstance(this.b);
iFlyCollectorExt.c();
File file = new File(iFlyCollectorExt.b(), com.iflytek.idata.extension.d.b.a());
FileOutputStream fileOutputStream = null;
try {
FileOutputStream fileOutputStream2 = new FileOutputStream(file);
try {
bufferedOutputStream = new BufferedOutputStream(fileOutputStream2);
try {
bufferedOutputStream.write(bArr);
a(bufferedOutputStream);
a(fileOutputStream2);
} catch (Throwable th) {
th = th;
fileOutputStream = fileOutputStream2;
try {
th.printStackTrace();
} finally {
a(bufferedOutputStream);
a(fileOutputStream);
}
}
} catch (Throwable th2) {
th = th2;
bufferedOutputStream = null;
}
} catch (Throwable th3) {
th = th3;
bufferedOutputStream = null;
}
}
private static void a(Closeable closeable) {
if (closeable != null) {
try {
closeable.close();
} catch (IOException e) {
}
}
}
}