Warkop v5.73.0版本的 MD5 值为:a4330ec2d6f5e146f59fc7622f3cdb45

以下内容为反编译后的 b.java 源代码,内容仅作参考


package hf;

import android.content.Context;
import android.content.pm.PackageManager;
import android.util.Log;
import com.google.firebase.perf.network.FirebasePerfUrlConnection;
import com.inappstory.sdk.network.NetworkHandler;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.net.ssl.HttpsURLConnection;
import p031.p032.p033.InterfaceC4850;

public class b {

    private static String f65947d = "https://api.faceid.com/faceid/v1/sdk/authm";

    private static String f65948e = "https://api.megvii.com/faceid/v1/sdk/authm";

    private Context f65950b;

    private boolean f65949a = true;

    private List<a> f65951c = new ArrayList();

    public b(Context context) {
        if (context != null) {
            this.f65950b = context.getApplicationContext();
            return;
        }
        throw new InvalidParameterException("context can not be null");
    }

    private String a(String str, String str2, int i15) {
        try {
            if (this.f65949a) {
                c.a();
            }
            HttpsURLConnection httpsURLConnection = (HttpsURLConnection) ((URLConnection) FirebasePerfUrlConnection.instrument(new URL(str2).openConnection()));
            httpsURLConnection.setConnectTimeout(5000);
            httpsURLConnection.setReadTimeout(5000);
            httpsURLConnection.setRequestMethod(NetworkHandler.POST);
            httpsURLConnection.setRequestProperty("Content-type", InterfaceC4850.TEXT);
            httpsURLConnection.setRequestProperty("User-Agent", d());
            BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(httpsURLConnection.getOutputStream());
            bufferedOutputStream.write(str.getBytes());
            bufferedOutputStream.close();
            int responseCode = httpsURLConnection.getResponseCode();
            StringBuilder sb5 = new StringBuilder();
            if (responseCode == 200) {
                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpsURLConnection.getInputStream()));
                while (true) {
                    String readLine = bufferedReader.readLine();
                    if (readLine != null) {
                        sb5.append(readLine);
                    } else {
                        bufferedReader.close();
                        httpsURLConnection.disconnect();
                        return sb5.toString();
                    }
                }
            } else {
                if (responseCode >= 500 && i15 == 1) {
                    return a(str, f65948e, 2);
                }
                return sb5.toString();
            }
        } catch (IOException e15) {
            if (i15 == 1) {
                return a(str, f65948e, 2);
            }
            e15.printStackTrace();
            return null;
        } catch (Exception e16) {
            e16.printStackTrace();
            return null;
        }
    }

    private String c() {
        try {
            return this.f65950b.getPackageManager().getPackageInfo(this.f65950b.getPackageName(), 0).packageName;
        } catch (PackageManager.NameNotFoundException e15) {
            e15.printStackTrace();
            return "";
        }
    }

    private String d() {
        String str;
        try {
            if (this.f65951c.size() <= 0) {
                str = "";
            } else {
                Iterator<a> it = this.f65951c.iterator();
                String str2 = "";
                while (it.hasNext()) {
                    str2 = str2 + it.next().getVersion() + "$";
                }
                str = str2.substring(0, str2.length() - 1);
            }
            return "MegVii-SDK/" + str + "/" + c() + "/" + e() + "/" + Locale.getDefault().getLanguage();
        } catch (Exception e15) {
            e15.printStackTrace();
            return "";
        }
    }

    private String e() {
        try {
            return this.f65950b.getPackageManager().getPackageInfo(this.f65950b.getPackageName(), 0).versionName;
        } catch (PackageManager.NameNotFoundException e15) {
            e15.printStackTrace();
            return "";
        }
    }

    public String b(String str) {
        Log.w("LicenseManager", "managers size " + this.f65951c.size());
        if (this.f65950b == null || this.f65951c.size() == 0) {
            return null;
        }
        this.f65950b = this.f65950b.getApplicationContext();
        StringBuilder sb5 = new StringBuilder();
        Iterator<a> it = this.f65951c.iterator();
        while (it.hasNext()) {
            String a15 = it.next().a(str);
            Log.w("LicenseManager", "Thread id :" + Thread.currentThread().getName() + "contextStr is " + a15);
            sb5.append(a15);
            sb5.append('$');
        }
        return sb5.toString().substring(0, r7.length() - 1);
    }

    public synchronized boolean f(a aVar) {
        boolean z15;
        try {
            Iterator<a> it = this.f65951c.iterator();
            z15 = false;
            while (it.hasNext()) {
                if (it.next().getVersion().equals(aVar.getVersion())) {
                    z15 = true;
                }
            }
            if (!z15) {
                this.f65951c.add(aVar);
            }
        } catch (Throwable th4) {
            throw th4;
        }
        return !z15;
    }

    public Map<String, Long> g(String str) {
        HashMap hashMap = null;
        if (str != null && this.f65950b != null) {
            String[] split = str.split("\\$");
            if (split.length != this.f65951c.size()) {
                return null;
            }
            this.f65950b = this.f65950b.getApplicationContext();
            hashMap = new HashMap(split.length);
            for (int i15 = 0; i15 < this.f65951c.size(); i15++) {
                hashMap.put(this.f65951c.get(i15).getVersion(), Long.valueOf(this.f65951c.get(i15).b(split[i15])));
            }
        }
        return hashMap;
    }

    public synchronized Map<String, Long> h(String str) {
        return g(a(b(str), f65947d, 1));
    }
}