ModV2.0.4 v1.86526672844804版本的 MD5 值为:ab8437a2d03fc69805a8b4199bd7fecb
以下内容为反编译后的 ShareDataConfig.java 源代码,内容仅作参考
package com.joaomgcd.taskerm.datashare.export;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.InputFilter;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.SeekBar;
import android.widget.TextView;
import c.f.b.p;
import c.f.b.v;
import c.f.b.x;
import c.q;
import c.s;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.joaomgcd.taskerm.datashare.export.a;
import com.joaomgcd.taskerm.dialog.ac;
import com.joaomgcd.taskerm.dialog.ad;
import com.joaomgcd.taskerm.dialog.ae;
import com.joaomgcd.taskerm.dialog.as;
import com.joaomgcd.taskerm.dialog.w;
import com.joaomgcd.taskerm.dialog.y;
import com.joaomgcd.taskerm.signin.c;
import com.joaomgcd.taskerm.util.al;
import com.joaomgcd.taskerm.util.an;
import com.joaomgcd.taskerm.util.ao;
import com.joaomgcd.taskerm.util.bw;
import com.joaomgcd.taskerm.util.cs;
import com.joaomgcd.taskerservercommon.datashare.DataShareTag;
import com.joaomgcd.taskerservercommon.response.ResponseGetTags;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import net.danlew.android.joda.R;
import net.dinglisch.android.taskerm.HTMLView;
import net.dinglisch.android.taskerm.HasArgsEdit;
import net.dinglisch.android.taskerm.MyCheckBox;
import net.dinglisch.android.taskerm.MyScrollView;
import net.dinglisch.android.taskerm.az;
import net.dinglisch.android.taskerm.bo;
import net.dinglisch.android.taskerm.ct;
import net.dinglisch.android.taskerm.df;
import net.dinglisch.android.taskerm.dm;
import net.dinglisch.android.taskerm.fj;
import net.dinglisch.android.taskerm.ft;
import net.dinglisch.android.taskerm.fy;
import net.dinglisch.android.taskerm.gs;
public final class ShareDataConfig extends HasArgsEdit {
static final c.j.g[] f6236a = {x.a(new v(x.a(ShareDataConfig.class), "coroutineScope", "getCoroutineScope()Lcom/joaomgcd/taskerm/coroutines/ActivityScope;")), x.a(new p(x.a(ShareDataConfig.class), "userAgreedToConditions", "getUserAgreedToConditions()Z")), x.a(new p(x.a(ShareDataConfig.class), "timesOpenedThisScreen", "getTimesOpenedThisScreen()I")), x.a(new v(x.a(ShareDataConfig.class), "apiClient", "getApiClient()Lcom/joaomgcd/taskerm/datashare/export/APIDataShare;"))};
private fy O;
private dm P;
private com.joaomgcd.taskerm.datashare.export.e Q;
private final com.joaomgcd.taskerm.q.d R;
private final com.joaomgcd.taskerm.q.e S;
private az f6238c;
private final c.e f6237b = c.f.a(b.f6240a);
private final c.e T = c.f.a(new a());
private final int U = 99;
private final int V = 100;
private final void b(int i2) {
this.S.a(this, f6236a[2], Integer.valueOf(i2));
}
public final void c(boolean z) {
this.R.a(this, f6236a[1], Boolean.valueOf(z));
}
public final boolean g() {
return this.R.a(this, f6236a[1]).booleanValue();
}
public final int h() {
return this.S.a(this, f6236a[2]).intValue();
}
public final com.joaomgcd.taskerm.datashare.export.a a() {
c.e eVar = this.T;
c.j.g gVar = f6236a[3];
return (com.joaomgcd.taskerm.datashare.export.a) eVar.b();
}
@Override
public void a(bw bwVar, cs csVar) {
c.f.b.k.b(bwVar, "permissions");
c.f.b.k.b(csVar, "result");
}
@Override
public void onClick(View view) {
}
@Override
public void onProgressChanged(SeekBar seekBar, int i2, boolean z) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
public static final class i extends c.f.b.l implements c.f.a.a<List<? extends String>> {
final List f6256b;
i(List list) {
super(0);
this.f6256b = list;
}
public static final class a<T> implements Comparator<T> {
final AnonymousClass1 f6258a;
public a(AnonymousClass1 anonymousClass1) {
this.f6258a = anonymousClass1;
}
@Override
public final int compare(T t, T t2) {
return c.b.a.a(Boolean.valueOf(!this.f6258a.a((String) t)), Boolean.valueOf(!this.f6258a.a((String) t2)));
}
}
public static final class AnonymousClass1 extends c.f.b.l implements c.f.a.b<String, Boolean> {
AnonymousClass1() {
super(1);
}
@Override
public Boolean invoke(String str) {
return Boolean.valueOf(a(str));
}
public final boolean a(String str) {
c.f.b.k.b(str, "receiver$0");
return i.this.f6256b.contains(str);
}
}
@Override
public final List<String> invoke() {
List<DataShareTag> tags;
List<String> b2;
ac a2 = ac.a.a(ac.f6387a, ShareDataConfig.this, R.string.getting_tags_from_server, false, 4, null);
AnonymousClass1 anonymousClass1 = new AnonymousClass1();
ResponseGetTags b3 = ShareDataConfig.this.a().a().b();
if (b3 != null && (tags = b3.getTags()) != null) {
ArrayList arrayList = new ArrayList();
for (DataShareTag dataShareTag : tags) {
String id = dataShareTag.getId();
if (id != null) {
arrayList.add(id);
}
}
List a3 = c.a.j.a((Iterable) arrayList, (Comparator) new a(anonymousClass1));
if (a3 != null) {
ac.a(a2, null, 1, null);
as asVar = (as) com.joaomgcd.taskerm.dialog.k.a(new com.joaomgcd.taskerm.dialog.e(ShareDataConfig.this, an.a((int) R.string.pl_tags, ShareDataConfig.this), a3, false, new b(anonymousClass1), null, an.b((int) R.string.button_label_cancel, ShareDataConfig.this), null, null, null, true, 3, null, 5024, null)).b();
if (asVar == null || (b2 = asVar.b()) == null) {
throw new RuntimeException("Didn't select any tags");
}
if (b2.size() <= 3) {
return b2;
}
throw new RuntimeException("Too many tags selected. Maximum is 3");
}
}
throw new RuntimeException("Couldn't get tags from server");
}
public static final class b extends c.f.b.l implements c.f.a.b<String, w> {
final AnonymousClass1 f6259a;
b(AnonymousClass1 anonymousClass1) {
super(1);
this.f6259a = anonymousClass1;
}
@Override
public final w invoke(String str) {
c.f.b.k.b(str, "it");
return new w(str, null, this.f6259a.a(str), 2, null);
}
}
}
public static final class f extends c.f.b.l implements c.f.a.a<s> {
final Bundle f6246b;
f(Bundle bundle) {
super(0);
this.f6246b = bundle;
}
public static final class AnonymousClass1 extends c.f.b.l implements c.f.a.a<s> {
final GoogleSignInAccount f6248b;
AnonymousClass1(GoogleSignInAccount googleSignInAccount) {
super(0);
this.f6248b = googleSignInAccount;
}
public static final class C01301 extends c.f.b.l implements c.f.a.a<s> {
final Throwable f6250b;
C01301(Throwable th) {
super(0);
this.f6250b = th;
}
@Override
public s invoke() {
a();
return s.f2131a;
}
public final void a() {
gs.a(ShareDataConfig.this, this.f6250b.getMessage(), new Object[0]);
}
}
@Override
public s invoke() {
a();
return s.f2131a;
}
public final void a() {
try {
bo.b(com.joaomgcd.taskerm.datashare.export.f.d(), "Showing sharing as");
ShareDataConfig shareDataConfig = ShareDataConfig.this;
GoogleSignInAccount googleSignInAccount = this.f6248b;
c.f.b.k.a((Object) googleSignInAccount, "googleSignInAccount");
shareDataConfig.a(googleSignInAccount);
bo.b(com.joaomgcd.taskerm.datashare.export.f.d(), "Populating views");
ShareDataConfig.this.D();
bo.b(com.joaomgcd.taskerm.datashare.export.f.d(), "Setting UI from project");
ShareDataConfig.this.E();
bo.b(com.joaomgcd.taskerm.datashare.export.f.d(), "Setting help buttons from spec");
ShareDataConfig.this.b(ShareDataConfig.this, ShareDataConfig.this.f());
bo.b(com.joaomgcd.taskerm.datashare.export.f.d(), "oncreatedone doinmain");
if (ShareDataConfig.this.B()) {
return;
}
ShareDataConfig.this.i.b(R.string.you_can_use_html_to_format_share_descriptions);
} catch (Throwable th) {
bo.b(com.joaomgcd.taskerm.datashare.export.f.d(), "Error sharing to link doinmain", th);
com.joaomgcd.taskerm.rx.h.e(new C01301(th));
ShareDataConfig.this.a("exception in main block doinmain");
}
}
}
public static final class AnonymousClass2 extends c.f.b.l implements c.f.a.a<s> {
final Throwable f6252b;
AnonymousClass2(Throwable th) {
super(0);
this.f6252b = th;
}
@Override
public s invoke() {
a();
return s.f2131a;
}
public final void a() {
gs.a(ShareDataConfig.this, this.f6252b.getMessage(), new Object[0]);
}
}
@Override
public s invoke() {
a();
return s.f2131a;
}
public final void a() {
Bundle bundle;
Integer[] numArr;
try {
if (!ShareDataConfig.this.g()) {
if (y.a(new com.joaomgcd.taskerm.dialog.c(ShareDataConfig.this, "disclaimer_share.html", HTMLView.c.Confirm)).b().d()) {
ShareDataConfig.this.c(true);
} else {
throw new com.joaomgcd.taskerm.signin.b("User didn't accept conditions to share");
}
}
GoogleSignInAccount googleSignInAccount = (GoogleSignInAccount) c.a.a(com.joaomgcd.taskerm.signin.c.f8926a, ShareDataConfig.this, false, null, 6, null).b();
ac a2 = ac.a.a(ac.f6387a, ShareDataConfig.this, R.string.loading_apps_text, false, 4, null);
ShareDataConfig shareDataConfig = ShareDataConfig.this;
fy a3 = fy.a(ShareDataConfig.this);
bo.b(com.joaomgcd.taskerm.datashare.export.f.d(), "Loading data from cache file");
a3.a((Context) ShareDataConfig.this, "ShareLink", com.joaomgcd.taskerm.datashare.export.f.c(), true);
bo.b(com.joaomgcd.taskerm.datashare.export.f.d(), "Loaded data from cache file");
try {
if (this.f6246b == null) {
bo.b(com.joaomgcd.taskerm.datashare.export.f.d(), "Loading extra data from intent");
bundle = ShareDataConfig.this.getIntent().getBundleExtra(com.joaomgcd.taskerm.datashare.export.f.a());
} else {
bo.b(com.joaomgcd.taskerm.datashare.export.f.d(), "Loading extra data from icicle");
bundle = this.f6246b.getBundle(com.joaomgcd.taskerm.datashare.export.f.a());
}
} catch (Exception e2) {
bo.a(com.joaomgcd.taskerm.datashare.export.f.d(), "Can't get extra data for share", e2);
bundle = null;
}
if (bundle != null) {
ShareDataConfig.this.f6238c = fy.a(ShareDataConfig.this, bundle);
ShareDataConfig shareDataConfig2 = ShareDataConfig.this;
az azVar = ShareDataConfig.this.f6238c;
shareDataConfig2.Q = azVar != null ? azVar.e() : null;
az azVar2 = ShareDataConfig.this.f6238c;
if (azVar2 != null && (azVar2 instanceof dm)) {
Set<Integer> q = a3.q();
c.f.b.k.a((Object) q, "macroIDSet");
Object[] array = q.toArray(new Integer[0]);
if (array != null) {
for (Integer num : (Integer[]) array) {
if (!((dm) azVar2).q().contains(num)) {
c.f.b.k.a((Object) num, "it");
a3.o(num.intValue());
}
}
} else {
throw new q("null cannot be cast to non-null type kotlin.Array<T>");
}
}
}
shareDataConfig.O = a3;
ShareDataConfig shareDataConfig3 = ShareDataConfig.this;
fy fyVar = ShareDataConfig.this.O;
shareDataConfig3.P = fyVar != null ? fyVar.z(0) : null;
dm dmVar = ShareDataConfig.this.P;
if (dmVar != null) {
az azVar3 = ShareDataConfig.this.f6238c;
dmVar.a(azVar3 != null ? azVar3.m() : null);
}
ac.a(a2, null, 1, null);
ShareDataConfig.this.A();
com.joaomgcd.taskerm.rx.h.e(new AnonymousClass1(googleSignInAccount));
} catch (Throwable th) {
bo.b(com.joaomgcd.taskerm.datashare.export.f.d(), "Error sharing to link", th);
com.joaomgcd.taskerm.rx.h.e(new AnonymousClass2(th));
ShareDataConfig.this.a("exception in main block");
}
bo.b(com.joaomgcd.taskerm.datashare.export.f.d(), "oncreatedone doinbackground");
}
}
public static final class k implements View.OnClickListener {
k() {
}
static final class AnonymousClass1 extends c.f.b.l implements c.f.a.b<List<? extends String>, s> {
AnonymousClass1() {
super(1);
}
@Override
public s invoke(List<? extends String> list) {
a(list);
return s.f2131a;
}
public final void a(List<String> list) {
c.f.b.k.b(list, "it");
ShareDataConfig.this.c(4, c.a.j.a(list, ",", null, null, 0, null, null, 62, null));
}
}
@Override
public final void onClick(View view) {
List a2;
String c2 = ShareDataConfig.this.c(4);
if (c2 == null || (a2 = c.l.n.b((CharSequence) c2, new String[]{","}, false, 0, 6, (Object) null)) == null) {
a2 = c.a.j.a();
}
com.joaomgcd.taskerm.rx.h.a(com.joaomgcd.taskerm.rx.h.c(ShareDataConfig.this.a(a2)), ShareDataConfig.this, new AnonymousClass1());
}
}
public static final class c extends c.f.b.l implements c.f.a.a<s> {
final GoogleSignInAccount f6242b;
c(GoogleSignInAccount googleSignInAccount) {
super(0);
this.f6242b = googleSignInAccount;
}
@Override
public s invoke() {
a();
return s.f2131a;
}
public final void a() {
gs.c(ShareDataConfig.this, "Sharing as " + this.f6242b.c(), new Object[0]);
}
}
public static final class d extends c.f.b.l implements c.f.a.a<Boolean> {
d() {
super(0);
}
@Override
public Boolean invoke() {
return Boolean.valueOf(a());
}
public final boolean a() {
return ShareDataConfig.this.h() >= 3;
}
}
static final class g extends c.f.b.l implements c.f.a.a<s> {
g() {
super(0);
}
@Override
public s invoke() {
a();
return s.f2131a;
}
public final void a() {
try {
GoogleSignInAccount googleSignInAccount = (GoogleSignInAccount) c.a.a(com.joaomgcd.taskerm.signin.c.f8926a, ShareDataConfig.this, false, null, 4, null).b();
ShareDataConfig shareDataConfig = ShareDataConfig.this;
c.f.b.k.a((Object) googleSignInAccount, "account");
shareDataConfig.a(googleSignInAccount);
} catch (Exception e2) {
com.joaomgcd.taskerm.rx.h.a(ShareDataConfig.this, e2);
}
}
}
public static final class l extends c.f.b.l implements c.f.a.m<Integer, Boolean, s> {
l() {
super(2);
}
@Override
public s invoke(Integer num, Boolean bool) {
return a(num.intValue(), bool);
}
public final s a(int i, Boolean bool) {
MyCheckBox myCheckBox = ShareDataConfig.this.z[i];
if (myCheckBox != null) {
myCheckBox.setCheckedNoSignal(bool != null ? bool.booleanValue() : false);
return s.f2131a;
}
return null;
}
}
public static final class m extends c.f.b.l implements c.f.a.b<ae<ft>, s> {
m() {
super(1);
}
@Override
public s invoke(ae<ft> aeVar) {
a(aeVar);
return s.f2131a;
}
public final void a(ae<ft> aeVar) {
c.f.b.k.b(aeVar, "it");
ft b2 = aeVar.b();
if (b2 != null) {
ShareDataConfig.this.c(1, b2.m());
}
}
}
static final class b extends c.f.b.l implements c.f.a.a<com.joaomgcd.taskerm.g.a> {
public static final b f6240a = new b();
b() {
super(0);
}
@Override
public final com.joaomgcd.taskerm.g.a invoke() {
return new com.joaomgcd.taskerm.g.a();
}
}
public ShareDataConfig() {
ShareDataConfig shareDataConfig = this;
this.R = new com.joaomgcd.taskerm.q.d(shareDataConfig, false, null, "userAgreedToShareConditions", 4, null);
this.S = new com.joaomgcd.taskerm.q.e(shareDataConfig, 0, null, "timesOpenedShareConfigScreen", 6, null);
}
public final fj f() {
return new fj(6, 1, Integer.valueOf((int) R.string.pl_description), "t:5", 0, -1, Integer.valueOf((int) R.string.dc_help_data_share_description), 1, Integer.valueOf((int) R.string.pl_launch_task), "m:1:?", 0, -1, Integer.valueOf((int) R.string.dc_help_link_launch_task), 3, Integer.valueOf((int) R.string.bypass_permissions), "", 0, 0, Integer.valueOf((int) R.string.dc_help_share_share_ask_permissions), 3, Integer.valueOf((int) R.string.pl_public), "", 0, 0, Integer.valueOf((int) R.string.dc_help_share_public), 1, Integer.valueOf((int) R.string.pl_tags), "t:1:?", 0, -1, Integer.valueOf((int) R.string.dc_help_share_tags));
}
@Override
@SuppressLint({"MissingSuperCall"})
public void onCreate(Bundle bundle) {
super.a(bundle, R.layout.moveupfromzero);
bo.b(com.joaomgcd.taskerm.datashare.export.f.d(), "Started share link activity");
com.joaomgcd.taskerm.rx.h.c(new f(bundle));
}
public final void A() {
b(h() + 1);
}
public static final class e implements Runnable {
e() {
}
@Override
public final void run() {
ShareDataConfig.this.C();
}
}
public final boolean B() {
return com.joaomgcd.taskerm.helper.h.a(this.i, R.string.tip_share_tips_video, new d(), new e(), null, true, 8, null);
}
public final void C() {
al.a((Context) this, "https://youtu.be/ZxXFowle29I", false, false, false, 14, (Object) null);
}
@Override
public void onDestroy() {
super.onDestroy();
bo.b(com.joaomgcd.taskerm.datashare.export.f.d(), "Destroyed");
}
public final void a(GoogleSignInAccount googleSignInAccount) {
com.joaomgcd.taskerm.rx.h.e(new c(googleSignInAccount));
}
public final void a(String str) {
setResult(0);
String d2 = com.joaomgcd.taskerm.datashare.export.f.d();
bo.c(d2, "Cancelling export and finishing: " + str);
finish();
}
public final void D() {
a((View) ((MyScrollView) findViewById(R.id.content_scroller)));
b(f().e(), 66603);
this.z[3].setOnCheckedChangeListener(new h());
}
public static final class h implements CompoundButton.OnCheckedChangeListener {
h() {
}
@Override
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
EditText editText = ShareDataConfig.this.f11152d[4];
c.f.b.k.a((Object) editText, "argEditTextViews[ARG_TAGS]");
editText.setHint(!z ? an.a((int) R.string.word_optional, ShareDataConfig.this, new Object[0]) : "");
if (z) {
com.joaomgcd.taskerm.helper.j.a(ShareDataConfig.this.i, y.b(ShareDataConfig.this, (int) R.string.public_shares_have_to_include_tags), (b.a.d.f) null, 2, (Object) null);
}
}
}
public final String c(int i2) {
return gs.a((TextView) this.f11152d[i2]);
}
public final void c(int i2, String str) {
if (str != null) {
gs.b(this.f11152d[i2], str);
}
}
public final void E() {
String[] e2;
boolean z;
Iterator<Integer> it = c.i.d.b(0, f().e()).iterator();
while (it.hasNext()) {
int b2 = ((c.a.y) it).b();
switch (f().d(b2)) {
case 0:
this.f11152d[b2].setLines(1);
EditText editText = this.f11152d[b2];
c.f.b.k.a((Object) editText, "argEditTextViews[a]");
editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(10)});
df.a((TextView) this.f11152d[b2], 2);
z = false;
break;
case 1:
this.f11152d[b2].setLines(b2 == 0 ? 15 : 1);
z = !net.dinglisch.android.taskerm.b.g(f().a(b2));
break;
default:
z = false;
break;
}
int i2 = an.a(Integer.valueOf(b2), 0, 1, 4) ? 0 : 8;
int i3 = an.a(Integer.valueOf(b2), 2, 3) ? 0 : 8;
EditText editText2 = this.f11152d[b2];
c.f.b.k.a((Object) editText2, "argEditTextViews[a]");
editText2.setHint(z ? ct.a(this, (int) R.string.word_optional, new Object[0]) : "");
String a2 = ct.a(this, f().g(b2), new Object[0]);
c.f.b.k.a((Object) a2, "MyRes.getString(this, ARG_SPEC.getArgLabelID(a))");
TextView textView = this.x[b2];
c.f.b.k.a((Object) textView, "argLabels[a]");
textView.setText(a2);
TextView textView2 = this.x[b2];
c.f.b.k.a((Object) textView2, "argLabels[a]");
textView2.setVisibility(0);
EditText editText3 = this.f11152d[b2];
c.f.b.k.a((Object) editText3, "argEditTextViews[a]");
editText3.setVisibility(i2);
ImageButton imageButton = this.J[b2];
c.f.b.k.a((Object) imageButton, "argChooseButtons[a]");
imageButton.setVisibility(8);
MyCheckBox myCheckBox = this.z[b2];
c.f.b.k.a((Object) myCheckBox, "argCheckBoxes[a]");
myCheckBox.setVisibility(i3);
}
fy fyVar = this.O;
if ((fyVar != null && fyVar.n() == 0) || !(this.f6238c instanceof dm)) {
ViewGroup viewGroup = this.u[1];
c.f.b.k.a((Object) viewGroup, "argLayouts[ARG_LAUNCH_TASK_NAME]");
viewGroup.setVisibility(8);
} else {
ImageButton imageButton2 = this.J[1];
imageButton2.setVisibility(0);
imageButton2.setOnClickListener(new j());
}
ImageButton imageButton3 = this.J[4];
imageButton3.setVisibility(0);
imageButton3.setOnClickListener(new k());
ShareDataConfig shareDataConfig = this;
Object[] objArr = new Object[1];
dm dmVar = this.P;
String str = null;
objArr[0] = dmVar != null ? dmVar.m() : null;
setTitle(ct.a(shareDataConfig, (int) R.string.dt_share, objArr));
l lVar = new l();
com.joaomgcd.taskerm.datashare.export.e eVar = this.Q;
c(0, eVar != null ? eVar.b() : null);
com.joaomgcd.taskerm.datashare.export.e eVar2 = this.Q;
c(1, eVar2 != null ? eVar2.c() : null);
com.joaomgcd.taskerm.datashare.export.e eVar3 = this.Q;
lVar.a(2, eVar3 != null ? Boolean.valueOf(eVar3.a()) : null);
com.joaomgcd.taskerm.datashare.export.e eVar4 = this.Q;
lVar.a(3, eVar4 != null ? eVar4.d() : null);
com.joaomgcd.taskerm.datashare.export.e eVar5 = this.Q;
if (eVar5 != null && (e2 = eVar5.e()) != null) {
str = c.a.d.a(e2, ",", (CharSequence) null, (CharSequence) null, 0, (CharSequence) null, (c.f.a.b) null, 62, (Object) null);
}
c(4, str);
}
public static final class j implements View.OnClickListener {
j() {
}
@Override
public final void onClick(View view) {
ShareDataConfig.this.F();
}
}
public final void F() {
ArrayList<ft> b2;
fy fyVar = this.O;
if (fyVar == null || (b2 = fyVar.b(-2, ft.c.Alpha)) == null) {
return;
}
com.joaomgcd.taskerm.rx.h.a(com.joaomgcd.taskerm.dialog.k.a(new ad(this, R.string.taskselect_title, b2, true, n.f6265a, null, null, null, null, null, null, null, null, null, null, null, 65504, null)), this, new m());
}
public static final class n extends c.f.b.l implements c.f.a.b<ft, w> {
public static final n f6265a = new n();
n() {
super(1);
}
@Override
public final w invoke(ft ftVar) {
c.f.b.k.a((Object) ftVar, "it");
String m = ftVar.m();
c.f.b.k.a((Object) m, "it.name");
return new w(m, ftVar.f(), false, 4, null);
}
}
static final class a extends c.f.b.l implements c.f.a.a<com.joaomgcd.taskerm.datashare.export.a> {
a() {
super(0);
}
@Override
public final com.joaomgcd.taskerm.datashare.export.a invoke() {
return a.C0131a.a(com.joaomgcd.taskerm.datashare.export.a.f6266a, (Context) ShareDataConfig.this, false, 2, (Object) null);
}
}
public final b.a.l<List<String>> a(List<String> list) {
return com.joaomgcd.taskerm.rx.h.b(new i(list));
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
c.f.b.k.b(menuItem, "item");
if (menuItem.getItemId() == 6) {
finish();
return true;
} else if (menuItem.getItemId() == 16908332) {
L_();
return true;
} else if (menuItem.getItemId() == this.V) {
com.joaomgcd.taskerm.rx.h.c(new g());
return true;
} else if (menuItem.getItemId() == this.U) {
C();
return true;
} else {
return a(menuItem, (String) null, "sharecreation.html");
}
}
@Override
public void onBackPressed() {
L_();
}
private final com.joaomgcd.taskerm.datashare.export.e G() {
String[] strArr;
List<String> b2;
if (a(this, f())) {
boolean z = false;
String a2 = gs.a((TextView) this.f11152d[0]);
String a3 = gs.a((TextView) this.f11152d[1]);
MyCheckBox myCheckBox = this.z[2];
Boolean valueOf = myCheckBox != null ? Boolean.valueOf(myCheckBox.isChecked()) : null;
MyCheckBox myCheckBox2 = this.z[3];
Boolean valueOf2 = myCheckBox2 != null ? Boolean.valueOf(myCheckBox2.isChecked()) : null;
String c2 = c(4);
if (c2 == null || (b2 = c.l.n.b((CharSequence) c2, new String[]{","}, false, 0, 6, (Object) null)) == null) {
strArr = null;
} else {
ArrayList arrayList = new ArrayList();
for (String str : b2) {
if (str != null) {
String A = ao.A(c.l.n.b((CharSequence) str).toString());
if (A != null) {
arrayList.add(A);
}
} else {
throw new q("null cannot be cast to non-null type kotlin.CharSequence");
}
}
Object[] array = arrayList.toArray(new String[0]);
if (array == null) {
throw new q("null cannot be cast to non-null type kotlin.Array<T>");
}
strArr = (String[]) array;
}
if (c.f.b.k.a((Object) valueOf2, (Object) true)) {
if (strArr != null) {
}
z = true;
if (z) {
com.joaomgcd.taskerm.helper.j.a(this.i, y.d(this, R.string.pl_public, R.string.public_shares_have_to_include_tags), (c.f.a.b) null, 2, (Object) null);
return null;
}
}
return new com.joaomgcd.taskerm.datashare.export.e(a2, a3, valueOf, valueOf2, strArr);
}
return null;
}
public final void L_() {
com.joaomgcd.taskerm.datashare.export.e G = G();
if (G != null) {
a(G);
finish();
}
}
private final void a(com.joaomgcd.taskerm.datashare.export.e eVar) {
setResult(-1, new Intent().putExtra(com.joaomgcd.taskerm.datashare.export.f.b(), eVar.a(0).c()));
}
@Override
public void a(int i2) {
E();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
c.f.b.k.b(menu, "menu");
boolean a2 = super.a(menu, R.string.ml_help_this_screen, -1);
ShareDataConfig shareDataConfig = this;
menu.add(0, this.U, 0, an.a((int) R.string.pl_tips_video, shareDataConfig, new Object[0]));
menu.add(0, this.V, 0, an.a((int) R.string.pl_change_share_account, shareDataConfig, new Object[0]));
return a2;
}
}