正在查看: Tasker v6.5.11 应用的 q.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Tasker v6.5.11 应用的 q.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.joaomgcd.taskerm.helper;
import android.annotation.SuppressLint;
import android.app.Activity;
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.view.KeyEvent;
import android.widget.EditText;
import android.widget.ImageView;
import com.joaomgcd.oldtaskercompat.aigenerator.ui.ActivityAIChat;
import com.joaomgcd.tasker2024.edittask.ActivityEditTask2024;
import com.joaomgcd.taskerm.settings.q0;
import com.joaomgcd.taskerm.share.ActivityReceiveShare;
import com.joaomgcd.taskerm.structuredoutput.StructureType;
import com.joaomgcd.taskerm.util.ExtensionsContextKt;
import com.joaomgcd.taskerm.util.j7;
import com.joaomgcd.taskerm.util.o2;
import com.joaomgcd.taskerm.util.p8;
import com.joaomgcd.taskerm.util.s6;
import com.joaomgcd.taskerm.util.u3;
import com.joaomgcd.taskerm.util.x2;
import com.joaomgcd.taskerm.util.x3;
import com.joaomgcd.taskerm.util.y6;
import com.joaomgcd.taskerm.util.z2;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import kotlin.Pair;
import lj.e0;
import net.dinglisch.android.taskerm.MacroEdit;
import net.dinglisch.android.taskerm.Main;
import net.dinglisch.android.taskerm.Settings;
import net.dinglisch.android.taskerm.c2;
import net.dinglisch.android.taskerm.dk;
import net.dinglisch.android.taskerm.r7;
import net.dinglisch.android.taskerm.tn;
import net.dinglisch.android.taskerm.to;
import net.dinglisch.android.taskerm.vi;
import net.dinglisch.android.taskerm.wo;
import net.dinglisch.android.taskerm.xi;
import pg.w0;
import we.i0;
import we.j2;
import we.k0;
import we.l0;
import we.v1;
import we.w1;
import yf.i;
public final class q extends com.joaomgcd.taskerm.helper.e<Main> {
private final u3<ij.a> l;
private final ij.b<e0> m;
public static final class a {
private final boolean a;
private final boolean b;
public a(boolean z, boolean z2) {
this.a = z;
this.b = z2;
}
public final boolean a() {
return this.b;
}
public a(boolean z) {
this(z, true);
}
}
private static final class b {
public static final b i = new b("Preferences", 0);
public static final b q = new b("ToggleTasker", 1);
public static final b r = new b("SaveSetup", 2);
public static final b s = new b("LicenseValidation", 3);
private static final b[] t;
private static final rj.a u;
static {
b[] a = a();
t = a;
u = rj.b.a(a);
}
private b(String str, int i2) {
}
private static final b[] a() {
return new b[]{i, q, r, s};
}
public static b valueOf(String str) {
return (b) Enum.valueOf(b.class, str);
}
public static b[] values() {
return (b[]) t.clone();
}
}
private static final class c {
private final tn a;
private final tn b;
private final List<net.dinglisch.android.taskerm.c> c;
public c(tn tnVar, tn tnVar2, List<? extends net.dinglisch.android.taskerm.c> list) {
yj.p.i(tnVar, "originalTask");
yj.p.i(tnVar2, "taskThatReferencesOriginal");
yj.p.i(list, "performTaskActionsInTaskThatReferenceOriginal");
this.a = tnVar;
this.b = tnVar2;
this.c = list;
}
public final tn a() {
return this.a;
}
public final tn b() {
return this.b;
}
}
static final class d extends yj.q implements xj.l<l0, Integer> {
final boolean i;
final int q;
final int r;
d(boolean z, int i, int i2) {
super(1);
this.i = z;
this.q = i;
this.r = i2;
}
@Override
public final Integer invoke(l0 l0Var) {
Integer m;
yj.p.i(l0Var, "it");
String c = l0Var.c();
int intValue = (c == null || (m = hk.o.m(c)) == null) ? 1 : m.intValue();
return Integer.valueOf(Math.min(Math.max(1, this.i ? this.q - intValue : this.q + intValue), this.r - 1));
}
}
static final class e extends yj.q implements xj.a<e0> {
final String q;
final StructureType r;
e(String str, StructureType structureType) {
super(0);
this.q = str;
this.r = structureType;
}
public final void a() {
com.joaomgcd.taskerm.structuredoutput.b.a.c(q.this.w0(), this.q, this.r);
}
@Override
public e0 invoke() {
a();
return e0.a;
}
}
static final class f extends yj.q implements xj.l<Pair<? extends Integer, ? extends xi>, e0> {
f() {
super(1);
}
public final void a(Pair<Integer, ? extends xi> pair) {
yj.p.i(pair, "it");
q.this.w0().q7(pair.getFirst().intValue());
q.this.w0().Z4(q.this.w0().D5());
}
@Override
public e0 invoke(Pair<? extends Integer, ? extends xi> pair) {
a(pair);
return e0.a;
}
}
static final class g extends yj.q implements xj.a<e0> {
final int[] i;
final boolean q;
final List<Pair<tn, List<c>>> r;
final xj.l<c, e0> s;
final q t;
final xj.l<int[], e0> u;
static final class a extends yj.q implements xj.a<e0> {
final q i;
final int q;
a(q qVar, int i) {
super(0);
this.i = qVar;
this.q = i;
}
public final void a() {
this.i.w0().Vc(this.q);
}
@Override
public e0 invoke() {
a();
return e0.a;
}
}
static final class b extends yj.q implements xj.a<e0> {
final xj.l<int[], e0> i;
final int[] q;
b(xj.l<? super int[], e0> lVar, int[] iArr) {
super(0);
this.i = lVar;
this.q = iArr;
}
public final void a() {
this.i.invoke(this.q);
}
@Override
public e0 invoke() {
a();
return e0.a;
}
}
static final class c extends yj.q implements xj.l<c, k0> {
final q i;
c(q qVar) {
super(1);
this.i = qVar;
}
@Override
public final k0 invoke(c cVar) {
yj.p.i(cVar, "it");
return new k0(this.i.Z1(cVar), (net.dinglisch.android.taskerm.g) null, false, 6, (yj.h) null);
}
}
static final class d extends yj.q implements xj.l<c, k0> {
final q i;
d(q qVar) {
super(1);
this.i = qVar;
}
@Override
public final k0 invoke(c cVar) {
yj.p.i(cVar, "it");
return new k0(this.i.Z1(cVar), (net.dinglisch.android.taskerm.g) null, false, 6, (yj.h) null);
}
}
static final class e extends yj.q implements xj.l<Pair<? extends tn, ? extends List<? extends c>>, k0> {
final q i;
e(q qVar) {
super(1);
this.i = qVar;
}
@Override
public final k0 invoke(Pair<? extends tn, ? extends List<c>> pair) {
yj.p.i(pair, "it");
tn first = pair.getFirst();
List<c> second = pair.getSecond();
q qVar = this.i;
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(second, 10));
Iterator<T> it = second.iterator();
while (it.hasNext()) {
arrayList.add(qVar.Z1((c) it.next()));
}
String string = this.i.u().getString(2131891292, first.k(), kotlin.collections.r.m0(arrayList, ", ", null, null, 0, null, null, 62, null));
yj.p.h(string, "getString(...)");
return new k0(string, (net.dinglisch.android.taskerm.g) null, false, 6, (yj.h) null);
}
}
g(int[] iArr, boolean z, List<? extends Pair<? extends tn, ? extends List<c>>> list, xj.l<? super c, e0> lVar, q qVar, xj.l<? super int[], e0> lVar2) {
super(0);
this.i = iArr;
this.q = z;
this.r = list;
this.s = lVar;
this.t = qVar;
this.u = lVar2;
}
private static final <T> T c(q qVar, xj.l<? super int[], e0> lVar, int[] iArr, List<? extends T> list, xj.l<? super T, e0> lVar2, xj.l<? super T, k0> lVar3) {
w1 w1Var = (w1) we.x.C(new v1(qVar.w0(), 2131890704, list, false, lVar3, (Integer) null, lVar2, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, x2.H4(2131886891, qVar.w0()), x2.H4(2131887371, qVar.w0()), (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 59304, (yj.h) null)).f();
if (!w1Var.a().k()) {
return (T) w1Var.c();
}
w0.q0(new b(lVar, iArr));
return null;
}
static Object d(q qVar, xj.l lVar, int[] iArr, List list, xj.l lVar2, xj.l lVar3, int i, Object obj) {
if ((i & 16) != 0) {
lVar2 = null;
}
return c(qVar, lVar, iArr, list, lVar2, lVar3);
}
public final void a() {
c cVar;
int[] iArr = this.i;
if (iArr.length != 1 || this.q) {
q qVar = this.t;
Pair pair = (Pair) d(qVar, this.u, iArr, this.r, null, new e(qVar), 16, null);
if (pair == null) {
return;
}
List list = (List) pair.getSecond();
if (list.size() == 1) {
cVar = (c) kotlin.collections.r.d0(list);
} else {
cVar = (c) ((w1) we.x.C(new v1(this.t.w0(), 2131890317, list, false, new d(this.t), (Integer) null, this.s, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, x2.H4(2131886867, this.t.w0()), (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 61352, (yj.h) null)).f()).c();
}
} else {
cVar = (c) c(this.t, this.u, iArr, (List) ((Pair) kotlin.collections.r.d0(this.r)).getSecond(), this.s, new c(this.t));
}
if (cVar == null) {
return;
}
w0.q0(new a(this.t, cVar.b().P0()));
}
@Override
public e0 invoke() {
a();
return e0.a;
}
}
static final class h extends yj.q implements xj.l<c, e0> {
h() {
super(1);
}
public final void a(c cVar) {
yj.p.i(cVar, "it");
q.this.w0().F6(cVar.b().P0());
}
@Override
public e0 invoke(c cVar) {
a(cVar);
return e0.a;
}
}
static final class i extends yj.q implements xj.l<wo, CharSequence> {
i() {
super(1);
}
@Override
public final CharSequence invoke(wo woVar) {
yj.p.i(woVar, "it");
return "- " + woVar.l1(q.this.w0());
}
}
static final class j extends yj.q implements xj.l<int[], e0> {
final xj.a<e0> i;
j(xj.a<e0> aVar) {
super(1);
this.i = aVar;
}
public final void a(int[] iArr) {
yj.p.i(iArr, "it");
this.i.invoke();
}
@Override
public e0 invoke(int[] iArr) {
a(iArr);
return e0.a;
}
}
static final class k extends yj.q implements xj.a<e0> {
static final class a extends yj.q implements xj.a<l0> {
final q i;
a(q qVar) {
super(0);
this.i = qVar;
}
@Override
public final l0 invoke() {
return (l0) com.joaomgcd.taskerm.dialog.a.d1(this.i.w0(), 2131888395, 2131888381).f();
}
}
k() {
super(0);
}
public final void a() {
Intent b;
try {
i.b f = yf.i.m.q(q.this.w0()).f();
if (f.a()) {
return;
}
if (!ExtensionsContextKt.H2(q.this.w0())) {
x2.U4(null, new a(q.this), 1, null);
}
try {
if (q.this.w0().A() && (b = f.b()) != null) {
ExtensionsContextKt.s3(q.this.w0(), new y6(b, false, 0, null, 14, null));
}
} catch (Exception e) {
o2.i(e, q.this.w0());
}
q.this.w0().finish();
} catch (Exception e2) {
r7.g("T", "Can't check license", e2);
}
}
@Override
public e0 invoke() {
a();
return e0.a;
}
}
static final class l extends yj.q implements xj.a<e0> {
final Runnable q;
l(Runnable runnable) {
super(0);
this.q = runnable;
}
public final void a() {
q.this.n2("init ended async");
this.q.run();
}
@Override
public e0 invoke() {
a();
return e0.a;
}
}
static final class m extends yj.q implements xj.a<e0> {
public class a {
public static final int[] a;
static {
int[] iArr = new int[b.values().length];
try {
iArr[b.i.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[b.q.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
iArr[b.r.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
iArr[b.s.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
a = iArr;
}
}
public static final class b extends yj.q implements xj.l<b, String> {
public static final b i = new b();
public b() {
super(1);
}
@Override
public final String invoke(b bVar) {
yj.p.i(bVar, "it");
return z2.K(bVar.name());
}
}
public static final class c extends yj.q implements xj.l<b, Boolean> {
public static final c i = new c();
public c() {
super(1);
}
@Override
public final Boolean invoke(b bVar) {
yj.p.i(bVar, "it");
return Boolean.TRUE;
}
}
m() {
super(0);
}
public final void a() {
b bVar = (b) we.x.G(q.this.w0(), "TV Options", b.class, b.i, c.i).f();
int i = bVar == null ? -1 : a.a[bVar.ordinal()];
if (i == 1) {
q.this.B2();
return;
}
if (i == 2) {
q.this.w0().u5();
} else if (i == 3) {
q.this.w0().J5();
} else {
if (i != 4) {
return;
}
q.this.w0().Pc(false, false);
}
}
@Override
public e0 invoke() {
a();
return e0.a;
}
}
static final class n extends yj.q implements xj.a<Boolean> {
final boolean q;
static final class a extends yj.q implements xj.l<String, e0> {
public static final a i = new a();
a() {
super(1);
}
public final void invoke2(String str) {
yj.p.i(str, "it");
}
@Override
public e0 invoke(String str) {
invoke2(str);
return e0.a;
}
}
n(boolean z) {
super(0);
this.q = z;
}
@Override
public final Boolean invoke() {
s6 s6Var;
String o0 = ExtensionsContextKt.o0(q.this.w0());
if (o0 == null) {
return Boolean.FALSE;
}
boolean i0 = z2.i0(o0);
boolean i = com.joaomgcd.taskerm.datashare.export.a.a.i(o0);
if (!i0 && !i) {
return Boolean.FALSE;
}
if (this.q && !((l0) com.joaomgcd.taskerm.dialog.a.t3(q.this.w0(), 2131888289, 2131887375, 0, 8, (Object) null).f()).o()) {
return Boolean.FALSE;
}
if (i0) {
s6Var = (s6) com.joaomgcd.taskerm.datashare.export.d.x(q.this.w0(), o0, (xj.l) null, 4, (Object) null).f();
} else {
if (!i) {
return Boolean.FALSE;
}
s6Var = (s6) com.joaomgcd.taskerm.datashare.export.d.o(q.this.w0(), false, o0, true, false, false, a.i, 48, (Object) null).f();
}
return !s6Var.b() ? Boolean.FALSE : Boolean.TRUE;
}
}
static final class o extends yj.q implements xj.a<ij.a> {
public static final o i = new o();
o() {
super(0);
}
@Override
public final ij.a invoke() {
return ij.a.L();
}
}
static final class p extends yj.q implements xj.a<List<? extends Integer>> {
final List<Object> i;
p(List<? extends Object> list) {
super(0);
this.i = list;
}
@Override
public final List<? extends Integer> invoke() {
List<Object> list = this.i;
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(list, 10));
for (Object obj : list) {
yj.p.g(obj, "null cannot be cast to non-null type net.dinglisch.android.taskerm.TaskerProfile");
arrayList.add(Integer.valueOf(((wo) obj).C0()));
}
return arrayList;
}
}
static final class C0021q extends yj.q implements xj.p<Integer, Integer, e0> {
C0021q() {
super(2);
}
public final void a(int i, int i2) {
q.this.X1().R3(i, i2);
}
@Override
public e0 l(Integer num, Integer num2) {
a(num.intValue(), num2.intValue());
return e0.a;
}
}
static final class r extends yj.q implements xj.a<List<? extends String>> {
final List<Object> i;
r(List<? extends Object> list) {
super(0);
this.i = list;
}
@Override
public final List<? extends String> invoke() {
List<Object> list = this.i;
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(list, 10));
for (Object obj : list) {
yj.p.g(obj, "null cannot be cast to non-null type net.dinglisch.android.taskerm.Scene");
arrayList.add(((dk) obj).getName());
}
return arrayList;
}
}
static final class s extends yj.q implements xj.p<String, Integer, e0> {
s() {
super(2);
}
public final void a(String str, int i) {
q.this.X1().U3(str, i);
}
@Override
public e0 l(String str, Integer num) {
a(str, num.intValue());
return e0.a;
}
}
static final class t extends yj.q implements xj.a<List<? extends Integer>> {
final List<Object> i;
t(List<? extends Object> list) {
super(0);
this.i = list;
}
@Override
public final List<? extends Integer> invoke() {
List<Object> list = this.i;
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(list, 10));
for (Object obj : list) {
yj.p.g(obj, "null cannot be cast to non-null type net.dinglisch.android.taskerm.Task");
arrayList.add(Integer.valueOf(((tn) obj).P0()));
}
return arrayList;
}
}
static final class u extends yj.q implements xj.p<Integer, Integer, e0> {
u() {
super(2);
}
public final void a(int i, int i2) {
q.this.X1().W3(i, i2);
}
@Override
public e0 l(Integer num, Integer num2) {
a(num.intValue(), num2.intValue());
return e0.a;
}
}
static final class v extends yj.q implements xj.a<e0> {
final List<wo> i;
final q q;
static final class a extends yj.q implements xj.a<e0> {
final q i;
final wo q;
a(q qVar, wo woVar) {
super(0);
this.i = qVar;
this.q = woVar;
}
public final void a() {
this.i.w0().E6(this.q.C0(), true);
}
@Override
public e0 invoke() {
a();
return e0.a;
}
}
static final class b extends yj.q implements xj.l<wo, k0> {
final q i;
b(q qVar) {
super(1);
this.i = qVar;
}
@Override
public final k0 invoke(wo woVar) {
yj.p.i(woVar, "it");
String l1 = woVar.l1(this.i.w0());
yj.p.h(l1, "makeTitleText(...)");
return new k0(l1, (net.dinglisch.android.taskerm.g) null, false, 6, (yj.h) null);
}
}
v(List<? extends wo> list, q qVar) {
super(0);
this.i = list;
this.q = qVar;
}
public final void a() {
wo woVar;
if (this.i.size() == 1) {
woVar = this.i.get(0);
} else {
w1 w1Var = (w1) we.x.C(new v1(this.q.w0(), 2131890587, this.i, false, new b(this.q), (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65512, (yj.h) null)).f();
if (w1Var == null || (woVar = (wo) w1Var.c()) == null) {
return;
}
}
woVar.x0();
w0.q0(new a(this.q, woVar));
}
@Override
public e0 invoke() {
a();
return e0.a;
}
}
static final class w extends yj.q implements xj.a<e0> {
final com.joaomgcd.taskerm.util.s q;
static final class a extends yj.q implements xj.a<ji.r<Bitmap>> {
final q i;
a(q qVar) {
super(0);
this.i = qVar;
}
@Override
public final ji.r<Bitmap> invoke() {
ji.r<Bitmap> w = ji.r.w(BitmapFactory.decodeResource(this.i.w0().getResources(), 2131232639));
yj.p.h(w, "just(...)");
return w;
}
}
w(com.joaomgcd.taskerm.util.s sVar) {
super(0);
this.q = sVar;
}
public final void a() {
try {
l0 a2 = ((j2) i0.c(new we.g(q.this.w0(), new a(q.this), Integer.valueOf(p8.c(q.this.w0(), 200)), (Integer) null, x2.H4(2131890694, q.this.w0()), z2.m(x2.Q4(2131889377, q.this.w0(), new Object[0])), x2.H4(2131886891, q.this.w0()), x2.H4(2131886867, q.this.w0()), x2.H4(2131886902, q.this.w0()), (Boolean) null, (Integer) null, 1544, (yj.h) null)).f()).a();
if (a2.o()) {
jg.c.u(q.this.u(), this.q);
ExtensionsContextKt.j(q.this.w0());
} else if (a2.n()) {
jg.c.u(q.this.u(), this.q);
com.joaomgcd.taskerm.dialog.a.j1(q.this.w0(), x2.Q4(2131890695, q.this.w0(), new Object[0]), x2.Q4(2131889378, q.this.w0(), new Object[0]), (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, 24, (Object) null).f();
}
} catch (Throwable th2) {
w0.X0(q.this.w0(), th2);
}
}
@Override
public e0 invoke() {
a();
return e0.a;
}
}
public static final class x extends Handler {
final xi a;
final q b;
x(xi xiVar, q qVar) {
this.a = xiVar;
this.b = qVar;
}
@Override
public void handleMessage(Message message) {
yj.p.i(message, "m");
if (message.what != 0) {
return;
}
Bundle data = message.getData();
yj.p.h(data, "getData(...)");
String string = data.getString("v");
if (string != null) {
this.a.s0((kg.w0) wf.c.a().h(string, kg.w0.class));
}
this.a.k0(data.getString("c"));
this.b.w0().Ta();
}
}
public q(Main main) {
super(main);
yj.p.i(main, "activity");
this.l = x3.c(o.i);
ij.b<e0> A0 = ij.b.A0();
yj.p.h(A0, "create(...)");
this.m = A0;
}
public final void B2() {
w0().Ic(Settings.D1(w0(), false, -1), 3);
}
public static final Integer L1(xj.l lVar, Object obj) {
yj.p.i(lVar, "$tmp0");
yj.p.i(obj, "p0");
return (Integer) lVar.invoke(obj);
}
public final to X1() {
to toVar = w0().S;
yj.p.h(toVar, "data");
return toVar;
}
public final String Z1(c cVar) {
String G0;
String Q4;
tn b2 = cVar.b();
if (b2.u()) {
String name = b2.getName();
yj.p.f(name);
return name;
}
wo woVar = (wo) kotlin.collections.r.f0(x2.I2(X1(), Integer.valueOf(b2.P0())));
String Z0 = (woVar == null || (G0 = woVar.G0(w0())) == null || (Q4 = x2.Q4(2131891038, w0(), G0)) == null) ? b2.Z0() : Q4;
yj.p.f(Z0);
return Z0;
}
private final List<c> c2(int[] iArr) {
c cVar;
Set<Integer> Q1 = X1().Q1();
yj.p.h(Q1, "getMacroIDSet(...)");
Set<Integer> set = Q1;
ArrayList<tn> arrayList = new ArrayList(kotlin.collections.r.v(set, 10));
for (Integer num : set) {
to X1 = X1();
yj.p.f(num);
arrayList.add(X1.R(num.intValue()));
}
ArrayList arrayList2 = new ArrayList(iArr.length);
for (int i2 : iArr) {
tn R = X1().R(i2);
ArrayList arrayList3 = new ArrayList();
for (tn tnVar : arrayList) {
List<net.dinglisch.android.taskerm.c> D0 = tnVar.D0();
yj.p.h(D0, "getActions(...)");
ArrayList arrayList4 = new ArrayList();
for (Object obj : D0) {
net.dinglisch.android.taskerm.c cVar2 = (net.dinglisch.android.taskerm.c) obj;
if (cVar2.j() == 130 && yj.p.d(cVar2.N(0).w(), R.getName())) {
arrayList4.add(obj);
}
}
if (arrayList4.isEmpty()) {
cVar = null;
} else {
yj.p.f(R);
yj.p.f(tnVar);
cVar = new c(R, tnVar, arrayList4);
}
if (cVar != null) {
arrayList3.add(cVar);
}
}
arrayList2.add(arrayList3);
}
return kotlin.collections.r.w(arrayList2);
}
public static ji.r k2(q qVar, boolean z, int i2, Object obj) {
if ((i2 & 1) != 0) {
z = false;
}
return qVar.j2(z);
}
public final void n2(String str) {
r7.f("T", str);
}
private final <TId> void r2(final c2.a aVar, final xj.a<? extends List<? extends TId>> aVar2, final xj.p<? super TId, ? super Integer, e0> pVar) {
R(com.joaomgcd.taskerm.dialog.a.Q1(w0(), X1(), 2131890314, (List) null, 8, (Object) null), new oi.d() {
@Override
public final void accept(Object obj) {
com.joaomgcd.taskerm.helper.q.s2(xj.a.this, this, aVar, pVar, (Pair) obj);
}
});
}
public static final void s2(xj.a aVar, q qVar, c2.a aVar2, xj.p pVar, Pair pair) {
yj.p.i(aVar, "$idsGetter");
yj.p.i(qVar, "this$0");
yj.p.i(aVar2, "$entityType");
yj.p.i(pVar, "$mover");
yj.p.i(pair, "pair");
List list = (List) aVar.invoke();
int intValue = ((Number) pair.getFirst()).intValue();
Iterator it = list.iterator();
while (it.hasNext()) {
pVar.l(it.next(), Integer.valueOf(intValue));
}
qVar.w0().K6(false, aVar2);
qVar.w0().v();
}
public static final void t2(q qVar, e0 e0Var) {
yj.p.i(qVar, "this$0");
vi viVar = qVar.w0().x;
if (viVar == null) {
return;
}
r7.f("T", "Notifying profile adapter of change");
viVar.notifyDataSetChanged();
}
private final void z2() {
w0().Ic(new Intent(u(), (Class<?>) ActivityAIChat.class), 33);
}
public final void A2() {
n2("starting init");
this.l.a();
}
public final void C2() {
if (w0.Y0()) {
throw new IllegalStateException("Can't run waitForInitEnd on UI Thread");
}
n2("waiting for init to end sync");
this.l.getValue().h();
n2("init ended sync");
}
@Override
public void I() {
super.I();
ji.n<e0> Y = this.m.o(250L, TimeUnit.MILLISECONDS).Y(li.a.b());
yj.p.h(Y, "observeOn(...)");
M(Y, new oi.d() {
@Override
public final void accept(Object obj) {
com.joaomgcd.taskerm.helper.q.t2(com.joaomgcd.taskerm.helper.q.this, (lj.e0) obj);
}
});
}
public final ji.r<Integer> K1(int i2, boolean z, int i3) {
ji.r e3 = com.joaomgcd.taskerm.dialog.a.e3(new we.k(w0(), 2131888239, "1", 0, 0, 0, true, 16385, (String) null, 0, (Integer) null, 1848, (yj.h) null));
final d dVar = new d(z, i2, i3);
ji.r<Integer> x2 = e3.x(new oi.e() {
@Override
public final Object a(Object obj) {
Integer L1;
L1 = com.joaomgcd.taskerm.helper.q.L1(xj.l.this, obj);
return L1;
}
});
yj.p.h(x2, "map(...)");
return x2;
}
public final void M1(String str, String str2) {
if (str == null || str2 == null) {
return;
}
Pair<StructureType, j7> a2 = StructureType.Companion.a(str2);
StructureType first = a2 != null ? a2.getFirst() : null;
if (first == null) {
com.joaomgcd.taskerm.structuredoutput.b.a.c(w0(), str, null);
} else {
if (com.joaomgcd.taskerm.structuredoutput.b.a.a(w0(), str) == first) {
return;
}
com.joaomgcd.taskerm.dialog.a.x1(w0(), 2131886559, new com.joaomgcd.taskerm.util.s(x2.Q4(2131890680, u(), x2.Q4(first.getStringResId(), u(), new Object[0]))), new e(str, first));
}
}
public final void N1() {
Main w0 = w0();
to toVar = w0().S;
yj.p.h(toVar, "data");
w0.F1(com.joaomgcd.taskerm.dialog.a.Q1(w0, toVar, 2131891224, (List) null, 8, (Object) null), w0(), new f());
}
public final int O1(int i2, int i3) {
return !w0().N7() ? i2 : (i3 - i2) - 1;
}
public final boolean P1(int[] iArr, boolean z, boolean z2, xj.l<? super int[], e0> lVar) {
yj.p.i(iArr, "ids");
yj.p.i(lVar, "handleDelete");
List<c> c2 = c2(iArr);
if (c2.isEmpty()) {
return true;
}
h hVar = new h();
ArrayList arrayList = new ArrayList(iArr.length);
for (int i2 : iArr) {
arrayList.add(Integer.valueOf(X1().H(i2)));
}
List X = kotlin.collections.r.X(arrayList);
LinkedHashMap linkedHashMap = new LinkedHashMap();
for (Object obj : c2) {
Integer valueOf = Integer.valueOf(((c) obj).a().n1(X1()));
Object obj2 = linkedHashMap.get(valueOf);
if (obj2 == null) {
obj2 = new ArrayList();
linkedHashMap.put(valueOf, obj2);
}
((List) obj2).add(obj);
}
List N0 = kotlin.collections.r.N0(linkedHashMap.keySet());
if (!z2 && X.size() == 1 && N0.size() == 1 && ((Number) X.get(0)).intValue() == ((Number) N0.get(0)).intValue()) {
return true;
}
LinkedHashMap linkedHashMap2 = new LinkedHashMap();
for (Object obj3 : c2) {
tn a2 = ((c) obj3).a();
Object obj4 = linkedHashMap2.get(a2);
if (obj4 == null) {
obj4 = new ArrayList();
linkedHashMap2.put(a2, obj4);
}
((List) obj4).add(obj3);
}
ArrayList arrayList2 = new ArrayList(linkedHashMap2.size());
for (Map.Entry entry : linkedHashMap2.entrySet()) {
arrayList2.add(new Pair(entry.getKey(), entry.getValue()));
}
q(new g(iArr, z, arrayList2, hVar, this, lVar));
return false;
}
public final boolean Q1(int[] iArr) {
yj.p.i(iArr, "ids");
for (int i2 : iArr) {
List<wo> I2 = x2.I2(X1(), Integer.valueOf(i2));
int size = I2.size();
if (size != 0) {
com.joaomgcd.taskerm.helper.i.U(this, com.joaomgcd.taskerm.dialog.a.e1(w0(), 2131891164, x2.Q4(2131887880, w0(), Integer.valueOf(size)) + "\n\n" + kotlin.collections.r.m0(I2, "\n", null, null, 0, null, new i(), 30, null)), null, 2, null);
return false;
}
}
return true;
}
public final boolean R1(int i2, xj.a<e0> aVar) {
yj.p.i(aVar, "handleDelete");
Set<Integer> J = X1().w(i2).J();
yj.p.f(J);
return P1(kotlin.collections.r.M0(J), true, false, new j(aVar));
}
public final void S1() {
q(new k());
}
public final void T1() {
EditText editText = w0().B;
if (editText != null) {
editText.setText("");
}
}
public final void U1() {
List<wo> q2 = X1().q2(w0().C5());
yj.p.h(q2, "getProfilesInProject(...)");
for (wo woVar : kotlin.collections.r.a0(q2)) {
if (!woVar.f1()) {
woVar.K1();
}
}
}
public final void V1(Runnable runnable) {
yj.p.i(runnable, "runnable");
if (!m2()) {
n2("don't need to wait for init to end async");
runnable.run();
} else {
n2("waiting for init to end async");
ij.a value = this.l.getValue();
yj.p.h(value, "<get-value>(...)");
O(w0.h1(value), new l(runnable));
}
}
public final void W1() {
n2("ending init");
this.l.getValue().a();
}
public final boolean Y1() {
Editable text;
String obj;
EditText editText = w0().B;
if (editText == null || (text = editText.getText()) == null || (obj = text.toString()) == null) {
return false;
}
return z2.h0(obj);
}
public final void a2() {
ExtensionsContextKt.i(w0());
}
public final Class<? extends Activity> b2() {
return q0.x(w0()) ? ActivityEditTask2024.class : MacroEdit.class;
}
public final void d2() {
z2();
}
public final void e2(Intent intent) {
if (w0().n6("handleGenerateResult") == null) {
return;
}
w0().K6(false, c2.a.Profile, c2.a.Task);
w0().I7();
}
public final boolean f2() {
if (ExtensionsContextKt.J2(w0())) {
q(new m());
return true;
}
z2();
return true;
}
public final boolean g2(int i2, KeyEvent keyEvent) {
yj.p.i(keyEvent, "event");
if (!keyEvent.isCtrlPressed() || i2 != 50) {
return false;
}
com.joaomgcd.taskerm.helper.i.U(this, k2(this, false, 1, null), null, 2, null);
return true;
}
public final void h2() {
ImageView imageView = w0().L;
if (imageView == null) {
return;
}
imageView.setVisibility(q0.a(w0()) ? 0 : 8);
}
public final void i2() {
com.joaomgcd.taskerm.helper.i.T(this, ExtensionsContextKt.y(u(), ActivityReceiveShare.class, !com.joaomgcd.taskerm.event.app.f.k.b(u()).isEmpty()), null, 2, null);
}
public final ji.r<Boolean> j2(boolean z) {
return C(new n(z));
}
public final void l2() {
ExtensionsContextKt.q(u(), "https://taskernet.com/?public", true, false, true, 4, null);
}
public final boolean m2() {
return !this.l.getValue().M();
}
public final void o2(List<? extends Object> list) {
yj.p.i(list, "taskerProfiles");
r2(c2.a.Profile, new p(list), new C0021q());
}
public final void p2(List<? extends Object> list) {
yj.p.i(list, "scenes");
r2(c2.a.Scene, new r(list), new s());
}
public final void q2(List<? extends Object> list) {
yj.p.i(list, "tasks");
r2(c2.a.Task, new t(list), new u());
}
public final void u2() {
ExtensionsContextKt.q(u(), "https://forum.joaoapps.com/index.php?resources", true, false, true, 4, null);
}
public final void v2() {
this.m.f(e0.a);
}
public final void w2(tn tnVar) {
yj.p.i(tnVar, "task");
List<wo> J2 = x2.J2(X1(), tnVar);
if (J2 == null || J2.isEmpty()) {
z2.L0(2131890705, w0());
} else {
q(new v(J2, this));
}
}
@SuppressLint({"CheckResult"})
public final boolean x2() {
com.joaomgcd.taskerm.util.s l2 = z2.l("showpatreondialog");
if (jg.c.t(u(), l2, null, 2, null) || ExtensionsContextKt.B0(w0()) < 30 || X1().b2() < 10 || X1().e2() < 15 || X1().c2() < 3) {
return false;
}
q(new w(l2));
return true;
}
public final void y2(int i2, xi xiVar) {
yj.p.i(xiVar, "project");
kg.c.s.a(w0(), new x(xiVar, this), i2, xiVar).l(w0());
}
}