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

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


package com.tencent.mobileqq.util;

import KQQ.ReqItem;
import KQQ.RespItem;
import KQQ.UserBitFlagReq;
import KQQ.UserBitFlagRes;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.ImageSpan;
import android.view.View;
import android.widget.ImageView;
import com.qq.taf.jce.JceInputStream;
import com.tencent.common.app.BaseApplicationImpl;
import com.tencent.image.URLDrawable;
import com.tencent.mobileqq.activity.LoginActivity;
import com.tencent.mobileqq.activity.MainFragment;
import com.tencent.mobileqq.app.AppConstants;
import com.tencent.mobileqq.app.ConfigHandler;
import com.tencent.mobileqq.app.FriendsManager;
import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.conditionsearch.data.AddressData;
import com.tencent.mobileqq.data.Card;
import com.tencent.mobileqq.gesturelock.GesturePWDUtils;
import com.tencent.mobileqq.managers.TroopAssistantManager;
import com.tencent.mobileqq.msf.sdk.MsfConstants;
import com.tencent.mobileqq.msf.sdk.SettingCloneUtil;
import com.tencent.mobileqq.music.QQPlayerService;
import com.tencent.mobileqq.richstatus.StatusManager;
import com.tencent.mobileqq.service.profile.CheckUpdateItemInterface;
import com.tencent.mobileqq.statistics.ReportController;
import com.tencent.mobileqq.statistics.StatisticCollector;
import com.tencent.mobileqq.stt.SttManager;
import com.tencent.mobileqq.transfile.HttpNetReq;
import com.tencent.mobileqq.transfile.INetEngine;
import com.tencent.mobileqq.transfile.NetReq;
import com.tencent.mobileqq.vaswebviewplugin.ThemeUiPlugin;
import com.tencent.mobileqq.widget.IndexView;
import com.tencent.qphone.base.util.BaseApplication;
import com.tencent.qphone.base.util.QLog;
import com.tencent.tim.R;
import java.lang.ref.WeakReference;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
public class QQSettingUtil {
    public static int f94452a = 0;
    public static final String f33541a = "QQSetting";
    public static final String f94453b = "Setting_Quit";

    public static void m9044a(QQAppInterface qQAppInterface) {
        qQAppInterface.a(new vmb(qQAppInterface));
    }

