星辰影院解锁vip v1.0.4版本的 MD5 值为:3d99bbcbb0d5d5e568b9f6134424c24e

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


package org.qiyi.net.k;

import android.net.Uri;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import okhttp3.Call;
import okhttp3.OkHttpClient;
import okhttp3.Request;

public class m {
    public static int a = 0;

    public static int f17559b = 1;

    public static int f17560c = 2;

    public static int f17561d = 3;

    private static ThreadPoolExecutor f17562e = (ThreadPoolExecutor) Executors.newCachedThreadPool();

    private static final Object f17563f = new Object();

    private static ConcurrentHashMap<String, Integer> f17564g = new ConcurrentHashMap<>();

    private static volatile String[] f17565h = null;

    private static OkHttpClient f17566i;

    public static class a implements Runnable {
        private String a;

        private AtomicInteger f17567b;

        public a(String str, AtomicInteger atomicInteger) {
            this.a = str;
            this.f17567b = atomicInteger;
        }

        public String[] a() {
            BufferedReader bufferedReader;
            AtomicInteger atomicInteger;
            BufferedReader bufferedReader2;
            Call newCall = m.f17566i.newCall(new Request.Builder().url("http://" + this.a + "/3f1").build());
            BufferedReader bufferedReader3 = null;
            try {
                try {
                    StringBuilder sb = new StringBuilder();
                    bufferedReader = new BufferedReader(new InputStreamReader(newCall.execute().body().byteStream()));
                    while (true) {
                        try {
                            String readLine = bufferedReader.readLine();
                            if (readLine == null) {
                                break;
                            }
                            sb.append(readLine);
                        } catch (IOException e2) {
                            e = e2;
                            org.qiyi.net.a.d("fetch schedule system ip by %s failed.", this.a);
                            e.printStackTrace();
                            AtomicInteger atomicInteger2 = this.f17567b;
                            if (atomicInteger2 != null) {
                                atomicInteger2.decrementAndGet();
                            }
                            if (bufferedReader != null) {
                                try {
                                    bufferedReader.close();
                                } catch (IOException unused) {
                                }
                            }
                            return null;
                        }
                    }
                    bufferedReader.close();
                    String[] split = sb.toString().split(";");
                    if (split.length > 0) {
                        org.qiyi.net.a.g("fetch schedule system ip by %s successfully", this.a);
                        AtomicInteger atomicInteger3 = this.f17567b;
                        if (atomicInteger3 != null) {
                            atomicInteger3.decrementAndGet();
                        }
                        try {
                            bufferedReader.close();
                        } catch (IOException unused2) {
                        }
                        return split;
                    }
                    AtomicInteger atomicInteger4 = this.f17567b;
                    if (atomicInteger4 != null) {
                        atomicInteger4.decrementAndGet();
                    }
                    try {
                        bufferedReader.close();
                    } catch (IOException unused3) {
                    }
                    return null;
                } catch (Throwable th) {
                    th = th;
                    bufferedReader3 = bufferedReader2;
                    atomicInteger = this.f17567b;
                    if (atomicInteger != null) {
                        atomicInteger.decrementAndGet();
                    }
                    if (bufferedReader3 != null) {
                        try {
                            bufferedReader3.close();
                        } catch (IOException unused4) {
                        }
                    }
                    throw th;
                }
            } catch (IOException e3) {
                e = e3;
                bufferedReader = null;
            } catch (Throwable th2) {
                th = th2;
                atomicInteger = this.f17567b;
                if (atomicInteger != null) {
                }
                if (bufferedReader3 != null) {
                }
                throw th;
            }
        }

        @Override
        public void run() {
            String[] a = a();
            if (a != null && m.f17565h == null) {
                synchronized (m.class) {
                    if (m.f17565h == null) {
                        String[] unused = m.f17565h = a;
                    }
                }
            }
            synchronized (m.f17563f) {
                m.f17563f.notifyAll();
            }
        }
    }

    public static class b {
        String a;

        int f17568b;

        String f17569c;

        public b(String str, int i2, String str2) {
            this.a = str;
            this.f17568b = i2;
            this.f17569c = str2;
        }

        public int a() {
            return this.f17568b;
        }

        public String b() {
            return this.a;
        }
    }

    static {
        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        TimeUnit timeUnit = TimeUnit.SECONDS;
        f17566i = builder.connectTimeout(6L, timeUnit).readTimeout(6L, timeUnit).writeTimeout(6L, timeUnit).callTimeout(10L, timeUnit).build();
    }

    public static b e(String str, boolean z) {
        int i2;
        String str2;
        List<InetAddress> b2;
        String str3 = "access.if.iqiyi.com";
        String str4 = null;
        if (str == null) {
            return null;
        }
        if (!str.startsWith("http://") && !str.startsWith("https://")) {
            org.qiyi.net.a.g("unsupported scheme: %s", str);
            return null;
        }
        if (f17565h == null) {
            f();
        }
        String host = Uri.parse(str).getHost();
        Integer num = f17564g.get(host);
        if (str.startsWith("https://")) {
            str4 = str.substring(8);
        } else if (str.startsWith("http://")) {
            str4 = str.substring(7);
        }
        int i3 = f17560c;
        if (f17565h != null && f17565h.length > 0) {
            if (num != null && num.intValue() == a && f17565h.length > 1) {
                str2 = f17565h[1];
                i2 = f17559b;
            } else {
                str2 = f17565h[0];
                i2 = a;
            }
        } else {
            try {
                l.a.c h2 = org.qiyi.net.l.f.j().h("access.if.iqiyi.com", 2, true);
                if (h2 != null && (b2 = h2.b()) != null && !b2.isEmpty()) {
                    str3 = b2.get(0).getHostAddress();
                    i3 = f17561d;
                }
            } catch (UnknownHostException e2) {
                e2.printStackTrace();
            }
            String str5 = str3;
            i2 = i3;
            str2 = str5;
        }
        StringBuilder sb = new StringBuilder();
        if (z) {
            sb.append("https://");
        } else {
            sb.append("http://");
        }
        sb.append(str2);
        sb.append("/3f1/");
        sb.append(str4);
        return new b(sb.toString(), i2, host);
    }

    public static void f() {
        org.qiyi.net.a.g("refreshSuperPipeIP", new Object[0]);
        AtomicInteger atomicInteger = new AtomicInteger(2);
        a aVar = new a("39.156.54.66", atomicInteger);
        a aVar2 = new a("116.211.198.237", atomicInteger);
        f17562e.execute(aVar);
        f17562e.execute(aVar2);
        synchronized (f17563f) {
            while (atomicInteger.get() > 0 && f17565h == null) {
                try {
                    org.qiyi.net.a.g("start to wait...", new Object[0]);
                    f17563f.wait(6000L);
                } catch (InterruptedException e2) {
                    e2.printStackTrace();
                }
            }
        }
        if (f17565h == null) {
            String[] a2 = new a("103.44.59.54", null).a();
            if (a2 == null || f17565h != null) {
                return;
            }
            synchronized (m.class) {
                if (f17565h == null) {
                    f17565h = a2;
                }
            }
            return;
        }
        org.qiyi.net.a.g("wait finished, get system ip.", new Object[0]);
    }

    public static void g(String str, int i2) {
        f17564g.put(str, Integer.valueOf(i2));
    }
}