Aqara Home v2.4.1版本的 MD5 值为:529779ac2bc0131db52a1fc3098d2b35

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


package com.lumiunited.aqara.user.minepage.setting.view;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.lifecycle.Lifecycle;
import com.alibaba.android.arouter.launcher.ARouter;
import com.lumi.common.service.account.IAccount;
import com.lumi.common.service.login.ILogin;
import com.lumi.external.http.ApiResponseWithJava;
import com.lumiunited.aqara.application.base.BaseActivity;
import com.lumiunited.aqara.common.ui.cell.CommonCell;
import com.lumiunited.aqara.common.ui.dialog.CenterListBinder;
import com.lumiunited.aqara.common.ui.titlebar.TitleBar;
import com.lumiunited.aqara.language.SwitchLanguageActivity;
import com.lumiunited.aqara.location.RegionListActivity;
import com.lumiunited.aqara.user.minepage.setting.view.SettingActivity;
import com.lumiunited.aqara.user.minepage.setting.view.about.AboutActivity;
import com.lumiunited.aqara.user.minepage.setting.view.about.TermsPrivacyActivity;
import com.lumiunited.aqara.user.minepage.setting.view.accountsafety.AccountSafetyMainActivity;
import com.lumiunited.aqara.user.minepage.setting.view.push.PushSettingActivity;
import com.lumiunited.aqara.user.minepage.setting.view.theme.ChangeThemeActivity;
import com.lumiunited.aqara.user.minepage.setting.view.transfer.HomeTransferActivity;
import com.lumiunited.aqara.web.commonpage.SettingWebActivity;
import com.lumiunited.aqara.web.repository.WebHelper;
import com.lumiunited.aqarahome.R;
import java.util.HashMap;
import java.util.List;
import k.d0.a.a0;
import k.d0.a.f;
import k.t.b.f.e.h;
import k.u.c.d.d.q0;
import k.u.c.d.g.d.k1;
import k.u.c.d.j.r;
import k.u.c.f.a.q.j0;
import k.u.c.f.a.q.v0;
import k.u.c.f.a.q.w0;
import k.u.c.f.a.q.y0;
import k.u.c.g0.c.j.a;
import k.u.c.r.l.d;
import k.u.c.x.j3;
import p.a.x0.g;
import reactnative.RnSettingsListActivity;
public class SettingActivity extends BaseActivity<a.e> implements a.f {
    public CommonCell H;
    public CommonCell I;
    public CommonCell J;
    public CommonCell K;
    public CommonCell L;
    public CommonCell M;
    public CommonCell N;
    public CommonCell R;
    public CommonCell S;
    public CommonCell T;
    public CommonCell U;
    public TextView a7;
    public FrameLayout b7;
    public y0 c7;
    public w0 d7;
    public j0 e7;
    public v0 j7;
    public String f7 = null;
    public HashMap<String, String> g7 = new HashMap<>();
    public View.OnClickListener h7 = new a();
    public k.u.c.v.a.b<String> i7 = new b();
    public int k7 = 0;
    public int l7 = 10;

    public class a implements View.OnClickListener {
        public a() {
        }

        public void a(View view) {
            SettingActivity.this.c7.dismiss();
        }

        public void b(View view) {
            ((a0) ((ILogin) ARouter.getInstance().build(k.t.e.a.b.f19194k).navigation()).e(((IAccount) ARouter.getInstance().build(k.t.e.a.b.f19208y).navigation()).getUserId(), k.u.c.y.a.e().a()).a(f.a(k.d0.a.m0.g.b.a(SettingActivity.this, Lifecycle.Event.ON_DESTROY)))).subscribe(new g() {
                @Override
                public final void accept(Object obj) {
                    SettingActivity.a.this.a((ApiResponseWithJava) obj);
                }
            });
        }

