TIM v2.3.1版本的 MD5 值为:d6957e3ee7ce901ccc491cefdea0da8c

以下内容为反编译后的 TroopMemberCharmUtils.java 源代码,内容仅作参考


package com.tencent.mobileqq.troop.utils;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.v4.util.LruCache;
import com.tencent.image.URLDrawable;
import com.tencent.mobileqq.msf.core.NetConnInfoCenter;
import com.tencent.mobileqq.util.SharePreferenceUtils;
import java.util.Calendar;
public class TroopMemberCharmUtils {
    public static final int f94118a = 1;
    public static final String f32635a = "http://qun.qq.com/qunpay/gifts/charm.html?from=31&_wv=1031&_bid=2204&uin=";
    public static final int f94119b = 2;
    public static final String f32637b = "http://pub.idqqimg.com/pc/misc/groupgift/charminglevel_%1$s_aio.png";
    public static final int f94120c = 4;
    public static final String f32638c = "http://pub.idqqimg.com/pc/misc/groupgift/charminglevel_%1$s_card.png";
    protected static final int d = 4;
    public static final String f32639d = "glamour_has_update_today";
    public static final String e = "glamour_updated";
    protected static LruCache f32634a = new LruCache(4);
    protected static LruCache f32636b = new LruCache(4);

    public static Drawable a(int i, int i2) {
        if (i2 == 1) {
            Drawable drawable = (Drawable) f32634a.get(Integer.valueOf(i));
            if (drawable == null) {
                URLDrawable drawable2 = URLDrawable.getDrawable(String.format(f32637b, Integer.valueOf(i)), URLDrawable.URLDrawableOptions.obtain());
                f32634a.put(Integer.valueOf(i), drawable2);
                return drawable2;
            }
            return drawable;
        } else if (i2 != 2) {
            return null;
        } else {
            Drawable drawable3 = (Drawable) f32636b.get(Integer.valueOf(i));
            if (drawable3 == null) {
                URLDrawable drawable4 = URLDrawable.getDrawable(String.format(f32638c, Integer.valueOf(i)), URLDrawable.URLDrawableOptions.obtain());
                f32636b.put(Integer.valueOf(i), drawable4);
                return drawable4;
            }
            return drawable3;
        }
    }

    protected static void a() {
        for (int i = 0; i < 4; i++) {
            f32634a.remove(Integer.valueOf(i));
            URLDrawable.removeMemoryCacheByUrl(String.format(f32637b, Integer.valueOf(i)));
            f32636b.remove(Integer.valueOf(i));
            URLDrawable.removeMemoryCacheByUrl(String.format(f32638c, Integer.valueOf(i)));
        }
    }

    public static boolean a(Context context) {
        if (e.equals(SharePreferenceUtils.a(context, f32639d))) {
            return false;
        }
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(NetConnInfoCenter.getServerTime() * 1000);
        if (calendar.get(11) >= 4) {
            a();
            SharePreferenceUtils.a(context, f32639d, e);
        }
        return true;
    }

    public static String a(String str, String str2) {
        return f32635a + str + "&gc=" + str2;
    }
}