TIM v2.3.1版本的 MD5 值为:d6957e3ee7ce901ccc491cefdea0da8c
以下内容为反编译后的 TroopNotificationUtils.java 源代码,内容仅作参考
package com.tencent.mobileqq.activity.contact.troop;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import com.tencent.mobileqq.activity.QQBrowserActivity;
import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.app.RecommendTroopManagerImp;
import com.tencent.mobileqq.systemmsg.GroupSystemMsgController;
import com.tencent.mobileqq.util.FaceDecoder;
import com.tencent.mobileqq.utils.ImageUtil;
import com.tencent.qphone.base.util.BaseApplication;
import com.tencent.qphone.base.util.QLog;
import java.util.HashMap;
import tencent.mobileim.structmsg.structmsg;
public class TroopNotificationUtils {
public static final int f86185a = 0;
protected static final String f14121a = "TroopNotificationUtils";
protected static HashMap f14122a = null;
public static final int f86186b = 1;
protected static final String f14123b = "troop_notification_sp";
public static final int f86187c = 2;
public static final String f14124c = "share_key_pay2joinTroop_request_num";
protected static final String d = "http://qun.qq.com/qunpay/qunfee/pay.html?gc=%s&source=joingroup&_wv=1031";
public interface TroopPrivilegeCallback {
void a(String str, structmsg.StructMsg structMsg, int i);
void a(String str, structmsg.StructMsg structMsg, int i, int i2, String str2);
}
public static int a(int i) {
switch (i) {
case 1:
case 13:
case 22:
case 60:
return 2;
case 10:
case 12:
return 1;
case 82:
default:
return 0;
}
}
public static Drawable a(FaceDecoder faceDecoder, String str, int i) {
if (faceDecoder == null || str == null || i == -1) {
return null;
}
if (faceDecoder.m8991b()) {
faceDecoder.b();
}
Bitmap a2 = faceDecoder.a(i, str);
if (a2 == null) {
faceDecoder.a(str, i, true);
if (i == 4) {
a2 = ImageUtil.f();
} else {
a2 = ImageUtil.a();
}
}
return new BitmapDrawable(a2);
}
public static int a(QQAppInterface qQAppInterface) {
int a2 = 0 + GroupSystemMsgController.a().a(qQAppInterface) + RecommendTroopManagerImp.b(qQAppInterface);
if (QLog.isDevelopLevel()) {
QLog.d(f14121a, 4, "getTroopNotificationUnreadNum:" + a2);
}
return a2;
}
public static void a() {
if (QLog.isColorLevel()) {
QLog.d(f14121a, 2, "clearAccountLoginInfoSp");
}
SharedPreferences sharedPreferences = BaseApplication.getContext().getSharedPreferences(f14123b, 0);
if (sharedPreferences != null) {
sharedPreferences.edit().clear().commit();
}
}
public static boolean m3437a(String str) {
SharedPreferences sharedPreferences;
boolean z = false;
if (!TextUtils.isEmpty(str) && (sharedPreferences = BaseApplication.getContext().getSharedPreferences(f14123b, 0)) != null) {
z = sharedPreferences.getBoolean("isFirstLogin" + str, true);
if (QLog.isColorLevel()) {
QLog.d(f14121a, 2, "isAccountFirstLogin uin=" + str + " result=" + z);
}
}
return z;
}
public static void a(String str, boolean z) {
SharedPreferences sharedPreferences;
if (!TextUtils.isEmpty(str) && (sharedPreferences = BaseApplication.getContext().getSharedPreferences(f14123b, 0)) != null) {
sharedPreferences.edit().putBoolean("isFirstLogin" + str, z).commit();
if (QLog.isColorLevel()) {
QLog.d(f14121a, 2, "setIsAccountFirstLogin uin=" + str + " firstLogin=" + z);
}
}
}
public static final void a(Context context, String str) {
Intent intent = new Intent(context, QQBrowserActivity.class);
intent.putExtra("url", String.format(d, str));
context.startActivity(intent);
}
public static void m3436a(QQAppInterface qQAppInterface) {
SharedPreferences sharedPreferences = qQAppInterface.getApp().getSharedPreferences(qQAppInterface.getAccount(), 0);
SharedPreferences.Editor edit = sharedPreferences.edit();
edit.putInt(f14124c, sharedPreferences.getInt(f14124c, 0) + 1);
edit.commit();
}
public static void m3438b(QQAppInterface qQAppInterface) {
SharedPreferences.Editor edit = qQAppInterface.getApp().getSharedPreferences(qQAppInterface.getAccount(), 0).edit();
edit.putInt(f14124c, 0);
edit.commit();
}
public static int b(QQAppInterface qQAppInterface) {
return qQAppInterface.getApp().getSharedPreferences(qQAppInterface.getAccount(), 0).getInt(f14124c, 0);
}
public static final void a(String str, structmsg.StructMsg structMsg) {
if (f14122a == null) {
f14122a = new HashMap(3);
}
f14122a.put(str, structMsg);
}
public static final void b() {
if (f14122a != null) {
f14122a.clear();
}
}
public static final structmsg.StructMsg a(String str) {
if (f14122a == null || !f14122a.containsKey(str)) {
return null;
}
return (structmsg.StructMsg) f14122a.get(str);
}
}