4399游戏盒 v7.2.1.31版本的 MD5 值为:951717f45e3fda95c8a358caf4ca93e1
以下内容为反编译后的 SettingsRootFragment.java 源代码,内容仅作参考
package com.m4399.gamecenter.plugin.main.controllers.settings;
import android.app.Activity;
import android.app.ProgressDialog;
import android.arch.lifecycle.m;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Keep;
import android.support.v4.view.PointerIconCompat;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.view.ViewTreeObserver;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import com.download.DownloadConfigKey;
import com.framework.EnvironmentMode;
import com.framework.config.Config;
import com.framework.config.SysConfigKey;
import com.framework.helpers.AppNativeHelper;
import com.framework.helpers.CommandHelper;
import com.framework.manager.network.NetworkStatusManager;
import com.framework.manager.storage.StorageManager;
import com.framework.manager.udid.UdidManager;
import com.framework.models.DnsType;
import com.framework.net.HttpDns;
import com.framework.net.ILoadPageEventListener;
import com.framework.providers.IHaveResponseDataListener;
import com.framework.rxbus.RxBus;
import com.framework.rxbus.annotation.Subscribe;
import com.framework.rxbus.annotation.Tag;
import com.framework.utils.ActivityStateUtils;
import com.framework.utils.FileUtils;
import com.framework.utils.JSONUtils;
import com.framework.utils.KeyboardUtils;
import com.framework.utils.UMengEventUtils;
import com.m4399.framework.BaseApplication;
import com.m4399.gamecenter.app.config.AppConfigKey;
import com.m4399.gamecenter.plugin.main.PluginApplication;
import com.m4399.gamecenter.plugin.main.R;
import com.m4399.gamecenter.plugin.main.config.BaseConfigKey;
import com.m4399.gamecenter.plugin.main.config.GameCenterConfigKey;
import com.m4399.gamecenter.plugin.main.config.UserConfigKey;
import com.m4399.gamecenter.plugin.main.controllers.youngmodel.IYoungModelManager;
import com.m4399.gamecenter.plugin.main.helpers.ar;
import com.m4399.gamecenter.plugin.main.helpers.bh;
import com.m4399.gamecenter.plugin.main.livedata.LiveDataBus;
import com.m4399.gamecenter.plugin.main.manager.authorization.AccessManager;
import com.m4399.gamecenter.plugin.main.manager.config.RemoteConfigManager;
import com.m4399.gamecenter.plugin.main.manager.minigame.MiniGamePluginLoaderHelper;
import com.m4399.gamecenter.plugin.main.manager.router.GameCenterRouterManager;
import com.m4399.gamecenter.plugin.main.manager.router.RouterBuilder;
import com.m4399.gamecenter.plugin.main.manager.router.n;
import com.m4399.gamecenter.plugin.main.manager.share.ShareItemKind;
import com.m4399.gamecenter.plugin.main.manager.shop.ShopThemeManager;
import com.m4399.gamecenter.plugin.main.manager.stat.StatManager;
import com.m4399.gamecenter.plugin.main.manager.stat.g;
import com.m4399.gamecenter.plugin.main.manager.user.PassProInfoManager;
import com.m4399.gamecenter.plugin.main.manager.user.UserCenterManager;
import com.m4399.gamecenter.plugin.main.models.share.ShareDataModel;
import com.m4399.gamecenter.plugin.main.models.user.UserInfoModel;
import com.m4399.gamecenter.plugin.main.models.user.UserModel;
import com.m4399.gamecenter.plugin.main.umeng.StatStructureSettings;
import com.m4399.gamecenter.plugin.main.utils.bc;
import com.m4399.gamecenter.plugin.main.utils.bq;
import com.m4399.gamecenter.plugin.main.views.settings.SettingsCell;
import com.m4399.stat.StatisticsConfig;
import com.m4399.support.utils.ClipboardUitls;
import com.m4399.support.utils.HttpResultTipUtils;
import com.m4399.support.utils.ImageProvide;
import com.m4399.support.utils.ToastUtils;
import java.util.HashMap;
import java.util.concurrent.TimeUnit;
import org.json.JSONObject;
import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.schedulers.Schedulers;
public class SettingsRootFragment extends e implements View.OnClickListener {
static Thread bFu = null;
static boolean bFv = false;
private EditText bFf;
private TextView bFg;
private Button bFh;
private TextView bFi;
private View bFj;
private SettingsCell bFk;
private SettingsCell bFl;
private SettingsCell bFm;
private SettingsCell bFn;
private TextView bFo;
private Button bFp;
private SettingsCell bFq;
private SettingsCell bFr;
private SettingsCell bFs;
private EditText bFt;
private View mCustomView;
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
registerSubscriber(UserCenterManager.getInstance().asLoginStatusObservable().observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<Boolean>() {
@Override
public void call(Boolean bool) {
SettingsRootFragment.this.bD(bool.booleanValue());
SettingsRootFragment.this.bG(bool.booleanValue());
SettingsRootFragment.this.bF(bool.booleanValue());
}
}));
registerSubscriber(UserCenterManager.getInstance().asUserInfoChangeObservable().observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<String>() {
@Override
public void call(String str) {
if (UserModel.USER_PROPERTY_USER_ICON.equals(str)) {
ImageProvide.with(SettingsRootFragment.this.getContext()).load(UserCenterManager.getUserIcon()).placeholder(R.mipmap.m4399_png_user_default_avatar).wifiLoad(false).into(SettingsRootFragment.this.bFm.getDescImageView());
}
}
}));
registerSubscriber(UserCenterManager.getInstance().asUserInfoChangeObservable().observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<String>() {
@Override
public void call(String str) {
if (UserModel.USER_PROPERTY_NICK.equals(str)) {
SettingsRootFragment.this.bFm.getActionName().setText(UserCenterManager.getNick());
}
}
}));
LiveDataBus.INSTANCE.get("modify.password.success").observe(getContext(), new m<String>() {
@Override
public void onChanged(String str) {
Bundle bundle2 = new Bundle();
bundle2.putString("intent.extra.logout.tip", SettingsRootFragment.this.getContext().getString(R.string.settings_modify_password_success));
GameCenterRouterManager.getInstance().openLoginInvalid(SettingsRootFragment.this.getContext(), bundle2);
}
});
RxBus.register(this);
}
@Override
protected int getLayoutID() {
return R.layout.m4399_fragment_settings_root;
}
@Override
public void onResume() {
super.onResume();
SettingsCell settingsCell = this.bFn;
if (settingsCell != null) {
b(settingsCell);
}
}
@Override
protected void onCellClick(final SettingsCell settingsCell) {
switch (settingsCell.getId()) {
case 1002:
Bundle bundle = new Bundle();
bundle.putString("fargment_name", SettingActivity.SETTING_INSTALL_FRAGMENT);
GameCenterRouterManager.getInstance().openSettings(getContext(), bundle);
bq.commitStat(StatStructureSettings.INSTALL_FLOW);
return;
case 1003:
Bundle bundle2 = new Bundle();
bundle2.putString("fargment_name", SettingActivity.SETTINGS_NOTIFICATION_FRAGMENT);
GameCenterRouterManager.getInstance().openSettings(getContext(), bundle2);
bq.commitStat(StatStructureSettings.NOTIFY);
return;
case 1004:
bE(true);
Bundle bundle3 = new Bundle();
bundle3.putString("fargment_name", SettingActivity.SETTINGS_OTHER_FRAGMENT);
GameCenterRouterManager.getInstance().openSettings(getContext(), bundle3);
UMengEventUtils.onEvent("ad_setting_account_bind_safe");
bq.commitStat(StatStructureSettings.ACCOUNT_BIND);
return;
case 1005:
UserCenterManager.checkIsLogin(getContext(), new com.m4399.gamecenter.plugin.main.listeners.f<Boolean>() {
@Override
public void onChecking() {
}
@Override
public void onCheckFinish(Boolean bool, Object... objArr) {
if (bool.booleanValue()) {
GameCenterRouterManager.getInstance().openBlacklist(SettingsRootFragment.this.getContext());
}
}
});
bq.commitStat(StatStructureSettings.BLACKLIST_SET);
return;
case PointerIconCompat.TYPE_CELL:
d(settingsCell);
com.m4399.feedback.controllers.c.getInstance().setShowHintBubble(true);
Bundle bundle4 = new Bundle();
bundle4.putInt("intent.extra.feedback.from", 1);
GameCenterRouterManager.getInstance().openFeedback(getActivity(), bundle4);
UMengEventUtils.onEvent("ad_setting_feedback_click");
bq.commitStat(StatStructureSettings.FEEDBACK);
return;
case PointerIconCompat.TYPE_CROSSHAIR:
Config.setValue(GameCenterConfigKey.IS_MARK_NEW_FUNCTION, Integer.valueOf(BaseApplication.getApplication().getStartupConfig().getVersionCode()));
settingsCell.getIsNew().setVisibility(8);
GameCenterRouterManager.getInstance().openNewFeature(getActivity());
UMengEventUtils.onEvent("ad_setting_new_feature");
bq.commitStat(StatStructureSettings.NEW_FUNCTION);
return;
case PointerIconCompat.TYPE_TEXT:
if (!NetworkStatusManager.checkIsAvalible()) {
ToastUtils.showToast(getContext(), R.string.network_error);
return;
}
UMengEventUtils.onEvent("ad_setting_check_upgrade");
if (((Boolean) Config.getValue(GameCenterConfigKey.IS_MARK_NEW_VERSION)).booleanValue()) {
Config.setValue(GameCenterConfigKey.IS_MARK_NEW_VERSION, false);
settingsCell.getIsNew().setVisibility(8);
}
com.m4399.gamecenter.plugin.main.manager.ac.a.getInstance().checkUpgradeUserCheck();
bq.commitStat(StatStructureSettings.CHECK_LATEST_VERSION);
return;
case PointerIconCompat.TYPE_VERTICAL_TEXT:
GameCenterRouterManager.getInstance().openSettingsAbout(getActivity());
UMengEventUtils.onEvent("ad_setting_about");
bq.commitStat(StatStructureSettings.ABOUT);
return;
case PointerIconCompat.TYPE_ALIAS:
default:
return;
case PointerIconCompat.TYPE_COPY:
Bundle bundle5 = new Bundle();
UserInfoModel userInfoModel = new UserInfoModel();
userInfoModel.setNick(UserCenterManager.getNick());
userInfoModel.setBface(UserCenterManager.getBface());
userInfoModel.setSface(UserCenterManager.getUserIcon());
userInfoModel.setRemark(UserCenterManager.getRemark());
userInfoModel.setFeel(UserCenterManager.getMood());
userInfoModel.setSex(UserCenterManager.getSex());
userInfoModel.setBirthday(UserCenterManager.getBirthday());
userInfoModel.setCity(UserCenterManager.getCity());
userInfoModel.setHeadgearId(UserCenterManager.getHeadGearId());
userInfoModel.setPtUid(UserCenterManager.getPtUid());
userInfoModel.setTagList(UserCenterManager.getUserTag());
userInfoModel.setUserFollowState(UserInfoModel.UserFollowState.None);
userInfoModel.setFavoriteGameList(UserCenterManager.getFavoriteGameList());
bundle5.putParcelable("intent.extra.goto.userinfo.model", userInfoModel);
GameCenterRouterManager.getInstance().openUserInfo(getActivity(), bundle5);
UMengEventUtils.onEvent("ad_setting_userdata_click");
bq.commitStat(StatStructureSettings.PERSON_INFO);
return;
case PointerIconCompat.TYPE_NO_DROP:
UMengEventUtils.onEvent("ad_newwork_settings_permissions_settings");
if (AccessManager.getInstance().IsOpenAccessEntrance(getContext())) {
GameCenterRouterManager.getInstance().openAccessManager(getActivity());
} else {
AccessManager.getInstance().openAppDetailsSettings(getContext());
HashMap hashMap = new HashMap();
hashMap.put("type", "直接查看");
UMengEventUtils.onEvent("ad_setting_all_permissions", hashMap);
}
bq.commitStat(StatStructureSettings.PERMISSION);
return;
case PointerIconCompat.TYPE_ALL_SCROLL:
if (settingsCell.getTag() != null ? ((Boolean) settingsCell.getTag()).booleanValue() : true) {
settingsCell.setTag(false);
new com.m4399.gamecenter.plugin.main.providers.settings.i().loadData(new IHaveResponseDataListener() {
@Override
public void onSubBefore() {
}
@Override
public void onSubSuccess(JSONObject jSONObject) {
if (SettingsRootFragment.this.getContext() == null || SettingsRootFragment.this.getContext().isFinishing()) {
return;
}
final ShareDataModel shareDataModel = new ShareDataModel();
shareDataModel.parse(jSONObject);
com.m4399.gamecenter.plugin.main.manager.share.d.openShareDialog(SettingsRootFragment.this.getContext(), com.m4399.gamecenter.plugin.main.manager.share.d.buildShareItemKind("shareGameBox", null), new com.m4399.gamecenter.plugin.main.controllers.share.b() {
@Override
public void onShareItemClick(ShareItemKind shareItemKind) {
com.m4399.gamecenter.plugin.main.manager.share.d.share(SettingsRootFragment.this.getContext(), shareDataModel, shareItemKind, "ad_setting_share_result");
}
}, "ad_setting_share", "游戏盒分享");
Observable.timer(600L, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread()).subscribe(new Action1<Long>() {
@Override
public void call(Long l) {
if (settingsCell != null) {
settingsCell.setTag(true);
}
}
});
}
@Override
public void onSubFailure(Throwable th, int i, String str, int i2, JSONObject jSONObject) {
SettingsCell settingsCell2 = settingsCell;
if (settingsCell2 != null) {
settingsCell2.setTag(true);
}
if (SettingsRootFragment.this.getActivity() != null) {
ToastUtils.showToast(SettingsRootFragment.this.getActivity(), HttpResultTipUtils.getFailureTip(SettingsRootFragment.this.getActivity(), th, i, str));
}
}
});
bq.commitStat(StatStructureSettings.SHARE_GAME_BOX);
return;
}
return;
case PointerIconCompat.TYPE_HORIZONTAL_DOUBLE_ARROW:
AO();
bq.commitStat(StatStructureSettings.EXPERIENCE);
return;
case PointerIconCompat.TYPE_VERTICAL_DOUBLE_ARROW:
AN();
bq.commitStat(StatStructureSettings.SEND_LOG);
return;
case PointerIconCompat.TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW:
UMengEventUtils.onEvent("app_introduction_video_play", "设置");
com.m4399.gamecenter.plugin.main.manager.newcomer.c.getInstance().openIntroGuideVideo(getActivity(), "设置页", null);
bq.commitStat(StatStructureSettings.INTRODUCTION);
return;
case PointerIconCompat.TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW:
GameCenterRouterManager.getInstance().openNetworkDiagnose(getContext(), null, "", 1);
return;
case PointerIconCompat.TYPE_ZOOM_IN:
GameCenterRouterManager.getInstance().openYoungModelActivity(getActivity(), 0);
return;
case PointerIconCompat.TYPE_ZOOM_OUT:
GameCenterRouterManager.getInstance().openActivityByJson(getActivity(), new RouterBuilder("setting/game_box_doctor").build());
return;
}
}
private void AN() {
com.m4399.gamecenter.plugin.main.manager.stat.g.getInstance().uploadLog(900000L, new g.a() {
private ProgressDialog bFL;
@Override
public void onStart() {
this.bFL = new ProgressDialog(SettingsRootFragment.this.getContext());
this.bFL.setIndeterminate(true);
this.bFL.setMessage(SettingsRootFragment.this.getString(R.string.uploading_not_close));
this.bFL.setTitle(SettingsRootFragment.this.getString(R.string.commit_error_log));
this.bFL.show();
}
@Override
public void onProgress(final int i, final int i2) {
Observable.just("").subscribeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<String>() {
@Override
public void call(String str) {
AnonymousClass45.this.bFL.setMessage(SettingsRootFragment.this.getString(R.string.upload_progress) + i + "/" + i2);
}
});
}
@Override
public void onComplete() {
if (this.bFL.isShowing()) {
this.bFL.dismiss();
}
}
});
}
private void AO() {
JSONObject experience = RemoteConfigManager.getInstance().getExperience();
if (experience != null) {
String string = JSONUtils.getString("acturl", experience);
int i = JSONUtils.getInt("actid", experience);
if (TextUtils.isEmpty(string)) {
return;
}
Bundle bundle = new Bundle();
bundle.putInt("intent.extra.activity.id", i);
bundle.putString("intent.extra.activity.title", getString(R.string.join_experience));
bundle.putString("intent.extra.activity.url", string);
GameCenterRouterManager.getInstance().openActivitiesDetail(getContext(), bundle, new int[0]);
UMengEventUtils.onEvent("ad_setting_test_public_activity");
}
}
@Override
public void onDestroy() {
Config.setValue(GameCenterConfigKey.IS_MARK_SETTING_RED_DOT, false);
Config.setValue(GameCenterConfigKey.IS_MARK_SETTING_RED_DOT_FROM_FEEDBACK, false);
Config.setValue(GameCenterConfigKey.IS_MARK_MYCENTER_RED_DOT_FROM_FEEDBACK, false);
Config.setValue(UserConfigKey.IS_MARK_SETTING_RED_DOT_FROM_PHONE_SMS_FIRST_LOGIN, false);
RxBus.get().post("tag.setting.button.mark.config.update", "setting-close");
super.onDestroy();
RxBus.unregister(this);
}
@Override
protected void setupSettingCell(SettingsCell settingsCell) {
switch (settingsCell.getId()) {
case 1004:
f(settingsCell);
return;
case 1005:
case PointerIconCompat.TYPE_VERTICAL_TEXT:
case PointerIconCompat.TYPE_ALIAS:
default:
return;
case PointerIconCompat.TYPE_CELL:
d(settingsCell);
return;
case PointerIconCompat.TYPE_CROSSHAIR:
c(settingsCell);
return;
case PointerIconCompat.TYPE_TEXT:
this.bFk = settingsCell;
AR();
return;
case PointerIconCompat.TYPE_COPY:
this.bFm = settingsCell;
bD(UserCenterManager.isLogin().booleanValue());
return;
case PointerIconCompat.TYPE_NO_DROP:
AccessManager.getInstance().updateAccessArray(getContext());
e(settingsCell);
settingsCell.setVisibility(0);
return;
case PointerIconCompat.TYPE_ALL_SCROLL:
settingsCell.setDescText(getResources().getString(R.string.settings_root_share_desc));
settingsCell.getIconAccess().setImageResource(R.mipmap.m4399_png_settings_root_share);
settingsCell.getIconAccess().setVisibility(0);
return;
case PointerIconCompat.TYPE_HORIZONTAL_DOUBLE_ARROW:
this.bFl = settingsCell;
AP();
return;
case PointerIconCompat.TYPE_VERTICAL_DOUBLE_ARROW:
settingsCell.setVisibility(com.m4399.gamecenter.plugin.main.manager.stat.g.getInstance().isLogOpen() ? 0 : 8);
return;
case PointerIconCompat.TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW:
settingsCell.setVisibility(com.m4399.gamecenter.plugin.main.manager.newcomer.c.getInstance().isShowGameBoxGuide() ? 0 : 8);
return;
case PointerIconCompat.TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW:
settingsCell.setVisibility(0);
TextView actionName = settingsCell.getActionName();
actionName.setVisibility(0);
actionName.setText(getString(R.string.network_diagnose_setting_menu_title));
return;
case PointerIconCompat.TYPE_ZOOM_IN:
this.bFn = settingsCell;
b(settingsCell);
return;
case PointerIconCompat.TYPE_ZOOM_OUT:
settingsCell.setVisibility(n.isCanJump("setting/game_box_doctor") ? 0 : 8);
return;
}
}
private void b(SettingsCell settingsCell) {
TextView actionName = settingsCell.getActionName();
if (IYoungModelManager.INSTANCE.getInstance().isOpenYoungModel()) {
actionName.setVisibility(0);
actionName.setText(getString(R.string.headsup_dialog_btn_left));
actionName.setTextColor(getResources().getColor(R.color.theme_default_lv));
return;
}
actionName.setText("");
}
private void AP() {
JSONObject experience = RemoteConfigManager.getInstance().getExperience();
if (experience == null) {
this.bFl.setVisibility(8);
return;
}
String string = JSONUtils.getString("acturl", experience);
String string2 = JSONUtils.getString("title", experience);
String string3 = JSONUtils.getString("content", experience);
if (!TextUtils.isEmpty(string)) {
this.bFl.setVisibility(0);
this.bFl.getActionName().setVisibility(0);
if (!TextUtils.isEmpty(string2)) {
this.bFl.getTitle().setText(string2);
}
if (TextUtils.isEmpty(string3)) {
this.bFl.getActionName().setText(getString(R.string.join_experience));
return;
} else {
this.bFl.getActionName().setText(string3);
return;
}
}
this.bFl.setVisibility(8);
}
public void bD(boolean z) {
if (z) {
this.bFm.setVisibility(0);
this.bFm.getDescImageView().setVisibility(0);
this.bFm.getDescImageView().setBackgroundResource(0);
this.bFm.getActionName().setVisibility(0);
ImageProvide.with(getContext()).load(UserCenterManager.getUserIcon()).placeholder(R.mipmap.m4399_png_user_default_avatar).wifiLoad(false).into(this.bFm.getDescImageView());
this.bFm.getActionName().setText(UserCenterManager.getNick());
this.bFm.getTitle().setText(getString(R.string.user_userinfo));
return;
}
this.bFm.setVisibility(8);
}
private void c(SettingsCell settingsCell) {
settingsCell.getIsNew().setVisibility(((Integer) Config.getValue(GameCenterConfigKey.IS_MARK_NEW_FUNCTION)).intValue() == BaseApplication.getApplication().getStartupConfig().getVersionCode() ? 8 : 0);
}
private void d(SettingsCell settingsCell) {
if (this.bFq != settingsCell) {
this.bFq = settingsCell;
}
int intValue = ((Integer) Config.getValue(GameCenterConfigKey.UNREAD_FEEDBACK_REPLY_MESSAGE)).intValue();
settingsCell.getNumberToggle().setVisibility(intValue > 0 ? 0 : 8);
settingsCell.getNumberToggle().setText("" + intValue);
}
private void e(SettingsCell settingsCell) {
if (this.bFr != settingsCell) {
this.bFr = settingsCell;
}
if (AccessManager.getInstance().getAccessManagerModelsArray().size() == 0) {
return;
}
if (AccessManager.getInstance().isHavePermissionNoOpen(getContext()) && AccessManager.getInstance().IsOpenAccessEntrance(getContext())) {
this.bFr.getIconAccess().setImageResource(R.mipmap.m4399_png_my_setting_dot_remind);
this.bFr.getIconAccess().setVisibility(0);
} else {
this.bFr.getIconAccess().setVisibility(8);
}
}
private void f(SettingsCell settingsCell) {
if (this.bFs != settingsCell) {
this.bFs = settingsCell;
}
if (this.bFs == null || !UserCenterManager.isLogin().booleanValue() || ActivityStateUtils.isDestroy((Activity) getContext()) || ((Boolean) Config.getValue(GameCenterConfigKey.ROOT_SETTINGS_PASSWORD_PROTECT_IS_HIDE_RED_POINT)).booleanValue()) {
return;
}
PassProInfoManager.INSTANCE.get().requestPassProInfo(new ILoadPageEventListener() {
@Override
public void onBefore() {
}
@Override
public void onFailure(Throwable th, int i, String str, int i2, JSONObject jSONObject) {
}
@Override
public void onSuccess() {
if (ActivityStateUtils.isDestroy((Activity) SettingsRootFragment.this.getContext()) || SettingsRootFragment.this.bFs == null) {
return;
}
if (UserCenterManager.getInstance().isCanSetPassPro() && UserCenterManager.getInstance().getPassProBindNum() == 0) {
SettingsRootFragment.this.bFs.getIconAccess().setBackgroundResource(R.mipmap.m4399_png_me_set_icon_password_safty);
SettingsRootFragment.this.bFs.getIconAccess().setVisibility(0);
} else {
SettingsRootFragment.this.bFs.getIconAccess().setVisibility(8);
}
}
});
}
private void bE(boolean z) {
SettingsCell settingsCell = this.bFs;
if (settingsCell == null || settingsCell.getIconAccess() == null || this.bFs.getIconAccess().getVisibility() != 0) {
return;
}
this.bFs.getIconAccess().setVisibility(8);
if (z) {
Config.setValue(GameCenterConfigKey.ROOT_SETTINGS_PASSWORD_PROTECT_IS_HIDE_RED_POINT, true);
}
}
private void AQ() {
if (this.bFs == null || !UserCenterManager.isLogin().booleanValue() || ActivityStateUtils.isDestroy((Activity) getContext())) {
return;
}
if (((Boolean) Config.getValue(GameCenterConfigKey.ROOT_SETTINGS_PASSWORD_PROTECT_IS_HIDE_RED_POINT)).booleanValue()) {
bE(false);
} else if (UserCenterManager.getInstance().isCanSetPassPro() && UserCenterManager.getInstance().getPassProBindNum() < 2) {
this.bFs.getIconAccess().setBackgroundResource(R.mipmap.m4399_png_me_set_icon_password_safty);
this.bFs.getIconAccess().setVisibility(0);
} else {
this.bFs.getIconAccess().setVisibility(8);
}
}
@Keep
@Subscribe(tags = {@Tag("tag.access.manager.mark.synchronous")})
public void updateAccessMark(Boolean bool) {
if (this.bFr != null) {
AccessManager.getInstance().updateAccessArray(getContext());
if (AccessManager.getInstance().getAccessManagerModelsArray().size() == 0) {
return;
}
if (AccessManager.getInstance().isHavePermissionNoOpen(getContext())) {
this.bFr.getIconAccess().setVisibility(0);
} else {
this.bFr.getIconAccess().setVisibility(8);
}
}
}
@Keep
@Subscribe(tags = {@Tag("tag.pass.info.load.when.login.success")})
public void onLoadPassProInfo(Integer num) {
int intValue = num.intValue();
if (intValue != 1) {
if (intValue == 2) {
AQ();
return;
} else if (intValue != 3) {
return;
}
}
bE(false);
}
@Keep
@Subscribe(tags = {@Tag("intent.action.unread.refresh")})
public void refreshFeedbackUnreadCount(Integer num) {
d(this.bFq);
}
private void AR() {
String str;
boolean z = !((Boolean) Config.getValue(GameCenterConfigKey.UPDATE_LAST_VERSION_IS_PLUGIN)).booleanValue() ? ((Integer) Config.getValue(GameCenterConfigKey.UPDATE_APP_LAST_VERSION_CODE)).intValue() <= BaseApplication.getApplication().getStartupConfig().getVersionCode() : ((Integer) Config.getValue(GameCenterConfigKey.UPDATE_PLUGIN_LAST_VERSION_CODE)).intValue() <= PluginApplication.getApplication().getPluginVersionCode();
this.bFk.getIsNew().setVisibility(((Boolean) Config.getValue(GameCenterConfigKey.IS_MARK_NEW_VERSION)).booleanValue() && z ? 0 : 8);
String pluginVersionName = PluginApplication.getApplication().getPluginVersionName();
if (z) {
str = pluginVersionName + "→" + ((String) Config.getValue(GameCenterConfigKey.UPDATE_VERSION_LAST_VERSION));
} else {
str = getString(R.string.app_upgrade_current_version) + pluginVersionName;
}
this.bFk.getActionName().setText(str);
}
@Override
public void onStart() {
super.onStart();
}
@Override
public View setupCustomCell(int i) {
if (i != 1010) {
return null;
}
this.mCustomView = View.inflate(getActivity(), R.layout.m4399_view_settings_footer, null);
Bp();
bF(UserCenterManager.isLogin().booleanValue());
if (BaseApplication.getApplication().getStartupConfig().getReleaseMode() == 2) {
AV();
Bn();
AU();
AT();
AS();
Bt();
Bu();
Bv();
Bw();
Bx();
View findViewById = this.mCustomView.findViewById(R.id.btn_make_crash);
if (findViewById != null) {
findViewById.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
"".substring(1);
}
});
findViewById.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
try {
Thread.sleep(50000L);
return true;
} catch (InterruptedException e) {
e.printStackTrace();
return true;
}
}
});
}
}
return this.mCustomView;
}
@Override
public void initView(ViewGroup viewGroup, Bundle bundle) {
super.initView(viewGroup, bundle);
this.mTopDivScrollView.setStyle(1);
this.mTopDivScrollView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
if (Build.VERSION.SDK_INT >= 16) {
SettingsRootFragment.this.mTopDivScrollView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
} else {
SettingsRootFragment.this.mTopDivScrollView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
if (SettingsRootFragment.this.mIsOpenAccessGuide.intValue() == 1) {
SettingsRootFragment.this.mIsOpenAccessGuide = 0;
int[] iArr = new int[2];
SettingsRootFragment.this.bFr.getTop();
SettingsRootFragment.this.bFr.getLocationOnScreen(iArr);
int i = iArr[1] / 2;
if (i < 0) {
i = 0;
}
SettingsRootFragment.this.mTopDivScrollView.smoothScrollTo(0, i);
}
}
});
}
private void AS() {
this.mCustomView.findViewById(R.id.btn_copy_anr_log).setOnClickListener(this);
}
private void AT() {
if (((Boolean) Config.getValue(GameCenterConfigKey.IS_OPEN_LEAKCANARY)).booleanValue()) {
this.mCustomView.findViewById(R.id.ll_battery_static).setVisibility(0);
this.bFo = (TextView) this.mCustomView.findViewById(R.id.tv_battery_record);
this.bFp = (Button) this.mCustomView.findViewById(R.id.btn_start_record_battery);
if (Config.getValue(GameCenterConfigKey.BATTERY_BTN_START) == null || Config.getValue(GameCenterConfigKey.BATTERY_BTN_STOP) != null) {
this.bFp.setText(getString(R.string.settings_appbattery_start));
} else {
this.bFp.setText(getString(R.string.settings_appbattery_stop));
}
this.bFp.setOnClickListener(this);
}
}
private void AU() {
if (((Boolean) Config.getValue(GameCenterConfigKey.IS_OPEN_LEAKCANARY)).booleanValue()) {
this.mCustomView.findViewById(R.id.ll_traffic_static).setVisibility(0);
TextView textView = (TextView) this.mCustomView.findViewById(R.id.tv_start_app_traffic);
this.bFi = (TextView) this.mCustomView.findViewById(R.id.tv_traffic_record);
this.bFh = (Button) this.mCustomView.findViewById(R.id.btn_start_record_traffic);
this.bFh.setOnClickListener(this);
textView.setText("启动至首页加载完成:" + com.m4399.gamecenter.plugin.main.utils.d.getTrafficGap(SysConfigKey.TRAFFIC_OPEN_APP, SysConfigKey.TRAFFIC_LOAD_RECOMMEND));
if (((Long) Config.getValue(SysConfigKey.TRAFFIC_BTN_STOP)).longValue() != 0 || ((Long) Config.getValue(SysConfigKey.TRAFFIC_BTN_START)).longValue() == 0) {
this.bFh.setText(getString(R.string.settings_apptraffic_start));
} else {
this.bFh.setText(getString(R.string.settings_apptraffic_stop));
}
}
}
private void AV() {
this.bFj = ((ViewStub) this.mCustomView.findViewById(R.id.deveoper_mode_viewstub)).inflate();
this.bFf = (EditText) this.bFj.findViewById(R.id.et_deviceId);
this.bFj.findViewById(R.id.btn_deviceId_clear).setOnClickListener(this);
this.bFj.findViewById(R.id.btn_deviceId).setOnClickListener(this);
Bo();
Bm();
Ba();
Bb();
Be();
Bf();
Bg();
Bh();
Bi();
Bj();
Bk();
Bl();
AZ();
By();
Bc();
Bd();
Bz();
BA();
AX();
AW();
AY();
}
private void AW() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.dev_setting_error_fast_game);
checkBox.setChecked(((Boolean) Config.getValue(BaseConfigKey.IS_OPEN_ERROR_FAST_GAME)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(BaseConfigKey.IS_OPEN_ERROR_FAST_GAME, Boolean.valueOf(z));
}
});
}
private void AX() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.dev_setting_toast_anti_addiction);
checkBox.setChecked(((Boolean) Config.getValue(BaseConfigKey.IS_OPEN_TOAST_ANTI_ADDICTION)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(BaseConfigKey.IS_OPEN_TOAST_ANTI_ADDICTION, Boolean.valueOf(z));
}
});
}
private void AY() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.dev_setting_get_local_time);
checkBox.setChecked(((Boolean) Config.getValue(SysConfigKey.IS_GET_LOCAL_MILL_TIME)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(SysConfigKey.IS_GET_LOCAL_MILL_TIME, Boolean.valueOf(z));
}
});
}
private void AZ() {
if (this.bFg == null) {
this.bFg = (TextView) this.bFj.findViewById(R.id.device_id_show);
this.bFg.setMovementMethod(LinkMovementMethod.getInstance());
}
String obj = Config.getValue(SysConfigKey.UNIQUEID).toString();
String udid = UdidManager.getInstance().getUdid();
String ptUid = UserCenterManager.getPtUid();
int i = 0;
String[] strArr = {obj, udid, ptUid};
StringBuilder sb = new StringBuilder();
sb.append("DeviceID:");
sb.append(obj);
sb.append("\t\t[复制]");
sb.append("\n");
sb.append("UDID:");
sb.append(udid);
sb.append("\t\t[复制]");
sb.append("\n");
sb.append("OAID:");
sb.append((String) Config.getValue(AppConfigKey.OAID));
sb.append("\n\n");
sb.append(BaseApplication.getApplication().getStartupConfig().getPushKeysDescription());
sb.append("\n");
sb.append("pushId:");
sb.append((String) Config.getValue(SysConfigKey.GETUI_PUSH_ID));
sb.append("\n\n");
sb.append("uid:");
sb.append(ptUid);
sb.append("\t\t[复制]");
sb.append("\n");
sb.append("token:");
StringBuilder sb2 = new StringBuilder();
UserCenterManager.getInstance();
sb2.append(UserCenterManager.getToken());
sb2.append("\n\n");
sb.append(sb2.toString());
sb.append("GameThemeVersionName:1.1\n");
sb.append("GameThemeVersionCode:5");
if (ShopThemeManager.getInstance().checkThemeFile(UserCenterManager.getThemeId())) {
sb.append("\nthemeFileName:" + ShopThemeManager.getInstance().getThemeVersionName() + "\n");
StringBuilder sb3 = new StringBuilder();
sb3.append("themeFileCode:");
sb3.append(ShopThemeManager.getInstance().getThemeVersionCode());
sb.append(sb3.toString());
}
SpannableString spannableString = new SpannableString(sb.toString());
int indexOf = sb.indexOf("\t\t[复制]", 0);
while (i < strArr.length) {
final String str = strArr[i];
ClickableSpan clickableSpan = new ClickableSpan() {
@Override
public void onClick(View view) {
ClipboardUitls.copyToClipboard(SettingsRootFragment.this.getContext(), str);
Log.w("COPY ID", str);
}
};
int i2 = indexOf + 6;
spannableString.setSpan(clickableSpan, indexOf, i2, 17);
i++;
indexOf = sb.indexOf("\t\t[复制]", i2);
}
this.bFg.setText(spannableString);
}
private void Ba() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.cb_setting_game_paid_check);
checkBox.setChecked(((Boolean) Config.getValue(GameCenterConfigKey.GAME_IS_PAID_FOR_PAY_SDK)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(GameCenterConfigKey.GAME_IS_PAID_FOR_PAY_SDK, Boolean.valueOf(z));
}
});
}
private void Bb() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.cb_setting_https);
checkBox.setChecked(((Boolean) Config.getValue(SysConfigKey.SETTING_HTTPS_TOGGLE)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(SysConfigKey.SETTING_HTTPS_TOGGLE, Boolean.valueOf(z));
com.m4399.gamecenter.manager.b.b.get().post("tag_on_setting_change");
}
});
}
private void Bc() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.cb_load_minigame);
checkBox.setChecked(((Boolean) Config.getValue(GameCenterConfigKey.LOAD_MINI_GAME_RESOURCE)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(GameCenterConfigKey.LOAD_MINI_GAME_RESOURCE, Boolean.valueOf(z));
}
});
CheckBox checkBox2 = (CheckBox) this.bFj.findViewById(R.id.cb_load_minigame_inner_game);
checkBox2.setChecked(((Boolean) Config.getValue(GameCenterConfigKey.LOAD_MINI_GAME_LOAD_INNER_TEST_GAME)).booleanValue());
checkBox2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(GameCenterConfigKey.LOAD_MINI_GAME_LOAD_INNER_TEST_GAME, Boolean.valueOf(z));
}
});
CheckBox checkBox3 = (CheckBox) this.bFj.findViewById(R.id.cb_load_minigame_online_runtime);
checkBox3.setChecked(((Boolean) Config.getValue(GameCenterConfigKey.LOAD_MINI_GAME_LOAD_ONLINE_RUNTIME)).booleanValue());
checkBox3.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(GameCenterConfigKey.LOAD_MINI_GAME_LOAD_ONLINE_RUNTIME, Boolean.valueOf(z));
}
});
CheckBox checkBox4 = (CheckBox) this.bFj.findViewById(R.id.cb_load_vendor_specific_runtime);
checkBox4.setChecked(((Boolean) Config.getValue(GameCenterConfigKey.LOAD_MINI_GAME_LOAD_VENDOR_SPECIFIC_RUNTIME)).booleanValue());
checkBox4.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(GameCenterConfigKey.LOAD_MINI_GAME_LOAD_VENDOR_SPECIFIC_RUNTIME, Boolean.valueOf(z));
}
});
}
private void Bd() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.dev_setting_show_page_trace);
checkBox.setChecked(bFv);
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
SettingsRootFragment.bFv = z;
if (SettingsRootFragment.bFu != null) {
return;
}
SettingsRootFragment.bFu = new Thread(new Runnable() {
@Override
public void run() {
String str = "";
while (SettingsRootFragment.bFv) {
final String filterTrace2 = StatManager.filterTrace2(com.m4399.gamecenter.plugin.main.base.utils.a.c.getFullTrace(SettingsRootFragment.this));
try {
Thread.sleep(500L);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (!str.equals(filterTrace2)) {
com.m4399.gamecenter.plugin.main.utils.e.runOnUiThread(new Runnable() {
@Override
public void run() {
Context curActivity = BaseApplication.getApplication().getCurActivity();
if (curActivity == null) {
curActivity = BaseApplication.getApplication();
}
ToastUtils.showToast(curActivity, filterTrace2);
}
});
str = filterTrace2;
}
}
SettingsRootFragment.bFu = null;
}
});
SettingsRootFragment.bFu.start();
}
});
}
private void Be() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.cb_setting_sim);
checkBox.setChecked(((Boolean) Config.getValue(SysConfigKey.IS_CLOSE_SIM_KA_TEST)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(SysConfigKey.IS_CLOSE_SIM_KA_TEST, Boolean.valueOf(z));
}
});
}
private void Bf() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.cb_setting_emulator);
checkBox.setChecked(((Boolean) Config.getValue(GameCenterConfigKey.IS_CLOSE_EMULATOR_TEST)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(GameCenterConfigKey.IS_CLOSE_EMULATOR_TEST, Boolean.valueOf(z));
}
});
}
private void Bg() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.cb_setting_leakcanary);
checkBox.setChecked(((Boolean) Config.getValue(GameCenterConfigKey.IS_OPEN_LEAKCANARY)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(GameCenterConfigKey.IS_OPEN_LEAKCANARY, Boolean.valueOf(z));
}
});
}
private void Bh() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.cb_setting_write_debug);
checkBox.setChecked(((Boolean) Config.getValue(AppConfigKey.IS_OPEN_WRITE_DEBUG)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(AppConfigKey.IS_OPEN_WRITE_DEBUG, Boolean.valueOf(z));
}
});
}
private void Bi() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.cb_setting_webview_template_debug_mode);
checkBox.setChecked(((Boolean) Config.getValue(GameCenterConfigKey.WEB_VIEW_DEBUG_MODE)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(GameCenterConfigKey.WEB_VIEW_DEBUG_MODE, Boolean.valueOf(z));
}
});
}
private void Bj() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.cb_setting_mini_program_share_type);
checkBox.setChecked(((Boolean) Config.getValue(GameCenterConfigKey.MINI_PROGRAM_SHARE_TYPE_PREVIEW)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(GameCenterConfigKey.MINI_PROGRAM_SHARE_TYPE_PREVIEW, Boolean.valueOf(z));
}
});
}
private void Bk() {
final CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.cb_setting_open_user_center_test_mode);
checkBox.setChecked(((Boolean) Config.getValue(AppConfigKey.IS_OPEN_USER_CENTER_TEST_MODE)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
if (EnvironmentMode.ONLINE.equals((String) Config.getValue(SysConfigKey.HTTP_ENVIRONMENT))) {
checkBox.setChecked(false);
Config.setValue(AppConfigKey.IS_OPEN_USER_CENTER_TEST_MODE, false);
ToastUtils.showToast(SettingsRootFragment.this.getContext(), "不支持线上环境,请切到其他环境");
return;
}
Config.setValue(AppConfigKey.IS_OPEN_USER_CENTER_TEST_MODE, Boolean.valueOf(z));
}
});
}
private void Bl() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.cb_setting_open_toast_umeng_event);
checkBox.setChecked(((Boolean) Config.getValue(GameCenterConfigKey.IS_OPEN_TOAST_UMENG_EVENT)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(GameCenterConfigKey.IS_OPEN_TOAST_UMENG_EVENT, Boolean.valueOf(z));
}
});
CheckBox checkBox2 = (CheckBox) this.bFj.findViewById(R.id.cb_setting_open_toast_4399analyst_event);
checkBox2.setChecked(((Boolean) Config.getValue(GameCenterConfigKey.IS_OPEN_TOAST_4399ANALYST_EVENT)).booleanValue());
checkBox2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(GameCenterConfigKey.IS_OPEN_TOAST_4399ANALYST_EVENT, Boolean.valueOf(z));
}
});
}
private void Bm() {
RadioGroup radioGroup = (RadioGroup) this.bFj.findViewById(R.id.release_mode);
radioGroup.check(((Boolean) Config.getValue(SysConfigKey.IS_PREVIEW_MODE)).booleanValue() ? R.id.rb_setting_model_t2 : R.id.rb_setting_model_t1);
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup2, int i) {
if (i == R.id.rb_setting_model_t1) {
Config.setValue(SysConfigKey.IS_PREVIEW_MODE, false);
} else if (i == R.id.rb_setting_model_t2) {
Config.setValue(SysConfigKey.IS_PREVIEW_MODE, true);
}
com.m4399.gamecenter.manager.b.b.get().post("tag_on_setting_change", "");
}
});
String str = (String) Config.getValue(AppConfigKey.HEADER_BBS_ENV);
final StringBuilder sb = new StringBuilder(str);
final EditText editText = (EditText) this.bFj.findViewById(R.id.et_set_bbs_channel);
editText.setText(str);
editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean z) {
if (z) {
return;
}
String obj = editText.getText().toString();
if (obj.equals(sb.toString())) {
return;
}
Config.setValue(AppConfigKey.HEADER_BBS_ENV, obj);
StringBuilder sb2 = sb;
sb2.delete(0, sb2.length());
sb.append(obj);
ToastUtils.showToast(SettingsRootFragment.this.getContext(), "设置成功");
}
});
editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
if (i == 6) {
String obj = editText.getText().toString();
if (!obj.equals(sb.toString())) {
Config.setValue(AppConfigKey.HEADER_BBS_ENV, obj);
StringBuilder sb2 = sb;
sb2.delete(0, sb2.length());
sb.append(obj);
ToastUtils.showToast(SettingsRootFragment.this.getContext(), "设置成功");
}
}
return false;
}
});
}
private void Bn() {
RadioGroup radioGroup = (RadioGroup) this.bFj.findViewById(R.id.kidap_radiogroup);
RadioButton radioButton = (RadioButton) radioGroup.findViewById(R.id.rb_open_tx_httpdns_setting);
RadioButton radioButton2 = (RadioButton) radioGroup.findViewById(R.id.rb_open_al_httpdns_setting);
RadioButton radioButton3 = (RadioButton) radioGroup.findViewById(R.id.rb_close_httpdns_setting);
int intValue = ((Integer) Config.getValue(SysConfigKey.OPEN_API_HTTPDNS)).intValue();
if (intValue == 2) {
radioButton.setChecked(true);
}
if (intValue == 3) {
radioButton2.setChecked(true);
}
if (intValue == -1) {
radioButton3.setChecked(true);
}
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup2, int i) {
if (i == R.id.rb_open_tx_httpdns_setting) {
Config.setValue(SysConfigKey.OPEN_API_HTTPDNS, 2);
HttpDns.getInstance().changeDns(DnsType.TXDns);
} else if (i == R.id.rb_open_al_httpdns_setting) {
Config.setValue(SysConfigKey.OPEN_API_HTTPDNS, 3);
HttpDns.getInstance().changeDns(DnsType.ALDns);
} else if (i == R.id.rb_close_httpdns_setting) {
Config.setValue(SysConfigKey.OPEN_API_HTTPDNS, -1);
HttpDns.getInstance().changeDns(DnsType.LocalDns);
}
}
});
}
private void Bo() {
char c;
RadioGroup radioGroup = (RadioGroup) this.bFj.findViewById(R.id.environment_radiogroup);
RadioButton radioButton = (RadioButton) radioGroup.findViewById(R.id.rb_setting_t1);
RadioButton radioButton2 = (RadioButton) radioGroup.findViewById(R.id.rb_setting_tester);
RadioButton radioButton3 = (RadioButton) radioGroup.findViewById(R.id.rb_setting_t2);
RadioButton radioButton4 = (RadioButton) radioGroup.findViewById(R.id.rb_setting_online);
RadioButton radioButton5 = (RadioButton) radioGroup.findViewById(R.id.rb_setting_alternate);
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup2, int i) {
int i2 = R.id.rb_setting_t1;
String str = EnvironmentMode.ONLINE;
if (i == i2) {
str = EnvironmentMode.T2;
} else if (i == R.id.rb_setting_tester) {
str = EnvironmentMode.TESTER;
} else if (i == R.id.rb_setting_t2) {
str = EnvironmentMode.OT;
} else if (i == R.id.rb_setting_alternate) {
Config.setValue(AppConfigKey.SETTING_IS_ALTERNATE, true);
} else if (i == R.id.rb_setting_online) {
Config.setValue(AppConfigKey.SETTING_IS_ALTERNATE, false);
}
Config.setValue(SysConfigKey.HTTP_ENVIRONMENT, str);
com.m4399.gamecenter.manager.b.b.get().post("tag_on_setting_change", "");
StatisticsConfig.setOnline(!(EnvironmentMode.T2.equals(str) || EnvironmentMode.TESTER.equals(str)));
}
});
String str = (String) Config.getValue(SysConfigKey.HTTP_ENVIRONMENT);
int hashCode = str.hashCode();
if (hashCode == -1408024454) {
if (str.equals("alternate")) {
c = 4;
}
c = 65535;
} else if (hashCode == -1012222381) {
if (str.equals(EnvironmentMode.ONLINE)) {
c = 3;
}
c = 65535;
} else if (hashCode == 3557) {
if (str.equals(EnvironmentMode.OT)) {
c = 2;
}
c = 65535;
} else if (hashCode != 3646) {
if (hashCode == 3556498 && str.equals(EnvironmentMode.TESTER)) {
c = 1;
}
c = 65535;
} else {
if (str.equals(EnvironmentMode.T2)) {
c = 0;
}
c = 65535;
}
if (c == 0) {
radioButton.setChecked(true);
return;
}
if (c == 1) {
radioButton2.setChecked(true);
return;
}
if (c == 2) {
radioButton3.setChecked(true);
return;
}
if (c != 3) {
if (c == 4) {
radioButton5.setChecked(true);
return;
} else {
radioButton4.setChecked(true);
return;
}
}
if (((Boolean) Config.getValue(AppConfigKey.SETTING_IS_ALTERNATE)).booleanValue()) {
radioButton5.setChecked(true);
} else {
radioButton4.setChecked(true);
}
}
private void Bp() {
((Button) this.mCustomView.findViewById(R.id.btn_login_status)).setOnClickListener(this);
bG(UserCenterManager.isLogin().booleanValue());
}
public void bF(boolean z) {
TextView textView = (TextView) this.mCustomView.findViewById(R.id.switch_account);
if (z) {
textView.setOnClickListener(this);
textView.setVisibility(0);
} else {
textView.setOnClickListener(null);
textView.setVisibility(8);
}
}
public void bG(boolean z) {
Button button = (Button) this.mCustomView.findViewById(R.id.btn_login_status);
if (z) {
button.setBackgroundResource(R.drawable.m4399_xml_selector_btn_red);
button.setText(R.string.settings_fragment_logout);
UMengEventUtils.onEvent("ad_setting_logout");
} else {
button.setBackgroundResource(R.drawable.m4399_xml_selector_r3_green);
button.setText(R.string.login_btn_text);
UMengEventUtils.onEvent("ad_login");
}
}
@Override
public void onClick(View view) {
int id = view.getId();
if (id == R.id.btn_login_status) {
Bs();
return;
}
if (id == R.id.btn_start_record_traffic) {
Br();
return;
}
if (id == R.id.btn_deviceId_clear) {
this.bFf.setText("");
Config.setValue(SysConfigKey.UNIQUEID, "");
AZ();
ToastUtils.showToast(getContext(), "修改成功");
return;
}
if (id == R.id.btn_deviceId) {
if (TextUtils.isEmpty(this.bFf.getText().toString())) {
this.bFf.setText(EnvironmentMode.TESTER + AppNativeHelper.getMd5(String.valueOf(System.currentTimeMillis())).substring(0, 10));
}
Config.setValue(SysConfigKey.UNIQUEID, this.bFf.getText().toString());
AZ();
ToastUtils.showToast(getContext(), "修改成功");
this.bFf.setText("");
KeyboardUtils.hideKeyboard(getActivity(), this.bFf);
return;
}
if (id == R.id.btn_copy_anr_log) {
final String str = StorageManager.getAppPath() + "/anr/";
if (FileUtils.copyFolder("/data/anr/", str)) {
ToastUtils.showToast(getActivity(), getString(R.string.setting_save_success, str));
return;
} else {
Observable.create(new Observable.OnSubscribe<CommandHelper.CommandResult>() {
@Override
public void call(Subscriber<? super CommandHelper.CommandResult> subscriber) {
subscriber.onNext(CommandHelper.execCommand(new String[]{"cat /data/anr/traces.txt >" + str + "/traces.txt"}, false, true));
}
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<CommandHelper.CommandResult>() {
@Override
public void call(CommandHelper.CommandResult commandResult) {
if (TextUtils.isEmpty(commandResult.errorMsg)) {
Observable.create(new Observable.OnSubscribe<Boolean>() {
@Override
public void call(Subscriber<? super Boolean> subscriber) {
CommandHelper.execCommand(new String[]{"cat /data/anr/traces_1.txt >" + str + "/traces_1.txt", "cat /data/anr/traces_2.txt >" + str + "/traces_2.txt", "cat /data/anr/traces_3.txt >" + str + "/traces_3.txt", "cat /data/anr/traces_4.txt >" + str + "/traces_4.txt", "cat /data/anr/traces_5.txt >" + str + "/traces_5.txt"}, false, true);
subscriber.onNext(true);
}
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<Boolean>() {
@Override
public void call(Boolean bool) {
if (bool.booleanValue()) {
ToastUtils.showToast(SettingsRootFragment.this.getActivity(), SettingsRootFragment.this.getString(R.string.setting_save_success, str));
}
}
});
} else {
ToastUtils.showToast(SettingsRootFragment.this.getActivity(), SettingsRootFragment.this.getString(R.string.setting_save_fail, commandResult.errorMsg));
}
}
});
return;
}
}
if (id == R.id.btn_start_record_battery) {
return;
}
if (id == R.id.switch_account) {
GameCenterRouterManager.getInstance().openAccountsManager(getActivity(), null, 0);
bq.commitStat(StatStructureSettings.SWITCH_ACCOUNT);
} else if (id == R.id.bt_test_new_theme) {
ShopThemeManager.getInstance().copyNewTheme(getContext(), this.bFt.getText().toString().trim());
}
}
@Override
public void onUserVisible(boolean z) {
super.onUserVisible(z);
if (z) {
Bq();
}
}
private void Bq() {
ClipData primaryClip;
if (BaseApplication.getApplication().getStartupConfig().getReleaseMode() != 2 || this.bFt == null || (primaryClip = ((ClipboardManager) getContext().getSystemService("clipboard")).getPrimaryClip()) == null || primaryClip.getItemCount() == 0 || primaryClip.getItemAt(0).getText() == null) {
return;
}
String charSequence = primaryClip.getItemAt(0).getText().toString();
if (TextUtils.isEmpty(charSequence)) {
return;
}
String trim = charSequence.trim();
if (trim.startsWith("yxhTheme_com.m4399")) {
this.bFt.setText(trim);
}
}
private void Br() {
if (this.bFh.getText().equals(getString(R.string.settings_apptraffic_start))) {
com.m4399.gamecenter.plugin.main.utils.d.setAppTrafficList(SysConfigKey.TRAFFIC_BTN_START);
com.m4399.gamecenter.plugin.main.utils.d.clear(SysConfigKey.TRAFFIC_BTN_STOP);
this.bFh.setText(getString(R.string.settings_apptraffic_stop));
this.bFi.setText("");
return;
}
com.m4399.gamecenter.plugin.main.utils.d.setAppTrafficList(SysConfigKey.TRAFFIC_BTN_STOP);
this.bFi.setText("本次流量统计:" + com.m4399.gamecenter.plugin.main.utils.d.getTrafficGap(SysConfigKey.TRAFFIC_BTN_START, SysConfigKey.TRAFFIC_BTN_STOP));
this.bFh.setText(getString(R.string.settings_apptraffic_start));
}
private void Bs() {
if (UserCenterManager.isLogin().booleanValue()) {
UMengEventUtils.onEvent("app_logout");
UserCenterManager.getInstance().logout(false);
UMengEventUtils.onEvent("ad_setting_logout");
bq.commitStat(StatStructureSettings.LOGOUT);
return;
}
UMengEventUtils.onEvent("app_login", (String) getActivity().getTitle());
GameCenterRouterManager.getInstance().openLogin(getContext(), null, 0);
UMengEventUtils.onEvent("ad_login");
bq.commitStat(StatStructureSettings.LOGIN);
}
private void Bt() {
final EditText editText = (EditText) this.mCustomView.findViewById(R.id.et_liveTvRoomId);
Button button = (Button) this.mCustomView.findViewById(R.id.test_livetv_plugin);
if (button != null) {
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EditText editText2 = editText;
ar.playLiveTv(SettingsRootFragment.this.getContext(), bc.toInt(editText2 != null ? editText2.getText().toString() : ""), "", -1, 0);
}
});
}
}
private void Bu() {
int intValue = ((Integer) Config.getValue(DownloadConfigKey.DOWNLOAD_TYPE)).intValue();
RadioGroup radioGroup = (RadioGroup) this.bFj.findViewById(R.id.download_impl_radiogroup);
RadioButton radioButton = (RadioButton) radioGroup.findViewById(R.id.rb_ok_http_setting);
RadioButton radioButton2 = (RadioButton) radioGroup.findViewById(R.id.rb_http_client_setting);
RadioButton radioButton3 = (RadioButton) radioGroup.findViewById(R.id.rb_ok_http_piece_setting);
RadioButton radioButton4 = (RadioButton) radioGroup.findViewById(R.id.rb_tr_setting);
if (intValue == 0) {
radioButton2.setChecked(true);
} else if (intValue == 1) {
radioButton.setChecked(true);
} else if (intValue == 2) {
radioButton3.setChecked(true);
} else if (intValue == 3) {
radioButton4.setChecked(true);
}
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup2, int i) {
if (i == R.id.rb_ok_http_setting) {
Config.setValue(DownloadConfigKey.DOWNLOAD_TYPE, 1);
return;
}
if (i == R.id.rb_http_client_setting) {
Config.setValue(DownloadConfigKey.DOWNLOAD_TYPE, 0);
} else if (i == R.id.rb_ok_http_piece_setting) {
Config.setValue(DownloadConfigKey.DOWNLOAD_TYPE, 2);
} else if (i == R.id.rb_tr_setting) {
Config.setValue(DownloadConfigKey.DOWNLOAD_TYPE, 3);
}
}
});
}
private void Bv() {
this.bFj.findViewById(R.id.push_btn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EditText editText = (EditText) SettingsRootFragment.this.bFj.findViewById(R.id.push_json);
if (!TextUtils.isEmpty(editText.getText().toString())) {
bh.parsePayloadData(editText.getText().toString(), "1");
return;
}
bh.parsePayloadData("[{\"title\":\"测试3\",\"content\":\"测试3\",\"logo\":\"\",\"trace\":\"5d106eb945a04\",\"template\":1,\"type\":7,\"exts\":{\"url\":\"https://df.com\"},\"condition\":{},\"id\":\"5d106ec3c7a2c1.26683645" + System.currentTimeMillis() + "\"}]", "1");
}
});
}
private void Bw() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.cb_upload_download_log);
checkBox.setChecked(((Boolean) Config.getValue(DownloadConfigKey.UPLOAD_LOG_WHEN_FINISH)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(DownloadConfigKey.UPLOAD_LOG_WHEN_FINISH, Boolean.valueOf(z));
}
});
}
private void Bx() {
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.cb_install_show_toast);
checkBox.setChecked(((Boolean) Config.getValue(DownloadConfigKey.SHOW_TOAST_WHEN_INSTALL_INTERCEPTED)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(DownloadConfigKey.SHOW_TOAST_WHEN_INSTALL_INTERCEPTED, Boolean.valueOf(z));
}
});
}
private void By() {
this.bFt = (EditText) this.bFj.findViewById(R.id.et_theme_file_name);
this.bFj.findViewById(R.id.bt_test_new_theme).setOnClickListener(this);
}
private void Bz() {
final EditText editText = (EditText) this.bFj.findViewById(R.id.et_mini_game_id);
this.bFj.findViewById(R.id.bt_open_mini_game).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final String obj = editText.getText().toString();
UserCenterManager.checkIsLogin(SettingsRootFragment.this.getActivity(), new com.m4399.gamecenter.plugin.main.listeners.f<Boolean>() {
@Override
public void onChecking() {
}
@Override
public void onCheckFinish(Boolean bool, Object... objArr) {
if (bool.booleanValue()) {
MiniGamePluginLoaderHelper.openMiniGame(SettingsRootFragment.this.getActivity(), obj);
} else {
ToastUtils.showToast(SettingsRootFragment.this.getActivity(), "请先登录!");
}
}
});
}
});
CheckBox checkBox = (CheckBox) this.bFj.findViewById(R.id.dev_setting_text_new_game);
checkBox.setChecked(((Boolean) Config.getValue(GameCenterConfigKey.NEW_MINI_GAME_TEST)).booleanValue());
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(GameCenterConfigKey.NEW_MINI_GAME_TEST, Boolean.valueOf(z));
}
});
CheckBox checkBox2 = (CheckBox) this.bFj.findViewById(R.id.dev_setting_text_update_params);
checkBox2.setChecked(((Boolean) Config.getValue(GameCenterConfigKey.NEW_MINI_HEART_BEAT_PARAMS_UPDATE)).booleanValue());
checkBox2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
Config.setValue(GameCenterConfigKey.NEW_MINI_HEART_BEAT_PARAMS_UPDATE, Boolean.valueOf(z));
}
});
}
private void BA() {
this.bFj.findViewById(R.id.bt_open_route_test).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
GameCenterRouterManager.getInstance().openRouterTest(SettingsRootFragment.this.getContext());
}
});
}
}