导航菜单

页面标题

页面副标题

Tasker v6.6.3 - ShareDataConfig.java 源代码

正在查看: Tasker v6.6.3 应用的 ShareDataConfig.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.joaomgcd.taskerm.datashare.export;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.SeekBar;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.joaomgcd.taskerm.datashare.export.ShareDataConfig;
import com.joaomgcd.taskerm.datashare.export.a;
import com.joaomgcd.taskerm.dialog.b;
import com.joaomgcd.taskerm.signin.a;
import com.joaomgcd.taskerm.util.ExtensionsContextKt;
import com.joaomgcd.taskerm.util.ac;
import com.joaomgcd.taskerm.util.b7;
import com.joaomgcd.taskerm.util.h5;
import com.joaomgcd.taskerm.util.l7;
import com.joaomgcd.taskerm.util.se;
import com.joaomgcd.taskerservercommon.datashare.DataShareTag;
import com.joaomgcd.taskerservercommon.response.ResponseGetTags;
import df.i8;
import df.n;
import df.o1;
import df.p1;
import df.s7;
import df.t7;
import df.x0;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import jk.h;
import jk.k0;
import jk.p;
import jk.v;
import kotlin.collections.t;
import net.dinglisch.android.taskerm.HTMLView;
import net.dinglisch.android.taskerm.HasArgsEdit;
import net.dinglisch.android.taskerm.MyCheckBox;
import net.dinglisch.android.taskerm.f5;
import net.dinglisch.android.taskerm.fn;
import net.dinglisch.android.taskerm.fo;
import net.dinglisch.android.taskerm.o7;
import net.dinglisch.android.taskerm.pi;
import net.dinglisch.android.taskerm.pp;
import net.dinglisch.android.taskerm.um;
import qk.j;
import rg.l;
import rg.m;
import sk.q;
import ti.r;
import vj.e0;
import vj.k;
import xg.e2;

public final class ShareDataConfig extends HasArgsEdit {
    static final j<Object>[] v0 = {k0.e(new v(ShareDataConfig.class, "userAgreedToConditions", "getUserAgreedToConditions()Z", 0)), k0.e(new v(ShareDataConfig.class, "timesOpenedThisScreen", "getTimesOpenedThisScreen()I", 0))};
    public static final int w0 = 8;
    private f5 m0;
    private fo n0;
    private pi o0;
    private bf.b p0;
    private final l q0 = new l(this, false, (String) null, "userAgreedToShareConditions", 4, (h) null);
    private final m r0 = new m(this, 0, (String) null, "timesOpenedShareConfigScreen", 6, (h) null);
    private final vj.j s0 = k.a(new ik.a() {
        public final Object e() {
            com.joaomgcd.taskerm.datashare.export.a X2;
            X2 = ShareDataConfig.X2(ShareDataConfig.this);
            return X2;
        }
    });
    private final int t0 = 99;
    private final int u0 = 100;

    public static final class a<T> implements Comparator {
        final List i;

        public a(List list) {
            this.i = list;
        }

        @Override
        public final int compare(T t, T t2) {
            return xj.a.d(Boolean.valueOf(!ShareDataConfig.x3((String) t, this.i)), Boolean.valueOf(!ShareDataConfig.x3((String) t2, this.i)));
        }
    }

    private final void A3(int i, String str) {
        if (str != null) {
            pp.W2(((HasArgsEdit) this).v[i], str);
        }
    }

    private final void B3(int i) {
        this.r0.f(this, v0[1], Integer.valueOf(i));
    }

    private final void C3() {
        throw new UnsupportedOperationException("Method not decompiled: com.joaomgcd.taskerm.datashare.export.ShareDataConfig.C3():void");
    }

    public static final void D3(ShareDataConfig shareDataConfig, View view) {
        shareDataConfig.I3();
    }

    public static final void E3(final ShareDataConfig shareDataConfig, View view) {
        List m;
        String g3 = shareDataConfig.g3(4);
        if (g3 == null || (m = q.J0(g3, new String[]{","}, false, 0, 6, (Object) null)) == null) {
            m = t.m();
        }
        e2.C2(e2.e2(shareDataConfig.v3(m)), shareDataConfig, new ik.l() {
            public final Object invoke(Object obj) {
                vj.e0 F3;
                F3 = ShareDataConfig.F3(ShareDataConfig.this, (List) obj);
                return F3;
            }
        });
    }

    public static final e0 F3(ShareDataConfig shareDataConfig, List list) {
        p.i(list, "it");
        shareDataConfig.A3(4, t.n0(list, ",", (CharSequence) null, (CharSequence) null, 0, (CharSequence) null, (ik.l) null, 62, (Object) null));
        return e0.a;
    }