    public static void b(QQAppInterface qQAppInterface) {
        boolean z;
        HashMap hashMap = new HashMap();
        BaseApplication app = qQAppInterface.getApp();
        boolean readValue = SettingCloneUtil.readValue((Context) app, (String) null, app.getString(R.string.f63567name_res_0x7f0a142e), AppConstants.dS, true);
        hashMap.put("Clk_auto_receive_pic", Integer.valueOf(readValue ? 1 : 0));
        StatusManager statusManager = (StatusManager) qQAppInterface.getManager(14);
        hashMap.put("Clk_signature_qzone", Integer.valueOf(statusManager != null ? statusManager.m7616b() : readValue ? 1 : 0));
        hashMap.put("Download_new", Integer.valueOf(ConfigHandler.m4200a(qQAppInterface, false) ? 1 : 0));
        hashMap.put("System_icon", Integer.valueOf(SettingCloneUtil.readValue((Context) app, (String) null, app.getString(R.string.f64906name_res_0x7f0a196e), AppConstants.dR, false) ? 1 : 0));
        hashMap.put("Enter_sendmsg", Integer.valueOf(SettingCloneUtil.readValue((Context) app, (String) null, qQAppInterface.getApp().getString(R.string.f63595name_res_0x7f0a144a), AppConstants.f17398eh, false) ? 1 : 0));
        hashMap.put("Mobile_pc_online", Integer.valueOf(SettingCloneUtil.readValue((Context) app, qQAppInterface.getCurrentAccountUin(), AppConstants.Preferences.af, AppConstants.f17394ed, true) ? 1 : 0));
        hashMap.put("Visible_same", Integer.valueOf(qQAppInterface.m4725n() ? 1 : 0));
        hashMap.put("Same_likeme", Integer.valueOf(qQAppInterface.m4728q() ? 1 : 0));
        hashMap.put("Search_number", Integer.valueOf(qQAppInterface.m4697b(true) ? 1 : 0));
        hashMap.put("Nearby_likeme", Integer.valueOf(qQAppInterface.m4727p() ? 1 : 0));
        if (qQAppInterface.m4709e() == 0) {
            z = false;
        } else {
            z = true;
        }
        hashMap.put("Latest_chatlog_syn", Integer.valueOf(z ? 1 : 0));
        hashMap.put("Gesture_password", Integer.valueOf(GesturePWDUtils.getGesturePWDState(app, qQAppInterface.getCurrentAccountUin()) == 2 ? 1 : 0));
        hashMap.put("Security_check", Integer.valueOf(SettingCloneUtil.readValue((Context) qQAppInterface.getApp(), (String) null, AppConstants.Preferences.bM, AppConstants.f17395ee, false) ? 1 : 0));
        hashMap.put("Setting_Gesture_password", Integer.valueOf(GesturePWDUtils.getGesturePWDState(app, qQAppInterface.getCurrentAccountUin()) == 2 ? 1 : 0));
        hashMap.put("Clk_hide_grp_heper", Integer.valueOf(TroopAssistantManager.a().m6934a() ? 1 : 0));
        hashMap.put("Clk_grp_heper_top", Integer.valueOf(TroopAssistantManager.a().b() ? 1 : 0));
        try {
            for (String str : hashMap.keySet()) {
                ReportController.b(qQAppInterface, ReportController.i, "", "", "Setting_tab", str, 0, 0, String.valueOf(hashMap.get(str)), "", "", "");
            }
            ReportController.b(qQAppInterface, ReportController.i, "", "", "Setting_tab", "Shake_screenshot_switch", 0, 0, String.valueOf(SettingCloneUtil.readValue((Context) qQAppInterface.getApp(), (String) null, qQAppInterface.getApp().getString(R.string.f63569name_res_0x7f0a1430), AppConstants.f17397eg, false) ? 1 : 0), "", "", "");
            ReportController.b(qQAppInterface, ReportController.i, "", "", "0X80044D1", "0X80044D1", 0, 0, String.valueOf(qQAppInterface.m4703c(false) ? 1 : 0), "", "", "");
            Card m4319a = ((FriendsManager) qQAppInterface.getManager(50)).m4319a(qQAppInterface.getCurrentAccountUin());
            if (m4319a != null) {
                ReportController.b(qQAppInterface, ReportController.i, "", "", "0X8004884", "0X8004884", 0, 0, String.valueOf(m4319a.allowPeopleSee ? 1 : 0), "", "", "");
            }
            ReportController.b(qQAppInterface, ReportController.i, "", "", "0X8004C5C", "0X8004C5C", 0, 0, String.valueOf(qQAppInterface.m4712e(false) ? 1 : 0), "", "", "");
            ReportController.b(qQAppInterface, ReportController.i, "", "", "0X8004C5D", "0X8004C5D", 0, 0, String.valueOf(qQAppInterface.m4716f(false) ? 1 : 0), "", "", "");
            FriendsManager friendsManager = (FriendsManager) qQAppInterface.getManager(50);
            int m4367e = friendsManager.m4367e();
            ReportController.b(qQAppInterface, ReportController.i, "", "", "0X8004C69", "0X8004C69", 0, 0, m4367e > 0 ? "1" : "0", m4367e > 0 ? String.valueOf(m4367e) : "", String.valueOf(friendsManager.d()), "");
            ReportController.b(qQAppInterface, ReportController.i, "", "", "0X8004EDE", "0X8004EDE", 0, 0, String.valueOf(qQAppInterface.f18470m ? 1 : 0), "", "", "");
        } catch (Exception e) {
        }
    }

