ModV2.0.4 v1.86526672844804版本的 MD5 值为:ab8437a2d03fc69805a8b4199bd7fecb
以下内容为反编译后的 RegexHelper.java 源代码,内容仅作参考
package com.joaomgcd.taskerm.pattern;
import android.app.Activity;
import android.content.Context;
import androidx.annotation.Keep;
import c.f.a.m;
import c.f.b.g;
import c.f.b.k;
import c.f.b.l;
import c.f.b.w;
import c.l.n;
import com.joaomgcd.taskerm.dialog.k;
import com.joaomgcd.taskerm.dialog.x;
import com.joaomgcd.taskerm.dialog.y;
import com.joaomgcd.taskerm.rx.h;
import com.joaomgcd.taskerm.util.al;
import com.joaomgcd.taskerm.util.an;
import com.joaomgcd.taskerm.util.ao;
import com.joaomgcd.taskerm.util.i;
import java.util.List;
import net.danlew.android.joda.R;
public final class RegexHelper {
private final Activity f8444a;
public static final class a extends l implements c.f.a.b<HelpTypes, Boolean> {
public static final a f8460a = new a();
a() {
super(1);
}
public final boolean a(HelpTypes helpTypes) {
k.b(helpTypes, "it");
return true;
}
@Override
public Boolean invoke(HelpTypes helpTypes) {
return Boolean.valueOf(a(helpTypes));
}
}
public static final class e extends l implements c.f.a.b<HelpTypes, Boolean> {
public static final e f8465a = new e();
e() {
super(1);
}
@Override
public Boolean invoke(HelpTypes helpTypes) {
return Boolean.valueOf(a(helpTypes));
}
public final boolean a(HelpTypes helpTypes) {
k.b(helpTypes, "it");
return !helpTypes.isGroup();
}
}
public RegexHelper(Activity activity) {
k.b(activity, "activity");
this.f8444a = activity;
}
public final Activity b() {
return this.f8444a;
}
@Keep
public enum HelpTypes {
NamedGroup(R.string.named_group, AnonymousClass1.f8445a, true),
Group(R.string.group, AnonymousClass2.f8446a, true),
Word(R.string.word_character, AnonymousClass3.f8447a, false, 4, null),
NotWord(R.string.not_word_character, AnonymousClass4.f8448a, false, 4, null),
WhiteSpace(R.string.whitespace, AnonymousClass5.f8449a, false, 4, null),
AnyOfCharacters(R.string.any_of_certain_characters, AnonymousClass6.f8450a, false, 4, null),
NoneOfCharacters(R.string.none_of_certain_characters, AnonymousClass7.f8451a, false, 4, null),
Digit(R.string.digit, AnonymousClass8.f8452a, false, 4, null);
private final c.f.a.b<Activity, String> get;
private final boolean isGroup;
private final int titleResId;
static final class AnonymousClass2 extends l implements c.f.a.b<Activity, String> {
public static final AnonymousClass2 f8446a = new AnonymousClass2();
AnonymousClass2() {
super(1);
}
@Override
public final String invoke(Activity activity) {
k.b(activity, "it");
return "(AJIKJI!)(/){{][€])";
}
}
static final class AnonymousClass3 extends l implements c.f.a.b<Activity, String> {
public static final AnonymousClass3 f8447a = new AnonymousClass3();
AnonymousClass3() {
super(1);
}
@Override
public final String invoke(Activity activity) {
k.b(activity, "it");
return "\\w";
}
}
static final class AnonymousClass4 extends l implements c.f.a.b<Activity, String> {
public static final AnonymousClass4 f8448a = new AnonymousClass4();
AnonymousClass4() {
super(1);
}
@Override
public final String invoke(Activity activity) {
k.b(activity, "it");
return "\\W";
}
}
static final class AnonymousClass5 extends l implements c.f.a.b<Activity, String> {
public static final AnonymousClass5 f8449a = new AnonymousClass5();
AnonymousClass5() {
super(1);
}
@Override
public final String invoke(Activity activity) {
k.b(activity, "it");
return "\\s";
}
}
static final class AnonymousClass8 extends l implements c.f.a.b<Activity, String> {
public static final AnonymousClass8 f8452a = new AnonymousClass8();
AnonymousClass8() {
super(1);
}
@Override
public final String invoke(Activity activity) {
k.b(activity, "it");
return "\\d";
}
}
HelpTypes(int i, c.f.a.b bVar, boolean z) {
k.b(bVar, "get");
this.titleResId = i;
this.get = bVar;
this.isGroup = z;
}
HelpTypes(int i, c.f.a.b bVar, boolean z, int i2, g gVar) {
this(i, bVar, (i2 & 4) != 0 ? false : z);
}
public final c.f.a.b<Activity, String> getGet() {
return this.get;
}
public final int getTitleResId() {
return this.titleResId;
}
public final boolean isGroup() {
return this.isGroup;
}
static final class AnonymousClass1 extends l implements c.f.a.b<Activity, String> {
public static final AnonymousClass1 f8445a = new AnonymousClass1();
AnonymousClass1() {
super(1);
}
@Override
public final String invoke(Activity activity) {
k.b(activity, "activity");
Object b2 = y.a(activity, (int) R.string.named_group, Integer.valueOf((int) R.string.insert_named_group), (i) null, (Integer) null, (Integer) null, (List) null, 120, (Object) null).b();
k.a(b2, "dialogInput(activity, R.…amed_group).blockingGet()");
String q = ao.q((String) b2);
return "(?<" + q + ">AJIKJI!)(/){{][€])";
}
}
static final class AnonymousClass6 extends l implements c.f.a.b<Activity, String> {
public static final AnonymousClass6 f8450a = new AnonymousClass6();
AnonymousClass6() {
super(1);
}
@Override
public final String invoke(Activity activity) {
k.b(activity, "it");
return '[' + ((String) y.a(activity, (int) R.string.any_of_certain_characters, Integer.valueOf((int) R.string.which_characters_do_you_want_to_allow), (i) null, (Integer) null, (Integer) null, (List) null, 120, (Object) null).b()) + ']';
}
}
static final class AnonymousClass7 extends l implements c.f.a.b<Activity, String> {
public static final AnonymousClass7 f8451a = new AnonymousClass7();
AnonymousClass7() {
super(1);
}
@Override
public final String invoke(Activity activity) {
k.b(activity, "it");
return "[^" + ((String) y.a(activity, (int) R.string.none_of_certain_characters, Integer.valueOf((int) R.string.which_characters_dont_you_want_to_allow), (i) null, (Integer) null, (Integer) null, (List) null, 120, (Object) null).b()) + ']';
}
}
}
public final b.a.l<String> a() {
return h.b(new c());
}
public static final class c extends l implements c.f.a.a<String> {
c() {
super(0);
}
@Override
public final String invoke() {
if (!((x) y.a(RegexHelper.this.b(), (int) R.string.ml_matches_regex, (int) R.string.these_are_just_few_regex_examples_learn_more, (int) R.string.learn_more, 0, (String) null, 48, (Object) null).b()).e() || com.joaomgcd.taskerm.q.b.a(RegexHelper.this.b(), an.a((int) R.string.these_are_just_few_regex_examples_learn_more, RegexHelper.this.b()), null, 2, null)) {
return RegexHelper.this.c();
}
al.a((Context) RegexHelper.this.b(), "https://www.regular-expressions.info/tutorial.html", false, false, false, 14, (Object) null);
return "";
}
}
public static final class b extends l implements c.f.a.b<HelpTypes, String> {
b() {
super(1);
}
@Override
public final String invoke(HelpTypes helpTypes) {
k.b(helpTypes, "it");
return an.a(helpTypes.getTitleResId(), RegexHelper.this.b(), new Object[0]);
}
}
static HelpTypes a(RegexHelper regexHelper, String str, String str2, c.f.a.b bVar, int i, Object obj) {
if ((i & 1) != 0) {
str = null;
}
if ((i & 2) != 0) {
str2 = an.a((int) R.string.ml_matches_regex, regexHelper.f8444a, new Object[0]);
}
if ((i & 4) != 0) {
bVar = a.f8460a;
}
return regexHelper.a(str, str2, bVar);
}
private final HelpTypes a(String str, String str2, c.f.a.b<? super HelpTypes, Boolean> bVar) {
String str3;
Activity activity = this.f8444a;
if (str != null) {
str3 = str2 + ": " + str;
}
str3 = str2;
return (HelpTypes) com.joaomgcd.taskerm.dialog.k.a(activity, str3, HelpTypes.class, new b(), bVar).b();
}
public final String c() {
String a2;
HelpTypes a3 = a(this, null, null, null, 7, null);
if (a3.isGroup()) {
w.d dVar = new w.d();
dVar.f2028a = "";
String invoke = a3.getGet().invoke(this.f8444a);
if (invoke == null) {
throw new RuntimeException("No value for group");
}
d dVar2 = new d(invoke, dVar);
String a4 = an.a((int) R.string.add_to_regex_group, this.f8444a, new Object[0]);
dVar.f2028a = a(dVar2.invoke(), a4);
while (true) {
Activity activity = this.f8444a;
if (((x) y.a(activity, (int) R.string.group, an.a((int) R.string.add_group_content_question, this.f8444a, new Object[0]) + ' ' + dVar2.invoke(), 0, 8, (Object) null).b()).d()) {
dVar.f2028a = ((String) dVar.f2028a) + a(dVar2.invoke(), a4);
} else {
return a(dVar2.invoke());
}
}
} else {
String invoke2 = a3.getGet().invoke(this.f8444a);
return (invoke2 == null || (a2 = a(invoke2)) == null) ? "" : a2;
}
}
public static final class d extends l implements c.f.a.a<String> {
final String f8463a;
final w.d f8464b;
d(String str, w.d dVar) {
super(0);
this.f8463a = str;
this.f8464b = dVar;
}
@Override
public final String invoke() {
return n.a(this.f8463a, "AJIKJI!)(/){{][€]", (String) this.f8464b.f2028a, false, 4, (Object) null);
}
}
private final String a(String str, String str2) {
String a2;
String invoke = a(str, str2, e.f8465a).getGet().invoke(this.f8444a);
return (invoke == null || (a2 = a(invoke)) == null) ? "" : a2;
}
@Keep
public enum RepeatTypes {
None(R.string.word_none, AnonymousClass1.f8453a),
ZeroOrMore(R.string.zero_or_more, AnonymousClass2.f8454a),
OneOrMore(R.string.once_or_more, AnonymousClass3.f8455a),
ExactNumber(R.string.exact_number, AnonymousClass4.f8456a),
Minimum(R.string.minimum_number_of_time, AnonymousClass5.f8457a),
Maximum(R.string.maximum_number_of_time, AnonymousClass6.f8458a),
MinAndMax(R.string.between_minimum_and_max_times, AnonymousClass7.f8459a);
private final m<Activity, String, String> get;
private final int titleResId;
static final class AnonymousClass1 extends l implements m<Activity, String, String> {
public static final AnonymousClass1 f8453a = new AnonymousClass1();
AnonymousClass1() {
super(2);
}
@Override
public final String invoke(Activity activity, String str) {
k.b(activity, "<anonymous parameter 0>");
k.b(str, "<anonymous parameter 1>");
return "";
}
}
static final class AnonymousClass2 extends l implements m<Activity, String, String> {
public static final AnonymousClass2 f8454a = new AnonymousClass2();
AnonymousClass2() {
super(2);
}
@Override
public final String invoke(Activity activity, String str) {
k.b(activity, "<anonymous parameter 0>");
k.b(str, "<anonymous parameter 1>");
return "*";
}
}
static final class AnonymousClass3 extends l implements m<Activity, String, String> {
public static final AnonymousClass3 f8455a = new AnonymousClass3();
AnonymousClass3() {
super(2);
}
@Override
public final String invoke(Activity activity, String str) {
k.b(activity, "<anonymous parameter 0>");
k.b(str, "<anonymous parameter 1>");
return "+";
}
}
RepeatTypes(int i, m mVar) {
k.b(mVar, "get");
this.titleResId = i;
this.get = mVar;
}
public final m<Activity, String, String> getGet() {
return this.get;
}
public final int getTitleResId() {
return this.titleResId;
}
static final class AnonymousClass4 extends l implements m<Activity, String, String> {
public static final AnonymousClass4 f8456a = new AnonymousClass4();
AnonymousClass4() {
super(2);
}
@Override
public final String invoke(Activity activity, String str) {
k.b(activity, "activity");
k.b(str, "toRepeat");
return '{' + com.joaomgcd.taskerm.pattern.b.a(activity, str, R.string.how_many_times_repeat) + '}';
}
}
static final class AnonymousClass5 extends l implements m<Activity, String, String> {
public static final AnonymousClass5 f8457a = new AnonymousClass5();
AnonymousClass5() {
super(2);
}
@Override
public final String invoke(Activity activity, String str) {
k.b(activity, "activity");
k.b(str, "toRepeat");
return '{' + com.joaomgcd.taskerm.pattern.b.a(activity, str, R.string.how_many_times_repeat_min) + ",}";
}
}
static final class AnonymousClass6 extends l implements m<Activity, String, String> {
public static final AnonymousClass6 f8458a = new AnonymousClass6();
AnonymousClass6() {
super(2);
}
@Override
public final String invoke(Activity activity, String str) {
k.b(activity, "activity");
k.b(str, "toRepeat");
return "{1," + com.joaomgcd.taskerm.pattern.b.a(activity, str, R.string.how_many_times_repeat_max) + '}';
}
}
static final class AnonymousClass7 extends l implements m<Activity, String, String> {
public static final AnonymousClass7 f8459a = new AnonymousClass7();
AnonymousClass7() {
super(2);
}
@Override
public final String invoke(Activity activity, String str) {
k.b(activity, "activity");
k.b(str, "toRepeat");
String a2 = com.joaomgcd.taskerm.pattern.b.a(activity, str, R.string.how_many_times_repeat_min);
String a3 = com.joaomgcd.taskerm.pattern.b.a(activity, str, R.string.how_many_times_repeat_max);
return '{' + a2 + ',' + a3 + '}';
}
}
}
public static final class f extends l implements c.f.a.b<RepeatTypes, String> {
f() {
super(1);
}
@Override
public final String invoke(RepeatTypes repeatTypes) {
k.b(repeatTypes, "it");
return an.a(repeatTypes.getTitleResId(), RegexHelper.this.b(), new Object[0]);
}
}
private final String a(String str) {
Activity activity = this.f8444a;
StringBuilder sb = new StringBuilder();
sb.append(str);
String invoke = ((RepeatTypes) com.joaomgcd.taskerm.dialog.k.a(activity, an.a((int) R.string.repeat, this.f8444a, new Object[0]) + " " + str, RepeatTypes.class, new f(), k.v.f6548a).b()).getGet().invoke(this.f8444a, str);
if (invoke == null) {
invoke = "";
}
sb.append((Object) invoke);
return sb.toString();
}
}