App List v1.4.1版本的 MD5 值为:83af4eccc4c2dbeaca363142fe3c4495
以下内容为反编译后的 g.java 源代码,内容仅作参考
package com.cvte.tv.appstore.a;
import android.content.Context;
import android.content.pm.PackageManager;
import android.util.Log;
import com.cvte.tv.appstore.utils.i;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpHeaders;
public class g {
static class a {
@SerializedName("PreInstallAppFilter")
List<String> f595a = new ArrayList();
@SerializedName("ApplistFilter")
List<String> b = new ArrayList();
a() {
}
}
public static class b {
String f596a;
String b;
String c;
String d;
String e;
int f;
b() {
}
}
public static a a(Context context) {
a aVar;
try {
aVar = (a) new Gson().fromJson((Reader) new FileReader(d(context)), a.class);
} catch (Exception e) {
Log.e("OnlineConfigHelper", "getConfig err", e);
aVar = null;
}
e(context);
return aVar != null ? aVar : new a();
}
public static void b(HttpURLConnection httpURLConnection, String str) {
if (str == null || str.isEmpty()) {
return;
}
httpURLConnection.setRequestProperty(HttpHeaders.CONTENT_LENGTH, String.valueOf(str.getBytes().length));
try {
OutputStream outputStream = httpURLConnection.getOutputStream();
outputStream.write(str.getBytes());
outputStream.flush();
outputStream.close();
} catch (Exception e) {
Log.e("OnlineConfigHelper", "sendParam err", e);
}
}
public static File d(Context context) {
return new File(context.getCacheDir(), "AppstoreOnlineConfig.json");
}
private static void e(final Context context) {
new Thread(new Runnable() {
@Override
public void run() {
try {
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL("http://starkapp.cvte.com/ws/apk/blackList").openConnection();
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setDoOutput(true);
httpURLConnection.setDoInput(true);
httpURLConnection.setUseCaches(false);
httpURLConnection.setRequestProperty("Charset", "UTF-8");
httpURLConnection.setRequestProperty(HttpHeaders.CONTENT_TYPE, "application/json; charset=UTF-8");
httpURLConnection.setRequestProperty("accept", "application/json");
g.b(httpURLConnection, g.f(context));
if (httpURLConnection.getResponseCode() != 200) {
return;
}
InputStream inputStream = httpURLConnection.getInputStream();
FileOutputStream fileOutputStream = new FileOutputStream(g.d(context));
byte[] bArr = new byte[1024];
int i = 0;
while (true) {
int read = inputStream.read(bArr);
if (read == -1) {
inputStream.close();
fileOutputStream.close();
return;
} else {
fileOutputStream.write(bArr, i, read);
i += read;
}
}
} catch (Exception e) {
Log.e("OnlineConfigHelper", "updateOnlineConfig err", e);
}
}
}).start();
}
public static String f(Context context) {
String a2 = i.a(context).a("ro.CVTE_DEF_LAUNCHER_BATCH_CODE", "CVTE_TV_STARK");
String str = "null";
try {
str = context.getPackageManager().getApplicationInfo(context.getPackageName(), 128).metaData.getString("MENGYOU_APPKEY");
} catch (PackageManager.NameNotFoundException e) {
Log.e("OnlineConfigHelper", "get MENGYOU_APPKEY err", e);
}
b bVar = new b();
bVar.f596a = com.cvte.tv.appstore.utils.f.d();
bVar.b = a2;
bVar.f = 1534736339;
bVar.c = "1.4.1";
bVar.d = "com.cvte.tv.appstore";
bVar.e = str;
return new Gson().toJson(bVar);
}
}