    private static final e0 G3(int i, ShareDataConfig shareDataConfig, Boolean bool) {
        MyCheckBox myCheckBox = ((HasArgsEdit) shareDataConfig).U[i];
        if (myCheckBox == null) {
            return null;
        }
        myCheckBox.setCheckedNoSignal(bool != null ? bool.booleanValue() : false);
        return e0.a;
    }

    private final void H3(boolean z) {
        this.q0.f(this, v0[0], Boolean.valueOf(z));
    }

    private final void I3() {
        ArrayList K;
        fo foVar = this.n0;
        if (foVar == null || (K = foVar.K(-2, fn.f.r)) == null) {
            return;
        }
        e2.C2(x0.c0(new s7((Activity) this, 2131890750, (List) K, true, new ik.l() {
            public final Object invoke(Object obj) {
                o1 J3;
                J3 = ShareDataConfig.J3((fn) obj);
                return J3;
            }
        }, (Integer) null, (ik.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.e0) null, (com.joaomgcd.taskerm.util.e0) null, (com.joaomgcd.taskerm.util.e0) null, (Boolean) null, (Boolean) null, 65504, (h) null)), this, new ik.l() {
            public final Object invoke(Object obj) {
                vj.e0 K3;
                K3 = ShareDataConfig.K3(ShareDataConfig.this, (t7) obj);
                return K3;
            }
        });
    }

    public static final o1 J3(fn fnVar) {
        String name = fnVar.getName();
        p.h(name, "getName(...)");
        return new o1(name, fnVar.getIcon(), false, 4, null);
    }

    public static final e0 K3(ShareDataConfig shareDataConfig, t7 t7Var) {
        p.i(t7Var, "it");
        fn fnVar = (fn) t7Var.c();
        if (fnVar == null) {
            return e0.a;
        }
        shareDataConfig.A3(1, fnVar.getName());
        return e0.a;
    }

    public static final com.joaomgcd.taskerm.datashare.export.a X2(ShareDataConfig shareDataConfig) {
        return a.C0069a.c(com.joaomgcd.taskerm.datashare.export.a.a, shareDataConfig, false, 2, null);
    }

    private final void Y2(String str) {
        String I;
        setResult(0);
        I = d.I();
        o7.k(I, "Cancelling export and finishing: " + str);
        finish();
    }

    private final void Z2() {
        B3(h3() + 1);
    }

    private final void a3(final GoogleSignInAccount googleSignInAccount) {
        e2.a1(new ik.a() {
            public final Object e() {
                vj.e0 b3;
                b3 = ShareDataConfig.b3(ShareDataConfig.this, googleSignInAccount);
                return b3;
            }
        });
    }

    public static final e0 b3(ShareDataConfig shareDataConfig, GoogleSignInAccount googleSignInAccount) {
        pp.i0(shareDataConfig, "Sharing as " + googleSignInAccount.e(), new Object[0]);
        return e0.a;
    }

    private final um c3() {
        return new um(6, new Object[]{1, 2131889574, "t:5", 0, -1, 2131887213, 1, 2131889730, "m:1:?", 0, -1, 2131887226, 3, 2131886915, "", 0, 0, 2131887229, 3, 2131889883, "", 0, 0, 2131887228, 1, 2131890009, "t:1:?", 0, -1, 2131887230});
    }

    private final bf.b f3() {
        String[] strArr;
        List J0;
        if (!z0(this, c3())) {
            return null;
        }
        String m1 = pp.m1(((HasArgsEdit) this).v[0]);
        String m12 = pp.m1(((HasArgsEdit) this).v[1]);
        CompoundButton compoundButton = ((HasArgsEdit) this).U[2];
        Boolean valueOf = compoundButton != null ? Boolean.valueOf(compoundButton.isChecked()) : null;
        CompoundButton compoundButton2 = ((HasArgsEdit) this).U[3];
        Boolean valueOf2 = compoundButton2 != null ? Boolean.valueOf(compoundButton2.isChecked()) : null;
        String g3 = g3(4);
        if (g3 == null || (J0 = q.J0(g3, new String[]{","}, false, 0, 6, (Object) null)) == null) {
            strArr = null;
        } else {
            ArrayList arrayList = new ArrayList();
            Iterator it = J0.iterator();
            while (it.hasNext()) {
                String V = l7.V(q.g1((String) it.next()).toString());
                if (V != null) {
                    arrayList.add(V);
                }
            }
            strArr = (String[]) arrayList.toArray(new String[0]);
        }
        if (!p.d(valueOf2, Boolean.TRUE) || (strArr != null && strArr.length != 0)) {
            return new bf.b(m1, m12, valueOf, valueOf2, strArr);
        }
        com.joaomgcd.taskerm.helper.j.C0(((HasArgsEdit) this).A, com.joaomgcd.taskerm.dialog.a.R3(this, 2131889883, 2131890180), (ik.l) null, 2, (Object) null);
        return null;
    }

