和通讯录 v3.9.6版本的 MD5 值为:669178e2ee1b2311daf378bd20c6bbe1

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


package com.chinamobile.contacts.im.cloudserver;

import android.content.BroadcastReceiver;
import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ViewFlipper;
import com.android.internal.telephony.PhoneConstants;
import com.chinaMobile.MobileAgent;
import com.chinamobile.contacts.im.App;
import com.chinamobile.contacts.im.C0019R;
import com.chinamobile.contacts.im.Main;
import com.chinamobile.contacts.im.alumni.Alumniactivity;
import com.chinamobile.contacts.im.alumni.model.AlumniCard;
import com.chinamobile.contacts.im.alumni.model.Org;
import com.chinamobile.contacts.im.cloudserver.view.PlugInScrollLayout;
import com.chinamobile.contacts.im.conference.ConferenceActivity;
import com.chinamobile.contacts.im.config.LoginInfoSP;
import com.chinamobile.contacts.im.data.ContactAccessor;
import com.chinamobile.contacts.im.data.MediaPlatformDBManager;
import com.chinamobile.contacts.im.enterpriseContact.EnterpriseMainActivity;
import com.chinamobile.contacts.im.enterpriseContact.VnetListGansuActivity;
import com.chinamobile.contacts.im.enterpriseContact.VnetgansuhelpActivity;
import com.chinamobile.contacts.im.login.SettingNewLoginMainActivity;
import com.chinamobile.contacts.im.mms2.ui.QuickGroupSessionsActivity;
import com.chinamobile.contacts.im.ringtone.RingToneMainActivity;
import com.chinamobile.contacts.im.ringtone.model.RingToneInfo;
import com.chinamobile.contacts.im.setting.BrowserActivity;
import com.chinamobile.contacts.im.setting.MainSettingActivity;
import com.chinamobile.contacts.im.setting.SettingVoiceMailActivity;
import com.chinamobile.contacts.im.sync.SyncActivity;
import com.chinamobile.contacts.im.ui.ICloudActivity;
import com.chinamobile.contacts.im.ui.ICloudFragment;
import com.chinamobile.contacts.im.utils.ApplicationUtils;
import com.chinamobile.contacts.im.view.BaseToast;
import com.chinamobile.contacts.im.view.HintsDialog;
import com.chinamobile.contacts.im.view.actionbar.IcloudActionBar;
import com.huawei.mcs.api.McsApi;
import com.huawei.mcs.auth.data.AASConstants;
import com.huawei.mcs.cloud.msg.base.mms.Telephony;
import com.iflytek.cloud.SpeechConstant;
import com.umeng.analytics.MobclickAgent;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Pattern;
import org.json.JSONException;
import org.json.JSONObject;
import org.simpleframework.xml.strategy.Name;

public class c extends ICloudFragment implements View.OnClickListener, ap, as, com.chinamobile.contacts.im.cloudserver.view.h, com.chinamobile.contacts.im.cloudserver.view.i, com.chinamobile.contacts.im.cloudserver.view.k, com.chinamobile.contacts.im.login.a.c {
    private static String C;
    private static String D;
    private static String E;
    private static String F;
    private static com.chinamobile.contacts.im.sync.c.a n;
    private static TextView u;
    private ImageButton A;
    private String B;
    private PlugInScrollLayout H;
    private com.chinamobile.contacts.im.cloudserver.view.a I;
    private Handler J;
    private Handler K;
    private com.chinamobile.contacts.im.sync.d.h L;
    private BroadcastReceiver M;
    private m N;

    RelativeLayout f1692a;

    private LinearLayout f1693b;
    private RelativeLayout c;
    private RelativeLayout d;
    private ViewFlipper e;
    private TextView f;
    private TextView g;
    private TextView h;
    private TextView i;
    private TextView j;
    private Context l;
    private AlumniCard m;
    private ImageView o;
    private RelativeLayout p;
    private RelativeLayout q;
    private com.chinamobile.icloud.im.sync.a.a r;
    private String[] s;
    private TextView t;
    private ImageView v;
    private boolean w;
    private boolean x;
    private List<RingToneInfo> y;
    private ImageButton z;
    private static int k = -1;
    private static int G = -1;

    @Override
    public void onActivityCreated(Bundle bundle) {
        super.onActivityCreated(bundle);
        com.chinamobile.contacts.im.setting.c.g.a().d();
        a();
        aq.c().a(this);
        al.a().a(this);
    }

