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

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


package com.tencent.mobileqq.activity;

import QQService.SvcDevLoginInfo;
import android.app.Dialog;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Handler;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.tencent.common.config.AppSetting;
import com.tencent.mobileqq.app.FriendListObserver;
import com.tencent.mobileqq.app.IphoneTitleBarActivity;
import com.tencent.mobileqq.app.MessageRoamManager;
import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.app.SecSvcHandler;
import com.tencent.mobileqq.app.SecSvcObserver;
import com.tencent.mobileqq.equipmentlock.DevlockPhoneStatus;
import com.tencent.mobileqq.equipmentlock.EquipLockWebEntrance;
import com.tencent.mobileqq.equipmentlock.EquipmentLockImpl;
import com.tencent.mobileqq.msf.core.NetConnInfoCenter;
import com.tencent.mobileqq.statistics.ReportController;
import com.tencent.mobileqq.troop.utils.TroopBarUtils;
import com.tencent.mobileqq.utils.NetworkUtil;
import com.tencent.mobileqq.widget.FormCommonSingleLineItem;
import com.tencent.mobileqq.widget.FormCommonSwitchItem;
import com.tencent.mobileqq.widget.FormCommonTwoLineItem;
import com.tencent.mobileqq.widget.FormSwitchItem;
import com.tencent.mobileqq.widget.QQProgressDialog;
import com.tencent.mobileqq.widget.QQToast;
import com.tencent.qphone.base.util.QLog;
import com.tencent.tim.R;
import com.tencent.widget.ActionSheet;
import com.tencent.widget.ActionSheetHelper;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import mqq.app.NewIntent;
import mqq.manager.WtloginManager;
import mqq.observer.WtloginObserver;
import mqq.os.MqqHandler;
import oicq.wlogin_sdk.request.Ticket;
public class AuthDevActivity extends IphoneTitleBarActivity implements View.OnClickListener {
    private static final String f84890a = "Q.devlock.AuthDevActivity";
    private Dialog f8162a;
    private View f8164a;
    private LinearLayout f8166a;
    private ProgressBar f8167a;
    private TextView f8168a;
    private FormCommonSingleLineItem f8171a;
    private FormCommonSwitchItem f8172a;
    private FormCommonTwoLineItem f8173a;
    private FormSwitchItem f8174a;
    private QQProgressDialog f8175a;
    private ActionSheet f8176a;
    private List f8177a;
    private boolean f8179a;
    private ActionSheet f84891b;
    private String f84892c;
    private boolean d;
    private boolean e;
    private String f8180b = "";
    private Handler f8163a = new jek(this);
    private boolean f8181b = true;
    private boolean f8182c = true;
    private CompoundButton.OnCheckedChangeListener f8165a = new jeo(this);
    private FriendListObserver f8169a = new jet(this);
    private WtloginObserver f8178a = new jeu(this);
    private SecSvcObserver f8170a = new jev(this);

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        super.setContentView(R.layout.f57501name_res_0x7f030484);
        super.setTitle(R.string.f65258name_res_0x7f0a1ace);
        this.f8171a = (FormCommonSingleLineItem) super.findViewById(R.id.f52723name_res_0x7f09160f);
        this.f8171a.setOnClickListener(this);
        this.f8166a = (LinearLayout) super.findViewById(R.id.f52729name_res_0x7f091615);
        this.f8167a = (ProgressBar) super.findViewById(R.id.f48286name_res_0x7f0904ba);
        this.f8173a = (FormCommonTwoLineItem) super.findViewById(R.id.f52724name_res_0x7f091610);
        this.f8173a.setOnClickListener(this);
        this.f8172a = (FormCommonSwitchItem) super.findViewById(R.id.f52722name_res_0x7f09160e);
        this.f8164a = super.findViewById(R.id.f52727name_res_0x7f091613);
        this.f8164a.setVisibility(4);
        this.f8174a = (FormSwitchItem) super.findViewById(R.id.f52725name_res_0x7f091611);
        this.f8174a.setOnCheckedChangeListener(this.f8165a);
        this.f8174a.setVisibility(8);
        this.f8168a = (TextView) super.findViewById(R.id.f52726name_res_0x7f091612);
        this.f8168a.setVisibility(8);
        this.rightViewText.setVisibility(0);
        this.rightViewText.setText(R.string.f66467name_res_0x7f0a1f87);
        if (AppSetting.f7081k) {
            this.rightViewText.setContentDescription(getString(R.string.f65266name_res_0x7f0a1ad6));
        }
        this.rightViewText.setOnClickListener(this);
        Intent intent = super.getIntent();
        this.f8179a = intent.getExtras().getBoolean("auth_dev_open");
        this.f84892c = intent.getExtras().getString("phone_num");
        this.d = intent.getExtras().getBoolean("allow_set");
        this.e = intent.getExtras().getBoolean(EquipmentLockImpl.k);
        if (TextUtils.equals(intent.getExtras().getString("devlock_open_source"), EquipmentLockImpl.g)) {
            this.leftView.setText(R.string.f65438name_res_0x7f0a1b82);
        }
        if (DevlockPhoneStatus.a().b() != DevlockPhoneStatus.i) {
            this.f8173a.setVisibility(0);
            String m6036b = DevlockPhoneStatus.a().m6036b();
            if (!TextUtils.isEmpty(m6036b)) {
                this.f8173a.setRightText(m6036b);
            }
        }
        this.f8172a.setChecked(this.f8179a);
        this.f8172a.setOnCheckedChangeListener(this.f8165a);
        if (this.app == null) {
            this.app = (QQAppInterface) getAppRuntime();
        }
        if (this.app == null) {
            super.finish();
            return;
        }
        MqqHandler handler = this.app.getHandler(LoginInfoActivity.class);
        if (handler != null) {
            if (this.f8179a) {
                handler.obtainMessage(LoginInfoActivity.f85160b, 1, 0).sendToTarget();
            } else {
                handler.obtainMessage(LoginInfoActivity.f85160b, 0, 0).sendToTarget();
            }
        }
        if (AppSetting.f7081k) {
            this.f8172a.setContentDescription(getString(R.string.f65258name_res_0x7f0a1ace));
        }
        try {
            this.f8180b = getPackageManager().getPackageInfo(getPackageName(), 0).packageName;
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        if (QLog.isColorLevel()) {
            QLog.d(f84890a, 2, "packName = " + this.f8180b);
        }
        addObserver(this.f8169a);
        addObserver(this.f8170a);
        if (DevlockPhoneStatus.a().m6033a() == DevlockPhoneStatus.d) {
            this.f8171a.setRightText(super.getString(R.string.f65323name_res_0x7f0a1b0f));
        } else {
            this.f8171a.setRightText(this.f84892c);
        }
        if (this.f8179a) {
            SecSvcHandler secSvcHandler = (SecSvcHandler) this.app.getBusinessHandler(34);
            if (secSvcHandler != null) {
                secSvcHandler.a();
            }
            this.f8164a.setVisibility(0);
            c();
        } else if (this.d && (EquipmentLockImpl.a().m6047c() || this.e)) {
            f();
        } else {
            this.f8167a.setVisibility(8);
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        e();
        removeObserver(this.f8169a);
        removeObserver(this.f8170a);
    }

    public void c() {
        if (QLog.isColorLevel()) {
            QLog.d(f84890a, 2, "startGetAuthDevList.begin to getAuthLoginDevList");
        }
        boolean c2 = EquipmentLockImpl.a().c(this.app, this.f8180b, 0L);
        if (c2) {
            this.f8167a.setVisibility(0);
        } else if (QLog.isColorLevel()) {
            QLog.d(f84890a, 2, "startGetAuthDevList getAuthLoginDevList failed ret =" + c2);
        }
    }

    public void a(List list) {
        if (list == null || list.size() == 0) {
            this.f8164a.setVisibility(4);
            this.f8166a.setVisibility(8);
            return;
        }
        this.f8166a.removeAllViews();
        this.f8166a.setVisibility(0);
        int size = list.size();
        for (int i = 0; i < size; i++) {
            SvcDevLoginInfo svcDevLoginInfo = (SvcDevLoginInfo) list.get(i);
            if (svcDevLoginInfo != null) {
                View inflate = getLayoutInflater().inflate(R.layout.f57502name_res_0x7f030485, (ViewGroup) this.f8166a, false);
                RelativeLayout relativeLayout = (RelativeLayout) inflate.findViewById(R.id.f47704name_res_0x7f090274);
                if (i == size - 1) {
                    relativeLayout.setBackgroundResource(R.drawable.f41986name_res_0x7f02038d);
                } else {
                    relativeLayout.setBackgroundResource(R.drawable.f41975name_res_0x7f020382);
                }
                TextView textView = (TextView) inflate.findViewById(R.id.f47709name_res_0x7f090279);
                TextView textView2 = (TextView) inflate.findViewById(R.id.f48074info);
                String str = svcDevLoginInfo.strDeviceName;
                if (TextUtils.isEmpty(str)) {
                    str = getResources().getString(R.string.f65228name_res_0x7f0a1ab0);
                }
                String str2 = null;
                if (Arrays.equals(NetConnInfoCenter.GUID, svcDevLoginInfo.vecGuid)) {
                    str2 = "(" + getResources().getString(R.string.f65224name_res_0x7f0a1aac) + ")";
                }
                SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(str);
                if (!TextUtils.isEmpty(str2)) {
                    spannableStringBuilder.append((CharSequence) str2);
                    jep jepVar = new jep(this);
                    int length = str.length();
                    spannableStringBuilder.setSpan(jepVar, length, str2.length() + length, 33);
                }
                textView.setText(spannableStringBuilder);
                StringBuffer stringBuffer = new StringBuffer();
                if (!TextUtils.isEmpty(svcDevLoginInfo.strLoginLocation)) {
                    stringBuffer.append(svcDevLoginInfo.strLoginLocation);
                }
                if (!TextUtils.isEmpty(svcDevLoginInfo.strDeviceTypeInfo)) {
                    if (stringBuffer.length() > 0) {
                        stringBuffer.append(TroopBarUtils.y);
                    }
                    stringBuffer.append(svcDevLoginInfo.strDeviceTypeInfo);
                }
                if (stringBuffer.length() > 0) {
                    textView2.setText(stringBuffer.toString());
                }
                relativeLayout.setClickable(true);
                relativeLayout.setTag(svcDevLoginInfo);
                relativeLayout.setOnClickListener(new jeq(this, relativeLayout, i));
                this.f8166a.addView(inflate);
            }
        }
        this.f8164a.setVisibility(this.f8166a.getChildCount() == 0 ? 4 : 0);
    }

    public void a(String str, ArrayList arrayList, String str2, int i, boolean z, boolean z2, long j) {
        this.f84891b = (ActionSheet) ActionSheetHelper.a(this, (View) null);
        this.f84891b.a((CharSequence) getResources().getString(R.string.f65310name_res_0x7f0a1b02), 5, false);
        this.f84891b.a((CharSequence) getResources().getString(R.string.f63878name_res_0x7f0a1565), 3, false);
        this.f84891b.d(R.string.f63203cancel);
        this.f84891b.a(new jer(this, str2, j, str, i, arrayList, z, z2));
        this.f84891b.show();
    }

    public void b(String str, ArrayList arrayList, String str2, int i, boolean z, boolean z2, long j) {
        String string;
        if (TextUtils.isEmpty(str)) {
            str = getResources().getString(R.string.f65228name_res_0x7f0a1ab0);
        }
        this.f8176a = (ActionSheet) ActionSheetHelper.a(this, (View) null);
        if (z) {
            string = getString(R.string.f65268name_res_0x7f0a1ad8, new Object[]{str});
        } else {
            string = getString(R.string.f65267name_res_0x7f0a1ad7, new Object[]{str});
        }
        this.f8176a.m10334a((CharSequence) string);
        this.f8176a.a((CharSequence) getResources().getString(R.string.f65269name_res_0x7f0a1ad9), 3, false);
        this.f8176a.d(R.string.f63203cancel);
        this.f8176a.a(new jes(this, str2, arrayList, i, z2, j));
        this.f8176a.show();
    }

    void a() {
        boolean z = false;
        b();
        Dialog dialog = new Dialog(this, R.style.f67750qZoneInputDialog);
        dialog.setContentView(R.layout.f56594custom_dialog);
        TextView textView = (TextView) dialog.findViewById(R.id.f48934dialogTitle);
        if (textView != null) {
            textView.setText(getString(R.string.f65270name_res_0x7f0a1ada));
        }
        TextView textView2 = (TextView) dialog.findViewById(R.id.f47745dialogText);
        if (textView2 != null) {
            MessageRoamManager messageRoamManager = (MessageRoamManager) this.app.getManager(91);
            if (messageRoamManager != null && messageRoamManager.m4495g()) {
                z = messageRoamManager.b() == 1;
            }
            textView2.setText(z ? getString(R.string.f65272name_res_0x7f0a1adc) : getString(R.string.f65271name_res_0x7f0a1adb));
        }
        TextView textView3 = (TextView) dialog.findViewById(R.id.f48937dialogLeftBtn);
        if (textView3 != null) {
            textView3.setText(R.string.f64225close);
        }
        TextView textView4 = (TextView) dialog.findViewById(R.id.f48938dialogRightBtn);
        if (textView4 != null) {
            textView4.setText(R.string.f63203cancel);
        }
        dialog.setOnDismissListener(new jel(this));
        if (textView3 != null) {
            textView3.setOnClickListener(this);
        }
        if (textView4 != null) {
            textView4.setOnClickListener(this);
        }
        this.f8162a = dialog;
        this.f8162a.show();
    }

    void b() {
        if (this.f8162a != null) {
            if (this.f8162a.isShowing()) {
                try {
                    this.f8162a.dismiss();
                } catch (Exception e) {
                }
            }
            this.f8162a = null;
        }
    }

    public void d() {
        this.f8163a.post(new jem(this));
    }

    public void e() {
        this.f8163a.post(new jen(this));
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.f48299ivTitleBtnRightText:
                Intent intent = new Intent(this, QQBrowserActivity.class);
                intent.putExtra("url", "http://kf.qq.com/touch/apifaq/1211147RVfAV140617UV3MZn.html?ADTAG=veda.mobileqq.en");
                intent.putExtra("hide_more_button", true);
                startActivity(intent);
                return;
            case R.id.f48937dialogLeftBtn:
                b();
                if (QLog.isColorLevel()) {
                    QLog.d(f84890a, 2, "onClick.begin to CloseDevLock");
                }
                if (!this.f8182c) {
                    if (this.f8175a == null || !this.f8175a.isShowing()) {
                        d();
                        return;
                    }
                    return;
                }
                d();
                this.f8182c = false;
                int a2 = EquipmentLockImpl.a().a(this.app, this.app.getCurrentAccountUin(), this.f8178a);
                if (a2 != 0) {
                    e();
                    this.f8182c = true;
                    if (QLog.isColorLevel()) {
                        QLog.d(f84890a, 2, "onClick.CloseDevLock fail ret =" + a2);
                    }
                    QQToast.a(getApplicationContext(), getString(R.string.f65279name_res_0x7f0a1ae3), 0).b(getTitleBarHeight());
                    return;
                }
                return;
            case R.id.f48938dialogRightBtn:
                b();
                return;
            case R.id.f52722name_res_0x7f09160e:
                f();
                return;
            case R.id.f52723name_res_0x7f09160f:
                this.app.sendWirelessMeibaoReq(1);
                ReportController.b(this.app, "dc01331", "", "", "My_eq_lock", "Clk_protect_detail", 0, 0, "", "", "", "");
                if (TextUtils.isEmpty(this.app.getCurrentAccountUin()) && QLog.isColorLevel()) {
                    QLog.d(f84890a, 2, "onClick current is empty");
                }
                EquipLockWebEntrance.a(this, this.app, EquipLockWebEntrance.f89222a, 1003, null);
                return;
            case R.id.f52724name_res_0x7f091610:
                EquipLockWebEntrance.a(this, this.app, EquipLockWebEntrance.f89223b, 1003, null);
                return;
            default:
                return;
        }
    }

