正在查看: Bhakti v5.4.0 应用的 MoEDebuggerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Bhakti v5.4.0 应用的 MoEDebuggerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.moengage.sdk.debugger;
import A8.w;
import Ai.p;
import Ed.kcXh.UGAElDSWVInPx;
import Vh.f;
import Vh.g;
import Vh.h;
import Xh.c;
import ai.a;
import ai.b;
import ai.d;
import ai.e;
import android.content.Context;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatButton;
import androidx.datastore.preferences.protobuf.o;
import androidx.lifecycle.q0;
import androidx.lifecycle.s0;
import com.google.android.material.navigationrail.mA.RDoLFqbSNk;
import java.util.HashMap;
import java.util.TimeZone;
import kotlin.Metadata;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.i;
import nf.F;
import qg.e0;
@Metadata
public final class MoEDebuggerActivity extends AppCompatActivity {
private TextView deviceIdView;
private TextView endTimeView;
private TextView environmentView;
private TextView errorMessageView;
private AppCompatButton extendDebuggerTimeView;
private LinearLayout infoSectionView;
private TextView logLevelView;
private ProgressBar progressBarView;
private F sdkInstance;
private AppCompatButton startDebuggerView;
private TextView startTimeView;
private AppCompatButton stopDebuggerView;
private TextView uniqueIdView;
private d viewModel;
private TextView workspaceIdView;
private final String tag = "SDKDebugger_2.0.0_MoEDebuggerActivity";
private int logLevel = 5;
public static final void initUIElements$lambda$1(MoEDebuggerActivity moEDebuggerActivity, View view) {
Intrinsics.checkNotNullParameter(moEDebuggerActivity, "this$0");
d dVar = moEDebuggerActivity.viewModel;
if (dVar == null) {
Intrinsics.m("viewModel");
throw null;
}
dVar.c.f.i(new a(dVar, moEDebuggerActivity.logLevel, 0));
String string = moEDebuggerActivity.getResources().getString(h.moe_debugger_enable_log_update_message);
Intrinsics.checkNotNullExpressionValue(string, "getString(...)");
moEDebuggerActivity.showMessage(string, c.TOAST);
}
public static final void initUIElements$lambda$2(MoEDebuggerActivity moEDebuggerActivity, View view) {
Intrinsics.checkNotNullParameter(moEDebuggerActivity, "this$0");
d dVar = moEDebuggerActivity.viewModel;
if (dVar == null) {
Intrinsics.m("viewModel");
throw null;
}
dVar.c.f.i(new b(dVar, 1));
String string = moEDebuggerActivity.getResources().getString(h.moe_debugger_disable_log_update_message);
Intrinsics.checkNotNullExpressionValue(string, "getString(...)");
moEDebuggerActivity.showMessage(string, c.TOAST);
}
public static final void initUIElements$lambda$3(MoEDebuggerActivity moEDebuggerActivity, View view) {
Intrinsics.checkNotNullParameter(moEDebuggerActivity, "this$0");
d dVar = moEDebuggerActivity.viewModel;
if (dVar == null) {
Intrinsics.m("viewModel");
throw null;
}
dVar.c.f.i(new a(dVar, moEDebuggerActivity.logLevel, 1));
String string = moEDebuggerActivity.getResources().getString(h.moe_debugger_timing_update_message);
Intrinsics.checkNotNullExpressionValue(string, "getString(...)");
moEDebuggerActivity.showMessage(string, c.TOAST);
}
private final void initViewModel() {
F f = this.sdkInstance;
if (f == null) {
Intrinsics.m("sdkInstance");
throw null;
}
mf.h.a(f.d, 0, (Throwable) null, (Function0) null, new Vh.c(this, 2), 7);
int i = this.logLevel;
F f2 = this.sdkInstance;
if (f2 == null) {
Intrinsics.m("sdkInstance");
throw null;
}
e eVar = new e(i, f2, this);
Intrinsics.checkNotNullParameter(this, "owner");
Intrinsics.checkNotNullParameter(eVar, "factory");
s0 viewModelStore = getViewModelStore();
Intrinsics.checkNotNullParameter(this, "owner");
T2.c defaultViewModelCreationExtras = getDefaultViewModelCreationExtras();
Intrinsics.checkNotNullParameter(viewModelStore, "store");
Intrinsics.checkNotNullParameter(eVar, "factory");
Intrinsics.checkNotNullParameter(defaultViewModelCreationExtras, "defaultCreationExtras");
pd.a aVar = new pd.a(viewModelStore, (q0) eVar, defaultViewModelCreationExtras);
Intrinsics.checkNotNullParameter(d.class, "modelClass");
i o = o.o(d.class, "<this>", d.class, "modelClass", "modelClass");
String x = android.support.v4.media.session.h.x(o);
if (x == null) {
throw new IllegalArgumentException("Local and anonymous classes can not be ViewModels");
}
d S = aVar.S(o, "androidx.lifecycle.ViewModelProvider.DefaultKey:".concat(x));
this.viewModel = S;
if (S == null) {
Intrinsics.m("viewModel");
throw null;
}
S.f.e(this, new Ik.d(new Vh.d(this, 0)));
d dVar = this.viewModel;
if (dVar == null) {
Intrinsics.m("viewModel");
throw null;
}
dVar.h.e(this, new Ik.d(new Vh.d(this, 1)));
d dVar2 = this.viewModel;
if (dVar2 == null) {
Intrinsics.m("viewModel");
throw null;
}
dVar2.i.e(this, new Ik.d(new Vh.d(this, 2)));
d dVar3 = this.viewModel;
if (dVar3 != null) {
dVar3.g.e(this, new Ik.d(new Vh.d(this, 3)));
} else {
Intrinsics.m("viewModel");
throw null;
}
}
private final void showMessage(String str, c cVar) {
int i = Vh.b.b[cVar.ordinal()];
if (i == 1) {
Toast.makeText((Context) this, (CharSequence) str, 1).show();
return;
}
if (i != 2) {
return;
}
TextView textView = this.errorMessageView;
if (textView == null) {
Intrinsics.m("errorMessageView");
throw null;
}
textView.setText(str);
TextView textView2 = this.errorMessageView;
if (textView2 == null) {
Intrinsics.m("errorMessageView");
throw null;
}
textView2.setVisibility(0);
ProgressBar progressBar = this.progressBarView;
if (progressBar == null) {
Intrinsics.m("progressBarView");
throw null;
}
progressBar.setVisibility(8);
LinearLayout linearLayout = this.infoSectionView;
if (linearLayout != null) {
linearLayout.setVisibility(8);
} else {
Intrinsics.m("infoSectionView");
throw null;
}
}
public final void updateUIElementsVisibility(Xh.b bVar) {
int i = Vh.b.a[bVar.ordinal()];
if (i == 1) {
ProgressBar progressBar = this.progressBarView;
if (progressBar == null) {
Intrinsics.m("progressBarView");
throw null;
}
progressBar.setVisibility(0);
TextView textView = this.errorMessageView;
if (textView == null) {
Intrinsics.m("errorMessageView");
throw null;
}
textView.setVisibility(8);
LinearLayout linearLayout = this.infoSectionView;
if (linearLayout != null) {
linearLayout.setVisibility(8);
return;
} else {
Intrinsics.m("infoSectionView");
throw null;
}
}
if (i == 2) {
ProgressBar progressBar2 = this.progressBarView;
if (progressBar2 == null) {
Intrinsics.m("progressBarView");
throw null;
}
progressBar2.setVisibility(8);
TextView textView2 = this.errorMessageView;
if (textView2 == null) {
Intrinsics.m("errorMessageView");
throw null;
}
textView2.setVisibility(0);
LinearLayout linearLayout2 = this.infoSectionView;
if (linearLayout2 != null) {
linearLayout2.setVisibility(8);
return;
} else {
Intrinsics.m("infoSectionView");
throw null;
}
}
ProgressBar progressBar3 = this.progressBarView;
if (progressBar3 == null) {
Intrinsics.m("progressBarView");
throw null;
}
progressBar3.setVisibility(8);
TextView textView3 = this.errorMessageView;
if (textView3 == null) {
Intrinsics.m("errorMessageView");
throw null;
}
textView3.setVisibility(8);
LinearLayout linearLayout3 = this.infoSectionView;
if (linearLayout3 == null) {
Intrinsics.m("infoSectionView");
throw null;
}
linearLayout3.setVisibility(0);
if (bVar == Xh.b.ENABLED) {
AppCompatButton appCompatButton = this.startDebuggerView;
if (appCompatButton == null) {
Intrinsics.m("startDebuggerView");
throw null;
}
appCompatButton.setVisibility(8);
AppCompatButton appCompatButton2 = this.stopDebuggerView;
if (appCompatButton2 == null) {
Intrinsics.m("stopDebuggerView");
throw null;
}
appCompatButton2.setVisibility(0);
AppCompatButton appCompatButton3 = this.extendDebuggerTimeView;
if (appCompatButton3 != null) {
appCompatButton3.setVisibility(0);
return;
} else {
Intrinsics.m("extendDebuggerTimeView");
throw null;
}
}
AppCompatButton appCompatButton4 = this.startDebuggerView;
if (appCompatButton4 == null) {
Intrinsics.m("startDebuggerView");
throw null;
}
appCompatButton4.setVisibility(0);
AppCompatButton appCompatButton5 = this.stopDebuggerView;
if (appCompatButton5 == null) {
Intrinsics.m("stopDebuggerView");
throw null;
}
appCompatButton5.setVisibility(8);
AppCompatButton appCompatButton6 = this.extendDebuggerTimeView;
if (appCompatButton6 != null) {
appCompatButton6.setVisibility(8);
} else {
Intrinsics.m("extendDebuggerTimeView");
throw null;
}
}
public void onCreate(Bundle bundle) {
super/*androidx.fragment.app.FragmentActivity*/.onCreate(bundle);
try {
yd.c cVar = mf.h.c;
p.P(0, (Throwable) null, (e0) null, new Vh.c(this, 3), 7);
setContentView(f.activity_moe_debugger);
initUIElements();
F D = w.D(getIntent().getExtras());
if (D == null) {
p.P(0, (Throwable) null, (e0) null, new Vh.c(this, 4), 7);
String string = getResources().getString(h.moe_debugger_wrong_workspace_id_message);
Intrinsics.checkNotNullExpressionValue(string, "getString(...)");
showMessage(string, c.EMBEDDED);
return;
}
this.sdkInstance = D;
HashMap hashMap = mf.i.a;
Bundle extras = getIntent().getExtras();
Integer num = (Integer) hashMap.get(extras != null ? extras.getString("logLevel") : null);
this.logLevel = num != null ? num.intValue() : 5;
initStaticViewData();
initViewModel();
} catch (Throwable th) {
if (th instanceof UnsupportedOperationException) {
String string2 = getResources().getString(h.moe_debugger_wrong_environment);
Intrinsics.checkNotNullExpressionValue(string2, "getString(...)");
showMessage(string2, c.EMBEDDED);
}
yd.c cVar2 = mf.h.c;
p.P(1, th, (e0) null, new Vh.c(this, 5), 4);
}
}
public boolean onCreateOptionsMenu(Menu menu) {
Intrinsics.checkNotNullParameter(menu, "menu");
getMenuInflater().inflate(g.moe_debugger_share_menu, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem menuItem) {
Intrinsics.checkNotNullParameter(menuItem, "item");
try {
if (menuItem.getItemId() != Vh.e.action_share) {
return super/*android.app.Activity*/.onOptionsItemSelected(menuItem);
}
if (this.sdkInstance == null) {
String string = getResources().getString(h.moe_debugger_share_error_text);
Intrinsics.checkNotNullExpressionValue(string, "getString(...)");
showMessage(string, c.TOAST);
} else {
String string2 = getResources().getString(h.moe_debugger_share_subject);
Intrinsics.checkNotNullExpressionValue(string2, "getString(...)");
d dVar = this.viewModel;
if (dVar == null) {
Intrinsics.m("viewModel");
throw null;
}
Xh.b bVar = (Xh.b) dVar.f.d();
if (bVar == null) {
bVar = Xh.b.LOADING;
}
Xh.b bVar2 = bVar;
Intrinsics.e(bVar2);
TextView textView = this.logLevelView;
if (textView == null) {
Intrinsics.m("logLevelView");
throw null;
}
String obj = textView.getText().toString();
TextView textView2 = this.startTimeView;
if (textView2 == null) {
Intrinsics.m("startTimeView");
throw null;
}
String obj2 = textView2.getText().toString();
TextView textView3 = this.endTimeView;
if (textView3 == null) {
Intrinsics.m("endTimeView");
throw null;
}
String obj3 = textView3.getText().toString();
TextView textView4 = this.workspaceIdView;
if (textView4 == null) {
Intrinsics.m("workspaceIdView");
throw null;
}
String obj4 = textView4.getText().toString();
TextView textView5 = this.environmentView;
if (textView5 == null) {
Intrinsics.m("environmentView");
throw null;
}
String obj5 = textView5.getText().toString();
TextView textView6 = this.deviceIdView;
if (textView6 == null) {
Intrinsics.m("deviceIdView");
throw null;
}
String obj6 = textView6.getText().toString();
TextView textView7 = this.uniqueIdView;
if (textView7 == null) {
Intrinsics.m("uniqueIdView");
throw null;
}
String obj7 = textView7.getText().toString();
TimeZone timeZone = TimeZone.getDefault();
Intrinsics.checkNotNullExpressionValue(timeZone, "getDefault(...)");
w.c0(this, new Xh.a(string2, bVar2, obj, obj2, obj3, obj4, obj5, obj6, obj7, w.H(timeZone, System.currentTimeMillis())));
}
return true;
} catch (Throwable th) {
F f = this.sdkInstance;
if (f == null) {
Intrinsics.m("sdkInstance");
throw null;
}
mf.h.a(f.d, 1, th, (Function0) null, new Vh.c(this, 6), 4);
return super/*android.app.Activity*/.onOptionsItemSelected(menuItem);
}
}
private final void initStaticViewData() {
F f = this.sdkInstance;
String str = RDoLFqbSNk.aFQEmdBFfyud;
if (f == null) {
Intrinsics.m(str);
throw null;
}
mf.h.a(f.d, 0, (Throwable) null, (Function0) null, new Vh.c(this, 0), 7);
TextView textView = this.workspaceIdView;
if (textView == null) {
Intrinsics.m("workspaceIdView");
throw null;
}
F f2 = this.sdkInstance;
if (f2 == null) {
Intrinsics.m(str);
throw null;
}
textView.setText(f2.a.a);
TextView textView2 = this.environmentView;
if (textView2 == null) {
Intrinsics.m("environmentView");
throw null;
}
boolean H = Yf.e.H(this);
F f4 = this.sdkInstance;
if (f4 == null) {
Intrinsics.m(str);
throw null;
}
ag.a aVar = f4.b.n.a;
Intrinsics.checkNotNullParameter(aVar, "environment");
if (Wh.b.a[aVar.ordinal()] == 1) {
aVar = H ? ag.a.TEST : ag.a.LIVE;
}
textView2.setText(aVar.toString());
}
private final void initUIElements() {
yd.c cVar = mf.h.c;
p.P(0, (Throwable) null, (e0) null, new Vh.c(this, 1), 7);
setSupportActionBar(findViewById(Vh.e.toolbar));
View findViewById = findViewById(Vh.e.progressIndicatorView);
Intrinsics.checkNotNullExpressionValue(findViewById, "findViewById(...)");
this.progressBarView = (ProgressBar) findViewById;
View findViewById2 = findViewById(Vh.e.errorMessageTextView);
Intrinsics.checkNotNullExpressionValue(findViewById2, "findViewById(...)");
this.errorMessageView = (TextView) findViewById2;
View findViewById3 = findViewById(Vh.e.infoSectionView);
Intrinsics.checkNotNullExpressionValue(findViewById3, "findViewById(...)");
this.infoSectionView = (LinearLayout) findViewById3;
View findViewById4 = findViewById(Vh.e.logLevelTextView);
Intrinsics.checkNotNullExpressionValue(findViewById4, "findViewById(...)");
this.logLevelView = (TextView) findViewById4;
View findViewById5 = findViewById(Vh.e.startTimeTextView);
Intrinsics.checkNotNullExpressionValue(findViewById5, "findViewById(...)");
this.startTimeView = (TextView) findViewById5;
View findViewById6 = findViewById(Vh.e.endTimeTextView);
Intrinsics.checkNotNullExpressionValue(findViewById6, "findViewById(...)");
this.endTimeView = (TextView) findViewById6;
AppCompatButton findViewById7 = findViewById(Vh.e.stopButtonView);
Intrinsics.checkNotNullExpressionValue(findViewById7, "findViewById(...)");
this.stopDebuggerView = findViewById7;
AppCompatButton findViewById8 = findViewById(Vh.e.startButtonView);
Intrinsics.checkNotNullExpressionValue(findViewById8, "findViewById(...)");
this.startDebuggerView = findViewById8;
AppCompatButton findViewById9 = findViewById(Vh.e.extendButtonView);
Intrinsics.checkNotNullExpressionValue(findViewById9, "findViewById(...)");
this.extendDebuggerTimeView = findViewById9;
View findViewById10 = findViewById(Vh.e.workspaceIdTextView);
Intrinsics.checkNotNullExpressionValue(findViewById10, "findViewById(...)");
this.workspaceIdView = (TextView) findViewById10;
View findViewById11 = findViewById(Vh.e.environmentTextView);
Intrinsics.checkNotNullExpressionValue(findViewById11, "findViewById(...)");
this.environmentView = (TextView) findViewById11;
View findViewById12 = findViewById(Vh.e.deviceIdTextView);
Intrinsics.checkNotNullExpressionValue(findViewById12, "findViewById(...)");
this.deviceIdView = (TextView) findViewById12;
View findViewById13 = findViewById(Vh.e.uniqueIdTextView);
Intrinsics.checkNotNullExpressionValue(findViewById13, "findViewById(...)");
this.uniqueIdView = (TextView) findViewById13;
AppCompatButton appCompatButton = this.startDebuggerView;
if (appCompatButton == null) {
Intrinsics.m("startDebuggerView");
throw null;
}
appCompatButton.setOnClickListener(new Vh.a(this, 0));
AppCompatButton appCompatButton2 = this.stopDebuggerView;
if (appCompatButton2 == null) {
Intrinsics.m(UGAElDSWVInPx.oTutGxoYwAO);
throw null;
}
appCompatButton2.setOnClickListener(new Vh.a(this, 1));
AppCompatButton appCompatButton3 = this.extendDebuggerTimeView;
if (appCompatButton3 != null) {
appCompatButton3.setOnClickListener(new Vh.a(this, 2));
} else {
Intrinsics.m("extendDebuggerTimeView");
throw null;
}
}
}