    private final String g3(int i) {
        return pp.m1(((HasArgsEdit) this).v[i]);
    }

    private final int h3() {
        return ((Number) this.r0.d(this, v0[1])).intValue();
    }

    private final boolean i3() {
        return ((Boolean) this.q0.d(this, v0[0])).booleanValue();
    }

    private final boolean j3() {
        return com.joaomgcd.taskerm.helper.h.u2(((HasArgsEdit) this).A, 2131890968, new ik.a() {
            public final Object e() {
                boolean k3;
                k3 = ShareDataConfig.k3(ShareDataConfig.this);
                return Boolean.valueOf(k3);
            }
        }, new Runnable() {
            @Override
            public final void run() {
                ShareDataConfig.l3(ShareDataConfig.this);
            }
        }, (String) null, Boolean.TRUE, 8, (Object) null);
    }

    public static final boolean k3(ShareDataConfig shareDataConfig) {
        return shareDataConfig.h3() >= 3;
    }

    public static final void l3(ShareDataConfig shareDataConfig) {
        shareDataConfig.r3();
    }

    public static final e0 m3(final ShareDataConfig shareDataConfig, Bundle bundle) {
        String I;
        String I2;
        String I3;
        String I4;
        String I5;
        String I6;
        Bundle bundle2;
        String I7;
        String I8;
        try {
            if (!shareDataConfig.i3()) {
                if (!((p1) com.joaomgcd.taskerm.dialog.a.Q2(new df.c(shareDataConfig, "disclaimer_share.html", HTMLView.g.i)).f()).o()) {
                    throw new dh.b("User didn't accept conditions to share");
                }
                shareDataConfig.H3(true);
            }
            final GoogleSignInAccount googleSignInAccount = (GoogleSignInAccount) a.a.J(com.joaomgcd.taskerm.signin.a.a, shareDataConfig, false, (dh.a) null, 6, (Object) null).f();
            com.joaomgcd.taskerm.dialog.b g = b.a.g(com.joaomgcd.taskerm.dialog.b.c, shareDataConfig, 2131888416, false, 4, null);
            try {
                fo b2 = fo.b2(shareDataConfig);
                I3 = d.I();
                o7.f(I3, "Loading data from cache file");
                try {
                    b2.n1(shareDataConfig, "ShareLink", d.H(), true);
                    I5 = d.I();
                    o7.f(I5, "Loaded data from cache file");
                    try {
                        if (bundle == null) {
                            I8 = d.I();
                            o7.f(I8, "Loading extra data from intent");
                            bundle2 = shareDataConfig.getIntent().getBundleExtra(d.F());
                        } else {
                            I7 = d.I();
                            o7.f(I7, "Loading extra data from icicle");
                            bundle2 = bundle.getBundle(d.F());
                        }
                    } catch (Exception e) {
                        I6 = d.I();
                        o7.H(I6, "Can't get extra data for share", e);
                        bundle2 = null;
                    }
                    if (bundle2 != null) {
                        f5 m1 = fo.m1(shareDataConfig, bundle2);
                        shareDataConfig.m0 = m1;
                        shareDataConfig.p0 = m1 != null ? m1.p0() : null;
                        pi piVar = shareDataConfig.m0;
                        if (piVar != null && (piVar instanceof pi)) {
                            Set S1 = b2.S1();
                            p.h(S1, "getMacroIDSet(...)");
                            for (Integer num : (Integer[]) S1.toArray(new Integer[0])) {
                                if (!piVar.J().contains(num)) {
                                    p.f(num);
                                    b2.i1(num.intValue());
                                }
                            }
                        }
                    }
                    shareDataConfig.n0 = b2;
                    pi w = b2.w(0);
                    shareDataConfig.o0 = w;
                    if (w != null) {
                        f5 f5Var = shareDataConfig.m0;
                        w.o0(f5Var != null ? f5Var.getName() : null);
                    }
                    com.joaomgcd.taskerm.dialog.b.h(g, null, 1, null);
                    shareDataConfig.Z2();
                    e2.a1(new ik.a() {
                        public final Object e() {
                            vj.e0 n3;
                            n3 = ShareDataConfig.n3(ShareDataConfig.this, googleSignInAccount);
                            return n3;
                        }
                    });
                } catch (Throwable th) {
                    I4 = d.I();
                    o7.l(I4, "Couldn't load data from cache file", th);
                    h5.n(th, shareDataConfig);
                    shareDataConfig.Y2("Couldn't load data from cache file");
                    e0 e0Var = e0.a;
                    com.joaomgcd.taskerm.dialog.b.h(g, null, 1, null);
                    return e0Var;
                }
            } catch (Throwable th2) {
                com.joaomgcd.taskerm.dialog.b.h(g, null, 1, null);
                throw th2;
            }
        } catch (Throwable th3) {
            I = d.I();
            o7.l(I, "Error sharing to link", th3);
            e2.a1(new ik.a() {
                public final Object e() {
                    vj.e0 p3;
                    p3 = ShareDataConfig.p3(ShareDataConfig.this, th3);
                    return p3;
                }
            });
            shareDataConfig.Y2("exception in main block");
        }
        I2 = d.I();
        o7.f(I2, "oncreatedone doinbackground");
        return e0.a;
    }

