安全中心 v4.9.2版本的 MD5 值为:d64c0ec7920c532fa6e6d9bb001cf9bf
以下内容为反编译后的 RequestUtil.java 源代码,内容仅作参考
package com.anguanjia.framework.network;
import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import com.anguanjia.framework.system.MyLog;
import com.anguanjia.framework.userhabit.UHAnalytics;
import com.anguanjia.framework.utils.SslException;
import com.anguanjia.framework.utils.SslUtileExt;
import com.anguanjia.framework.utils.SystemTool;
import com.anguanjia.framework.utils.SystemUtil;
import com.google.gson.Gson;
import com.tencent.kingkong.database.SQLiteDatabase;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import meri.pluginsdk.d;
import meri.pluginsdk.h;
import meri.pluginsdk.l;
import org.apache.http.protocol.HTTP;
public class RequestUtil {
static CommonParameters COM_PARAMETERS;
static String[] PUSH_INDEXES;
private static h piApplicationContext;
public static boolean ewr = false;
public static String URL = "http://sec.aqgj.cn/test.cgi";
static long CACHE_TIME = d.ag.eOw;
public static String USER_ID = SQLiteDatabase.KeyEmpty;
public static String IMSI = SQLiteDatabase.KeyEmpty;
public static int REQUEST_VER = 3;
public static synchronized void Init(l lVar) {
synchronized (RequestUtil.class) {
piApplicationContext = lVar.lb().kI();
IMSI = k(piApplicationContext);
USER_ID = SystemUtil.getExtId(lVar);
COM_PARAMETERS = initCommonParameters(lVar);
String channel = SystemTool.getChannel(lVar.aHw);
if (channel != null && (channel.equalsIgnoreCase("debug") || channel.equalsIgnoreCase("123456"))) {
URL = "http://sec.aqgj.cn/test.cgi";
} else {
URL = "http://sec.aqgj.cn/security.cgi";
}
ewr = true;
}
}
public static String getZipData(String str) {
try {
return SslUtileExt.getInstance().data_to_compress(str, str.length());
} catch (SslException e) {
e.printStackTrace();
return SQLiteDatabase.KeyEmpty;
}
}
public static String getUnzipData(String str) {
try {
return SslUtileExt.getInstance().data_to_uncompress(str);
} catch (SslException e) {
e.printStackTrace();
return SQLiteDatabase.KeyEmpty;
}
}
public static String getEncryptedData(String str) {
if (SslUtileExt.getInstance().CPri == null) {
MyLog.d("KEY", "null");
} else {
MyLog.d("KEY", SslUtileExt.getInstance().CPri);
}
try {
return SslUtileExt.getInstance().data_to_encrypt_with_key(SslUtileExt.getInstance().CPri, SslUtileExt.getInstance().CPri.length(), str);
} catch (SslException e) {
e.printStackTrace();
return SQLiteDatabase.KeyEmpty;
}
}
public static String getDecryptedData(String str) {
try {
return SslUtileExt.getInstance().data_to_decrypt_with_key(SslUtileExt.getInstance().CPri, SslUtileExt.getInstance().CPri.length(), str, str.length());
} catch (SslException e) {
e.printStackTrace();
return SQLiteDatabase.KeyEmpty;
}
}
public static String getEncryptedDataSimple(String str) {
try {
return SslUtileExt.getInstance().data_to_encrypt(str);
} catch (Exception e) {
return SQLiteDatabase.KeyEmpty;
}
}
public static String getDecryptedDataSimple(String str) {
try {
return SslUtileExt.getInstance().data_to_decrypt(str, str.length());
} catch (Exception e) {
return SQLiteDatabase.KeyEmpty;
}
}
private static String k(Context context) {
return SystemUtil.getDefaultImsi(context);
}
public static String eh() {
return piApplicationContext.getSharedPreferences("net", 0).getString("userId", SQLiteDatabase.KeyEmpty);
}
public static void clearUserId() {
saveUserId(SQLiteDatabase.KeyEmpty);
}
public static void saveUserId(String str) {
SharedPreferences.Editor edit = piApplicationContext.getSharedPreferences("net", 0).edit();
edit.putString("userId", str);
edit.commit();
USER_ID = str;
}
public static CommonParameters initCommonParameters(l lVar) {
CommonParameters commonParameters = new CommonParameters(lVar);
COM_PARAMETERS = commonParameters;
return commonParameters;
}
private static String[] initPushList(Context context) {
String[] split;
try {
if (SystemUtil.getTelOperatorsImsi(context) == null) {
split = new String[]{getPushListString(context.getResources().getAssets().open("push_no_telecom.config"))};
} else {
split = getPushListString(context.getResources().getAssets().open("push.config")).split(",");
}
return split;
} catch (Exception e) {
e.printStackTrace();
return new String[0];
}
}
private static String getPushListString(InputStream inputStream) {
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byte[] bArr = new byte[4096];
while (true) {
int read = inputStream.read(bArr, 0, 4096);
if (read != -1) {
byteArrayOutputStream.write(bArr, 0, read);
} else {
String str = new String(byteArrayOutputStream.toByteArray(), HTTP.UTF_8);
byteArrayOutputStream.close();
inputStream.close();
return str;
}
}
} catch (Exception e) {
e.printStackTrace();
return SQLiteDatabase.KeyEmpty;
}
}
public static CommonParameters getCommonParams() {
return COM_PARAMETERS;
}
public static String getBusinessParams(LinkedHashMap<String, String> linkedHashMap) {
return new Gson().toJson(linkedHashMap);
}
public static LinkedList<PushUnit> getPushParams() {
LinkedList<PushUnit> linkedList = new LinkedList<>();
for (PushUnit pushUnit : PushManager.PUSH_PARAMS_MAP.values()) {
if (pushUnit.getPushUnitListener() != null) {
if (pushUnit.getPushUnitListener().onRefresh()) {
String refreshPush = pushUnit.getPushUnitListener().getRefreshPush();
if (!TextUtils.isEmpty(refreshPush) && refreshPush.contains(",")) {
MyLog.d("getRefreshPush:", refreshPush);
String[] split = refreshPush.split(",");
if (split != null && split.length >= 2) {
String str = split[0];
String str2 = split[1];
if (!TextUtils.isEmpty(str) && !TextUtils.isEmpty(str2)) {
pushUnit.add(str, str2);
linkedList.add(pushUnit);
}
}
}
}
} else {
linkedList.add(pushUnit);
}
}
return linkedList;
}
public static LinkedHashMap<String, String> getUserdataParams(long j) {
LinkedHashMap<String, String> linkedHashMap = new LinkedHashMap<>();
linkedHashMap.put("tb", String.valueOf(UHAnalytics.getBeginTime()));
linkedHashMap.put("te", String.valueOf(j));
linkedHashMap.put("H_type1", UHAnalytics.getUHString(0));
linkedHashMap.put("H_type2", UHAnalytics.getUHString(1));
linkedHashMap.put("H_type3", UHAnalytics.getUHString(2));
linkedHashMap.put("H_type4", UHAnalytics.getUHString(3));
linkedHashMap.put("H_type5", UHAnalytics.getUHString(4));
return linkedHashMap;
}
}