    @Override
    public boolean onBackEvent() {
        WtloginManager wtloginManager;
        Ticket GetLocalTicket;
        Bundle extras;
        Intent intent = getIntent();
        if ((intent == null || (extras = intent.getExtras()) == null || !extras.containsKey(AuthDevUgActivity.k)) ? false : extras.getBoolean(AuthDevUgActivity.k)) {
            Intent intent2 = new Intent();
            intent2.setAction(NewIntent.ACTION_DEVLOCK_ROAM);
            intent2.putExtra("auth_dev_open", this.f8179a);
            if (this.f8179a && (wtloginManager = (WtloginManager) this.app.getManager(1)) != null && (GetLocalTicket = wtloginManager.GetLocalTicket(this.app.getCurrentAccountUin(), 16L, 33554432)) != null) {
                intent2.putExtra(AuthDevUgActivity.f8225j, GetLocalTicket._sig);
            }
            sendBroadcast(intent2, "com.tencent.tim.msg.permission.pushnotify");
        }
        Intent intent3 = new Intent();
        intent3.putExtra("auth_dev_open", this.f8179a);
        intent3.putExtra("allow_set", this.f8181b);
        intent3.putExtra("phone_num", this.f84892c);
        setResult(0, intent3);
        finish();
        return false;
    }

