导航菜单

页面标题

页面副标题

饼干视频 v4.1.0 - C1657.java 源代码

正在查看: 饼干视频 v4.1.0 应用的 C1657.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package amc.cd.p251;

import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.baidu.mobads.sdk.internal.bm;
import com.bytedance.sdk.openadsdk.api.plugin.PluginConstants;
import com.hailiang.advlib.common.d;
import com.hailiang.advlib.common.e;
import com.hailiang.advlib.core.QMConfig;
import com.sigmob.sdk.base.k;
import com.sigmob.sdk.base.mta.PointCategory;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.json.JSONObject;

public class C1657 {

    public static String f3084;

    public class RunnableC1658 implements Runnable {

        public final QMConfig f3085;

        public RunnableC1658(QMConfig qMConfig) {
            this.f3085 = qMConfig;
        }

        @Override
        public void run() {
            C1657.this.m2357(this.f3085);
            d.a(this, 900000L);
        }
    }

    public static class C1659 {

        public static C1657 f3087 = new C1657(null);
    }

    public C1657(RunnableC1658 runnableC1658) {
        this();
    }

    public static boolean m2348(String str, File file) {
        if (TextUtils.isEmpty(str)) {
            return true;
        }
        try {
            return !str.equals(e.a(new FileInputStream(file), 0, -1));
        } catch (Throwable unused) {
            return true;
        }
    }

    public static String m2349(String str) {
        return "temp_" + str;
    }

    public static C1657 m2350() {
        return C1659.f3087;
    }

    public static void m2351(File file) {
        if (file == null || !file.exists()) {
            return;
        }
        file.delete();
    }

    public static void m2352(File file, File file2) {
        if (file.exists()) {
            file.delete();
        }
        file2.renameTo(file);
        if (Build.VERSION.SDK_INT == 34) {
            file.setReadOnly();
        }
    }

    public static String m2353(@NonNull Context context) {
        if (!TextUtils.isEmpty(f3084)) {
            return f3084;
        }
        String b = e.b(context);
        f3084 = b;
        return b;
    }

    public static boolean m2354(@NonNull File file) throws IOException {
        ZipFile zipFile;
        try {
            zipFile = new ZipFile(file);
            try {
                Enumeration<? extends ZipEntry> entries = zipFile.entries();
                boolean z = false;
                boolean z2 = false;
                while (entries.hasMoreElements()) {
                    ZipEntry nextElement = entries.nextElement();
                    if (nextElement.getName().equals("androidx.temp")) {
                        z = true;
                    } else if (nextElement.getName().equals("android.temp")) {
                        z2 = true;
                    }
                    if (!z || !z2) {
                    }
                }
                try {
                    zipFile.close();
                } catch (IOException unused) {
                }
                boolean a2 = e.a();
                return a2 == z || (a2 ^ true) == z2;
            } catch (Throwable th) {
                th = th;
                if (zipFile != null) {
                    try {
                        zipFile.close();
                    } catch (IOException unused2) {
                    }
                }
                throw th;
            }
        } catch (Throwable th2) {
            th = th2;
            zipFile = null;
        }
    }