    public static final e0 n3(final ShareDataConfig shareDataConfig, GoogleSignInAccount googleSignInAccount) {
        String I;
        String I2;
        String I3;
        String I4;
        String I5;
        String I6;
        try {
            I2 = d.I();
            o7.f(I2, "Showing sharing as");
            p.f(googleSignInAccount);
            shareDataConfig.a3(googleSignInAccount);
            I3 = d.I();
            o7.f(I3, "Populating views");
            shareDataConfig.s3();
            I4 = d.I();
            o7.f(I4, "Setting UI from project");
            shareDataConfig.C3();
            I5 = d.I();
            o7.f(I5, "Setting help buttons from spec");
            shareDataConfig.Q1(shareDataConfig, shareDataConfig.c3());
            I6 = d.I();
            o7.f(I6, "oncreatedone doinmain");
            if (!shareDataConfig.j3()) {
                ((HasArgsEdit) shareDataConfig).A.x2(2131891322);
            }
        } catch (Throwable th) {
            I = d.I();
            o7.l(I, "Error sharing to link doinmain", th);
            e2.a1(new ik.a() {
                public final Object e() {
                    vj.e0 o3;
                    o3 = ShareDataConfig.o3(ShareDataConfig.this, th);
                    return o3;
                }
            });
            shareDataConfig.Y2("exception in main block doinmain");
        }
        return e0.a;
    }

    public static final e0 o3(ShareDataConfig shareDataConfig, Throwable th) {
        pp.b0(shareDataConfig, th.getMessage(), new Object[0]);
        return e0.a;
    }

    public static final e0 p3(ShareDataConfig shareDataConfig, Throwable th) {
        pp.b0(shareDataConfig, th.getMessage(), new Object[0]);
        return e0.a;
    }

    public static final e0 q3(ShareDataConfig shareDataConfig) {
        try {
            GoogleSignInAccount googleSignInAccount = (GoogleSignInAccount) a.a.J(com.joaomgcd.taskerm.signin.a.a, shareDataConfig, false, (dh.a) null, 4, (Object) null).f();
            p.f(googleSignInAccount);
            shareDataConfig.a3(googleSignInAccount);
        } catch (Exception e) {
            e2.R1(shareDataConfig, e);
        }
        return e0.a;
    }

    private final void r3() {
        ExtensionsContextKt.e0(this, "https://youtu.be/ZxXFowle29I", false, false, false, 14, (Object) null);
    }

