TIM v2.3.1版本的 MD5 值为:d6957e3ee7ce901ccc491cefdea0da8c
以下内容为反编译后的 AboutConfig.java 源代码,内容仅作参考
package com.tencent.mobileqq.config;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Process;
import com.tencent.common.config.AppSetting;
import com.tencent.mobileqq.activity.QQBrowserActivity;
import com.tencent.mobileqq.app.MemoryManager;
import com.tencent.mobileqq.app.PluginConfigProxy;
import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.app.ThreadManager;
import com.tencent.mobileqq.app.automator.Automator;
import com.tencent.mobileqq.data.ResourcePluginInfo;
import com.tencent.mobileqq.persistence.EntityManager;
import com.tencent.mobileqq.statistics.StatisticCollector;
import com.tencent.mobileqq.troop.utils.TroopBarUtils;
import com.tencent.mobileqq.utils.DeviceInfoUtil;
import com.tencent.mobileqq.widget.IndexView;
import com.tencent.qphone.base.util.QLog;
import com.tencent.tim.R;
import cooperation.garbage.QUA;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import mqq.observer.ServerConfigObserver;
import protocol.KQQConfig.GetResourceReqInfoV2;
public class AboutConfig {
public static final String f88756a = "com.tx.aboutfunction";
public static final boolean f21487a = true;
public static final String f88757b = "http://fwd.3g.qq.com:8080/forward.jsp?bid=942";
public static final String f88758c = "com.tx.aboutimage";
public static final String d = "http://fwd.3g.qq.com:8080/forward.jsp?bid=943";
public static final String e = "com.tencent.Feedback_5_8";
public static final String f = "http://mma.qq.com/feedback/index.html";
public static final String g = "#_rc=mqq_faq_feedback";
public static final String h = "com.tencent.help_5_8";
public static final String i = "http://kf.qq.com/touch/product/mobileqq_platform_app.html?scene_id=kf180";
private QQAppInterface f21488a;
private boolean f21492b = true;
private ServerConfigObserver f21491a = new qmv(this);
private List f21490a = new ArrayList();
private Hashtable f21489a = new Hashtable();
public AboutConfig(QQAppInterface qQAppInterface) {
this.f21488a = qQAppInterface;
}
public void m5789a() {
this.f21492b = this.f21488a.getApp().getResources().getDisplayMetrics().widthPixels >= 480;
a(false);
for (int i2 = 0; i2 < this.f21490a.size(); i2++) {
ResourcePluginListener.a((ResourcePluginListener) this.f21490a.get(i2), (byte) 1, 2);
}
}
private Hashtable a() {
Hashtable hashtable = new Hashtable();
ResourcePluginInfo resourcePluginInfo = new ResourcePluginInfo();
resourcePluginInfo.strPkgName = f88756a;
resourcePluginInfo.strResName = this.f21488a.getApp().getString(R.string.f64515name_res_0x7f0a17e2);
resourcePluginInfo.strResURL = "";
resourcePluginInfo.sResSubType = (short) 2;
resourcePluginInfo.cCanChangeState = (byte) 0;
resourcePluginInfo.cDefaultState = (byte) 0;
resourcePluginInfo.cLocalState = (byte) 1;
resourcePluginInfo.cDataType = (byte) 1;
resourcePluginInfo.isNew = (byte) 1;
resourcePluginInfo.sLanType = (short) 1;
resourcePluginInfo.uiResId = 0L;
resourcePluginInfo.strGotoUrl = f88757b;
resourcePluginInfo.iPluginType = 32;
hashtable.put(resourcePluginInfo.strPkgName, resourcePluginInfo);
ResourcePluginInfo resourcePluginInfo2 = new ResourcePluginInfo();
resourcePluginInfo2.strPkgName = f88758c;
resourcePluginInfo2.strResName = this.f21488a.getApp().getString(R.string.f64516name_res_0x7f0a17e3);
resourcePluginInfo2.strResURL = "";
resourcePluginInfo2.sResSubType = (short) 2;
resourcePluginInfo2.cCanChangeState = (byte) 0;
resourcePluginInfo2.cDefaultState = (byte) 0;
resourcePluginInfo2.cLocalState = (byte) 1;
resourcePluginInfo2.cDataType = (byte) 1;
resourcePluginInfo2.isNew = (byte) 1;
resourcePluginInfo2.sLanType = (short) 1;
resourcePluginInfo2.uiResId = 0L;
resourcePluginInfo2.strGotoUrl = d;
resourcePluginInfo2.iPluginType = 32;
hashtable.put(resourcePluginInfo2.strPkgName, resourcePluginInfo2);
ResourcePluginInfo resourcePluginInfo3 = new ResourcePluginInfo();
resourcePluginInfo3.strPkgName = h;
resourcePluginInfo3.strResName = this.f21488a.getApp().getString(R.string.f66467name_res_0x7f0a1f87);
resourcePluginInfo3.strResDesc = "";
resourcePluginInfo3.strResURL = "";
resourcePluginInfo3.sResSubType = (short) 2;
resourcePluginInfo3.cCanChangeState = (byte) 0;
resourcePluginInfo3.cDefaultState = (byte) 0;
resourcePluginInfo3.cLocalState = (byte) 1;
resourcePluginInfo3.cDataType = (byte) 1;
resourcePluginInfo3.isNew = (byte) 1;
resourcePluginInfo3.sLanType = (short) 1;
resourcePluginInfo3.sPriority = (short) 0;
resourcePluginInfo3.uiResId = 0L;
resourcePluginInfo3.strGotoUrl = i;
resourcePluginInfo3.iPluginType = 32;
hashtable.put(resourcePluginInfo3.strPkgName, resourcePluginInfo3);
ResourcePluginInfo resourcePluginInfo4 = new ResourcePluginInfo();
resourcePluginInfo4.strPkgName = e;
resourcePluginInfo4.strResName = this.f21488a.getApp().getString(R.string.f66468name_res_0x7f0a1f88);
resourcePluginInfo4.strResDesc = "";
resourcePluginInfo4.strResURL = "";
resourcePluginInfo4.sResSubType = (short) 2;
resourcePluginInfo4.cCanChangeState = (byte) 0;
resourcePluginInfo4.cDefaultState = (byte) 0;
resourcePluginInfo4.cLocalState = (byte) 1;
resourcePluginInfo4.cDataType = (byte) 1;
resourcePluginInfo4.isNew = (byte) 1;
resourcePluginInfo4.sLanType = (short) 1;
resourcePluginInfo4.sPriority = (short) 0;
resourcePluginInfo4.uiResId = 0L;
resourcePluginInfo4.strGotoUrl = f;
resourcePluginInfo4.iPluginType = 32;
hashtable.put(resourcePluginInfo4.strPkgName, resourcePluginInfo4);
return hashtable;
}
public void a(boolean z) {
if (!this.f21488a.isLogin()) {
if (QLog.isColorLevel()) {
QLog.d("AboutConfig", 2, "error happens: loadAboutConfig while current account is null, which means there is no logined account now");
}
} else if (!z && this.f21489a != null && this.f21489a.size() > 0) {
if (QLog.isColorLevel()) {
QLog.d("AboutConfig", 2, "there has about data in memory cache, do not need load from DB");
}
} else {
this.f21489a = a();
ThreadManager.a(new qmu(this), 5, null, false);
}
}
public void a(ResourcePluginInfo resourcePluginInfo) {
if (this.f21489a != null && resourcePluginInfo != null && this.f21489a.containsKey(resourcePluginInfo.strPkgName)) {
ResourcePluginInfo resourcePluginInfo2 = (ResourcePluginInfo) this.f21489a.get(resourcePluginInfo.strPkgName);
resourcePluginInfo2.cLocalState = resourcePluginInfo.cLocalState;
resourcePluginInfo2.isNew = resourcePluginInfo.isNew;
EntityManager createEntityManager = this.f21488a.getEntityManagerFactory().createEntityManager();
try {
ResourcePluginInfo.persistOrReplace(createEntityManager, resourcePluginInfo2);
if (createEntityManager != null) {
createEntityManager.m7241a();
}
} catch (Exception e2) {
if (createEntityManager != null) {
createEntityManager.m7241a();
}
} catch (Throwable th) {
if (createEntityManager != null) {
createEntityManager.m7241a();
}
throw th;
}
}
}
public void c() {
if (this.f21489a != null) {
this.f21489a.clear();
}
}
public void a(ResourcePluginListener resourcePluginListener) {
if (!this.f21490a.contains(resourcePluginListener)) {
this.f21490a.add(resourcePluginListener);
}
}
public void b(ResourcePluginListener resourcePluginListener) {
this.f21490a.remove(resourcePluginListener);
}
public void a(PluginConfigProxy pluginConfigProxy) {
ArrayList arrayList = new ArrayList();
if (this.f21489a != null) {
for (ResourcePluginInfo resourcePluginInfo : ((Hashtable) this.f21489a.clone()).values()) {
if (resourcePluginInfo.cDataType == 0) {
GetResourceReqInfoV2 getResourceReqInfoV2 = new GetResourceReqInfoV2();
getResourceReqInfoV2.cState = (byte) 0;
getResourceReqInfoV2.sLanType = resourcePluginInfo.sLanType;
getResourceReqInfoV2.sResSubType = (short) 0;
getResourceReqInfoV2.strPkgName = resourcePluginInfo.strPkgName;
getResourceReqInfoV2.uiCurVer = resourcePluginInfo.uiCurVer;
arrayList.add(getResourceReqInfoV2);
}
}
}
if (QLog.isColorLevel()) {
QLog.d(Automator.f18855a, 2, "sendAboutConfig" + arrayList.size());
}
pluginConfigProxy.a(32, arrayList, this.f21491a);
}
public void b() {
for (ResourcePluginListener resourcePluginListener : new ArrayList(this.f21490a)) {
ResourcePluginListener.a(resourcePluginListener, (byte) 5, 2);
}
}
public ResourcePluginInfo a(String str) {
return (ResourcePluginInfo) this.f21489a.get(str);
}
public boolean m5790a() {
for (ResourcePluginInfo resourcePluginInfo : this.f21489a.values()) {
if (resourcePluginInfo.isNew == 0 && resourcePluginInfo.cLocalState == 1) {
return true;
}
}
return false;
}
public static void a(QQAppInterface qQAppInterface, Context context, ResourcePluginInfo resourcePluginInfo) {
String str;
String str2;
String str3;
String sb;
AboutConfig m4639a = qQAppInterface.m4639a();
String str4 = resourcePluginInfo.strGotoUrl;
String str5 = "version=6.5.5.1834.tim&appid=" + AppSetting.f83701a + "&QUA=" + QUA.a();
if (resourcePluginInfo.strPkgName.equals(e) || resourcePluginInfo.strPkgName.equals(h)) {
str5 = str5 + "&adtag=1834";
}
if (resourcePluginInfo.strPkgName.equals(e)) {
if (str4.endsWith(g)) {
str4 = str4.substring(0, str4.length() - g.length());
}
str = "?" + str5;
} else {
str = IndexView.f95329b + str5;
}
String str6 = str4 + str;
if (resourcePluginInfo.strPkgName.equals(e) || resourcePluginInfo.strPkgName.equals(h)) {
if (QLog.isColorLevel()) {
if (resourcePluginInfo.strPkgName.equals(e)) {
QLog.i("About-Feedback", 2, "feedfack before: url = " + str6);
} else if (resourcePluginInfo.strPkgName.equals(h)) {
QLog.i("About-Help", 2, "help before: url = " + str6);
}
}
String str7 = Build.MODEL;
if (str7 != null) {
str2 = str7.replaceAll(TroopBarUtils.y, "_");
} else {
str2 = "";
}
int a2 = StatisticCollector.a();
if (a2 > 0) {
str2 = str2 + "_qzpatch" + a2;
}
String str8 = Build.MANUFACTURER;
if (str8 != null) {
str3 = str8.replaceAll(TroopBarUtils.y, "_");
} else {
str3 = "";
}
StringBuilder sb2 = new StringBuilder();
sb2.append(str6).append("&model=").append(str2).append("&manufacture=").append(str3).append("&cpunum=").append(DeviceInfoUtil.b()).append("&cpurate=").append(DeviceInfoUtil.m9129a()).append("&mem=").append((DeviceInfoUtil.m9139c() / 1024) / 1024).append("&amem=").append((DeviceInfoUtil.m9142d() / 1024) / 1024).append("&w=").append(DeviceInfoUtil.f()).append("&h=").append(DeviceInfoUtil.g()).append("&pss=").append((MemoryManager.a(Process.myPid()) / 1024) / 1024).append("&heapmax=").append((Runtime.getRuntime().maxMemory() / 1024) / 1024).append("&heapsize=").append(((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024) / 1024).append("&sysver=").append(Build.VERSION.RELEASE);
sb = sb2.toString();
if (resourcePluginInfo.strPkgName.equals(e)) {
sb = sb + g;
}
if (QLog.isColorLevel()) {
if (resourcePluginInfo.strPkgName.equals(e)) {
QLog.i("About-Feedback", 2, "feedfack after: url = " + sb);
} else if (resourcePluginInfo.strPkgName.equals(h)) {
QLog.i("About-Help", 2, "help after: url = " + sb);
}
}
} else {
sb = str6;
}
Intent intent = new Intent(context, QQBrowserActivity.class);
intent.putExtra("portraitOnly", true);
intent.putExtra("url", sb).putExtra("bFormatUrl", false);
intent.putExtra("uin", qQAppInterface.getCurrentAccountUin());
if (resourcePluginInfo.strPkgName.equals(e) || resourcePluginInfo.strPkgName.equals(h)) {
intent.putExtra("reportMsfLog", true);
}
try {
context.startActivity(intent);
} catch (SecurityException e2) {
}
if (resourcePluginInfo.isNew == 0) {
resourcePluginInfo.isNew = (byte) 1;
ThreadManager.a(new qmw(m4639a, resourcePluginInfo), 8, null, false);
}
}
public void a(List list) {
if (this.f21489a != null && list != null && list.size() > 0) {
Iterator it = list.iterator();
while (it.hasNext()) {
ResourcePluginInfo resourcePluginInfo = (ResourcePluginInfo) it.next();
this.f21489a.put(resourcePluginInfo.strPkgName, resourcePluginInfo);
}
}
}
}