    public void f() {
        if (!NetworkUtil.e(this)) {
            QQToast.a(this, getString(R.string.f63198name_res_0x7f0a12bb), 0).b(getTitleBarHeight());
        } else if (this.f8179a) {
            ReportController.b(this.app, "dc01331", "", "", "My_eq_lock", "My_eq_lock_close", 0, 0, "", "", "", "");
            a();
        } else {
            if (QLog.isColorLevel()) {
                QLog.d(f84890a, 2, "onClick.begin to CheckDevLockSms");
            }
            if (DevlockPhoneStatus.a().m6033a() == DevlockPhoneStatus.d) {
                DevlockPhoneStatus.a().a(this, this.f84892c);
                return;
            }
            ReportController.b(this.app, "dc01331", "", "", "My_eq_lock", "My_eq_lock_open", 0, 0, "0", "", "", "");
            if (!this.f8182c) {
                if (this.f8175a == null || !this.f8175a.isShowing()) {
                    d();
                    return;
                }
                return;
            }
            d();
            this.f8182c = false;
            int a2 = EquipmentLockImpl.a().a(this.app, this.app.getCurrentAccountUin(), "", (byte[]) null, this.f8178a);
            if (a2 != 0) {
                this.f8182c = true;
                e();
                if (QLog.isColorLevel()) {
                    QLog.d(f84890a, 2, "onClick.CheckDevLockSms fail ret=" + a2);
                }
                QQToast.a(getApplicationContext(), getString(R.string.f65280name_res_0x7f0a1ae4), 0).b(getTitleBarHeight());
            }
        }
    }

