ComeetChat v1.866866806590版本的 MD5 值为:4a7461802cd62adce19de75377dd7ca7
以下内容为反编译后的 q.java 源代码,内容仅作参考
package com.joaomgcd.taskerm.helper;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.widget.EditText;
import com.joaomgcd.taskerm.dialog.ad;
import com.joaomgcd.taskerm.dialog.ae;
import com.joaomgcd.taskerm.o.c;
import com.joaomgcd.taskerm.structuredoutput.StructureType;
import com.joaomgcd.taskerm.util.al;
import com.joaomgcd.taskerm.util.am;
import com.joaomgcd.taskerm.util.an;
import com.joaomgcd.taskerm.util.ao;
import com.joaomgcd.taskerm.util.ba;
import com.joaomgcd.taskerm.util.bd;
import com.joaomgcd.taskerm.util.cx;
import com.joaomgcd.taskerm.util.di;
import com.joaomgcd.taskerm.util.dx;
import java.util.List;
import java.util.concurrent.TimeUnit;
import net.danlew.android.joda.R;
import net.dinglisch.android.taskerm.Main;
import net.dinglisch.android.taskerm.bo;
import net.dinglisch.android.taskerm.dm;
import net.dinglisch.android.taskerm.ft;
import net.dinglisch.android.taskerm.fy;
import net.dinglisch.android.taskerm.gb;
public final class q extends com.joaomgcd.taskerm.helper.h<Main> {
private final ba<b.a.k.a> f7738a;
public static final class i extends c.f.b.l implements c.f.a.a<c.s> {
final List f7754b;
i(List list) {
super(0);
this.f7754b = list;
}
public static final class AnonymousClass1 extends c.f.b.l implements c.f.a.a<c.s> {
final gb f7756b;
AnonymousClass1(gb gbVar) {
super(0);
this.f7756b = gbVar;
}
@Override
public c.s invoke() {
a();
return c.s.f2131a;
}
public final void a() {
q.this.d().a(this.f7756b.K(), true);
}
}
@Override
public c.s invoke() {
a();
return c.s.f2131a;
}
public static final class a extends c.f.b.l implements c.f.a.b<gb, com.joaomgcd.taskerm.dialog.w> {
a() {
super(1);
}
@Override
public final com.joaomgcd.taskerm.dialog.w invoke(gb gbVar) {
c.f.b.k.b(gbVar, "it");
String a2 = gbVar.a(q.this.d());
c.f.b.k.a((Object) a2, "it.makeTitleText(activity)");
return new com.joaomgcd.taskerm.dialog.w(a2, null, false, 6, null);
}
}
public final void a() {
gb gbVar;
if (this.f7754b.size() == 1) {
gbVar = (gb) this.f7754b.get(0);
} else {
ae aeVar = (ae) com.joaomgcd.taskerm.dialog.k.a(new ad(q.this.d(), R.string.show_linked_profiles, this.f7754b, false, new a(), null, null, null, null, null, null, null, null, null, null, null, 65512, null)).b();
if (aeVar == null || (gbVar = (gb) aeVar.b()) == null) {
return;
}
}
gbVar.ad();
com.joaomgcd.taskerm.rx.h.e(new AnonymousClass1(gbVar));
}
}
public static final class b<T, R> implements b.a.d.g<T, R> {
final boolean f7741a;
final int f7742b;
final int f7743c;
b(boolean z, int i, int i2) {
this.f7741a = z;
this.f7742b = i;
this.f7743c = i2;
}
@Override
public Object apply(Object obj) {
return Integer.valueOf(a((com.joaomgcd.taskerm.dialog.x) obj));
}
public final int a(com.joaomgcd.taskerm.dialog.x xVar) {
Integer c2;
c.f.b.k.b(xVar, "it");
String j = xVar.j();
int intValue = (j == null || (c2 = c.l.n.c(j)) == null) ? 1 : c2.intValue();
return Math.min(Math.max(1, this.f7741a ? this.f7742b - intValue : this.f7742b + intValue), this.f7743c - 1);
}
}
public static final class c extends c.f.b.l implements c.f.a.a<c.s> {
final StructureType f7745b;
final String f7746c;
c(StructureType structureType, String str) {
super(0);
this.f7745b = structureType;
this.f7746c = str;
}
@Override
public c.s invoke() {
a();
return c.s.f2131a;
}
public final void a() {
com.joaomgcd.taskerm.structuredoutput.b.f9043a.a(q.this.d(), this.f7746c, this.f7745b);
}
}
public static final class d extends c.f.b.l implements c.f.a.b<c.k<? extends Integer, ? extends dm>, c.s> {
d() {
super(1);
}
@Override
public c.s invoke(c.k<? extends Integer, ? extends dm> kVar) {
a(kVar);
return c.s.f2131a;
}
public final void a(c.k<Integer, ? extends dm> kVar) {
c.f.b.k.b(kVar, "it");
q.this.d().c(kVar.a().intValue());
q.this.d().f(q.this.d().j());
}
}
public static final class f extends c.f.b.l implements c.f.a.a<c.s> {
f() {
super(0);
}
@Override
public c.s invoke() {
a();
return c.s.f2131a;
}
public final void a() {
try {
c.b b2 = com.joaomgcd.taskerm.o.c.f8360b.a(q.this.d(), false).b(20L, TimeUnit.SECONDS).b();
if (b2.a()) {
return;
}
if (!al.Y(q.this.d())) {
com.joaomgcd.taskerm.dialog.y.d(q.this.d(), R.string.licence_status_not_licensed, R.string.licence_feature_not_licensed_app).b();
}
try {
Intent b3 = b2.b();
if (b3 != null) {
al.a(q.this.d(), new cx(b3, false, 0, null, 14, null));
}
} catch (Exception e2) {
am.a(e2, q.this.d());
}
q.this.d().finish();
} catch (Exception e3) {
bo.a("T", "Can't check license", (Throwable) e3);
}
}
}
public static final class g extends c.f.b.l implements c.f.a.a<c.s> {
final Runnable f7751b;
g(Runnable runnable) {
super(0);
this.f7751b = runnable;
}
@Override
public c.s invoke() {
a();
return c.s.f2131a;
}
public final void a() {
q.this.a("init ended async");
this.f7751b.run();
}
}
public static final class j extends c.f.b.l implements c.f.a.a<c.s> {
final com.joaomgcd.taskerm.util.k f7759b;
j(com.joaomgcd.taskerm.util.k kVar) {
super(0);
this.f7759b = kVar;
}
@Override
public c.s invoke() {
a();
return c.s.f2131a;
}
public final void a() {
try {
com.joaomgcd.taskerm.dialog.x a2 = com.joaomgcd.taskerm.dialog.q.a(new com.joaomgcd.taskerm.dialog.d(q.this.d(), new a(), Integer.valueOf(dx.a((Context) q.this.d(), 200)), null, an.a(R.string.support_continuous_development, q.this.d()), ao.D(an.a(R.string.patreon_support, q.this.d(), new Object[0])), an.a(R.string.button_label_ok, q.this.d()), an.a(R.string.button_label_cancel, q.this.d()), an.a(R.string.button_label_stop_reminding, q.this.d()), null, null, 1544, null)).b().a();
if (a2.d()) {
com.joaomgcd.taskerm.q.b.b(q.this.u(), this.f7759b);
al.z(q.this.d());
} else if (a2.g()) {
com.joaomgcd.taskerm.q.b.b(q.this.u(), this.f7759b);
com.joaomgcd.taskerm.dialog.y.a(q.this.d(), an.a(R.string.support_on_patreon, q.this.d(), new Object[0]), an.a(R.string.patreon_support_negative_response, q.this.d(), new Object[0]), (com.joaomgcd.taskerm.util.i) null, 8, (Object) null).b();
}
} catch (Throwable th) {
com.joaomgcd.taskerm.rx.h.a(q.this.d(), th);
}
}
public static final class a extends c.f.b.l implements c.f.a.a<b.a.l<Bitmap>> {
a() {
super(0);
}
@Override
public final b.a.l<Bitmap> invoke() {
b.a.l<Bitmap> a2 = b.a.l.a(BitmapFactory.decodeResource(q.this.d().getResources(), R.drawable.patreon));
c.f.b.k.a((Object) a2, "Single.just(BitmapFactor…ces, R.drawable.patreon))");
return a2;
}
}
}
public static final class a {
private final boolean f7739a;
private final boolean f7740b;
public a(boolean z, boolean z2) {
this.f7739a = z;
this.f7740b = z2;
}
public final boolean a() {
return this.f7740b;
}
public a(boolean z) {
this(z, true);
}
}
public q(Main main) {
super(main);
c.f.b.k.b(main, "activity");
this.f7738a = bd.a(h.f7752a);
}
public final void e() {
a(new f());
}
public final b.a.l<Integer> a(int i2, boolean z, int i3) {
return com.joaomgcd.taskerm.dialog.y.a(new com.joaomgcd.taskerm.dialog.h((Activity) d(), R.string.how_many_positions, "1", 0, 0, 0, true, 16385, (String) null, 0, (Integer) null, 1848, (c.f.b.g) null)).c(new b(z, i2, i3));
}
public final void f() {
Main d2 = d();
fy fyVar = d().h;
c.f.b.k.a((Object) fyVar, "activity.data");
com.joaomgcd.taskerm.rx.h.a(com.joaomgcd.taskerm.dialog.y.a(d2, fyVar, R.string.word_project, (List) null, 8, (Object) null), d(), new d());
}
public static final class k extends Handler {
final dm f7762b;
k(dm dmVar) {
this.f7762b = dmVar;
}
@Override
public void handleMessage(Message message) {
c.f.b.k.b(message, "m");
if (message.what != 0) {
return;
}
Bundle data = message.getData();
c.f.b.k.a((Object) data, "m.getData()");
String string = data.getString("v");
if (string != null) {
this.f7762b.a((com.joaomgcd.taskerm.profile.k) com.joaomgcd.taskerm.n.b.a().a(string, com.joaomgcd.taskerm.profile.k.class));
}
q.this.d().f();
}
}
public final void a(int i2, dm dmVar) {
c.f.b.k.b(dmVar, "project");
com.joaomgcd.taskerm.profile.a.f8487b.a(d(), new k(dmVar), i2, dmVar).a(d());
}
public final void a(String str, String str2) {
if (str == null || str2 == null) {
return;
}
c.k<StructureType, di> a2 = StructureType.Companion.a(str2);
StructureType a3 = a2 != null ? a2.a() : null;
if (a3 == null) {
com.joaomgcd.taskerm.structuredoutput.b.f9043a.a(d(), str, (StructureType) null);
} else {
if (com.joaomgcd.taskerm.structuredoutput.b.f9043a.a(d(), str) == a3) {
return;
}
com.joaomgcd.taskerm.dialog.y.a(d(), R.string.an_set_variable_structure_type, new com.joaomgcd.taskerm.util.k(an.a(R.string.structure_global_variable_help, u(), an.a(a3.getStringResId(), u(), new Object[0]))), new c(a3, str));
}
}
static final class h extends c.f.b.l implements c.f.a.a<b.a.k.a> {
public static final h f7752a = new h();
h() {
super(0);
}
@Override
public final b.a.k.a invoke() {
return b.a.k.a.g();
}
}
public final void g() {
a("starting init");
this.f7738a.a();
}
public final void h() {
a("ending init");
this.f7738a.b().Q_();
}
public final void i() {
if (com.joaomgcd.taskerm.rx.h.c()) {
throw new IllegalStateException("Can't run waitForInitEnd on UI Thread");
}
a("waiting for init to end sync");
this.f7738a.b().b();
a("init ended sync");
}
public final boolean j() {
return !this.f7738a.b().h();
}
public final void g(Runnable runnable) {
c.f.b.k.b(runnable, "runnable");
if (j()) {
a("waiting for init to end async");
b.a.k.a b2 = this.f7738a.b();
c.f.b.k.a((Object) b2, "init.value");
a(com.joaomgcd.taskerm.rx.h.c(b2), new g(runnable));
return;
}
a("don't need to wait for init to end async");
runnable.run();
}
public final void a(String str) {
bo.b("T", str);
}
public final void k() {
al.a(u(), "https://taskernet.com/?public", true, false, true, 4, (Object) null);
}
public final void l() {
al.a(u(), "https://forum.joaoapps.com/index.php?resources", true, false, true, 4, (Object) null);
}
private final fy v() {
fy fyVar = d().h;
c.f.b.k.a((Object) fyVar, "activity.data");
return fyVar;
}
public static final class e extends c.f.b.l implements c.f.a.b<gb, String> {
e() {
super(1);
}
@Override
public final String invoke(gb gbVar) {
c.f.b.k.b(gbVar, "it");
return "- " + gbVar.a(q.this.d());
}
}
public final void a(ft ftVar) {
c.f.b.k.b(ftVar, "task");
List<gb> e2 = an.e(v(), ftVar);
List<gb> list = e2;
if (list == null || list.isEmpty()) {
ao.a(Integer.valueOf(R.string.task_not_linked_to_any_profiles), d());
} else {
a(new i(e2));
}
}
public final void m() {
List<gb> B = v().B(d().i());
c.f.b.k.a((Object) B, "data.getProfilesInProjec…tivity.curProjectIndex())");
for (gb gbVar : c.a.j.f((Iterable) B)) {
if (!gbVar.P()) {
gbVar.Q();
}
}
}
@SuppressLint({"CheckResult"})
public final boolean o() {
com.joaomgcd.taskerm.util.k i2 = ao.i("showpatreondialog");
if (com.joaomgcd.taskerm.q.b.a(u(), i2, null, 2, null) || al.j(d()) < 30 || v().y() < 10 || v().n() < 15 || v().A() < 3) {
return false;
}
a(new j(i2));
return true;
}
public final boolean p() {
Editable text;
String obj;
EditText editText = d().g;
if (editText == null || (text = editText.getText()) == null || (obj = text.toString()) == null) {
return false;
}
return ao.z(obj);
}
public final void q() {
EditText editText = d().g;
if (editText != null) {
editText.setText("");
}
}
public final boolean a(int[] iArr) {
c.f.b.k.b(iArr, "ids");
for (int i2 : iArr) {
List<gb> a2 = an.a(v(), Integer.valueOf(i2));
int size = a2.size();
if (size != 0) {
com.joaomgcd.taskerm.helper.j.a(this, com.joaomgcd.taskerm.dialog.y.c(d(), R.string.word_error, an.a(R.string.f_profile_delete_referenced, d(), Integer.valueOf(size)) + "\n\n" + c.a.j.a(a2, "\n", null, null, 0, null, new e(), 30, null)), (b.a.d.f) null, 2, (Object) null);
return false;
}
}
return true;
}
}