    @Override
    public void onResume() {
        com.chinamobile.contacts.im.utils.aq.d("king", "CloudServerFragment onResume");
        super.onResume();
        try {
            com.chinamobile.contacts.im.login.a.a.a(getActivity()).a(this);
        } catch (Exception e) {
            e.printStackTrace();
        }
        l();
    }

    public void l() {
        boolean booleanValue = LoginInfoSP.isfirstloginvnet(this.l).booleanValue();
        if (LoginInfoSP.isLogin(this.l) && booleanValue) {
            com.chinamobile.contacts.im.enterpriseContact.utils.g.b(this.l);
            LoginInfoSP.savefirstloginvnet(this.l, false);
        }
        com.chinamobile.contacts.im.service.m.a(getActivity(), this.M);
        q();
        r();
        if (LoginInfoSP.isLogin(this.l)) {
            m();
        }
        s();
        v();
    }

    public static String a(Context context) {
        String str;
        C = null;
        JSONObject jSONObject = new JSONObject();
        JSONObject jSONObject2 = new JSONObject();
        try {
            jSONObject.put(Name.MARK, ApplicationUtils.generateString(4));
            jSONObject.put("jsonrpc", McsApi.API_VERSION);
            jSONObject.put("method", "sdkAd/getAdByPosition");
            jSONObject2.put(Telephony.BaseMmsColumns.FROM, ApplicationUtils.getChannel(App.b()));
            jSONObject2.put("version", ApplicationUtils.getVersionName(App.b()));
            jSONObject2.put("client_id", "4");
            jSONObject2.put("position", "0");
            jSONObject.put(SpeechConstant.PARAMS, jSONObject2);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        String a2 = com.chinamobile.contacts.im.sync.d.z.a(context, com.chinamobile.contacts.im.config.g.j, jSONObject.toString());
        com.chinamobile.contacts.im.utils.aq.d("whj", jSONObject.toString());
        if (a2 == null) {
            com.chinamobile.contacts.im.utils.aq.d("whj", "网络异常");
            str = "网络异常";
            com.chinamobile.contacts.im.config.b.a(context, false);
        } else {
            try {
                JSONObject jSONObject3 = new JSONObject(a2);
                Iterator<String> keys = jSONObject3.keys();
                while (keys.hasNext()) {
                    String next = keys.next();
                    if (next.equals("result")) {
                        JSONObject jSONObject4 = jSONObject3.getJSONObject(next);
                        try {
                            Iterator<String> keys2 = jSONObject4.keys();
                            while (keys2.hasNext()) {
                                String next2 = keys2.next();
                                if (next2.equals(MediaPlatformDBManager.KEY_TITLE)) {
                                    C = jSONObject4.optString(next2);
                                    com.chinamobile.contacts.im.utils.aq.d("whj", C);
                                } else if (next2.equals("url")) {
                                    D = jSONObject4.optString(next2);
                                }
                            }
                        } catch (Exception e2) {
                            e2.printStackTrace();
                        }
                    }
                }
                if (C != null && C.length() > 0) {
                    com.chinamobile.contacts.im.config.b.a(context, true);
                    com.chinamobile.contacts.im.config.b.b(context, C);
                    com.chinamobile.contacts.im.config.b.c(context, D);
                    com.chinamobile.contacts.im.config.b.a(context, System.currentTimeMillis());
                    str = a2;
                } else {
                    com.chinamobile.contacts.im.config.b.a(context, false);
                    str = a2;
                }
            } catch (Exception e3) {
                e3.printStackTrace();
                return "ERROR";
            }
        }
        return str.toString();
    }

    private void m() {
        List<com.chinamobile.contacts.im.voicemail.c.a> a2 = com.chinamobile.contacts.im.voicemail.a.a.a(LoginInfoSP.getMobile(this.l));
        int i = 0;
        while (true) {
            int i2 = i;
            if (i2 >= a2.size()) {
                break;
            }
            if (a2.get(i2).a() == 0) {
                i = i2 + 1;
            } else {
                al.a().a(10007, true);
                break;
            }
        }
        if (com.chinamobile.contacts.im.config.m.w(this.l)) {
            al.a().a(10007, true);
        }
    }

    @Override
    public void onPause() {
        super.onPause();
        try {
            getActivity().unregisterReceiver(this.M);
            com.chinamobile.contacts.im.login.a.a.a(getActivity()).a((com.chinamobile.contacts.im.login.a.c) null);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        aq.c().a((as) null);
    }

    public void a() {
        if (getActivity() != null && !isDetached()) {
            IcloudActionBar icloudActionBar = ((ICloudActivity) getActivity()).getIcloudActionBar();
            icloudActionBar.setNavigationMode(3);
            icloudActionBar.setDisplayAsUpTitle("和通讯录");
            icloudActionBar.setDisplayAsUpBack(0, null);
            icloudActionBar.setVisibility(0, false);
        }
    }

    @Override
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        this.l = getActivity();
        setHasOptionsMenu(false);
        View inflate = layoutInflater.inflate(C0019R.layout.cloud_main, (ViewGroup) null);
        this.H = (PlugInScrollLayout) inflate.findViewById(C0019R.id.plug_container);
        w();
        this.d = (RelativeLayout) inflate.findViewById(C0019R.id.login);
        this.d.setOnClickListener(this);
        this.c = (RelativeLayout) inflate.findViewById(C0019R.id.sync);
        this.c.setOnClickListener(this);
        this.z = (ImageButton) inflate.findViewById(C0019R.id.imgbtn_ringtone);
        this.z.setOnClickListener(this);
        this.q = (RelativeLayout) inflate.findViewById(C0019R.id.ad_layout);
        this.q.setOnClickListener(this);
        this.q.setVisibility(8);
        u = (TextView) inflate.findViewById(C0019R.id.ad_info);
        this.A = (ImageButton) inflate.findViewById(C0019R.id.ad_close);
        this.A.setOnClickListener(this);
        this.o = (ImageView) inflate.findViewById(C0019R.id.avatar);
        this.o.setImageResource(C0019R.drawable.edit_contact_head_icon);
        this.p = (RelativeLayout) inflate.findViewById(C0019R.id.avatar_layout);
        this.e = (ViewFlipper) inflate.findViewById(C0019R.id.layout1);
        this.f1692a = (RelativeLayout) inflate.findViewById(C0019R.id.btn_create);
        this.f1692a.setOnClickListener(this);
        this.f = (TextView) inflate.findViewById(C0019R.id.info1);
        this.h = (TextView) inflate.findViewById(C0019R.id.contect_detail_company);
        this.g = (TextView) inflate.findViewById(C0019R.id.name);
        DisplayMetrics displayMetrics = new DisplayMetrics();
        getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
        if (displayMetrics.heightPixels * displayMetrics.widthPixels <= 153600) {
            this.g.setMaxWidth(100);
        }
        if (Build.MODEL.equals("HT-A6")) {
            this.g.setMaxWidth(180);
        }
        this.j = (TextView) inflate.findViewById(C0019R.id.local_contact_counts);
        this.f1693b = (LinearLayout) inflate.findViewById(C0019R.id.plug_option_index_view);
        this.i = (TextView) inflate.findViewById(C0019R.id.remote_contact_counts);
        this.j = (TextView) inflate.findViewById(C0019R.id.local_contact_counts);
        this.v = (ImageView) inflate.findViewById(C0019R.id.vip);
        this.t = (TextView) inflate.findViewById(C0019R.id.sync_type);
        if (k != -1) {
            this.j.setText("手机" + k);
            this.t.setText(this.s[c()]);
            com.chinamobile.contacts.im.directory.f.a().a(this.l, this.v);
            if (k != -1) {
                this.j.setText("手机" + k);
            }
            if (App.f1274b != -1) {
                this.i.setText("/网络" + App.f1274b);
            }
        }
        d();
        this.I = new com.chinamobile.contacts.im.cloudserver.view.a(getActivity(), 0);
        this.H.setOnAddPage(this);
        this.H.setOnPageChangedListener(this);
        this.H.setOnEditModeListener(this);
        this.H.setAdapter(this.I);
        this.H.setOnExchangeListener(new g(this));
        this.H.setColCount(3);
        this.H.setRowCount(2);
        v();
        com.chinamobile.contacts.im.login.a.a.a(getActivity()).d();
        return inflate;
    }

    private void n() {
        switch (G) {
            case -1:
                this.z.setVisibility(8);
                return;
            case 0:
                this.z.setVisibility(0);
                return;
            case 1:
                this.z.setVisibility(0);
                return;
            case 2:
                this.z.setVisibility(8);
                return;
            case 11:
                this.z.setVisibility(0);
                return;
            default:
                return;
        }
    }

    public void o() {
        try {
            this.g.setText(this.m.getName());
            if (n != null && !TextUtils.isEmpty(n.c())) {
                this.f.setText(n.c());
            } else if (n != null) {
                this.f.setText(n.b());
            }
            if (this.m.getOrg().size() > 0) {
                Org org2 = this.m.getOrg().get(0);
                StringBuffer stringBuffer = new StringBuffer();
                if (org2.company != null && !org2.company.equals("")) {
                    stringBuffer.append(org2.company).append(" ");
                }
                if (org2.department != null && !org2.department.equals("")) {
                    stringBuffer.append(org2.department).append(" ");
                }
                if (org2.position != null && !org2.position.equals("")) {
                    stringBuffer.append(org2.position);
                }
                if (stringBuffer.length() > 0) {
                    this.h.setText(stringBuffer.toString());
                } else {
                    this.h.setText((CharSequence) null);
                }
            } else {
                this.h.setText((CharSequence) null);
            }
            if (this.m.getStyle() != null) {
                this.d.setBackgroundResource(com.chinamobile.contacts.im.contacts.d.g.a(Integer.valueOf(this.m.getStyle()).intValue()));
            } else {
                this.d.setBackgroundResource(C0019R.drawable.cloudserver_bg);
            }
            if (this.m.getPhoto() != null) {
                Bitmap decodeByteArray = BitmapFactory.decodeByteArray(this.m.getPhoto(), 0, this.m.getPhoto().length);
                if (decodeByteArray != null) {
                    this.o.setImageBitmap(ApplicationUtils.getCroppedBitmap(decodeByteArray, true));
                    this.p.setBackgroundResource(C0019R.drawable.icon_border2);
                    this.o.setVisibility(0);
                } else {
                    this.o.setVisibility(8);
                    this.p.setBackgroundResource(C0019R.drawable.edit_contact_head_icon);
                }
            } else {
                this.o.setVisibility(8);
                this.p.setBackgroundResource(C0019R.drawable.edit_contact_head_icon);
            }
            this.e.setDisplayedChild(0);
            u();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void p() {
        this.e.setDisplayedChild(0);
        this.g.setText("未登录");
        this.f.setText("点击进行登录");
        this.o.setVisibility(8);
        this.h.setText((CharSequence) null);
        this.p.setBackgroundResource(C0019R.drawable.edit_contact_head_icon);
        G = -1;
    }

    @Override
    public void onClick(View view) {
        try {
            switch (view.getId()) {
                case C0019R.id.login:
                    if (n != null && n.d()) {
                        if (this.m != null) {
                            MobclickAgent.onEvent(this.l, "cloudServer_edit_personalCard");
                            Intent intent = new Intent(this.l, (Class<?>) EditCloudContactActivity.class);
                            Bundle bundle = new Bundle();
                            bundle.putString(AASConstants.ACCOUNT, ApplicationUtils.getBundedPhoneNumber(this.l));
                            bundle.putString("mobile", n.c());
                            intent.putExtras(bundle);
                            intent.setAction("android.intent.action.EDIT");
                            if (ContentUris.withAppendedId(com.chinamobile.contacts.im.provider.b.f3136a, this.m.getContactId().intValue()) != null) {
                                intent.setData(ContentUris.withAppendedId(com.chinamobile.contacts.im.provider.b.f3136a, this.m.getContactId().intValue()));
                            }
                            startActivity(intent);
                            return;
                        }
                        if (ApplicationUtils.isUserPhoneBunded(this.l)) {
                            MobclickAgent.onEvent(this.l, "cloudServer_create_personalCard");
                            Intent intent2 = new Intent(getActivity(), (Class<?>) EditCloudContactActivity.class);
                            Bundle bundle2 = new Bundle();
                            bundle2.putString(AASConstants.ACCOUNT, ApplicationUtils.getBundedPhoneNumber(this.l));
                            bundle2.putString("mobile", n.c());
                            intent2.putExtras(bundle2);
                            intent2.setAction("android.intent.action.INSERT");
                            intent2.setData(com.chinamobile.contacts.im.provider.b.f3136a);
                            startActivity(intent2);
                            return;
                        }
                        BaseToast.makeText(this.l, C0019R.string.not_bind_phone_warning, 2000).show();
                        return;
                    }
                    a(0, 0);
                    return;
                case C0019R.id.imgbtn_ringtone:
                    MobclickAgent.onEvent(this.l, "cloudServer_ringtone");
                    if (LoginInfoSP.isLogin(this.l)) {
                        if (LoginInfoSP.isBunding(this.l)) {
                            this.B = LoginInfoSP.getMobile(this.l);
                            if (this.B.length() == 0) {
                                this.B = n.b();
                            }
                            if (ApplicationUtils.isCMCCPhone(this.B)) {
                                Intent intent3 = new Intent(getActivity(), (Class<?>) RingToneMainActivity.class);
                                intent3.putExtra("hasBeenOpen", this.w);
                                intent3.putExtra("hasBeenOrder", this.x);
                                intent3.putExtra("name", this.g.getText().toString());
                                intent3.putExtra("number", this.B);
                                startActivity(intent3);
                                return;
                            }
                            BaseToast.makeText(this.l, C0019R.string.ringtone_cm, 2000).show();
                            return;
                        }
                        BaseToast.makeText(this.l, C0019R.string.not_bind_phone_warning, 2000).show();
                        return;
                    }
                    a(0, 0);
                    return;
                case C0019R.id.ad_layout:
                    MobclickAgent.onEvent(this.l, "cloudServer_ad");
                    if (C != null && D != null) {
                        System.currentTimeMillis();
                        String substring = (System.currentTimeMillis() + "").substring(0, 10);
                        if (LoginInfoSP.isLogin(this.l)) {
                            E = ContactAccessor.getAuth(this.l).k();
                            com.chinamobile.contacts.im.utils.aq.d("whj", "mUserID" + E);
                        } else {
                            E = ((TelephonyManager) this.l.getSystemService(PhoneConstants.PHONE_KEY)).getDeviceId();
                            com.chinamobile.contacts.im.utils.aq.d("whj", "mUserID" + E);
                        }
                        String str = E;
                        String str2 = "A01151947735" + MobileAgent.USER_STATUS_LOGIN + str + 20 + substring + str;
                        String lowerCase = ("A01151947735" + substring + "cardpack" + str).toLowerCase();
                        String lowerCase2 = str2.toLowerCase();
                        String b2 = com.chinamobile.icloud.im.sync.c.h.b(com.chinamobile.icloud.im.sync.c.h.b(lowerCase) + "dJ4ZXBIFUeE5CyP8");
                        String b3 = com.chinamobile.icloud.im.sync.c.h.b(com.chinamobile.icloud.im.sync.c.h.b(lowerCase2) + "dJ4ZXBIFUeE5CyP8");
                        D += "/?channel=A01151947735&time=" + substring + "&type=cardpack&userId=" + str + "&sign=" + b2;
                        F = "http://y.buptinfo.com/telecom/hetongxun/recharge.php/?channel=A01151947735&username=" + str + "&phone=" + str + "&point=20&orderType=" + MobileAgent.USER_STATUS_LOGIN + "&time=" + substring + "&sign=" + b3;
                        com.chinamobile.contacts.im.utils.aq.d("whj", D);
                        Main.f1278b.execute(new h(this));
                        return;
                    }
                    return;
                case C0019R.id.ad_close:
                    MobclickAgent.onEvent(this.l, "cloudServer_ad_close");
                    com.chinamobile.contacts.im.config.b.b(this.l, false);
                    this.q.setVisibility(8);
                    return;
                case C0019R.id.btn_create:
                    if (ApplicationUtils.isUserPhoneBunded(this.l)) {
                        MobclickAgent.onEvent(this.l, "cloudServer_create_personalCard");
                        Intent intent4 = new Intent(getActivity(), (Class<?>) EditCloudContactActivity.class);
                        Bundle bundle3 = new Bundle();
                        bundle3.putString(AASConstants.ACCOUNT, n.b());
                        bundle3.putString("mobile", n.c());
                        intent4.putExtras(bundle3);
                        intent4.setAction("android.intent.action.INSERT");
                        intent4.setData(com.chinamobile.contacts.im.provider.b.f3136a);
                        startActivity(intent4);
                        return;
                    }
                    BaseToast.makeText(this.l, C0019R.string.not_bind_phone_warning, 2000).show();
                    return;
                case C0019R.id.sync:
                    if (t()) {
                        this.l.startActivity(new Intent(this.l, (Class<?>) SyncActivity.class));
                        return;
                    } else {
                        a(1, 100);
                        return;
                    }
                case C0019R.id.iab_ib_action:
                    ((ICloudActivity) getActivity()).getIcloudActionBar().setDisplayAsUpTitleIBAction(C0019R.drawable.marketing_entrance, this);
                    if (!ApplicationUtils.isNetworkAvailable(getActivity())) {
                        BaseToast.makeText(this.l, "无法连接网络,请检查网络配置!", 2000).show();
                        return;
                    }
                    if (getActivity() instanceof Main) {
                        ((Main) getActivity()).e();
                    }
                    if (t()) {
                        b(" ", com.chinamobile.contacts.im.config.g.r);
                        return;
                    } else {
                        a(1, 103);
                        return;
                    }
                case C0019R.id.iab_ib_more:
                    getActivity().startActivity(new Intent(getActivity(), (Class<?>) MainSettingActivity.class));
                    return;
                default:
                    return;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void q() {
        n = ContactAccessor.getEntity(this.l);
        if (n.d()) {
            u();
            MobclickAgent.onEvent(this.l, "cloudServer_logined");
            Main.f1278b.execute(new i(this));
            this.J.sendEmptyMessage(2);
        } else {
            p();
        }
        this.r = ContactAccessor.getAuth(this.l);
    }

    @Override
    public void b() {
        this.m = aq.b(getActivity(), ApplicationUtils.getBundedPhoneNumber(this.l));
        if (this.m == null) {
            com.chinamobile.contacts.im.utils.aq.d("zyu", "cloud contact is null");
            this.m = com.chinamobile.contacts.im.alumni.a.c.c();
            if (this.m.errorCode == null) {
                HashMap hashMap = new HashMap();
                hashMap.put(ApplicationUtils.getBundedPhoneNumber(this.l), this.m);
                aq.a((Context) getActivity(), n.b(), (HashMap<String, AlumniCard>) hashMap, true);
                this.m = aq.b(getActivity(), ApplicationUtils.getBundedPhoneNumber(this.l));
                if (this.m == null) {
                    this.J.sendEmptyMessage(2);
                    return;
                } else {
                    this.J.sendEmptyMessage(1);
                    return;
                }
            }
            this.J.sendEmptyMessage(2);
            this.m = null;
            return;
        }
        this.J.sendEmptyMessage(1);
    }

    private void r() {
        int c = c();
        if (this.t != null) {
            this.t.setText(this.s[c]);
        }
        com.chinamobile.contacts.im.directory.f.a().a(this.l, this.v);
    }

    private void s() {
        new com.chinamobile.contacts.im.sync.d.c(getActivity(), 0).a(this.j).a(this.L).a();
        if (t()) {
            new com.chinamobile.contacts.im.sync.d.c(getActivity(), 1).a(this.i).a(this.r).a(this.L).a();
        } else {
            this.i.setText("/未登录");
        }
    }

    private boolean t() {
        return !isDetached() && ContactAccessor.getEntity(getActivity()).d();
    }

    public int c() {
        return com.chinamobile.contacts.im.config.o.e(getActivity());
    }

    public void a(int i, int i2) {
        Intent intent = new Intent(getActivity(), (Class<?>) SettingNewLoginMainActivity.class);
        if (i == 0) {
            startActivity(intent);
        } else {
            startActivityForResult(intent, i2);
        }
    }

    public void d() {
        if (System.currentTimeMillis() >= com.chinamobile.contacts.im.config.b.d(this.l) + com.umeng.analytics.a.h) {
            com.chinamobile.contacts.im.config.b.b(this.l, true);
            if (!ApplicationUtils.isNetworkAvailable(getActivity())) {
                com.chinamobile.contacts.im.utils.aq.d("whj", "----无法连接网络----");
                return;
            }
            com.chinamobile.contacts.im.config.b.c(this.l, true);
            if (com.chinamobile.contacts.im.config.b.f(this.l)) {
                try {
                    new l(this, null).execute(new Object[0]);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        } else if (com.chinamobile.contacts.im.config.b.f(this.l)) {
            C = com.chinamobile.contacts.im.config.b.b(this.l);
            D = com.chinamobile.contacts.im.config.b.c(this.l);
            if (C != null && C.length() > 0) {
                com.chinamobile.contacts.im.config.b.a(this.l, true);
            } else {
                com.chinamobile.contacts.im.config.b.a(this.l, false);
            }
        }
        if (com.chinamobile.contacts.im.config.b.e(this.l) && com.chinamobile.contacts.im.config.b.f(this.l)) {
            u.setText(C);
            this.q.setVisibility(0);
        } else {
            this.q.setVisibility(8);
        }
    }

    public void e() {
        com.chinamobile.contacts.im.utils.aq.d("whj", "----refresh1----");
        d();
        s();
        if (al.a().f()) {
            v();
        }
    }

    @Override
    public void onActivityResult(int i, int i2, Intent intent) {
        com.chinamobile.contacts.im.utils.aq.d("king", "CloudServerFragment onActivityResult");
        if (i == 1231) {
            if (LoginInfoSP.isLogin(this.l)) {
                if (ApplicationUtils.isUserPhoneBunded(this.l)) {
                    this.l.startActivity(new Intent(this.l, (Class<?>) EnterpriseMainActivity.class));
                    return;
                } else {
                    BaseToast.makeText(this.l, C0019R.string.not_bind_phone_warning, 2000).show();
                    return;
                }
            }
            return;
        }
        if (i == 1232) {
            if (Pattern.compile("^(1)\\d{10}$").matcher("" + ContactAccessor.getEntity(App.a()).b()).find()) {
                if (ApplicationUtils.isUserPhoneBunded(this.l)) {
                    startActivity(Alumniactivity.a(this.l));
                    return;
                } else {
                    BaseToast.makeText(this.l, C0019R.string.not_bind_phone_warning, 2000).show();
                    return;
                }
            }
            return;
        }
        if (i != 102) {
            if (i == 103) {
                if (LoginInfoSP.isLogin(this.l)) {
                    b("营销活动", com.chinamobile.contacts.im.config.g.r);
                    return;
                }
                return;
            }
            if (i == 104) {
                if (LoginInfoSP.isLogin(this.l)) {
                    b("发现", com.chinamobile.contacts.im.config.g.r);
                    return;
                }
                return;
            }
            if (i == 2211) {
                if (LoginInfoSP.isLogin(this.l)) {
                    a(getActivity(), this);
                    return;
                }
                return;
            }
            if (i == 6868) {
                if (LoginInfoSP.isLogin(this.l)) {
                    if ("CM".equals(LoginInfoSP.getMobileNet(this.l))) {
                        if (LoginInfoSP.isfirstloginvnet(this.l).booleanValue()) {
                            com.chinamobile.contacts.im.enterpriseContact.utils.g.b(this.l);
                            LoginInfoSP.savefirstloginvnet(this.l, false);
                        }
                        if (LoginInfoSP.isVnet(this.l) == 2) {
                            startActivity(new Intent(this.l, (Class<?>) VnetgansuhelpActivity.class));
                            return;
                        } else {
                            this.l.startActivity(new Intent(this.l, (Class<?>) VnetListGansuActivity.class));
                            return;
                        }
                    }
                    Toast.makeText(this.l, "V网功能目前只支持中国移动甘肃用户", 1).show();
                    return;
                }
                return;
            }
            if (i == 7666) {
                if (LoginInfoSP.isLogin(this.l)) {
                    this.l.startActivity(new Intent(this.l, (Class<?>) ConferenceActivity.class));
                    return;
                }
                return;
            }
            if (i == 1111) {
                if (LoginInfoSP.isLogin(this.l) && "CM".equals(LoginInfoSP.getMobileNet(this.l))) {
                    this.l.startActivity(new Intent(this.l, (Class<?>) SettingVoiceMailActivity.class));
                    return;
                } else {
                    if (LoginInfoSP.isLogin(this.l)) {
                        Toast.makeText(this.l, "和留言目前只支持中国移动用户!", 1).show();
                        return;
                    }
                    return;
                }
            }
            if (t()) {
                startActivity(new Intent(getActivity(), (Class<?>) SyncActivity.class));
            }
        }
    }

    private void u() {
        if (LoginInfoSP.isLogin(this.l)) {
            n();
            if (LoginInfoSP.isBunding(this.l)) {
                this.y = null;
                LoginInfoSP.getMobileNet(this.l);
                this.B = LoginInfoSP.getMobile(this.l);
                if (this.B.length() == 0) {
                    this.B = n.b();
                }
                if (G == -1) {
                    this.z.setVisibility(8);
                }
                if (ApplicationUtils.isCMCCPhone(this.B)) {
                    this.z.setVisibility(8);
                    Main.f1278b.execute(new j(this));
                    return;
                } else {
                    this.z.setVisibility(8);
                    return;
                }
            }
            this.z.setVisibility(8);
        }
    }

    private void b(String str, String str2) {
        String mobile = LoginInfoSP.getMobile(getActivity());
        if (TextUtils.isEmpty(mobile)) {
            a("温馨提示", "抱歉,检测到你的账号未绑定手机号,请绑定后参与活动。");
            return;
        }
        if (!ApplicationUtils.isCMCCPhone(mobile)) {
            a("温馨提示", "抱歉,和通讯录用户回馈活动目前仅支持中国移动用户参与。");
            return;
        }
        String str3 = str2 + "token=" + ContactAccessor.getAuth(this.l).l() + "&endpointId=" + ApplicationUtils.getUUID(this.l);
        com.chinamobile.contacts.im.utils.aq.d("king", "CloudServerFragment jumpMarketingView url " + str3);
        Intent intent = new Intent(getActivity(), (Class<?>) BrowserActivity.class);
        intent.putExtra("url", str3);
        intent.putExtra(MediaPlatformDBManager.KEY_TITLE, str);
        getActivity().startActivity(intent);
    }

    public void c(String str, String str2) {
        LoginInfoSP.getMobile(getActivity());
        ContactAccessor.getAuth(this.l).l();
        ApplicationUtils.getUUID(this.l);
        com.chinamobile.contacts.im.utils.aq.d("whj", "AD url " + str2);
        Intent intent = new Intent(getActivity(), (Class<?>) BrowserActivity.class);
        intent.putExtra("url", str2);
        intent.putExtra(MediaPlatformDBManager.KEY_TITLE, str);
        intent.putExtra(Telephony.BaseMmsColumns.FROM, "ad");
        getActivity().startActivity(intent);
    }

    public void a(String str, String str2) {
        HintsDialog hintsDialog = new HintsDialog(getActivity(), str, str2);
        hintsDialog.setStyle(HintsDialog.STYLE_SINGLE_BUTTON);
        hintsDialog.show();
    }

    public static boolean b(Context context) {
        com.chinamobile.contacts.im.sync.c.a entity = ContactAccessor.getEntity(context);
        return entity.d() && entity.c() != null && entity.c().length() > 0;
    }

    public static void c(Context context) {
        Toast.makeText(context, "快速群发目前只支持中国移动用户!", 1).show();
    }

    public static void a(Context context, Fragment fragment) {
        if (!b(context)) {
            d(context);
        } else if (!com.chinamobile.contacts.im.directory.f.a().c(context)) {
            c(context);
        } else {
            fragment.startActivity(new Intent(context, (Class<?>) QuickGroupSessionsActivity.class));
        }
    }

    public static void d(Context context) {
        HintsDialog hintsDialog = new HintsDialog(context, HintsDialog.STYLE_SINGLE_BUTTON, context.getString(C0019R.string.cozyNotice), context.getString(C0019R.string.groups_bindmobile_tip));
        hintsDialog.setButton(new k());
        hintsDialog.show();
    }

    @Override
    public void onTabChange() {
        super.onTabChange();
    }

    @Override
    public void onDetach() {
        super.onDetach();
        try {
            Field declaredField = Fragment.class.getDeclaredField("mChildFragmentManager");
            declaredField.setAccessible(true);
            declaredField.set(this, null);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        } catch (NoSuchFieldException e2) {
            throw new RuntimeException(e2);
        }
    }

    public void v() {
        try {
            com.chinamobile.contacts.im.utils.aq.d("zyu", "CloudServerFragment onDataChange");
            this.I.a(al.a().d());
            a(this.H.getTotalPage());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void a(int i) {
        this.f1693b.removeAllViews();
        if (i != 1) {
            for (int i2 = 0; i2 < i; i2++) {
                ImageView imageView = new ImageView(this.l);
                int dip2px = ApplicationUtils.dip2px(this.l, 5.0f);
                imageView.setPadding(dip2px, dip2px, dip2px, dip2px);
                if (i2 == 0) {
                    imageView.setImageResource(C0019R.drawable.emoticon_index_select);
                } else {
                    imageView.setImageResource(C0019R.drawable.emoticon_index_unselect);
                }
                this.f1693b.addView(imageView);
            }
            this.f1693b.setVisibility(0);
        }
    }

    @Override
    public void onBackPressed() {
        try {
            if (this.H.a()) {
                this.H.a(false);
            } else {
                super.onBackPressed();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void a(boolean z) {
        ((ICloudActivity) getActivity()).setPluginEdit(z);
    }

    @Override
    public void b(int i, int i2) {
        int childCount = this.f1693b.getChildCount();
        for (int i3 = 0; i3 < childCount; i3++) {
            ImageView imageView = (ImageView) this.f1693b.getChildAt(i3);
            if (i3 == i2) {
                imageView.setImageResource(C0019R.drawable.emoticon_index_select);
            } else {
                imageView.setImageResource(C0019R.drawable.emoticon_index_unselect);
            }
        }
    }

    @Override
    public void a(int i, boolean z) {
        a(this.H.getTotalPage());
    }

    @Override
    public void onHiddenChanged(boolean z) {
        super.onHiddenChanged(z);
        if (!z) {
            e();
            w();
        }
    }

    @Override
    public void f() {
        getActivity().runOnUiThread(new e(this));
    }

    @Override
    public void g() {
        getActivity().runOnUiThread(new f(this));
    }

    private void w() {
        if (this.N != null && this.H != null) {
            this.N.a(this.H);
        }
    }
}