    public static void a(Activity activity, QQAppInterface qQAppInterface, boolean z) {
        boolean z2 = true;
        Intent intent = new Intent();
        intent.setClass(activity, LoginActivity.class);
        intent.putExtra("logout_intent", true);
        ThemeUiPlugin.destroy(qQAppInterface);
        if (z) {
            z2 = false;
            intent.putExtra("tab_index", MainFragment.f85178b);
        }
        qQAppInterface.logout(z2);
        if (BaseApplicationImpl.f6969a != null) {
            BaseApplicationImpl.f6969a.evictAll();
        }
        a(activity, qQAppInterface.getCurrentAccountUin(), a(activity, qQAppInterface.getCurrentAccountUin()) + 1);
        activity.startActivityForResult(intent, 1000);
        if (QQPlayerService.m7028a()) {
            Intent intent2 = new Intent();
            intent2.setAction(QQPlayerService.d);
            activity.sendBroadcast(intent2);
        }
    }

    public static void a(Context context, String str, int i) {
        SharedPreferences.Editor edit = context.getSharedPreferences(AppConstants.f17367Y, 0).edit();
        edit.putInt("setting_quit_" + str, i);
        edit.commit();
    }

    public static int a(Context context, String str) {
        return context.getSharedPreferences(AppConstants.f17367Y, 0).getInt("setting_quit_" + str, 0);
    }

    public static SpannableString a(Resources resources, int i) {
        Drawable drawable;
        if (resources == null) {
            return new SpannableString("");
        }
        if (i == 0) {
            SpannableString spannableString = new SpannableString(MsfConstants.ProcessNameAll);
            int dimension = (int) resources.getDimension(R.dimen.f39532name_res_0x7f0c0076);
            Drawable drawable2 = resources.getDrawable(R.drawable.f44470name_res_0x7f020d46);
            drawable2.setBounds(0, 0, dimension, dimension);
            spannableString.setSpan(new ImageSpan(drawable2), 0, 1, 33);
            return spannableString;
        }
        int i2 = i / 64;
        int i3 = i % 64;
        int i4 = i3 / 16;
        int i5 = i3 % 16;
        int i6 = i5 / 4;
        int i7 = i5 % 4;
        String str = "";
        int i8 = 0;
        while (true) {
            int i9 = i8;
            if (i9 < 4) {
                int i10 = 0;
                String str2 = "";
                switch (i9) {
                    case 0:
                        str2 = "!";
                        i10 = i2;
                        break;
                    case 1:
                        str2 = "@";
                        i10 = i4;
                        break;
                    case 2:
                        str2 = "#";
                        i10 = i6;
                        break;
                    case 3:
                        str2 = "%";
                        i10 = i7;
                        break;
                }
                int i11 = 0;
                while (i11 < i10) {
                    i11++;
                    str = str + str2;
                }
                i8 = i9 + 1;
            } else {
                String str3 = (f94452a <= 1 || str.length() <= f94452a) ? str : str.substring(0, f94452a - 1) + IndexView.f35472a;
                SpannableString spannableString2 = new SpannableString(str3);
                int dimension2 = (int) resources.getDimension(R.dimen.f39532name_res_0x7f0c0076);
                for (int i12 = 0; i12 < str3.length(); i12++) {
                    String substring = str3.substring(i12, i12 + 1);
                    if ("!".equalsIgnoreCase(substring)) {
                        drawable = resources.getDrawable(R.drawable.f44468name_res_0x7f020d44);
                    } else if ("@".equalsIgnoreCase(substring)) {
                        drawable = resources.getDrawable(R.drawable.f44472name_res_0x7f020d48);
                    } else if ("#".equalsIgnoreCase(substring)) {
                        drawable = resources.getDrawable(R.drawable.f44469name_res_0x7f020d45);
                    } else if ("%".equalsIgnoreCase(substring)) {
                        drawable = resources.getDrawable(R.drawable.f44471name_res_0x7f020d47);
                    } else if (IndexView.f35472a.equalsIgnoreCase(substring)) {
                        drawable = resources.getDrawable(R.drawable.f46984name_res_0x7f021718);
                    } else {
                        drawable = null;
                    }
                    if (drawable != null) {
                        if (IndexView.f95329b.equalsIgnoreCase(substring)) {
                            drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
                        } else {
                            drawable.setBounds(0, 0, dimension2, dimension2);
                        }
                        spannableString2.setSpan(new ImageSpan(drawable), i12, i12 + 1, 33);
                    }
                }
                if (QLog.isDevelopLevel()) {
                    QLog.i(f33541a, 4, "parseQQLevel, sLevel = " + str3 + ", span = " + ((Object) spannableString2));
                }
                return spannableString2;
            }
        }
    }

