Maxcredito v1.2.1版本的 MD5 值为:2605738f37f8ddb81288799ddcbfcbe8
以下内容为反编译后的 a.java 源代码,内容仅作参考
package g.j.a.a.n;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import com.facebook.internal.ServerProtocol;
import com.hiii.mobile.track.TrackerManager;
import com.sensorsdata.analytics.android.sdk.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.xinmi.android.moneed.bean.AppVersionData;
import com.xinmi.android.moneed.bean.base.BaseResponse;
import com.xinmi.android.moneed.library.R;
import com.xinmi.android.moneed.request.GetVersionRequest;
import e.r.a.q;
import g.b.a.b.p;
import g.j.a.a.s.d;
import g.j.a.a.w.h.a;
import h.b.l;
import j.s;
import j.z.c.t;
import java.util.List;
import java.util.ListIterator;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.text.Regex;
public final class a {
public static final a a = new a();
public static final class ViewOnClickListenerC0202a implements View.OnClickListener {
public final FragmentActivity a;
public ViewOnClickListenerC0202a(FragmentActivity fragmentActivity) {
this.a = fragmentActivity;
}
@Override
@SensorsDataInstrumented
public final void onClick(View view) {
TrackerManager trackerManager = TrackerManager.a;
g.b.a.b.b bVar = g.b.a.b.b.a;
TrackerManager.i(trackerManager, bVar.a(), "update_updatenow", null, 4, null);
a.a.d(this.a);
g.b.a.a.c.a.b(bVar.a(), false);
SensorsDataAutoTrackHelper.trackViewOnClick(view);
}
}
public static final class b implements View.OnClickListener {
public final FragmentActivity a;
public b(FragmentActivity fragmentActivity) {
this.a = fragmentActivity;
}
@Override
@SensorsDataInstrumented
public final void onClick(View view) {
a aVar = a.a;
FragmentManager supportFragmentManager = this.a.getSupportFragmentManager();
t.e(supportFragmentManager, "activity.supportFragmentManager");
aVar.e(supportFragmentManager);
SensorsDataAutoTrackHelper.trackViewOnClick(view);
}
}
public static final class c implements View.OnClickListener {
public final FragmentActivity a;
public final j.z.b.a b;
public c(FragmentActivity fragmentActivity, j.z.b.a aVar) {
this.a = fragmentActivity;
this.b = aVar;
}
@Override
@SensorsDataInstrumented
public final void onClick(View view) {
TrackerManager.i(TrackerManager.a, g.b.a.b.b.a.a(), "update_cancel", null, 4, null);
a aVar = a.a;
FragmentManager supportFragmentManager = this.a.getSupportFragmentManager();
t.e(supportFragmentManager, "activity.supportFragmentManager");
aVar.e(supportFragmentManager);
j.z.b.a aVar2 = this.b;
if (aVar2 != null) {
}
SensorsDataAutoTrackHelper.trackViewOnClick(view);
}
}
public final l<BaseResponse<AppVersionData>> b() {
l compose = ((g.j.a.a.d.a) g.b.a.g.c.a.a(g.j.a.a.d.a.class)).M(new GetVersionRequest(p.a.b(g.b.a.b.b.a.a()))).compose(g.b.a.j.c.a.a());
t.e(compose, "RetrofitFactory.createAp…chedulerUtils.ioToMain())");
return compose;
}
public final boolean c(String str) {
List g2;
List g3;
t.f(str, "ver");
d dVar = d.z;
if (!t.b(dVar.t0(), str)) {
try {
List<String> split = new Regex("\\.").split(dVar.t0(), 0);
if (!split.isEmpty()) {
ListIterator<String> listIterator = split.listIterator(split.size());
while (listIterator.hasPrevious()) {
if (!(listIterator.previous().length() == 0)) {
g2 = CollectionsKt___CollectionsKt.b0(split, listIterator.nextIndex() + 1);
break;
}
}
}
g2 = j.u.t.g();
Object[] array = g2.toArray(new String[0]);
if (array != null) {
String[] strArr = (String[]) array;
List<String> split2 = new Regex("\\.").split(str, 0);
if (!split2.isEmpty()) {
ListIterator<String> listIterator2 = split2.listIterator(split2.size());
while (listIterator2.hasPrevious()) {
if (!(listIterator2.previous().length() == 0)) {
g3 = CollectionsKt___CollectionsKt.b0(split2, listIterator2.nextIndex() + 1);
break;
}
}
}
g3 = j.u.t.g();
Object[] array2 = g3.toArray(new String[0]);
if (array2 != null) {
String[] strArr2 = (String[]) array2;
int min = Math.min(strArr.length, strArr2.length);
for (int i2 = 0; i2 < min; i2++) {
int parseInt = Integer.parseInt(strArr[i2]);
int parseInt2 = Integer.parseInt(strArr2[i2]);
if (parseInt != parseInt2) {
return parseInt2 > parseInt;
}
}
} else {
throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T>");
}
} else {
throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T>");
}
} catch (Exception e2) {
g.j.a.a.m.a.a.c("UpdateHelper", e2.getMessage(), e2);
}
}
return false;
}
public final void d(Context context) {
try {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse("market://details?id=" + context.getPackageName()));
intent.setPackage("com.android.vending");
intent.addFlags(268435456);
if (intent.resolveActivity(context.getPackageManager()) != null) {
context.startActivity(intent);
} else {
Intent intent2 = new Intent("android.intent.action.VIEW");
intent2.setData(Uri.parse("https://play.google.com/store/apps/details?id=" + context.getPackageName()));
intent.addFlags(268435456);
if (intent2.resolveActivity(context.getPackageManager()) != null) {
context.startActivity(intent2);
}
}
} catch (Exception e2) {
g.j.a.a.m.a.a.c("UpdateHelper", e2.getMessage(), e2);
Intent intent3 = new Intent("android.intent.action.VIEW");
intent3.setData(Uri.parse("https://play.google.com/store/apps/details?id=" + context.getPackageName()));
intent3.addFlags(268435456);
if (intent3.resolveActivity(context.getPackageManager()) != null) {
context.startActivity(intent3);
}
}
}
public final void e(FragmentManager fragmentManager) {
t.f(fragmentManager, "fragmentManager");
try {
Fragment j0 = fragmentManager.j0("UpdateDialogFragment");
if (j0 == null || j0.isRemoving()) {
return;
}
q m2 = fragmentManager.m();
m2.q(j0);
m2.j();
} catch (Exception e2) {
g.j.a.a.m.a.a.c("UpdateHelper", e2.getMessage(), e2);
}
}
public final void f(FragmentActivity fragmentActivity, AppVersionData appVersionData, j.z.b.a<s> aVar) {
t.f(fragmentActivity, "activity");
t.f(appVersionData, "data");
if (fragmentActivity.isFinishing()) {
return;
}
a.C0225a c0225a = g.j.a.a.w.h.a.v;
boolean z = !t.b(appVersionData.isForce(), ServerProtocol.DIALOG_RETURN_SCOPES_TRUE);
String memo = appVersionData.getMemo();
if (memo == null) {
memo = "A new version is available.";
}
String version = appVersionData.getVersion();
if (version == null) {
version = "";
}
g.j.a.a.w.h.a a2 = c0225a.a(z, memo, version);
a2.show(fragmentActivity.getSupportFragmentManager(), "UpdateDialogFragment");
g.b.a.b.b bVar = g.b.a.b.b.a;
a2.n(bVar.a().getString(R.string.update_now), new ViewOnClickListenerC0202a(fragmentActivity));
if (t.b(appVersionData.isForce(), ServerProtocol.DIALOG_RETURN_SCOPES_TRUE)) {
a2.m("", new b(fragmentActivity));
} else {
a2.m(bVar.a().getString(R.string.cancel), new c(fragmentActivity, aVar));
}
}
}