        @Override
        public void onClick(View view) {
            switch (view.getId()) {
                case R.id.common_cell_about:
                    SettingActivity.this.startActivity(new Intent(SettingActivity.this, AboutActivity.class));
                    return;
                case R.id.common_cell_account_safety:
                    SettingActivity.this.startActivity(new Intent(SettingActivity.this, AccountSafetyMainActivity.class));
                    return;
                case R.id.common_cell_change_language:
                    SettingActivity.this.startActivity(new Intent(SettingActivity.this, SwitchLanguageActivity.class));
                    return;
                case R.id.common_cell_change_region:
                    SettingActivity settingActivity = SettingActivity.this;
                    settingActivity.f7 = d.b(settingActivity);
                    Intent intent = new Intent(SettingActivity.this, RegionListActivity.class);
                    intent.putExtra("shouldLogout", true);
                    SettingActivity.this.startActivityForResult(intent, RegionListActivity.o7);
                    return;
                case R.id.common_cell_change_theme:
                    new Intent(SettingActivity.this, ChangeThemeActivity.class);
                    return;
                case R.id.common_cell_check_update:
                    Intent intent2 = new Intent(SettingActivity.this, SettingWebActivity.class);
                    intent2.putExtra("aiotType", k1.b.CheckUpdate);
                    intent2.putExtra("url", k1.a(k1.b.CheckUpdate));
                    SettingActivity.this.startActivity(intent2);
                    return;
                case R.id.common_cell_home_transfer:
                    SettingActivity.this.startActivity(new Intent(SettingActivity.this, HomeTransferActivity.class));
                    return;
                case R.id.common_cell_lab:
                    SettingActivity.this.startActivity(new Intent(SettingActivity.this, LabActivity.class));
                    return;
                case R.id.common_cell_privacy:
                    SettingActivity.this.startActivity(new Intent(SettingActivity.this, TermsPrivacyActivity.class));
                    return;
                case R.id.common_cell_push_setting:
                    SettingActivity.this.startActivity(new Intent(SettingActivity.this, PushSettingActivity.class));
                    return;
                case R.id.common_cell_rn_settings:
                    SettingActivity.this.startActivity(new Intent(SettingActivity.this, RnSettingsListActivity.class));
                    return;
                case R.id.common_cell_temperature:
                    SettingActivity.this.j1();
                    return;
                case R.id.tv_logout:
                    if (SettingActivity.this.c7 == null) {
                        SettingActivity settingActivity2 = SettingActivity.this;
                        settingActivity2.c7 = new y0.c(settingActivity2).d(SettingActivity.this.getString(R.string.logout_confirm)).a(SettingActivity.this.getString(R.string.cancel), new View.OnClickListener() {
                            @Override
                            public final void onClick(View view2) {
                                SettingActivity.a.this.a(view2);
                            }
                        }).c(SettingActivity.this.getString(R.string.user_center_logout), new View.OnClickListener() {
                            @Override
                            public final void onClick(View view2) {
                                SettingActivity.a.this.b(view2);
                            }
                        }).a();
                    }
                    SettingActivity.this.c7.show();
                    return;
                default:
                    return;
            }
        }

        public void a(ApiResponseWithJava apiResponseWithJava) throws Exception {
            if (apiResponseWithJava.isSuccess()) {
                ARouter.getInstance().build("/api/goLogin").withFlags(32768).addFlags(268435456).navigation();
                SettingActivity.this.i1();
            }
        }
    }

    public class b extends k.u.c.v.a.b<String> {
        public b() {
        }

        @Override
        public void a(int i2, String str) {
            onSuccess("");
        }

        @Override
        public void onSubscribe(p.a.u0.c cVar) {
            SettingActivity.this.f8942e.b(cVar);
        }

        @Override
        public void onSuccess(String str) {
            SettingActivity.this.c7.dismiss();
            k.u.c.y.a.h();
            j3.E().d(SettingActivity.this.getApplicationContext());
            r.a(SettingActivity.this.getApplicationContext());
            ARouter.getInstance().build("/api/goLogin").navigation();
            x.b.a.c.f().c(new k.u.c.s.g.b());
            SettingActivity.this.finish();
        }
    }

    public class c implements TitleBar.l {

        public class a implements w0.e {
            public a() {
            }

            @Override
            public void a(String str) {
                SettingActivity.this.d7.dismiss();
                if (str.length() == 0) {
                    WebHelper.f12840g = WebHelper.f12839f;
                    return;
                }
                WebHelper.f12840g = "http://" + str.toString();
                k.u.c.d.g.c.d("http://" + str.toString() + "#");
                k.u.c.d.g.c.e("http://" + str.toString() + "#");
            }
        }

        public c() {
        }

        @Override
        public void c() {
            SettingActivity settingActivity = SettingActivity.this;
            int i2 = settingActivity.k7 + 1;
            settingActivity.k7 = i2;
            if (i2 % 20 != 0) {
                return;
            }
            if (settingActivity.d7 == null) {
                SettingActivity settingActivity2 = SettingActivity.this;
                settingActivity2.d7 = new w0.b(settingActivity2).g("H5<< 192.168.31.44:8089/").b("192.168.31.44:8089/").d(SettingActivity.this.getResources().getString(R.string.cancel)).e(SettingActivity.this.getResources().getString(R.string.email_unbind_confirm)).a();
                SettingActivity.this.d7.setCancelable(false);
                SettingActivity.this.d7.a(new a());
            }
            SettingActivity.this.d7.show();
        }
    }

    private void f(List<String> list) {
        v0 v0Var = this.j7;
        if (v0Var != null && v0Var.isShowing()) {
            this.j7.dismiss();
        }
        list.add("正式环境");
        list.add("测试环境");
        list.add("RC环境");
        list.add(getString(R.string.cancel));
        v0 a2 = new v0.a(this).a("请选择H5环境地址").b(getResources().getDimension(R.dimen.px52)).a(getResources().getDimension(R.dimen.px52)).a(list, new CenterListBinder.a() {
            @Override
            public final void onClick(int i2) {
                SettingActivity.this.D(i2);
            }
        }).a(0).a(false).a();
        this.j7 = a2;
        a2.show();
    }