    private final void s3() {
        x1(findViewById(2131296768));
        t1(c3().i(), 66603);
        ((HasArgsEdit) this).U[3].setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                ShareDataConfig.t3(ShareDataConfig.this, compoundButton, z);
            }
        });
    }

    public static final void t3(ShareDataConfig shareDataConfig, CompoundButton compoundButton, boolean z) {
        p.i(compoundButton, "<unused var>");
        ((HasArgsEdit) shareDataConfig).v[4].setHint(!z ? b7.j6(2131891235, shareDataConfig, new Object[0]) : "");
        if (z) {
            com.joaomgcd.taskerm.helper.j.t0(((HasArgsEdit) shareDataConfig).A, com.joaomgcd.taskerm.dialog.a.z7(shareDataConfig, 2131890180), (yi.d) null, 2, (Object) null);
        }
    }

    private final r<List<String>> v3(final List<String> list) {
        return e2.y1(new ik.a() {
            public final Object e() {
                List w3;
                w3 = ShareDataConfig.w3(ShareDataConfig.this, list);
                return w3;
            }
        });
    }

    public static final List w3(ShareDataConfig shareDataConfig, final List list) {
        List tags;
        List c;
        com.joaomgcd.taskerm.dialog.b g = b.a.g(com.joaomgcd.taskerm.dialog.b.c, shareDataConfig, 2131888077, false, 4, null);
        ResponseGetTags responseGetTags = (ResponseGetTags) shareDataConfig.d3().d().f();
        if (responseGetTags != null && (tags = responseGetTags.getTags()) != null) {
            ArrayList arrayList = new ArrayList();
            Iterator it = tags.iterator();
            while (it.hasNext()) {
                String id2 = ((DataShareTag) it.next()).getId();
                if (id2 != null) {
                    arrayList.add(id2);
                }
            }
            List G0 = t.G0(arrayList, new a(list));
            if (G0 != null) {
                com.joaomgcd.taskerm.dialog.b.h(g, null, 1, null);
                i8 i8Var = (i8) x0.E(new n(shareDataConfig, b7.a6(2131890009, shareDataConfig), G0, false, new ik.l() {
                    public final Object invoke(Object obj) {
                        o1 y3;
                        y3 = ShareDataConfig.y3(list, (String) obj);
                        return y3;
                    }
                }, null, b7.Z5(2131886870, shareDataConfig), null, null, null, Boolean.TRUE, 3, null, null, null, null, 62368, null)).f();
                if (i8Var == null || (c = i8Var.c()) == null) {
                    throw new RuntimeException("Didn't select any tags");
                }
                if (c.size() <= 3) {
                    return c;
                }
                throw new RuntimeException("Too many tags selected. Maximum is 3");
            }
        }
        throw new RuntimeException("Couldn't get tags from server");
    }

    public static final boolean x3(String str, List<String> list) {
        return list.contains(str);
    }

    public static final o1 y3(List list, String str) {
        p.i(str, "it");
        return new o1(str, null, x3(str, list), 2, null);
    }

    private final void z3(bf.b bVar) {
        setResult(-1, new Intent().putExtra(d.G(), bVar.X(0).c0()));
    }

    public void U1(int i) {
        C3();
    }

    public final com.joaomgcd.taskerm.datashare.export.a d3() {
        return (com.joaomgcd.taskerm.datashare.export.a) this.s0.getValue();
    }

    public Void O0() {
        return null;
    }

    public void g(ac acVar, se seVar) {
        p.i(acVar, "permissions");
        p.i(seVar, "result");
    }

    public void onBackPressed() {
        u3();
    }

    public void onClick(View view) {
    }

    @SuppressLint({"MissingSuperCall"})
    public void onCreate(final Bundle bundle) {
        String I;
        super.p1(bundle, 2131492909);
        I = d.I();
        o7.f(I, "Started share link activity");
        e2.T0(new ik.a() {
            public final Object e() {
                vj.e0 m3;
                m3 = ShareDataConfig.m3(ShareDataConfig.this, bundle);
                return m3;
            }
        });
    }

    public boolean onCreateOptionsMenu(Menu menu) {
        p.i(menu, "menu");
        boolean r1 = super.r1(menu, 2131888892, -1);
        menu.add(0, this.t0, 0, b7.j6(2131890038, this, new Object[0]));
        menu.add(0, this.u0, 0, b7.j6(2131889510, this, new Object[0]));
        return r1;
    }

    public void onDestroy() {
        String I;
        super.onDestroy();
        I = d.I();
        o7.f(I, "Destroyed");
    }

    public boolean onOptionsItemSelected(MenuItem menuItem) {
        p.i(menuItem, "item");
        if (menuItem.getItemId() == 6) {
            finish();
            return true;
        }
        if (menuItem.getItemId() == 16908332) {
            u3();
            return true;
        }
        if (menuItem.getItemId() == this.u0) {
            e2.T0(new ik.a() {
                public final Object e() {
                    vj.e0 q3;
                    q3 = ShareDataConfig.q3(ShareDataConfig.this);
                    return q3;
                }
            });
            return true;
        }
        if (menuItem.getItemId() != this.t0) {
            return s1(menuItem, (String) null, "sharecreation.html");
        }
        r3();
        return true;
    }

    public void onProgressChanged(SeekBar seekBar, int i, boolean z) {
    }

    public void onStartTrackingTouch(SeekBar seekBar) {
    }

    public void onStopTrackingTouch(SeekBar seekBar) {
    }

    public final void u3() {
        bf.b f3 = f3();
        if (f3 == null) {
            return;
        }
        z3(f3);
        finish();
    }
}