    public static SpannableString a(View view, Resources resources, boolean z, boolean z2, int i) {
        SpannableString spannableString;
        WeakReference weakReference = new WeakReference(view);
        SpannableString spannableString2 = new SpannableString("");
        URLDrawable uRLDrawable = null;
        int dimension = (int) resources.getDimension(R.dimen.f39532name_res_0x7f0c0076);
        if (z && i > 0) {
            SpannableString spannableString3 = new SpannableString("sb");
            Drawable drawable = resources.getDrawable(R.drawable.f44476name_res_0x7f020d4c);
            uRLDrawable = URLDrawable.getDrawable("http://i.gtimg.cn/club/mobile/profile/vipicon2016/android/svip_" + i + ".png", drawable, drawable);
            uRLDrawable.setBounds(0, 0, (int) (68.0d * (dimension / 24.0d)), dimension);
            spannableString = spannableString3;
        } else if (!z2 || i <= 0) {
            spannableString = spannableString2;
        } else {
            SpannableString spannableString4 = new SpannableString("vb");
            Drawable drawable2 = resources.getDrawable(R.drawable.f44482name_res_0x7f020d52);
            uRLDrawable = URLDrawable.getDrawable("http://i.gtimg.cn/club/mobile/profile/vipicon2016/android/vip_" + i + ".png", drawable2, drawable2);
            uRLDrawable.setBounds(0, 0, (int) (58.0d * (dimension / 24.0d)), dimension);
            spannableString = spannableString4;
        }
        if (uRLDrawable != null) {
            uRLDrawable.mutate();
            uRLDrawable.setURLDrawableListener(new vmc(weakReference));
            spannableString.setSpan(new ImageSpan(uRLDrawable), 0, 1, 33);
            Drawable drawable3 = resources.getDrawable(R.drawable.f44483name_res_0x7f020d53);
            drawable3.setBounds(0, 0, (int) resources.getDimension(R.dimen.f39533name_res_0x7f0c0077), dimension);
            spannableString.setSpan(new ImageSpan(drawable3), 1, 2, 33);
        }
        if (QLog.isDevelopLevel()) {
            QLog.i(f33541a, 4, "parseClubLevel, bSuperVipOpen=" + z + ", bQQVipOpen=" + z2 + ",iVipLevel=" + i);
        }
        return spannableString;
    }

    public static void a(ImageView imageView, long j) {
        if (imageView != null) {
            if (QLog.isColorLevel()) {
                QLog.d(f33541a, 2, "online status = " + j);
            }
            if (j == 11) {
                imageView.setImageResource(R.drawable.f46733name_res_0x7f02161d);
            } else if (j == 41) {
                imageView.setImageResource(R.drawable.f46730name_res_0x7f02161a);
            } else if (j == 31) {
                imageView.setImageResource(R.drawable.f46731name_res_0x7f02161b);
            }
        }
    }

    public static String a(long j) {
        if (j == 11) {
            return "在线";
        }
        if (j == 41) {
            return "隐身";
        }
        if (j == 31) {
            return "离线";
        }
        return "";
    }

