和通讯录 v4.2.0版本的 MD5 值为:f213fa766dccbfebde0dd8add5534518
以下内容为反编译后的 SettingMessageActivity.java 源代码,内容仅作参考
package com.chinamobile.contacts.im.setting;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.CheckBox;
import android.widget.RelativeLayout;
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.data.simcard.MultiSimCardAccessor;
import com.chinamobile.contacts.im.login.SettingNewLoginMainActivity;
import com.chinamobile.contacts.im.mms2.utils.CommonTools;
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.actionbar.IcloudActionBar;
import com.umeng.analytics.AspMobclickAgent;
public class SettingMessageActivity extends ICloudActivity implements SharedPreferences.OnSharedPreferenceChangeListener, View.OnClickListener {
private Context f3229a;
private RelativeLayout f3230b;
private RelativeLayout c;
private RelativeLayout d;
private IcloudActionBar e;
private RelativeLayout f;
private RelativeLayout g;
private RelativeLayout h;
private RelativeLayout i;
private RelativeLayout j;
private RelativeLayout k;
private RelativeLayout l;
private CheckBox m;
private CheckBox n;
private CheckBox o;
private CheckBox p;
private final int q = 10097;
private final int r = 10099;
private CheckBox s;
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
requestWindowFeature(1);
setContentView(C0019R.layout.setting_message_activity);
b();
c();
d();
com.chinamobile.contacts.im.config.f.a(this).registerOnSharedPreferenceChangeListener(this);
}
private void b() {
this.e = getIcloudActionBar();
this.e.setNavigationMode(2);
this.e.setDisplayAsUpTitle("信息设置");
this.e.setDisplayAsUpBack(C0019R.drawable.iab_green_back, this);
this.e.setDisplayAsUpTitleBtn("", null);
}
private void c() {
this.f3229a = this;
}
private void d() {
this.c = (RelativeLayout) findViewById(C0019R.id.setting_messge_forward_layout);
this.c.setOnClickListener(this);
this.f3230b = (RelativeLayout) findViewById(C0019R.id.setting_item_setapn);
this.f3230b.setOnClickListener(this);
this.f = (RelativeLayout) findViewById(C0019R.id.setting_second_send);
this.f.setOnClickListener(this);
this.g = (RelativeLayout) findViewById(C0019R.id.setting_recycle_sms);
this.g.setOnClickListener(this);
this.h = (RelativeLayout) findViewById(C0019R.id.setting_item_classify);
this.h.setOnClickListener(this);
this.i = (RelativeLayout) findViewById(C0019R.id.setting_message_classify);
this.i.setOnClickListener(this);
this.j = (RelativeLayout) findViewById(C0019R.id.setting_quick_gruoup_help);
this.j.setOnClickListener(this);
this.k = (RelativeLayout) findViewById(C0019R.id.setting_message_set_def);
this.k.setOnClickListener(this);
this.l = (RelativeLayout) findViewById(C0019R.id.setting_mms_collect_backup_layout);
this.l.setOnClickListener(this);
this.d = (RelativeLayout) findViewById(C0019R.id.setting_message_remind);
this.d.setOnClickListener(this);
this.m = (CheckBox) findViewById(C0019R.id.setting_messge_forward_cb);
this.n = (CheckBox) findViewById(C0019R.id.setting_mms_backup_cb);
this.o = (CheckBox) findViewById(C0019R.id.setting_recycle_sms_cb);
this.p = (CheckBox) findViewById(C0019R.id.setting_item_classify_cb);
this.s = (CheckBox) findViewById(C0019R.id.setting_mms_collect_backup_cb);
}
@Override
public void onResume() {
super.onResume();
this.m.setChecked(com.chinamobile.contacts.im.config.j.j(this.f3229a));
this.p.setChecked(com.chinamobile.contacts.im.config.j.r(this.f3229a) > 0);
if (com.chinamobile.contacts.im.config.f.c(this.f3229a, ApplicationUtils.getSubscriberId(this.f3229a)) > 0) {
}
if (com.chinamobile.contacts.im.config.j.r(this.f3229a) > 0) {
this.i.setVisibility(0);
} else {
this.i.setVisibility(8);
}
this.o.setChecked(com.chinamobile.contacts.im.config.j.v(this.f3229a));
this.s.setChecked(com.chinamobile.contacts.im.config.o.s(this.f3229a));
}
@Override
public void onDestroy() {
com.chinamobile.contacts.im.config.f.a(this).unregisterOnSharedPreferenceChangeListener(this);
super.onDestroy();
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case C0019R.id.iab_back_area:
onBackPressed();
return;
case C0019R.id.setting_message_remind:
startActivity(new Intent(this, (Class<?>) SettingMessageRemindActivity.class));
return;
case C0019R.id.setting_item_classify:
if (this.p.isChecked()) {
HintsDialog hintsDialog = new HintsDialog(this.f3229a, "短信归档", "关闭后,接收端口类短信将不再自动归档。");
hintsDialog.setButton(new bv(this), C0019R.string.setting_close);
hintsDialog.show();
return;
} else {
AspMobclickAgent.onEvent(this, "settingMms_open_mmsClassify");
HintsDialog hintsDialog2 = new HintsDialog(this.f3229a, "短信归档", "是否开启端口类短信归档?");
hintsDialog2.setButton(new bx(this), C0019R.string.setting_btn_open);
hintsDialog2.show();
return;
}
case C0019R.id.setting_message_classify:
startActivity(new Intent().setClass(this, SettingNotificationActivity.class));
return;
case C0019R.id.setting_mms_collect_backup_layout:
if (com.chinamobile.contacts.im.config.o.s(this.f3229a) || com.chinamobile.contacts.im.sync.c.av.a(this.f3229a, false)) {
if (com.chinamobile.contacts.im.config.o.s(this.f3229a)) {
com.chinamobile.contacts.im.config.o.j(this.f3229a, false);
this.s.setChecked(false);
return;
} else {
if (LoginInfoSP.isLogin(this.f3229a)) {
com.chinamobile.contacts.im.config.o.j(this.f3229a, true);
this.s.setChecked(true);
a();
return;
}
startActivityForResult(new Intent(this, (Class<?>) SettingNewLoginMainActivity.class), 10099);
return;
}
}
return;
case C0019R.id.setting_recycle_sms:
if (this.o.isChecked()) {
AspMobclickAgent.onEvent(this.f3229a, "settingMms_close_recycleSms");
com.chinamobile.contacts.im.config.j.l(this.f3229a, false);
this.o.setChecked(false);
return;
} else {
com.chinamobile.contacts.im.config.j.l(this.f3229a, true);
this.o.setChecked(true);
return;
}
case C0019R.id.setting_messge_forward_layout:
if (this.m.isChecked()) {
HintsDialog hintsDialog3 = new HintsDialog(this.f3229a, "转发设置", "关闭后,转发收到的信息时,不自动添加“转发自...”前缀。");
hintsDialog3.setButton(new bu(this), C0019R.string.setting_close);
hintsDialog3.show();
return;
} else {
com.chinamobile.contacts.im.config.j.e(this.f3229a, true);
this.m.setChecked(true);
return;
}
case C0019R.id.setting_message_set_def:
AspMobclickAgent.onEvent(this, "sms_setting_default_client");
Intent intent = new Intent(this.f3229a, (Class<?>) BrowserActivity.class);
if ("OPPO".equalsIgnoreCase(ApplicationUtils.getMobileManufacturer())) {
intent.putExtra("url", "http://pim1.10086.cn/getThirdHlp.action?os=android&inSec=5&inThird=4");
} else if ("BBK".equalsIgnoreCase(ApplicationUtils.getMobileManufacturer())) {
intent.putExtra("url", "http://pim1.10086.cn/getThirdHlp.action?os=android&inSec=5&inThird=5");
} else if (MultiSimCardAccessor.MODEL_HUAWEI_SUR_TL00.equalsIgnoreCase(ApplicationUtils.getMobileManufacturer())) {
intent.putExtra("url", "http://pim1.10086.cn/getThirdHlp.action?os=android&inSec=5&inThird=6");
} else if ("Coolpad".equalsIgnoreCase(ApplicationUtils.getMobileManufacturer())) {
intent.putExtra("url", "http://pim1.10086.cn/getThirdHlp.action?os=android&inSec=5&inThird=7");
} else if ("LENOVO".equalsIgnoreCase(ApplicationUtils.getMobileManufacturer())) {
intent.putExtra("url", "http://pim1.10086.cn/getThirdHlp.action?os=android&inSec=5&inThird=8");
} else if ("SAMSUNG".equalsIgnoreCase(ApplicationUtils.getMobileManufacturer()) && ApplicationUtils.getSystemVersion() >= 19) {
intent.putExtra("url", "http://pim1.10086.cn/getThirdHlp.action?os=android&inSec=5&inThird=9");
} else if ("SAMSUNG".equalsIgnoreCase(ApplicationUtils.getMobileManufacturer()) && ApplicationUtils.getSystemVersion() < 19) {
intent.putExtra("url", "http://pim1.10086.cn/getThirdHlp.action?os=android&inSec=5&inThird=10");
} else if ("Sony".equalsIgnoreCase(ApplicationUtils.getMobileManufacturer())) {
intent.putExtra("url", "http://pim1.10086.cn/getThirdHlp.action?os=android&inSec=5&inThird=11");
} else if ("K-Touch".equalsIgnoreCase(ApplicationUtils.getMobileManufacturer())) {
intent.putExtra("url", "http://pim1.10086.cn/getThirdHlp.action?os=android&inSec=5&inThird=12");
} else if ("XIAOMI".equalsIgnoreCase(ApplicationUtils.getMobileManufacturer())) {
intent.putExtra("url", "http://pim1.10086.cn/getThirdHlp.action?os=android&inSec=5&inThird=13");
} else if ("ZTE".equalsIgnoreCase(ApplicationUtils.getMobileManufacturer())) {
intent.putExtra("url", "http://pim1.10086.cn/getThirdHlp.action?os=android&inSec=5&inThird=14");
} else {
intent.putExtra("url", "http://pim1.10086.cn/getSecondHlp.action?os=android&inSec=5");
}
startActivity(intent);
return;
case C0019R.id.setting_item_setapn:
try {
if (CommonTools.getInstance().createOrUpdateMmsApnConfig(this.f3229a) == 1) {
BaseToast.makeText(this.f3229a, "接入点已存在", 0).show();
} else {
BaseToast.makeText(this.f3229a, "设置成功", 0).show();
}
return;
} catch (Exception e) {
BaseToast.makeText(this.f3229a, "设置不成功,请手动设置", 1).show();
return;
}
case C0019R.id.setting_second_send:
if (ContactAccessor.getEntity(this.f3229a).c()) {
startActivity(SettingGroupsDetialActivity.a(this.f3229a));
return;
} else {
startActivity(new Intent().setClass(this.f3229a, SettingNewLoginMainActivity.class));
return;
}
case C0019R.id.setting_quick_gruoup_help:
if (!LoginInfoSP.isLogin(this)) {
startActivityForResult(new Intent(this, (Class<?>) SettingNewLoginMainActivity.class), 10097);
return;
} else {
startActivity(new Intent(this, (Class<?>) SettingGroupsDetialActivity.class));
return;
}
default:
return;
}
}
public static Intent a(Context context) {
return new Intent(context, (Class<?>) SettingMessageActivity.class);
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
com.chinamobile.contacts.im.utils.bm.b("SettingMessageActivity", "onActivityResult");
if (10097 == i) {
if (LoginInfoSP.isLogin(this)) {
startActivity(new Intent(this, (Class<?>) SettingGroupsDetialActivity.class));
}
} else if (10099 == i && LoginInfoSP.isLogin(this)) {
com.chinamobile.contacts.im.config.o.j(this.f3229a, true);
this.s.setChecked(true);
a();
}
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String str) {
}
public void a() {
com.chinamobile.contacts.im.sync.c.h.a().a(this.f3229a);
if (com.chinamobile.contacts.im.sync.c.h.a().f()) {
com.chinamobile.contacts.im.sync.c.h.a().k();
} else {
new Handler().postDelayed(new bz(this), 10000L);
}
}
}