Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Класс авторизации
- public class bf {
- public static bg m1104a(String str, String str2, String str3, boolean z, String str4, byte[] bArr) {
- bg bgVar;
- Exception exception;
- Exception e;
- bg bgVar2;
- Throwable th;
- String a = C0000a.m2a(str2, "$2a$10$OOv2wLxbNjUxVcc1sjysau");
- a = (!z || str3.isEmpty()) ? "{\"email\":\"" + str + "\",\"password\":\"" + a + "\"" : "{\"email\":\"" + str + "\",\"password\":\"" + a + "\",\"totp\":\"" + str3 + "\"";
- a = (bArr == null || bArr.length <= 0) ? a + "}" : a + ", \"sign\":\"" + C0136r.m1137a(bArr).toLowerCase() + "\",\"task\":\"" + str4 + "\"}";
- Log.d("Auth", "request: " + a);
- byte[] bytes = a.getBytes();
- try {
- HttpURLConnection httpURLConnection = null;
- try {
- HttpURLConnection httpURLConnection2 = (HttpURLConnection) new URL(z ? "https://rest.url.com/api/2.4/auth/login" : "https://rest.url.com/api/2.4/auth/register").openConnection();
- try {
- httpURLConnection2.setRequestProperty("Accept-Encoding", "");
- httpURLConnection2.setRequestProperty("Content-Type", "application/json");
- httpURLConnection2.setRequestProperty("Connection", "close");
- httpURLConnection2.setRequestProperty("User-Agent", m1105a());
- try {
- httpURLConnection2.setRequestMethod("POST");
- httpURLConnection2.setDoInput(true);
- httpURLConnection2.setDoOutput(true);
- httpURLConnection2.setFixedLengthStreamingMode(bytes.length);
- try {
- httpURLConnection2.getOutputStream().write(bytes);
- try {
- int responseCode = httpURLConnection2.getResponseCode();
- Класс, в котором вызывается метод получения Sign
- public class C0136r {
- private static final char[] f609a;
- static {
- f609a = "0123456789ABCDEF".toCharArray();
- }
- public static int m1136a(char c) {
- if (c >= '0' && c <= '9') {
- return c - 48;
- }
- if (c >= 'A' && c <= 'F') {
- return (c - 65) + 10;
- }
- if (c >= 'a' && c <= 'f') {
- return (c - 97) + 10;
- }
- throw new RuntimeException("Invalid hex character");
- }
- public static String m1137a(byte[] bArr) {
- char[] cArr = new char[(bArr.length * 2)];
- for (int i = 0; i < bArr.length; i++) {
- int i2 = bArr[i] & 255;
- cArr[i * 2] = f609a[i2 >>> 4];
- cArr[(i * 2) + 1] = f609a[i2 & 15];
- }
- return new String(cArr);
- }
- public static byte[] m1138a(String str) {
- if ((str.length() & 1) != 0) {
- throw new RuntimeException("Invalid hex string");
- }
- byte[] bArr = new byte[(str.length() / 2)];
- for (int i = 0; i < str.length() / 2; i++) {
- bArr[i] = (byte) ((C0136r.m1136a(str.charAt(i * 2)) << 4) | C0136r.m1136a(str.charAt((i * 2) + 1)));
- }
- return bArr;
- }
- }
- Класс, в котором вызывается метод авторизации
- public C0139u(LoginActivity loginActivity, int i, Handler handler, String str, String str2, String str3) {
- this.f616a = loginActivity;
- this.f617b = i;
- this.f618c = handler;
- this.Username = str; \\Login
- this.Password = str2; \\ password
- this.f621f = str3; \\ Task
- }
- byte[] m1140a(bj bjVar) {
- byte[] bytes = bjVar.f554b.getBytes();
- byte[] bArr = new byte[64];
- int i = 0;
- while (i < bjVar.f553a) {
- LoginActivity.keccak(bytes, bArr);
- i++;
- bytes = bArr;
- }
- return bArr;
- }
- public void run() {
- if (this.f621f.isEmpty()) {
- bk c = bf.m1113c(this.Username);
- if (c.f555a) {
- bj bjVar = c.f557c;
- if (this.f617b == 0 ? c.f556b : false) {
- this.f618c.post(new C0138t(this.f616a, "Verification required", this.Username, ""));
- return;
- }
- bg a;
- do {
- bj bjVar2 = bjVar;
- a = bf.m1104a(this.Username, this.Password, "", this.f617b == 0, bjVar2.f554b, bjVar2.f553a > 0 ? m1140a(bjVar2) : null);
- bjVar = a.f548c;
- } while (bjVar != null);
- this.f618c.post(new C0138t(this.f616a, a.f546a, this.Username, a.f547b));
- return;
- }
- this.f618c.post(new C0138t(this.f616a, c.f558d, this.Username, ""));
- return;
- }
- bg a2 = bf.m1104a(this.Username, this.Password, this.f621f, this.f617b == 0, null, null);
- this.f618c.post(new C0138t(this.f616a, a2.f546a, this.Username, a2.f547b));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement