discord-jadx/app/src/main/java/b/j/a/e.java

142 lines
4.7 KiB
Java
Raw Normal View History

2021-12-21 23:37:30 +00:00
package b.j.a;
2021-06-27 20:44:35 +00:00
import android.webkit.JavascriptInterface;
2021-12-21 23:37:30 +00:00
import b.g.a.b.p.i;
import b.g.a.b.t.k;
import b.g.a.c.i0.d;
import b.g.a.c.r;
import b.j.a.f.a;
import b.j.a.f.b;
import b.j.a.f.c;
2021-06-27 20:44:35 +00:00
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.hcaptcha.sdk.HCaptchaConfig;
import com.hcaptcha.sdk.HCaptchaError;
import com.hcaptcha.sdk.HCaptchaException;
import com.hcaptcha.sdk.HCaptchaTokenResponse;
import java.io.IOException;
import java.io.Serializable;
import java.util.Objects;
public class e implements Serializable {
2022-01-11 22:19:46 +00:00
private final HCaptchaConfig hCaptchaConfig;
private final a onFailureListener;
private final b onLoadedListener;
private final c<HCaptchaTokenResponse> onSuccessListener;
2021-06-27 20:44:35 +00:00
public e(HCaptchaConfig hCaptchaConfig, b bVar, c<HCaptchaTokenResponse> cVar, a aVar) {
this.hCaptchaConfig = hCaptchaConfig;
this.onLoadedListener = bVar;
this.onSuccessListener = cVar;
this.onFailureListener = aVar;
}
@Override // java.lang.Object
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof e)) {
return false;
}
e eVar = (e) obj;
Objects.requireNonNull(eVar);
HCaptchaConfig hCaptchaConfig = this.hCaptchaConfig;
HCaptchaConfig hCaptchaConfig2 = eVar.hCaptchaConfig;
if (hCaptchaConfig != null ? !hCaptchaConfig.equals(hCaptchaConfig2) : hCaptchaConfig2 != null) {
return false;
}
b bVar = this.onLoadedListener;
b bVar2 = eVar.onLoadedListener;
if (bVar != null ? !bVar.equals(bVar2) : bVar2 != null) {
return false;
}
c<HCaptchaTokenResponse> cVar = this.onSuccessListener;
c<HCaptchaTokenResponse> cVar2 = eVar.onSuccessListener;
if (cVar != null ? !cVar.equals(cVar2) : cVar2 != null) {
return false;
}
a aVar = this.onFailureListener;
a aVar2 = eVar.onFailureListener;
return aVar != null ? aVar.equals(aVar2) : aVar2 == null;
}
@JavascriptInterface
public String getConfig() {
char[] cArr;
r rVar = new r(null, null, null);
HCaptchaConfig hCaptchaConfig = this.hCaptchaConfig;
i iVar = new i(rVar._jsonFactory.a());
try {
rVar.b(rVar.c(iVar), hCaptchaConfig);
2021-12-21 23:37:30 +00:00
String c = iVar.j.c();
2021-12-17 22:03:14 +00:00
k kVar = iVar.j;
2021-12-21 23:37:30 +00:00
kVar.c = -1;
2021-06-27 20:44:35 +00:00
kVar.h = 0;
kVar.j = null;
if (kVar.e) {
kVar.e = false;
kVar.d.clear();
kVar.f = 0;
kVar.h = 0;
}
2021-12-21 23:37:30 +00:00
b.g.a.b.t.a aVar = kVar.f664b;
2021-06-27 20:44:35 +00:00
if (!(aVar == null || (cArr = kVar.g) == null)) {
kVar.g = null;
aVar.d.set(2, cArr);
}
2021-12-21 23:37:30 +00:00
return c;
2021-06-27 20:44:35 +00:00
} catch (JsonProcessingException e) {
throw e;
} catch (IOException e2) {
throw new JsonMappingException(null, String.format("Unexpected IOException (of type %s): %s", e2.getClass().getName(), d.h(e2)));
}
}
@Override // java.lang.Object
public int hashCode() {
HCaptchaConfig hCaptchaConfig = this.hCaptchaConfig;
int i = 43;
int hashCode = hCaptchaConfig == null ? 43 : hCaptchaConfig.hashCode();
b bVar = this.onLoadedListener;
int hashCode2 = ((hashCode + 59) * 59) + (bVar == null ? 43 : bVar.hashCode());
c<HCaptchaTokenResponse> cVar = this.onSuccessListener;
int hashCode3 = (hashCode2 * 59) + (cVar == null ? 43 : cVar.hashCode());
a aVar = this.onFailureListener;
int i2 = hashCode3 * 59;
if (aVar != null) {
i = aVar.hashCode();
}
return i2 + i;
}
@JavascriptInterface
public void onError(int i) {
this.onFailureListener.onFailure(new HCaptchaException(HCaptchaError.fromId(i)));
}
@JavascriptInterface
public void onLoaded() {
c cVar = (c) this.onLoadedListener;
2021-12-17 22:03:14 +00:00
cVar.k.post(new b(cVar));
2021-06-27 20:44:35 +00:00
}
@JavascriptInterface
public void onPass(String str) {
this.onSuccessListener.onSuccess(new HCaptchaTokenResponse(str));
}
@Override // java.lang.Object
public String toString() {
2021-12-21 23:37:30 +00:00
StringBuilder R = b.d.b.a.a.R("HCaptchaJSInterface(hCaptchaConfig=");
2021-11-08 18:25:28 +00:00
R.append(this.hCaptchaConfig);
R.append(", onLoadedListener=");
R.append(this.onLoadedListener);
R.append(", onSuccessListener=");
R.append(this.onSuccessListener);
R.append(", onFailureListener=");
R.append(this.onFailureListener);
R.append(")");
return R.toString();
2021-06-27 20:44:35 +00:00
}
}