HYDK v3.0.0版本的 MD5 值为:36b96e4c5561390bc72ab66c2f29a92f
以下内容为反编译后的 xc2.java 源代码,内容仅作参考
package p.a.y.e.a.s.e.net;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
import com.blankj.utilcode.constant.TimeConstants;
import com.tencent.open.utils.HttpUtils;
import io.netty.handler.codec.dns.DefaultDnsRecordDecoder;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
public class xc2 {
private static Map<String, xc2> lite_byte = Collections.synchronizedMap(new HashMap());
private static String lite_case = null;
private Context lite_do;
private String lite_if;
private JSONObject lite_for = null;
private long lite_int = 0;
private int lite_new = 0;
private boolean lite_try = true;
public class a extends Thread {
public final Bundle lite_static;
public a(Bundle bundle) {
this.lite_static = bundle;
}
@Override
public void run() {
try {
xc2.this.lite_case(cd2.lite_throws(HttpUtils.lite_else(xc2.this.lite_do, "https://127.0.0.1/cgi.connect.qq.com/qqconnectopen/openapi/policy_conf", gb2.G, this.lite_static).lite_do));
} catch (Exception e) {
e.printStackTrace();
}
xc2.this.lite_new = 0;
}
}
private xc2(Context context, String str) {
this.lite_do = null;
this.lite_if = null;
this.lite_do = context.getApplicationContext();
this.lite_if = str;
lite_new();
lite_char();
}
private void lite_byte(String str, String str2) {
try {
if (this.lite_if != null) {
str = str + DefaultDnsRecordDecoder.ROOT + this.lite_if;
}
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(this.lite_do.openFileOutput(str, 0), Charset.forName("UTF-8"));
outputStreamWriter.write(str2);
outputStreamWriter.flush();
outputStreamWriter.close();
} catch (IOException e) {
e.printStackTrace();
}
}
public void lite_case(JSONObject jSONObject) {
lite_this("cgi back, do update");
this.lite_for = jSONObject;
lite_byte("com.tencent.open.config.json", jSONObject.toString());
this.lite_int = SystemClock.elapsedRealtime();
}
private void lite_char() {
if (this.lite_new != 0) {
lite_this("update thread is running, return");
return;
}
this.lite_new = 1;
Bundle bundle = new Bundle();
bundle.putString("appid", this.lite_if);
bundle.putString("appid_for_getting_config", this.lite_if);
bundle.putString("status_os", Build.VERSION.RELEASE);
bundle.putString("status_machine", Build.MODEL);
bundle.putString("status_version", Build.VERSION.SDK);
bundle.putString("sdkv", gb2.lite_else);
bundle.putString("sdkp", com.hisign.a.d.a.f635a);
new a(bundle).start();
}
private String lite_goto(String str) {
InputStream open;
String str2;
String str3 = "";
try {
try {
if (this.lite_if != null) {
str2 = str + DefaultDnsRecordDecoder.ROOT + this.lite_if;
} else {
str2 = str;
}
open = this.lite_do.openFileInput(str2);
} catch (IOException e) {
e.printStackTrace();
return "";
}
} catch (FileNotFoundException unused) {
open = this.lite_do.getAssets().open(str);
}
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(open, Charset.forName("UTF-8")));
StringBuffer stringBuffer = new StringBuffer();
while (true) {
try {
try {
try {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
}
stringBuffer.append(readLine);
} catch (IOException e2) {
e2.printStackTrace();
}
} catch (IOException e3) {
e3.printStackTrace();
open.close();
bufferedReader.close();
}
} catch (Throwable th) {
try {
open.close();
bufferedReader.close();
} catch (IOException e4) {
e4.printStackTrace();
}
throw th;
}
}
str3 = stringBuffer.toString();
open.close();
bufferedReader.close();
return str3;
}
public static xc2 lite_int(Context context, String str) {
xc2 xc2Var;
synchronized (lite_byte) {
hc2.lite_const("openSDK_LOG.OpenConfig", "getInstance begin");
if (str != null) {
lite_case = str;
}
if (str == null && (str = lite_case) == null) {
str = "0";
}
xc2Var = lite_byte.get(str);
if (xc2Var == null) {
xc2Var = new xc2(context, str);
lite_byte.put(str, xc2Var);
}
hc2.lite_const("openSDK_LOG.OpenConfig", "getInstance end");
}
return xc2Var;
}
private void lite_long() {
int optInt = this.lite_for.optInt("Common_frequency");
if (optInt == 0) {
optInt = 1;
}
if (SystemClock.elapsedRealtime() - this.lite_int >= optInt * TimeConstants.lite_int) {
lite_char();
}
}
private void lite_new() {
try {
this.lite_for = new JSONObject(lite_goto("com.tencent.open.config.json"));
} catch (JSONException unused) {
this.lite_for = new JSONObject();
}
}
private void lite_this(String str) {
if (this.lite_try) {
StringBuilder g = r5.g(str, "; appid: ");
g.append(this.lite_if);
hc2.lite_const("openSDK_LOG.OpenConfig", g.toString());
}
}
public boolean lite_else(String str) {
lite_this(r5.lite_throws("get ", str));
lite_long();
Object opt = this.lite_for.opt(str);
if (opt == null) {
return false;
}
if (opt instanceof Integer) {
return !opt.equals(0);
}
if (opt instanceof Boolean) {
return ((Boolean) opt).booleanValue();
}
return false;
}
public int lite_if(String str) {
lite_this(r5.lite_throws("get ", str));
lite_long();
return this.lite_for.optInt(str);
}
}