Aqara Home v2.4.1版本的 MD5 值为:529779ac2bc0131db52a1fc3098d2b35
以下内容为反编译后的 a.java 源代码,内容仅作参考
package k.t.b.g.e;
import android.text.InputFilter;
import android.text.Spanned;
import android.text.TextUtils;
import com.umeng.socialize.handler.UMSSOHandler;
import com.yanzhenjie.permission.util.StringUtils;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.regex.Pattern;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import s.b3.w.k0;
import s.b3.w.w;
import s.h0;
import s.i3.b0;
import s.i3.o;
@h0(bv = {1, 0, 3}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\u0018\u0000 \u00032\u00020\u0001:\u0001\u0003B\u0005¢\u0006\u0002\u0010\u0002¨\u0006\u0004"}, d2 = {"Lcom/lumi/arms/repository/utils/CharacterUtils;", "", "()V", "Companion", "repository_debug"}, k = 1, mv = {1, 4, 1})
public final class a {
@NotNull
public static final b b = new b(null);
@NotNull
public static final InputFilter a = new C0398a();
public static final class C0398a implements InputFilter {
public Pattern a = Pattern.compile("[🀀-🏿]|[🐀-\u1f7ff]|[☀-⟿]", 66);
public final Pattern a() {
return this.a;
}
@Override
@Nullable
public CharSequence filter(@NotNull CharSequence charSequence, int i2, int i3, @NotNull Spanned spanned, int i4, int i5) {
k0.e(charSequence, "source");
k0.e(spanned, "dest");
if (this.a.matcher(charSequence).find()) {
return "";
}
return null;
}
public final void a(Pattern pattern) {
this.a = pattern;
}
}
public static final class b {
public b() {
}
@NotNull
public final InputFilter a() {
return a.a;
}
@NotNull
public final String b(@NotNull String str) {
k0.e(str, "str");
char[] charArray = StringUtils.DIGITS_TEXT.toCharArray();
k0.d(charArray, "(this as java.lang.String).toCharArray()");
StringBuilder sb = new StringBuilder("");
byte[] bytes = str.getBytes(s.i3.f.a);
k0.d(bytes, "(this as java.lang.String).getBytes(charset)");
int length = bytes.length;
for (int i2 = 0; i2 < length; i2++) {
sb.append(charArray[((byte) (bytes[i2] & ((byte) 240))) >> 4]);
sb.append(charArray[(byte) (bytes[i2] & 15)]);
}
String sb2 = sb.toString();
k0.d(sb2, "sb.toString()");
int length2 = sb2.length() - 1;
int i3 = 0;
boolean z2 = false;
while (i3 <= length2) {
boolean z3 = k0.a((int) sb2.charAt(!z2 ? i3 : length2), 32) <= 0;
if (z2) {
if (!z3) {
break;
}
length2--;
} else if (z3) {
i3++;
} else {
z2 = true;
}
}
return sb2.subSequence(i3, length2 + 1).toString();
}
@NotNull
public final String c(@NotNull String str) {
k0.e(str, "xml");
if (TextUtils.isEmpty(str)) {
return "Empty/Null xml content";
}
try {
StreamSource streamSource = new StreamSource(new StringReader(str));
StreamResult streamResult = new StreamResult(new StringWriter());
Transformer newTransformer = TransformerFactory.newInstance().newTransformer();
newTransformer.setOutputProperty("indent", "yes");
newTransformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
newTransformer.transform(streamSource, streamResult);
return new o(k.u.c.i.l3.e.f.f25226j).b(streamResult.getWriter().toString(), ">\n");
} catch (TransformerException unused) {
return str;
}
}
public b(w wVar) {
this();
}
@NotNull
public final String a(@NotNull String str) {
String jSONArray;
k0.e(str, UMSSOHandler.JSON);
if (TextUtils.isEmpty(str)) {
return "Empty/Null json content";
}
try {
int length = str.length() - 1;
int i2 = 0;
boolean z2 = false;
while (i2 <= length) {
boolean z3 = k0.a((int) str.charAt(!z2 ? i2 : length), 32) <= 0;
if (z2) {
if (!z3) {
break;
}
length--;
} else if (z3) {
i2++;
} else {
z2 = true;
}
}
String obj = str.subSequence(i2, length + 1).toString();
if (b0.d(obj, "{", false, 2, null)) {
jSONArray = new JSONObject(obj).toString(4);
k0.d(jSONArray, "jsonObject.toString(4)");
} else if (!b0.d(obj, "[", false, 2, null)) {
return obj;
} else {
jSONArray = new JSONArray(obj).toString(4);
k0.d(jSONArray, "jsonArray.toString(4)");
}
return jSONArray;
} catch (JSONException unused) {
return str;
}
}
}
}