Money Lover v8.14.0.6版本的 MD5 值为:48b9d922212c7ccfd438cdcc183ff396
以下内容为反编译后的 MigrateActivity.java 源代码,内容仅作参考
package com.zoostudio.moneylover.globalcate.migrate.ui;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.Network;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import androidx.activity.ComponentActivity;
import androidx.appcompat.widget.AppCompatButton;
import androidx.lifecycle.n0;
import androidx.lifecycle.o0;
import androidx.lifecycle.q0;
import com.bookmark.money.R;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.zoostudio.moneylover.MoneyApplication;
import com.zoostudio.moneylover.globalcate.migrate.ui.MigrateActivity;
import com.zoostudio.moneylover.globalcate.preview.ui.GlobalCateActivity;
import com.zoostudio.moneylover.help.activity.ActivityIssue;
import com.zoostudio.moneylover.main.MainActivity;
import h3.v1;
import java.lang.ref.WeakReference;
import java.util.Arrays;
import java.util.HashMap;
import kn.v;
import kotlin.jvm.internal.k0;
import kotlin.jvm.internal.p0;
import kotlin.jvm.internal.r;
import kotlin.jvm.internal.t;
import org.zoostudio.fw.view.CustomFontTextView;
public final class MigrateActivity extends androidx.appcompat.app.d {
private final i B;
private final k C;
public v1 f11887c;
private ConnectivityManager f11888d;
private final kn.g f11889e = new n0(k0.b(lc.a.class), new o(this), new n(this), new p(null, this));
private final kn.g f11890f;
private final kn.g f11891g;
private final kn.g f11892i;
private AlertDialog f11893j;
private ConnectivityManager.NetworkCallback f11894o;
private final a f11895p;
private final j f11896q;
public static final class a extends androidx.activity.l {
a() {
super(true);
}
@Override
public void b() {
MigrateActivity.this.d1();
MigrateActivity.this.finishAffinity();
}
}
public static final class b extends t implements wn.l<Boolean, v> {
b() {
super(1);
}
public final void a(boolean z10) {
if (z10) {
MigrateActivity.this.O0();
}
}
@Override
public v invoke(Boolean bool) {
a(bool.booleanValue());
return v.f26314a;
}
}
static final class c extends t implements wn.a<Boolean> {
public static final c f11899a = new c();
c() {
super(0);
}
@Override
public final Boolean invoke() {
return Boolean.valueOf(zi.f.i().F());
}
}
static final class d extends t implements wn.a<Boolean> {
d() {
super(0);
}
@Override
public final Boolean invoke() {
return Boolean.valueOf(qa.a.f31792a.b(MigrateActivity.this));
}
}
static final class e extends t implements wn.a<String> {
public static final e f11901a = new e();
e() {
super(0);
}
@Override
public final String invoke() {
return zi.f.i().x();
}
}
public static final class f extends t implements wn.l<Boolean, v> {
public static final class a extends t implements wn.l<Boolean, v> {
final MigrateActivity f11903a;
public static final class C0209a extends t implements wn.l<kn.m<? extends String, ? extends Boolean>, v> {
final MigrateActivity f11904a;
C0209a(MigrateActivity migrateActivity) {
super(1);
this.f11904a = migrateActivity;
}
public final void a(kn.m<String, Boolean> state) {
r.h(state, "state");
if (r.c(state.c(), "done")) {
this.f11904a.startActivity(new Intent(this.f11904a, (Class<?>) GlobalCateActivity.class));
}
}
@Override
public v invoke(kn.m<? extends String, ? extends Boolean> mVar) {
a(mVar);
return v.f26314a;
}
}
a(MigrateActivity migrateActivity) {
super(1);
this.f11903a = migrateActivity;
}
public final void a(boolean z10) {
if (z10) {
this.f11903a.N0();
lc.a S0 = this.f11903a.S0();
MigrateActivity migrateActivity = this.f11903a;
S0.n(migrateActivity, new C0209a(migrateActivity));
}
}
@Override
public v invoke(Boolean bool) {
a(bool.booleanValue());
return v.f26314a;
}
}
public static final class b extends t implements wn.l<kn.m<? extends String, ? extends Boolean>, v> {
final MigrateActivity f11905a;
b(MigrateActivity migrateActivity) {
super(1);
this.f11905a = migrateActivity;
}
public final void a(kn.m<String, Boolean> state) {
r.h(state, "state");
if (state.d().booleanValue()) {
this.f11905a.T0();
} else if (!r.c(state.c(), "lock")) {
this.f11905a.U0();
} else if (!zi.f.i().F()) {
this.f11905a.M0();
}
}
@Override
public v invoke(kn.m<? extends String, ? extends Boolean> mVar) {
a(mVar);
return v.f26314a;
}
}
f() {
super(1);
}
public final void a(boolean z10) {
String R0 = MigrateActivity.this.R0();
switch (R0.hashCode()) {
case -1274442605:
if (R0.equals("finish")) {
MigrateActivity.this.U0();
return;
}
return;
case -852085848:
if (R0.equals("migrating")) {
if (!MigrateActivity.this.V0()) {
MigrateActivity.this.N0();
return;
} else {
MigrateActivity.this.S0().m(new WeakReference<>(MigrateActivity.this), new a(MigrateActivity.this));
return;
}
}
return;
case -840442044:
if (R0.equals("unlock")) {
MigrateActivity.this.N0();
lc.a S0 = MigrateActivity.this.S0();
MigrateActivity migrateActivity = MigrateActivity.this;
S0.n(migrateActivity, new b(migrateActivity));
return;
}
return;
case 3089282:
if (R0.equals("done")) {
MigrateActivity.this.T0();
return;
}
return;
case 1934841231:
if (R0.equals("push_label")) {
MigrateActivity.this.N0();
qj.c.u(MigrateActivity.this);
return;
}
return;
default:
return;
}
}
@Override
public v invoke(Boolean bool) {
a(bool.booleanValue());
return v.f26314a;
}
}
public static final class g extends ConnectivityManager.NetworkCallback {
g() {
}
public static final void b(MigrateActivity this$0) {
r.h(this$0, "this$0");
this$0.L0();
this$0.b1();
}
@Override
public void onAvailable(Network network) {
r.h(network, "network");
}
@Override
public void onLost(Network network) {
r.h(network, "network");
final MigrateActivity migrateActivity = MigrateActivity.this;
migrateActivity.runOnUiThread(new Runnable() {
@Override
public final void run() {
MigrateActivity.g.b(MigrateActivity.this);
}
});
}
}
static final class h extends t implements wn.l<Boolean, v> {
h() {
super(1);
}
public final void a(boolean z10) {
if (z10) {
MigrateActivity.this.O0();
}
}
@Override
public v invoke(Boolean bool) {
a(bool.booleanValue());
return v.f26314a;
}
}
public static final class i extends BroadcastReceiver {
static final class a extends t implements wn.l<kn.m<? extends String, ? extends Boolean>, v> {
final MigrateActivity f11909a;
a(MigrateActivity migrateActivity) {
super(1);
this.f11909a = migrateActivity;
}
public final void a(kn.m<String, Boolean> it) {
r.h(it, "it");
if (r.c(it.c(), "done")) {
this.f11909a.T0();
}
}
@Override
public v invoke(kn.m<? extends String, ? extends Boolean> mVar) {
a(mVar);
return v.f26314a;
}
}
i() {
}
@Override
public void onReceive(Context context, Intent intent) {
if (context != null) {
MigrateActivity.this.S0().n(context, new a(MigrateActivity.this));
}
}
}
public static final class j extends BroadcastReceiver {
j() {
}
@Override
public void onReceive(Context context, Intent intent) {
MigrateActivity.this.P0();
}
}
public static final class k extends BroadcastReceiver {
static final class a extends t implements wn.l<kn.m<? extends String, ? extends Boolean>, v> {
final MigrateActivity f11912a;
a(MigrateActivity migrateActivity) {
super(1);
this.f11912a = migrateActivity;
}
public final void a(kn.m<String, Boolean> it) {
r.h(it, "it");
this.f11912a.T0();
}
@Override
public v invoke(kn.m<? extends String, ? extends Boolean> mVar) {
a(mVar);
return v.f26314a;
}
}
k() {
}
@Override
public void onReceive(Context context, Intent intent) {
if (context != null) {
MigrateActivity.this.S0().s(context, "done", new a(MigrateActivity.this));
}
}
}
public static final class l extends t implements wn.a<v> {
l() {
super(0);
}
@Override
public v invoke() {
invoke2();
return v.f26314a;
}
public final void invoke2() {
MigrateActivity.this.startActivity(new Intent("android.settings.WIFI_SETTINGS"));
AlertDialog alertDialog = MigrateActivity.this.f11893j;
if (alertDialog != null) {
alertDialog.dismiss();
}
}
}
public static final class m extends t implements wn.a<v> {
m() {
super(0);
}
@Override
public v invoke() {
invoke2();
return v.f26314a;
}
public final void invoke2() {
AlertDialog alertDialog = MigrateActivity.this.f11893j;
if (alertDialog != null) {
alertDialog.dismiss();
}
}
}
public static final class n extends t implements wn.a<o0.b> {
final ComponentActivity f11915a;
public n(ComponentActivity componentActivity) {
super(0);
this.f11915a = componentActivity;
}
@Override
public final o0.b invoke() {
o0.b defaultViewModelProviderFactory = this.f11915a.getDefaultViewModelProviderFactory();
r.g(defaultViewModelProviderFactory, "defaultViewModelProviderFactory");
return defaultViewModelProviderFactory;
}
}
public static final class o extends t implements wn.a<q0> {
final ComponentActivity f11916a;
public o(ComponentActivity componentActivity) {
super(0);
this.f11916a = componentActivity;
}
@Override
public final q0 invoke() {
q0 viewModelStore = this.f11916a.getViewModelStore();
r.g(viewModelStore, "viewModelStore");
return viewModelStore;
}
}
public static final class p extends t implements wn.a<u0.a> {
final wn.a f11917a;
final ComponentActivity f11918b;
public p(wn.a aVar, ComponentActivity componentActivity) {
super(0);
this.f11917a = aVar;
this.f11918b = componentActivity;
}
@Override
public final u0.a invoke() {
u0.a aVar;
wn.a aVar2 = this.f11917a;
if (aVar2 == null || (aVar = (u0.a) aVar2.invoke()) == null) {
u0.a defaultViewModelCreationExtras = this.f11918b.getDefaultViewModelCreationExtras();
r.g(defaultViewModelCreationExtras, "this.defaultViewModelCreationExtras");
return defaultViewModelCreationExtras;
}
return aVar;
}
}
public MigrateActivity() {
kn.g b10;
kn.g b11;
kn.g b12;
b10 = kn.i.b(e.f11901a);
this.f11890f = b10;
b11 = kn.i.b(c.f11899a);
this.f11891g = b11;
b12 = kn.i.b(new d());
this.f11892i = b12;
this.f11894o = new g();
this.f11895p = new a();
this.f11896q = new j();
this.B = new i();
this.C = new k();
}
public final void L0() {
Q0().V1.setText(getString(R.string.title_failed_to_update_data_screen));
Q0().K0.setText(getString(R.string.description_failed_to_update_data_screen));
AppCompatButton tryAgain = Q0().K1;
r.g(tryAgain, "tryAgain");
el.d.k(tryAgain);
LinearLayout layoutLoggedInAs = Q0().A1;
r.g(layoutLoggedInAs, "layoutLoggedInAs");
el.d.d(layoutLoggedInAs);
}
public final void M0() {
Q0().V1.setText(getString(R.string.title_categories_combining_screen));
Q0().K0.setText(getString(R.string.description_categories_combining_screen));
AppCompatButton tryAgain = Q0().K1;
r.g(tryAgain, "tryAgain");
el.d.d(tryAgain);
LinearLayout layoutLoggedInAs = Q0().A1;
r.g(layoutLoggedInAs, "layoutLoggedInAs");
el.d.k(layoutLoggedInAs);
}
public final void N0() {
Q0().V1.setText(getString(R.string.title_data_processing_screen));
Q0().K0.setText(getString(R.string.description_data_processing_screen));
AppCompatButton tryAgain = Q0().K1;
r.g(tryAgain, "tryAgain");
el.d.d(tryAgain);
LinearLayout layoutLoggedInAs = Q0().A1;
r.g(layoutLoggedInAs, "layoutLoggedInAs");
el.d.k(layoutLoggedInAs);
}
public final void O0() {
if (!W0()) {
L0();
b1();
} else {
X0();
}
}
public final void P0() {
S0().l(this, new b());
}
public final String R0() {
Object value = this.f11890f.getValue();
r.g(value, "getValue(...)");
return (String) value;
}
public final lc.a S0() {
return (lc.a) this.f11889e.getValue();
}
public final void U0() {
Intent intent = new Intent(this, (Class<?>) MainActivity.class);
intent.setFlags(335544320);
startActivity(intent);
finish();
}
public final boolean V0() {
return ((Boolean) this.f11891g.getValue()).booleanValue();
}
private final boolean W0() {
return ((Boolean) this.f11892i.getValue()).booleanValue();
}
private final void X0() {
S0().r(this, new f());
}
public static final void Y0(MigrateActivity this$0, View view) {
r.h(this$0, "this$0");
this$0.O0();
}
public static final void Z0(MigrateActivity this$0, View view) {
r.h(this$0, "this$0");
HashMap hashMap = new HashMap();
hashMap.put(FirebaseAnalytics.Param.SCREEN_NAME, "combine");
qe.a.k(this$0, "c__get_support", hashMap);
this$0.startActivity(new Intent(this$0, (Class<?>) ActivityIssue.class));
}
public final void b1() {
be.c n10 = new be.c(this).s().r(R.string.no_connection_title).k(R.string.check_internet_settings).p(R.string.setting, new l()).i(R.color.p_500).n(R.string.close, new m());
AlertDialog create = n10.setView(n10.e().getRoot()).create();
this.f11893j = create;
if (create != null) {
create.show();
}
}
private final void c1() {
String string = getString(R.string.version);
r.g(string, "getString(...)");
CustomFontTextView customFontTextView = Q0().C2;
p0 p0Var = p0.f26377a;
String format = String.format(string, Arrays.copyOf(new Object[]{"8.14.0.6"}, 1));
r.g(format, "format(format, *args)");
customFontTextView.setText(format);
}
public final void d1() {
ConnectivityManager connectivityManager = this.f11888d;
if (connectivityManager == null) {
r.z("connectivityManager");
connectivityManager = null;
}
connectivityManager.unregisterNetworkCallback(this.f11894o);
il.b.b(this.B);
il.b.b(this.C);
il.b.b(this.f11896q);
}
public final v1 Q0() {
v1 v1Var = this.f11887c;
if (v1Var != null) {
return v1Var;
}
r.z("binding");
return null;
}
public final void T0() {
Intent intent = new Intent(this, (Class<?>) GlobalCateActivity.class);
intent.setFlags(335544320);
startActivity(intent);
finish();
}
public final void a1(v1 v1Var) {
r.h(v1Var, "<set-?>");
this.f11887c = v1Var;
}
@Override
public void onCreate(Bundle bundle) {
boolean z10;
super.onCreate(bundle);
v1 F = v1.F(getLayoutInflater());
r.g(F, "inflate(...)");
a1(F);
setContentView(Q0().getRoot());
i iVar = this.B;
String jVar = com.zoostudio.moneylover.utils.j.LABEL.toString();
r.g(jVar, "toString(...)");
il.b.a(iVar, jVar);
il.b.a(this.C, "com.zoostudio.intent.action.UPDATE_STATE_LABEL");
il.b.a(this.f11896q, "com.zoostudio.intent.action.RE_MIGRATE");
Object systemService = getSystemService("connectivity");
r.f(systemService, "null cannot be cast to non-null type android.net.ConnectivityManager");
ConnectivityManager connectivityManager = (ConnectivityManager) systemService;
this.f11888d = connectivityManager;
if (connectivityManager == null) {
r.z("connectivityManager");
connectivityManager = null;
}
connectivityManager.registerDefaultNetworkCallback(this.f11894o);
String email = MoneyApplication.f11023j.o(this).getEmail();
if (email != null && email.length() != 0) {
z10 = false;
} else {
z10 = true;
}
if (!z10) {
Q0().f22093k1.setText(email);
}
S0().j(this, new h());
Q0().K1.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MigrateActivity.Y0(MigrateActivity.this, view);
}
});
Q0().C1.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MigrateActivity.Z0(MigrateActivity.this, view);
}
});
AppCompatButton tryAgain = Q0().K1;
r.g(tryAgain, "tryAgain");
el.d.d(tryAgain);
getOnBackPressedDispatcher().c(this, this.f11895p);
c1();
}
@Override
public void onDestroy() {
super.onDestroy();
d1();
}
}