    public static String m2355(Context context, String str, String str2, String str3) throws IOException {
        long currentTimeMillis = System.currentTimeMillis();
        URLConnection openConnection = new URL(str).openConnection();
        try {
            File file = new File(str2 + "/" + str3);
            String a2 = (file.exists() && Build.VERSION.SDK_INT == 33) ? e.a(new FileInputStream(file), 0, -1) : "";
            File file2 = new File(str2 + "/" + m2349(str3));
            m2351(file2);
            file2.createNewFile();
            FileOutputStream fileOutputStream = new FileOutputStream(file2);
            InputStream inputStream = openConnection.getInputStream();
            if (str.endsWith(".jar")) {
                e.a(inputStream, fileOutputStream);
            } else {
                e.b(inputStream, fileOutputStream);
            }
            inputStream.close();
            fileOutputStream.flush();
            fileOutputStream.close();
            if (!m2354(file2)) {
                d.a(context, "NOT_MATCH", str, System.currentTimeMillis() - currentTimeMillis);
                m2351(file2);
                try {
                    if (openConnection instanceof HttpURLConnection) {
                        if (((HttpURLConnection) openConnection).getErrorStream() != null) {
                            ((HttpURLConnection) openConnection).getErrorStream().close();
                        }
                        ((HttpURLConnection) openConnection).disconnect();
                    }
                } catch (Throwable unused) {
                }
                return "";
            }
            if (Build.VERSION.SDK_INT != 33) {
                m2352(file, file2);
                d.a(context, "FINISH", str, System.currentTimeMillis() - currentTimeMillis);
                String str4 = str2 + str3;
                try {
                    if (openConnection instanceof HttpURLConnection) {
                        if (((HttpURLConnection) openConnection).getErrorStream() != null) {
                            ((HttpURLConnection) openConnection).getErrorStream().close();
                        }
                        ((HttpURLConnection) openConnection).disconnect();
                    }
                } catch (Throwable unused2) {
                }
                return str4;
            }
            if (!m2348(a2, file2)) {
                m2351(file2);
                d.a(context, "READ_FILE", str, System.currentTimeMillis() - currentTimeMillis);
                try {
                    if (openConnection instanceof HttpURLConnection) {
                        if (((HttpURLConnection) openConnection).getErrorStream() != null) {
                            ((HttpURLConnection) openConnection).getErrorStream().close();
                        }
                        ((HttpURLConnection) openConnection).disconnect();
                    }
                } catch (Throwable unused3) {
                }
                return "";
            }
            m2352(file, file2);
            d.a(context, "FINISH", str, System.currentTimeMillis() - currentTimeMillis);
            String str5 = str2 + str3;
            try {
                if (openConnection instanceof HttpURLConnection) {
                    if (((HttpURLConnection) openConnection).getErrorStream() != null) {
                        ((HttpURLConnection) openConnection).getErrorStream().close();
                    }
                    ((HttpURLConnection) openConnection).disconnect();
                }
            } catch (Throwable unused4) {
            }
            return str5;
        } catch (Throwable th) {
            if (openConnection != null) {
                try {
                    if (openConnection instanceof HttpURLConnection) {
                        if (((HttpURLConnection) openConnection).getErrorStream() != null) {
                            ((HttpURLConnection) openConnection).getErrorStream().close();
                        }
                        ((HttpURLConnection) openConnection).disconnect();
                    }
                } catch (Throwable unused5) {
                }
            }
            throw th;
        }
    }

    public void m2356(QMConfig qMConfig) {
        d.a(new RunnableC1658(qMConfig));
    }

