CheetahGram v8.5.4版本的 MD5 值为:3d14e79cc242c314d3933620ff3ab030
以下内容为反编译后的 cg7.java 源代码,内容仅作参考
package org.telegram.messenger.p110;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONException;
import org.telegram.messenger.p110.ni4;
public class cg7 {
class a implements ni4.b<String> {
final d a;
a(d dVar) {
this.a = dVar;
}
@Override
public void a(String str) {
try {
JSONArray jSONArray = new JSONArray(str);
ArrayList arrayList = new ArrayList();
if (jSONArray.length() > 0) {
for (int i = 0; i < jSONArray.getJSONArray(0).length(); i++) {
arrayList.add(jSONArray.getJSONArray(0).getJSONArray(i).getString(0));
}
}
this.a.b(bg7.a("\n", arrayList));
} catch (JSONException e) {
e.printStackTrace();
this.a.a();
}
}
}
class b implements ni4.a {
final d a;
b(d dVar) {
this.a = dVar;
}
@Override
public void a(yx7 yx7Var) {
this.a.a();
}
}
class c extends e75 {
c(int i, String str, ni4.b bVar, ni4.a aVar) {
super(i, str, bVar, aVar);
}
@Override
public Map<String, String> E() {
HashMap hashMap = new HashMap();
hashMap.put("User-Agent", "Mozilla/5.0 (Linux; Android 11; LM-Q710(FGN)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Mobile Safari/537.36");
hashMap.put("Content-Type", "application/json");
return hashMap;
}
}
public interface d {
void a();
void b(String str);
}
public static void a(String str, String str2, d dVar) {
if (str2 == null || str2.isEmpty()) {
dVar.a();
return;
}
c cVar = new c(0, "https://translate.google.com/translate_a/single?client=gtx&dt=t&sl=auto&tl=" + str + "&q=" + b(str2), new a(dVar), new b(dVar));
cVar.f0(false);
s52.i().a(cVar);
}
private static String b(String str) {
char c2;
if (str == null) {
return null;
}
byte[] bytes = str.getBytes(Charset.defaultCharset());
StringBuilder sb = new StringBuilder(bytes.length);
for (byte b2 : bytes) {
if (b2 >= 97 ? b2 <= 122 || b2 == 126 : b2 >= 65 ? b2 <= 90 || b2 == 95 : b2 >= 48 ? b2 <= 57 : b2 == 45 || b2 == 46) {
c2 = (char) b2;
} else {
sb.append('%');
sb.append("0123456789ABCDEF".charAt((b2 >> 4) & 15));
c2 = "0123456789ABCDEF".charAt(b2 & 15);
}
sb.append(c2);
}
return sb.toString();
}
}