和通讯录 v4.2.0版本的 MD5 值为:f213fa766dccbfebde0dd8add5534518
以下内容为反编译后的 MainSettingActivity.java 源代码,内容仅作参考
package com.chinamobile.contacts.im.setting;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.chinamobile.contacts.im.App;
import com.chinamobile.contacts.im.C0019R;
import com.chinamobile.contacts.im.config.LoginInfoSP;
import com.chinamobile.contacts.im.data.ContactAccessor;
import com.chinamobile.contacts.im.login.SettingNewLoginMainActivity;
import com.chinamobile.contacts.im.mobilecard.OneCardLoginController;
import com.chinamobile.contacts.im.mobilecard.view.OneCardGroupAndSettingAc;
import com.chinamobile.contacts.im.ui.ICloudActivity;
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.ProgressDialog;
import com.chinamobile.contacts.im.view.actionbar.IcloudActionBar;
import com.umeng.analytics.AspMobclickAgent;
public class MainSettingActivity extends ICloudActivity implements View.OnClickListener, OneCardLoginController.OnLoadCompletedListener {
public static boolean f3209a = false;
private static com.chinamobile.contacts.im.sync.b.a i;
private Context f3210b;
private RelativeLayout c;
private RelativeLayout d;
private RelativeLayout e;
private RelativeLayout f;
private RelativeLayout g;
private RelativeLayout h;
private RelativeLayout j;
private z k;
private RelativeLayout l;
private IcloudActionBar m;
private int n = 1311;
private Handler o = new w(this);
private RelativeLayout p;
private RelativeLayout q;
private RelativeLayout r;
private TextView s;
private RelativeLayout t;
private TextView u;
private ImageView v;
private ProgressDialog w;
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.f3210b = this;
setContentView(C0019R.layout.setting_main_activity);
c();
d();
this.k = new z(this, null);
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("sync_switch_state");
intentFilter.addAction("com.chinamobile.contact.im.SYNC_CLOSE_ACTION");
intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE");
registerReceiver(this.k, intentFilter);
}
private void c() {
this.m = getIcloudActionBar();
this.m.setNavigationMode(3);
this.m.setDisplayAsUpTitle("设置");
this.m.setDisplayAsUpBack(C0019R.drawable.iab_green_back, this);
}
private void d() {
this.j = (RelativeLayout) findViewById(C0019R.id.setting_item_call);
this.e = (RelativeLayout) findViewById(C0019R.id.setting_item_message);
this.d = (RelativeLayout) findViewById(C0019R.id.setting_item_contact);
this.g = (RelativeLayout) findViewById(C0019R.id.setting_item_vip);
this.c = (RelativeLayout) findViewById(C0019R.id.setting_item_login);
this.f = (RelativeLayout) findViewById(C0019R.id.setting_about_icloud);
this.p = (RelativeLayout) findViewById(C0019R.id.setting_item_sync_backup);
this.r = (RelativeLayout) findViewById(C0019R.id.setting_item_problem);
this.r.setOnClickListener(this);
this.l = (RelativeLayout) findViewById(C0019R.id.setting_item_app);
if (ApplicationUtils.getChannel(this.f3210b).equals("mcontact_mfmfscanzhi")) {
this.l.setVisibility(8);
findViewById(C0019R.id.setting_item_app_line).setVisibility(8);
}
this.q = (RelativeLayout) findViewById(C0019R.id.setting_item_other);
this.h = (RelativeLayout) findViewById(C0019R.id.setting_item_trustee);
if (ApplicationUtils.getSystemVersion() >= 21) {
this.h.setVisibility(8);
}
this.s = (TextView) findViewById(C0019R.id.setting_item_login_text);
this.t = (RelativeLayout) findViewById(C0019R.id.setting_item_login_logout_text);
this.u = (TextView) findViewById(C0019R.id.setting_item_login_change_pwd);
this.v = (ImageView) findViewById(C0019R.id.setting_item_login_img);
this.t.setOnClickListener(this);
this.u.setOnClickListener(this);
this.j.setOnClickListener(this);
this.e.setOnClickListener(this);
this.g.setOnClickListener(this);
this.d.setOnClickListener(this);
this.c.setOnClickListener(this);
this.f.setOnClickListener(this);
this.p.setOnClickListener(this);
this.l.setOnClickListener(this);
this.q.setOnClickListener(this);
this.h.setOnClickListener(this);
com.chinamobile.contacts.im.directory.f.a().a(this, this.g);
a();
}
@Override
public void onPause() {
super.onPause();
}
@Override
public void onResume() {
super.onResume();
if (LoginInfoSP.isLogin(this.f3210b) && LoginInfoSP.isfirstloginvnet(this.f3210b).booleanValue()) {
com.chinamobile.contacts.im.enterpriseContact.utils.h.b(this.f3210b);
LoginInfoSP.savefirstloginvnet(this.f3210b, false);
}
a();
this.o.post(new x(this));
}
@Override
public void onDestroy() {
super.onDestroy();
unregisterReceiver(this.k);
}
public void a() {
i = ContactAccessor.getEntity(this.f3210b);
if (i.c()) {
this.v.setVisibility(8);
this.t.setVisibility(0);
this.u.setVisibility(0);
this.c.setClickable(false);
this.s.setText("帐号 " + i.a());
com.chinamobile.contacts.im.utils.bm.a("AAAAA", i.a());
return;
}
this.v.setVisibility(0);
this.t.setVisibility(8);
this.u.setVisibility(8);
this.c.setClickable(true);
this.s.setText("登录");
com.chinamobile.contacts.im.directory.f.a().a(this.f3210b, (View) this.g, false);
}
public static void b() {
i = ContactAccessor.getEntity(App.a());
if (i.c()) {
com.chinamobile.contacts.im.setting.c.g.a(ContactAccessor.getAuth(App.a()).l(), com.chinamobile.contacts.im.config.g.h);
}
}
@Override
public void onActivityResult(int i2, int i3, Intent intent) {
super.onActivityResult(i2, i3, intent);
if (i2 != 1232 && i2 == this.n) {
a();
}
}
private void e() {
HintsDialog hintsDialog = new HintsDialog(this, "温馨提示", "确定要退出登录吗?");
hintsDialog.setButton(new y(this));
hintsDialog.show();
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case C0019R.id.setting_item_vip:
com.chinamobile.icloud.im.sync.a.a auth = ContactAccessor.getAuth(this.f3210b);
if (auth != null) {
com.chinamobile.contacts.im.directory.g gVar = new com.chinamobile.contacts.im.directory.g(1, this.f3210b);
String a2 = com.chinamobile.contacts.im.directory.f.a().a(this.f3210b, auth, 1);
gVar.a(this.o.obtainMessage(88131));
gVar.executeOnMainExecutor(com.chinamobile.contacts.im.config.g.i, a2);
return;
}
return;
case C0019R.id.iab_back_area:
onBackPressed();
return;
case C0019R.id.setting_item_login:
AspMobclickAgent.onEvent(this, "setting_login");
startActivityForResult(new Intent().setClass(this.f3210b, SettingNewLoginMainActivity.class), this.n);
return;
case C0019R.id.setting_item_login_change_pwd:
if (!ApplicationUtils.isNetworkAvailable(this.f3210b)) {
BaseToast.makeText(this.f3210b, "网络不给力,请检查网络设置", 2000).show();
return;
} else if (!LoginInfoSP.isBunding(this.f3210b)) {
BaseToast.makeText(this.f3210b, "未绑定手机号!", 2000).show();
return;
} else {
String mobile = LoginInfoSP.getMobile(this.f3210b);
startActivity(BrowserActivity.createIntent(this.f3210b, "http://wap.cmpassport.com/xmdpwd?optype=12&sourceid=6&mobilenumber=" + mobile + "&check=" + ApplicationUtils.encrypt("MD5", ApplicationUtils.encrypt("MD5", "126" + mobile) + "1f7f2a6327159e9e") + "&backurl=", "修改密码"));
return;
}
case C0019R.id.setting_item_call:
AspMobclickAgent.onEvent(this.f3210b, "setting_callSetting");
startActivity(new Intent(this.f3210b, (Class<?>) SettingCallActivity.class));
return;
case C0019R.id.setting_item_contact:
AspMobclickAgent.onEvent(this.f3210b, "setting_contactSetting");
startActivity(SettingContactActivity.a(this.f3210b));
return;
case C0019R.id.setting_item_message:
AspMobclickAgent.onEvent(this.f3210b, "setting_smsSetting");
startActivity(SettingMessageActivity.a(this.f3210b));
return;
case C0019R.id.setting_item_sync_backup:
AspMobclickAgent.onEvent(this, "setting_syncSetting");
startActivity(new Intent(this, (Class<?>) SettingSyncActivity.class));
return;
case C0019R.id.setting_item_other:
AspMobclickAgent.onEvent(this, "setting_appsystemSetting");
startActivity(new Intent().setClass(this.f3210b, SettingOtherActivity.class));
return;
case C0019R.id.setting_item_trustee:
startActivity(new Intent(this, (Class<?>) SettingTrusteeActivity.class));
return;
case C0019R.id.setting_item_app:
AspMobclickAgent.onEvent(this, "setting_recommend_application");
startActivity(new Intent().setClass(this.f3210b, SettingRecommendAppActivity.class));
return;
case C0019R.id.setting_item_problem:
AspMobclickAgent.onEvent(this, "setting_feedback");
startActivity(new Intent().setClass(this.f3210b, SettingProblemDiagnoseActivity.class));
return;
case C0019R.id.setting_about_icloud:
AspMobclickAgent.onEvent(this, "setting_about");
this.f3210b.startActivity(new Intent(this.f3210b, (Class<?>) SettingAboutActivity.class));
return;
case C0019R.id.setting_item_login_logout_text:
AspMobclickAgent.onEvent(this.f3210b, "setting_logout_sure");
e();
return;
default:
return;
}
}
@Override
public void onLoadCompleted(String str) {
if (this.w != null && this.w.isShowing()) {
this.w.dismiss();
}
if (!TextUtils.isEmpty(str)) {
BaseToast.makeText(this.f3210b, str, 1000).show();
return;
}
if (LoginInfoSP.getLoadSubPhoneState(this.f3210b) == 0) {
startActivity(new Intent(this.f3210b, (Class<?>) BusinessIntroductionActivity.class));
} else if (LoginInfoSP.getLoadSubPhoneState(this.f3210b) == 1) {
Intent intent = new Intent(this.f3210b, (Class<?>) ACardMoreNumberActivity.class);
intent.putExtra(OneCardGroupAndSettingAc.INTENT_TITLE_NAME, this.f3210b.getString(C0019R.string.onecard_name_setting));
startActivity(intent);
}
}
public void a(Context context) {
com.chinamobile.icloud.im.sync.a.a auth = ContactAccessor.getAuth(context);
new com.chinamobile.contacts.im.sync.c.g(context, auth, false).a(true).executeOnMainExecutor(new Void[0]);
auth.b(false);
SettingSyncActivity.a(context, false, 3, false);
com.chinamobile.contacts.im.config.o.d(context, false);
com.chinamobile.contacts.im.config.o.e(context, false);
}
}