    public void m2357(QMConfig qMConfig) {
        String str;
        String name;
        JSONObject m2358;
        JSONObject jSONObject;
        int i;
        Context context = qMConfig.getContext();
        try {
            m2358 = m2358(context, qMConfig);
        } catch (Throwable th) {
            try {
                th.printStackTrace();
                try {
                    str = th.getMessage();
                    try {
                        name = th.getClass().getName();
                    } catch (Throwable th2) {
                        th = th2;
                        try {
                            th.printStackTrace();
                            name = null;
                        } catch (Throwable th3) {
                            th = th3;
                            th.printStackTrace();
                            try {
                                str = th.getMessage();
                                name = th.getClass().getName();
                            } catch (Throwable th4) {
                                th4.printStackTrace();
                                name = null;
                                if (str != null) {
                                }
                            }
                            if (str != null) {
                                return;
                            } else {
                                return;
                            }
                        }
                        if (str != null) {
                        }
                    }
                } catch (Throwable th5) {
                    th = th5;
                    str = null;
                }
            } catch (Throwable th6) {
                th = th6;
                str = null;
            }
        }
        if (m2358 == null) {
            return;
        }
        String a2 = e.a(C1661.f3109, m2358.toString());
        if (TextUtils.isEmpty(a2) || (i = (jSONObject = new JSONObject(a2)).getInt("action")) == 0) {
            return;
        }
        if (i != 1) {
            name = null;
            str = null;
            if (str != null || name == null) {
                return;
            }
            try {
                e.a(Uri.parse(String.format("%s?iclicashsid=baadfaad&os=Android&v=%s&op1=%s&t=%s&op2=%s&op3=%s", d.f33016a, URLEncoder.encode(Build.VERSION.RELEASE, "UTF-8"), URLEncoder.encode(str, "UTF-8"), URLEncoder.encode(name, "UTF-8"), URLEncoder.encode(Build.BRAND, "UTF-8"), URLEncoder.encode(Build.MODEL, "UTF-8"))).toString(), (String) null);
                return;
            } catch (Throwable th7) {
                th7.printStackTrace();
                return;
            }
        }
        String optString = jSONObject.optString("version");
        if (TextUtils.isEmpty(optString) || "3.468".compareTo(optString) < 0) {
            String string = jSONObject.getString(PointCategory.TARGET_URL);
            d.a(context, "START", string, 0L);
            if (TextUtils.isEmpty(m2355(context, string, C1661.f3097, C1661.f3101))) {
                return;
            }
            C1661.m2369(jSONObject);
        }
    }

    public final JSONObject m2358(Context context, QMConfig qMConfig) {
        FileInputStream fileInputStream;
        String str;
        File file = new File(C1661.f3097 + "/" + C1661.f3101);
        try {
            if (file.length() > 0) {
                fileInputStream = new FileInputStream(file);
                try {
                    str = e.a(fileInputStream, 0, -1);
                } catch (Throwable th) {
                    th = th;
                    try {
                        th.printStackTrace();
                        if (fileInputStream != null) {
                            try {
                                fileInputStream.close();
                            } catch (Throwable th2) {
                                th2.printStackTrace();
                            }
                        }
                        return null;
                    } finally {
                        if (fileInputStream != null) {
                            try {
                                fileInputStream.close();
                            } catch (Throwable th3) {
                                th3.printStackTrace();
                            }
                        }
                    }
                }
            } else {
                str = "";
                fileInputStream = null;
            }
            String str2 = Build.VERSION.RELEASE;
            if (str2 == null) {
                throw new IllegalStateException();
            }
            String str3 = Build.BRAND;
            String str4 = Build.MODEL;
            String packageName = context.getPackageName();
            String m2353 = m2353(context);
            if (TextUtils.isEmpty(m2353)) {
                return null;
            }
            JSONObject jSONObject = new JSONObject();
            String androidId = qMConfig.getAndroidId();
            if (TextUtils.isEmpty(androidId)) {
                androidId = C1661.m2386(context);
            }
            String m2393 = C1668.m2390().m2393(context);
            String m2394 = C1668.m2390().m2394(context);
            StringBuilder sb = new StringBuilder();
            sb.append("value=");
            sb.append(androidId);
            jSONObject.put("current_md5", str).put(bm.j, str3).put(bm.i, str4).put(PluginConstants.KEY_SDK_VERSION, "3.468.15.434").put("os_version", str2).put(k.p, packageName).put(k.r, m2353).put("local_version", C1661.f3110).put("remote_version", C1661.f3099).put("is_androidx", String.valueOf(e.a())).put("load_version", C1661.f3107).put("lib_pkg_name", C1667.m2389()).put("op1", m2393).put("op2", m2394).put("dda", URLEncoder.encode(C1656.m2346("CPC!@#$%Q529! 1*", androidId)));
            if (fileInputStream != null) {
                try {
                    fileInputStream.close();
                } catch (Throwable th4) {
                    th4.printStackTrace();
                }
            }
            return jSONObject;
        } catch (Throwable th5) {
            th = th5;
            fileInputStream = null;
        }
    }

    public C1657() {
    }
}