    @Override
    public void onActivityResult(int i, int i2, Intent intent) {
        Bundle extras;
        super.onActivityResult(i, i2, intent);
        if (i == 1003 && intent != null && (extras = intent.getExtras()) != null) {
            int i3 = extras.getInt("resultState", 1);
            int i4 = extras.getInt("emergency_phone_state", 1);
            if (i3 == 2) {
                DevlockPhoneStatus.a().a(DevlockPhoneStatus.e);
            } else if (i3 == 3) {
                DevlockPhoneStatus.a().a(DevlockPhoneStatus.d);
                DevlockPhoneStatus.a().a(0L);
            }
            if (i3 != 1) {
                this.f84892c = extras.getString("resultMobileMask");
                if (i3 == 2) {
                    this.f8171a.setRightText(this.f84892c);
                } else if (i3 == 3) {
                    this.f8171a.setRightText(super.getString(R.string.f65323name_res_0x7f0a1b0f));
                }
            }
            if (i4 == 4) {
                DevlockPhoneStatus.a().b(DevlockPhoneStatus.h);
            } else if (i4 != 1) {
                DevlockPhoneStatus.a().b(DevlockPhoneStatus.j);
            }
            String string = extras.getString("emergency_phone_mask");
            if (i4 == 4) {
                this.f8173a.setRightText(super.getString(R.string.f65315name_res_0x7f0a1b07));
                DevlockPhoneStatus.a().a(string);
            } else if (i4 != 1 && !TextUtils.isEmpty(string)) {
                this.f8173a.setRightText(string);
                DevlockPhoneStatus.a().a(string);
            }
        }
    }
}