TIM v2.3.1版本的 MD5 值为:d6957e3ee7ce901ccc491cefdea0da8c
以下内容为反编译后的 EmoticonUtils.java 源代码,内容仅作参考
package com.tencent.mobileqq.emoticonview;
import android.app.Activity;
import android.content.Context;
import com.tencent.mobileqq.activity.ChatActivity;
import com.tencent.mobileqq.activity.aio.SessionInfo;
import com.tencent.mobileqq.app.AppConstants;
import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.data.EmoticonPackage;
import com.tencent.mobileqq.model.EmoticonManager;
import com.tencent.mobileqq.msf.sdk.SettingCloneUtil;
import com.tencent.mobileqq.statistics.ReportController;
import com.tencent.mobileqq.text.QQText;
import com.tencent.mobileqq.utils.NetworkUtil;
import com.tencent.qphone.base.util.BaseApplication;
import com.tencent.qphone.base.util.QLog;
import com.tencent.tim.R;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;
import mqq.os.MqqHandler;
public class EmoticonUtils {
public static String f89138a = "http://i.gtimg.cn/qqshow/admindata/comdata/vipSmallEmoji_item_[epId]/[eId].gif";
public static String f89139b = "http://i.gtimg.cn/qqshow/admindata/comdata/vipSmallEmoji_item_[epId]/xydata.json";
public static String f89140c = "http://i.gtimg.cn/qqshow/admindata/comdata/vipSmallEmoji_item_[epId]/[eId].png";
public static String d = "http://i.gtimg.cn/club/item/parcel/item/[eIdSub]/[eId]/ring.amr";
public static String e = "http://i.gtimg.cn/club/item/parcel/item/[eIdSub]/[eId]/pngframe.zip";
public static String f = "http://i.gtimg.cn/club/item/parcel/item/[eIdSub]/[eId]/126x126.png";
public static String g = "http://i.gtimg.cn/club/item/parcel/item/[eIdSub]/[eId]/[width]_[height]";
public static String h = "http://i.gtimg.cn/club/item/parcel/item/[eIdSub]/[eId]/[width]x[height].png";
public static String i = AppConstants.dt + "[epId]" + File.separator;
public static String j = AppConstants.cp + "[epId]" + File.separator;
public static String k = j + "[eId].amr";
public static String l = j + "[eId]_thu.png";
public static String m = j + "[eId]_aio.png";
public static String n = j + "[epId].jtmp";
public static String o = j + "[eId]";
public static String p = j + "h5magic" + File.separator;
public static String q = p + "index.html";
public static String r = p + "fileList";
public static String s = j + "[epId].zip";
public static String t = j + "pngframe/";
private static final String u = "EmoticonUtils";
public static List a(QQAppInterface qQAppInterface) {
ArrayList arrayList = new ArrayList();
arrayList.add(new EmotionPanelInfo(7, 7, null));
arrayList.add(new EmotionPanelInfo(4, 4, null));
return arrayList;
}
public static List b(QQAppInterface qQAppInterface) {
EmotionPanelInfo emotionPanelInfo;
long currentTimeMillis = System.currentTimeMillis();
List synchronizedList = Collections.synchronizedList(new ArrayList());
List<EmoticonPackage> m6951a = ((EmoticonManager) qQAppInterface.getManager(13)).m6951a();
synchronizedList.add(new EmotionPanelInfo(7, 7, null));
synchronizedList.add(new EmotionPanelInfo(4, 4, null));
if (m6951a != null) {
for (EmoticonPackage emoticonPackage : m6951a) {
if (emoticonPackage.type != 1 && emoticonPackage.jobType == 0) {
if (emoticonPackage.jobType == 4) {
emotionPanelInfo = new EmotionPanelInfo(10, 7, emoticonPackage);
} else {
emotionPanelInfo = emoticonPackage.jobType == 0 ? new EmotionPanelInfo(6, 4, emoticonPackage) : null;
}
if (emotionPanelInfo != null) {
synchronizedList.add(emotionPanelInfo);
}
}
EmoticonTabAdapter.a(emoticonPackage.epId);
}
}
long currentTimeMillis2 = System.currentTimeMillis() - currentTimeMillis;
if (QLog.isColorLevel()) {
QLog.d(u, 2, "prepare data cost time:" + currentTimeMillis2);
}
return synchronizedList;
}
public static byte[] a(String str) {
int length = str.length() / 2;
byte[] bArr = new byte[length];
for (int i2 = 0; i2 < length; i2++) {
bArr[i2] = Integer.valueOf(str.substring(i2 * 2, (i2 * 2) + 2), 16).byteValue();
}
return bArr;
}
public static boolean a(EmoticonPackage emoticonPackage) {
return emoticonPackage != null && emoticonPackage.status == 2 && (emoticonPackage.updateFlag & 1) == 1;
}
public static boolean a(int i2) {
return (i2 & 1) == 1;
}
public static boolean b(int i2) {
return (i2 & 2) == 2;
}
public static boolean c(int i2) {
return i2 == 0 || i2 == 1 || i2 == 3000;
}
public static boolean a() {
int a2 = NetworkUtil.a((Context) BaseApplication.getContext());
return a2 == 1 || a2 == 3 || a2 == 4;
}
public static boolean b() {
return NetworkUtil.a((Context) BaseApplication.getContext()) == 1;
}
public static boolean c() {
BaseApplication context = BaseApplication.getContext();
int a2 = NetworkUtil.a((Context) context);
return (a2 == 3 || a2 == 4) && !SettingCloneUtil.readValue((Context) context, (String) null, context.getString(R.string.f63567name_res_0x7f0a142e), AppConstants.dT, true);
}
public static void a(QQText.EmotcationSpan[] emotcationSpanArr, float f2, float f3, boolean z, int i2, int i3, QQAppInterface qQAppInterface, SessionInfo sessionInfo, Activity activity, boolean z2) {
Iterator it;
String str;
if (emotcationSpanArr != null && qQAppInterface != null && sessionInfo != null && activity != null) {
TreeSet treeSet = new TreeSet();
int i4 = 0;
while (true) {
int i5 = i4;
if (i5 >= emotcationSpanArr.length) {
break;
}
QQText.EmotcationSpan emotcationSpan = emotcationSpanArr[i5];
if (emotcationSpan instanceof QQText.SmallEmojiSpan) {
QQText.SmallEmojiSpan smallEmojiSpan = (QQText.SmallEmojiSpan) emotcationSpan;
float f4 = smallEmojiSpan.f93240a;
float f5 = smallEmojiSpan.f93241b;
float f6 = smallEmojiSpan.f93242c;
float f7 = smallEmojiSpan.f30404d;
int i6 = smallEmojiSpan.f;
int i7 = smallEmojiSpan.g;
treeSet.add(Integer.valueOf(i6));
if (!z2 && f2 >= f4 && f2 <= f6 && f3 >= f5 && f3 <= f7 && !z) {
z = true;
i3 = i7;
i2 = i6;
}
}
i4 = i5 + 1;
}
if (z) {
if (treeSet.size() == 1) {
if (((EmoticonManager) qQAppInterface.getManager(13)).m6958b(String.valueOf(i2)) != null && sessionInfo.f85624a != 1008 && sessionInfo.f85624a != 1000 && sessionInfo.f85624a != 1001 && sessionInfo.f85624a != 1002 && sessionInfo.f85624a != 1003 && sessionInfo.f85624a != 1004 && sessionInfo.f85624a != 1005 && sessionInfo.f85624a != 1006) {
MqqHandler handler = qQAppInterface.getHandler(ChatActivity.class);
if (handler != null) {
handler.obtainMessage(22, String.valueOf(i2)).sendToTarget();
}
ReportController.b(qQAppInterface, "dc01331", "", "", "ep_mall", "0X8006FFE", 0, 0, String.valueOf(i2), String.valueOf(i3), "", "");
return;
}
ReportController.b(qQAppInterface, "dc01331", "", "", "ep_mall", "0X8006FFF", 0, 0, String.valueOf(i2), String.valueOf(i3), "", "");
return;
}
String str2 = "";
while (true) {
str = str2;
if (!treeSet.iterator().hasNext()) {
break;
}
str2 = str + ((Integer) it.next()) + ",";
}
if (!str.equals("")) {
str.substring(0, str.length() - 1);
}
ReportController.b(qQAppInterface, "dc01331", "", "", "ep_mall", "0X8007000", 0, 0, String.valueOf(i2), String.valueOf(i3), "", "");
}
}
}
}