    private void f1() {
        j0 j0Var = this.e7;
        if (j0Var == null || !j0Var.isShowing()) {
            return;
        }
        this.e7.dismiss();
    }

    private void g1() {
        this.J.setTvCellRight(d.g(this));
        this.U.setVisibility(8);
        this.g7.put("zh", "简体中文");
        this.g7.put("zh_HK", "繁體中文(香港)");
        this.g7.put("zh_TW", "繁體中文(台灣)");
        this.g7.put("en", "English");
        this.g7.put("ko", "한국어");
        this.g7.put("ru", "Русский");
    }

    private void h1() {
        TitleBar titleBar = (TitleBar) findViewById(R.id.titleBar);
        FrameLayout frameLayout = (FrameLayout) findViewById(R.id.fl_switch_position_finder);
        this.b7 = frameLayout;
        frameLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SettingActivity.this.d(view);
            }
        });
        titleBar.b("click h5", getResources().getColor(R.color.transparent));
        titleBar.setOnRightClickListener(new c());
        CommonCell commonCell = (CommonCell) findViewById(R.id.common_cell_home_transfer);
        this.H = commonCell;
        commonCell.setVisibility(8);
        this.I = (CommonCell) findViewById(R.id.common_cell_account_safety);
        this.J = (CommonCell) findViewById(R.id.common_cell_change_region);
        if (q0.b().a().getUserType().intValue() == 1) {
            this.J.setVisibility(8);
        }
        this.K = (CommonCell) findViewById(R.id.common_cell_change_theme);
        this.L = (CommonCell) findViewById(R.id.common_cell_check_update);
        this.S = (CommonCell) findViewById(R.id.common_cell_lab);
        this.T = (CommonCell) findViewById(R.id.common_cell_change_language);
        this.M = (CommonCell) findViewById(R.id.common_cell_temperature);
        this.N = (CommonCell) findViewById(R.id.common_cell_push_setting);
        this.R = (CommonCell) findViewById(R.id.common_cell_about);
        this.a7 = (TextView) findViewById(R.id.tv_logout);
        this.U = (CommonCell) findViewById(R.id.common_cell_rn_settings);
    }

    public void i1() {
        this.c7.dismiss();
        x.b.a.c.f().c(new k.u.c.s.g.b());
    }

    public void j1() {
        TemperatureSettingActivity.a(this);
    }

    public void D(int i2) {
        if (i2 == 0) {
            k.u.c.d.g.c.a(h.a(), "https://cdn.aqara.com/cdn/app/mainland/h5/index.html#");
            k.u.c.d.g.c.d("https://cdn.aqara.com/cdn/app/mainland/h5/index.html#");
            k.u.c.d.g.c.b(h.a(), k.u.c.a.f21799r);
            k.u.c.d.g.c.e(k.u.c.a.f21799r);
            this.l7 = 10;
        } else if (i2 == 1) {
            k.u.c.d.g.c.a(h.a(), k.u.c.a.f21804w);
            k.u.c.d.g.c.d(k.u.c.a.f21804w);
            k.u.c.d.g.c.b(h.a(), "https://app-h5-test.aqara.cn/index.html#");
            k.u.c.d.g.c.e("https://app-h5-test.aqara.cn/index.html#");
            this.l7 = 10;
        } else if (i2 != 2) {
            this.l7 = 10;
        } else {
            k.u.c.d.g.c.a(h.a(), k.u.c.a.f21796o);
            k.u.c.d.g.c.d(k.u.c.a.f21796o);
            k.u.c.d.g.c.b(h.a(), k.u.c.a.f21797p);
            k.u.c.d.g.c.e(k.u.c.a.f21797p);
            this.l7 = 10;
        }
        this.j7.dismiss();
    }

    @Override
    public void K(String str) {
    }

    @Override
    public void L(String str) {
        f1();
    }

    @Override
    public void o(String str) {
    }

    @Override
    public void onActivityResult(int i2, int i3, Intent intent) {
        super.onActivityResult(i2, i3, intent);
        if (i2 == 18411 && i3 == 18411 && this.f7.equals(d.b(this))) {
            this.J.setTvCellRight(d.g(this));
        }
    }

    @Override
    public void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.content_setting);
        h1();
        g1();
        findViewById(R.id.common_cell_privacy).setOnClickListener(this.h7);
        a(this.H, this.I, this.M, this.J, this.K, this.L, this.N, this.R, this.S, this.a7, this.T, this.U);
    }

    @Override
    public void onResume() {
        super.onResume();
        this.J.setTvCellRight(d.g(this));
        this.T.setTvCellRight(this.g7.get(k.u.c.p.f.a()));
    }

    @Override
    public boolean v0() {
        return true;
    }

    public void d(View view) {
        this.l7--;
    }

    @Override
    public a.e f0() {
        return new k.u.c.g0.c.j.b();
    }

    public void a(View... viewArr) {
        for (View view : viewArr) {
            view.setOnClickListener(this.h7);
        }
    }
}