    public static void c(QQAppInterface qQAppInterface) {
        if (qQAppInterface != null) {
            StringBuilder sb = new StringBuilder();
            sb.append("Vip_pay_mywallet").append(AddressData.f88743a).append(qQAppInterface.getCurrentAccountUin()).append(AddressData.f88743a).append("").append(AddressData.f88743a).append("wallet").append(AddressData.f88743a).append("index").append(AddressData.f88743a).append(0).append(AddressData.f88743a).append(1).append(AddressData.f88743a).append(0).append(AddressData.f88743a).append("").append(AddressData.f88743a).append("").append(AddressData.f88743a).append("").append(AddressData.f88743a).append("").append(AddressData.f88743a);
            StatisticCollector.a((Context) null).c(qQAppInterface, sb.toString());
        }
    }

    public static int a(QQAppInterface qQAppInterface) {
        return qQAppInterface.getApp().getApplicationContext().getSharedPreferences(qQAppInterface.getCurrentAccountUin(), 0).getInt(AppConstants.Preferences.di, 1);
    }

    public static void d(QQAppInterface qQAppInterface) {
        SharedPreferences preferences = qQAppInterface.getPreferences();
        if (!TextUtils.equals(new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA).format(new Date()), preferences.getString(AppConstants.Preferences.dS, "2015-04-17"))) {
            INetEngine netEngine = qQAppInterface.getNetEngine(0);
            HttpNetReq httpNetReq = new HttpNetReq();
            httpNetReq.f30916a = "http://imgcache.qq.com/club/mobile/profile/template/vip_menu_conf.json";
            httpNetReq.f30937a = new vmd(preferences);
            netEngine.mo8566a((NetReq) httpNetReq);
        }
    }

    public class UserBitFlagCheckUpdate implements CheckUpdateItemInterface {
        private QQAppInterface f94454a;

        @Override
        public int mo4203a() {
            return 1;
        }

        public UserBitFlagCheckUpdate(QQAppInterface qQAppInterface) {
            this.f94454a = qQAppInterface;
        }

        @Override
        public ReqItem mo918a() {
            if (QLog.isColorLevel()) {
                QLog.d(QQSettingUtil.f33541a, 2, "getCheckUpdateItemData");
            }
            ReqItem reqItem = new ReqItem();
            reqItem.cOperType = (byte) 1;
            reqItem.eServiceID = 106;
            UserBitFlagReq userBitFlagReq = new UserBitFlagReq();
            userBitFlagReq.cEmotionMall = (byte) 0;
            userBitFlagReq.cMyWallet = (byte) QQSettingUtil.a(this.f94454a);
            userBitFlagReq.cPtt2Text = (byte) 0;
            userBitFlagReq.cAccout2Dis = (byte) 0;
            reqItem.vecParam = userBitFlagReq.toByteArray();
            return reqItem;
        }

        @Override
        public void a(RespItem respItem) {
            if (QLog.isColorLevel()) {
                QLog.d(QQSettingUtil.f33541a, 2, "handleCheckUpdateItemData");
            }
            if (respItem.eServiceID == 106) {
                UserBitFlagRes userBitFlagRes = new UserBitFlagRes();
                userBitFlagRes.readFrom(new JceInputStream(respItem.vecUpdate));
                byte b2 = userBitFlagRes.cEmotionMall;
                byte b3 = userBitFlagRes.cMyWallet;
                byte b4 = userBitFlagRes.cAccout2Dis;
                if (QLog.isColorLevel()) {
                    QLog.d(QQSettingUtil.f33541a, 2, "vEmotion=" + ((int) b2) + ",cMyWallet=" + ((int) b3) + ",cPtt2Text=" + ((int) userBitFlagRes.cPtt2Text) + " ,cAccout2Dis=" + ((int) b4));
                }
                if (this.f94454a != null) {
                    this.f94454a.getApp().getApplicationContext().getSharedPreferences(this.f94454a.getCurrentAccountUin(), 0).edit().putInt(AppConstants.Preferences.di, b3).putInt(AppConstants.Preferences.dj, b4).commit();
                    SttManager.a(this.f94454a, userBitFlagRes.cPtt2Text == 1);
                }
            }
        }
    }
}