Aqara Home v2.4.1版本的 MD5 值为:529779ac2bc0131db52a1fc3098d2b35
以下内容为反编译后的 DevicePrivacyProtocolNoModelActivity.java 源代码,内容仅作参考
package com.lumiunited.aqara.device.settingpage.view;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.lumi.module.position.ui.fragment.face.FaceManagerFragment;
import com.lumiunited.aqara.R;
import com.lumiunited.aqara.application.base.BaseActivity;
import com.lumiunited.aqara.application.base.BaseDeviceEntity;
import com.lumiunited.aqara.application.repository.TermsPrivacyEntity;
import com.lumiunited.aqara.common.ui.cell.CommonCell;
import com.lumiunited.aqara.common.ui.titlebar.TitleBar;
import com.lumiunited.aqara.language.LanguageDataResult;
import com.lumiunited.aqara.main.MainActivity;
import com.lumiunited.aqara.web.commonpage.SettingWebActivity;
import java.util.HashMap;
import java.util.List;
import k.u.c.d.a.u;
import k.u.c.d.d.p0;
import k.u.c.d.g.d.k1;
import k.u.c.d.j.o;
import k.u.c.f.a.q.y0;
import k.u.c.i.m1;
import k.u.c.i.m3.e.s1;
import k.u.c.x.j3;
import kotlin.reflect.KDeclarationContainer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import p.a.x0.g;
import s.b3.v.l;
import s.b3.w.f0;
import s.b3.w.k0;
import s.h0;
import s.j2;
@h0(bv = {1, 0, 3}, d1 = {"\u0000<\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\u0018\u00002\f\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u00020\u00012\u00020\u0003B\u0005¢\u0006\u0002\u0010\u0004J\b\u0010\f\u001a\u00020\rH\u0002J\b\u0010\u000e\u001a\u00020\rH\u0002J\u0012\u0010\u000f\u001a\u00020\r2\b\u0010\u0010\u001a\u0004\u0018\u00010\u0011H\u0016J\u0012\u0010\u0012\u001a\u00020\r2\b\u0010\u0013\u001a\u0004\u0018\u00010\u0014H\u0014J\b\u0010\u0015\u001a\u00020\rH\u0014J\b\u0010\u0016\u001a\u00020\rH\u0002J\u0010\u0010\u0017\u001a\u00020\r2\u0006\u0010\u0018\u001a\u00020\u0006H\u0002J\b\u0010\u0019\u001a\u00020\rH\u0002J\b\u0010\u001a\u001a\u00020\rH\u0002J\b\u0010\u001b\u001a\u00020\rH\u0002R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082D¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\u0006X\u0082D¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\t\u001a\u0004\u0018\u00010\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u001c"}, d2 = {"Lcom/lumiunited/aqara/device/settingpage/view/DevicePrivacyProtocolNoModelActivity;", "Lcom/lumiunited/aqara/application/base/BaseActivity;", "Lcom/lumiunited/aqara/application/base/IBasePresenter;", "Landroid/view/View$OnClickListener;", "()V", "EU_DEVICE_PRIVACY_GDPR", "", "H5_PDF_VIEWER_URL", "did", "mCustomAlertDialog", "Lcom/lumiunited/aqara/common/ui/dialog/CustomAlertDialog;", "mDeviceProtocolUrl", com.umeng.socialize.tracker.a.c, "", "initView", "onClick", "v", "Landroid/view/View;", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "requestAppPrivacyProtocol", "requestDevicePrivacyProtocol", "model", "revokeDeviceProtocol", "setListener", "showRevokeProtocolDialog", "app_homekitRelease"}, k = 1, mv = {1, 1, 15})
public final class DevicePrivacyProtocolNoModelActivity extends BaseActivity<u<?>> implements View.OnClickListener {
public y0 J;
public HashMap M;
public final String H = "https://cdn.aqara.com/cdn/app/mainland/h5/index.html#/privacyPolicy_GDPR";
public final String I = "https://cdn.aqara.com/cdn/app/mainland/h5/pdfjs/web/view.html?pdf=";
public String K = "";
public String L = "";
public static final class a extends o<List<? extends TermsPrivacyEntity>> {
public a() {
}
@Override
public void a(int i2, @NotNull String str) {
k0.f(str, "errorMessage");
DevicePrivacyProtocolNoModelActivity.this.b0();
DevicePrivacyProtocolNoModelActivity.this.l(i2, str);
}
@Override
public void a(@Nullable List<? extends TermsPrivacyEntity> list) {
if (list != null) {
HashMap hashMap = new HashMap();
j3 E = j3.E();
k0.a((Object) E, "PositionHelper.getInstance()");
String d = E.d();
k0.a((Object) d, "PositionHelper.getInstance().currentHomeId");
hashMap.put(FaceManagerFragment.C, d);
String h2 = k.u.c.r.l.d.h();
k0.a((Object) h2, "LocationHelper.getSupportDeviceArea()");
hashMap.put("supportDeviceArea", h2);
TermsPrivacyEntity termsPrivacyEntity = list.get(0);
String a = k1.a(termsPrivacyEntity != null ? termsPrivacyEntity.getContent() : null, (String) null, (String) null);
if (!TextUtils.isEmpty(a)) {
DevicePrivacyProtocolNoModelActivity devicePrivacyProtocolNoModelActivity = DevicePrivacyProtocolNoModelActivity.this;
String a2 = k1.a(a, hashMap);
k0.a((Object) a2, "WebApi.joinParams(url, map)");
devicePrivacyProtocolNoModelActivity.L = a2;
}
DevicePrivacyProtocolNoModelActivity.this.b0();
}
}
}
public static final class b extends o<List<? extends LanguageDataResult>> {
public b() {
}
@Override
public void a(int i2, @Nullable String str) {
DevicePrivacyProtocolNoModelActivity.this.b0();
DevicePrivacyProtocolNoModelActivity.this.l(i2, str);
}
@Override
public void a(@Nullable List<? extends LanguageDataResult> list) {
if (list == null || !(!list.isEmpty())) {
DevicePrivacyProtocolNoModelActivity.this.h1();
} else if (TextUtils.isEmpty(list.get(0).getValue())) {
DevicePrivacyProtocolNoModelActivity.this.h1();
} else {
DevicePrivacyProtocolNoModelActivity devicePrivacyProtocolNoModelActivity = DevicePrivacyProtocolNoModelActivity.this;
devicePrivacyProtocolNoModelActivity.L = DevicePrivacyProtocolNoModelActivity.this.I + list.get(0).getValue();
DevicePrivacyProtocolNoModelActivity.this.b0();
}
}
}
public static final class c<T> implements g<String> {
public static final c a = new c();
@Override
public final void accept(String str) {
k.t.c.j.b.c().a(MainActivity.class.getSimpleName());
}
}
public static final class d extends f0 implements l<Throwable, j2> {
public d(DevicePrivacyProtocolNoModelActivity devicePrivacyProtocolNoModelActivity) {
super(1, devicePrivacyProtocolNoModelActivity);
}
public final void a(Throwable th) {
((DevicePrivacyProtocolNoModelActivity) this.receiver).a(th);
}
@Override
public final String getName() {
return "handleCommonRxHttpError";
}
@Override
public final KDeclarationContainer getOwner() {
return s.b3.w.k1.b(DevicePrivacyProtocolNoModelActivity.class);
}
@Override
public final String getSignature() {
return "handleCommonRxHttpError(Ljava/lang/Throwable;)V";
}
@Override
public j2 invoke(Throwable th) {
a(th);
return j2.a;
}
}
public static final class e implements View.OnClickListener {
public e() {
}
@Override
public final void onClick(View view) {
y0 y0Var = DevicePrivacyProtocolNoModelActivity.this.J;
if (y0Var != null) {
y0Var.dismiss();
}
}
}
public static final class f implements View.OnClickListener {
public f() {
}
@Override
public final void onClick(View view) {
DevicePrivacyProtocolNoModelActivity.this.i1();
}
}
private final void f1() {
showLoading();
String str = this.f8960w;
if (str != null) {
BaseDeviceEntity baseDeviceEntity = (BaseDeviceEntity) JSON.parseObject(str, BaseDeviceEntity.class);
k0.a((Object) baseDeviceEntity, "entry");
String did = baseDeviceEntity.getDid();
k0.a((Object) did, "entry.did");
this.K = did;
if (k.u.c.r.l.d.l(getApplicationContext())) {
this.L = this.H;
b0();
return;
}
String model = baseDeviceEntity.getModel();
k0.a((Object) model, "entry.model");
i0(model);
}
}
private final void g1() {
TitleBar titleBar = (TitleBar) _$_findCachedViewById(R.id.title_bar);
k0.a((Object) titleBar, "title_bar");
titleBar.setTextCenter(getString(com.lumiunited.aqarahome.R.string.user_device_privacy_agreement));
CommonCell commonCell = (CommonCell) _$_findCachedViewById(R.id.cell_privacy_policy);
k0.a((Object) commonCell, "cell_privacy_policy");
commonCell.setVisibility(0);
((CommonCell) _$_findCachedViewById(R.id.cell_privacy_policy)).setTvCellLeft(getString(com.lumiunited.aqarahome.R.string.user_device_privacy_agreement));
((CommonCell) _$_findCachedViewById(R.id.cell_privacy_policy)).g(true);
View _$_findCachedViewById = _$_findCachedViewById(R.id.vw_shadow_up);
k0.a((Object) _$_findCachedViewById, "vw_shadow_up");
_$_findCachedViewById.setVisibility(0);
TextView textView = (TextView) _$_findCachedViewById(R.id.tv_repeal);
k0.a((Object) textView, "tv_repeal");
textView.setVisibility(0);
((TextView) _$_findCachedViewById(R.id.tv_repeal)).setText(getString(com.lumiunited.aqarahome.R.string.user_revoke_auth_of_device));
}
public final void h1() {
JSONArray jSONArray = new JSONArray();
jSONArray.add("user_privacy_agreement");
p0.a().b(jSONArray.toString(), new a());
}
private final void i0(String str) {
m1.d().h(str, new b());
}
public final void i1() {
this.f8942e.b(m1.d().e(this.K, "10111").subscribe(c.a, new s1(new d(this))));
y0 y0Var = this.J;
if (y0Var != null) {
y0Var.dismiss();
}
}
private final void j1() {
((CommonCell) _$_findCachedViewById(R.id.cell_privacy_policy)).setOnClickListener(this);
((TextView) _$_findCachedViewById(R.id.tv_repeal)).setOnClickListener(this);
}
private final void k1() {
y0 y0Var;
if (this.J == null) {
this.J = new y0.c(this).d(getString(com.lumiunited.aqarahome.R.string.repeal_terms_and_privacy_title)).a(getString(com.lumiunited.aqarahome.R.string.user_device_auth_revoke_tips)).a(getString(com.lumiunited.aqarahome.R.string.common_think_again), new e()).c(getString(com.lumiunited.aqarahome.R.string.user_comfirm_revoke), new f()).a();
}
y0 y0Var2 = this.J;
if ((y0Var2 == null || !y0Var2.isShowing()) && (y0Var = this.J) != null) {
y0Var.show();
}
}
@Override
public void _$_clearFindViewByIdCache() {
HashMap hashMap = this.M;
if (hashMap != null) {
hashMap.clear();
}
}
@Override
public View _$_findCachedViewById(int i2) {
if (this.M == null) {
this.M = new HashMap();
}
View view = (View) this.M.get(Integer.valueOf(i2));
if (view == null) {
View findViewById = findViewById(i2);
this.M.put(Integer.valueOf(i2), findViewById);
return findViewById;
}
return view;
}
@Override
public void onClick(@Nullable View view) {
Integer valueOf = view != null ? Integer.valueOf(view.getId()) : null;
if (valueOf != null && valueOf.intValue() == com.lumiunited.aqarahome.R.id.cell_privacy_policy) {
SettingWebActivity.a(this, this.L, k1.b.PRIVACY_POLICY, getString(com.lumiunited.aqarahome.R.string.privacy_policy));
} else if (valueOf != null && valueOf.intValue() == com.lumiunited.aqarahome.R.id.tv_repeal) {
k1();
}
}
@Override
public void onCreate(@Nullable Bundle bundle) {
super.onCreate(bundle);
setContentView(com.lumiunited.aqarahome.R.layout.activity_device_privacy_protocol);
f1();
g1();
j1();
}
@Override
public void onDestroy() {
this.J = null;
super.onDestroy();
}
}