导航菜单

页面标题

页面副标题

度娘 v1.0.1 - d.java 源代码

正在查看: 度娘 v1.0.1 应用的 d.java JAVA 源代码文件

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


package q8;

import android.app.ActivityManager;
import android.content.Context;
import android.hardware.display.DisplayManager;
import android.os.Bundle;
import android.os.Looper;
import android.os.SystemClock;
import android.util.DisplayMetrics;
import io.flutter.embedding.engine.FlutterJNI;
import io.flutter.view.n;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import q8.d;
import z9.f;

public class d {

    private boolean f13160a;

    private c f13161b;

    private long f13162c;

    private q8.b f13163d;

    private FlutterJNI f13164e;

    private ExecutorService f13165f;

    Future<b> f13166g;

    class a implements Callable<b> {

        final Context f13167a;

        a(Context context) {
            this.f13167a = context;
        }

        public void c() {
            d.this.f13164e.prefetchDefaultFontManager();
        }

        @Override
        public b call() {
            f n10 = f.n("FlutterLoader initTask");
            try {
                d.a(d.this, this.f13167a);
                try {
                    d.this.f13164e.loadLibrary();
                    d.this.f13164e.updateRefreshRate();
                    d.this.f13165f.execute(new Runnable() {
                        @Override
                        public final void run() {
                            d.a.this.c();
                        }
                    });
                    b bVar = new b(z9.c.d(this.f13167a), z9.c.a(this.f13167a), z9.c.c(this.f13167a), null);
                    if (n10 != null) {
                        n10.close();
                    }
                    return bVar;
                } catch (UnsatisfiedLinkError e10) {
                    if (!e10.toString().contains("couldn't find \"libflutter.so\"") && !e10.toString().contains("dlopen failed: library \"libflutter.so\" not found")) {
                        throw e10;
                    }
                    String property = System.getProperty("os.arch");
                    File file = new File(d.this.f13163d.f13157f);
                    throw new UnsupportedOperationException("Could not load libflutter.so this is possibly because the application is running on an architecture that Flutter Android does not support (e.g. x86) see https://docs.flutter.dev/deployment/android#what-are-the-supported-target-architectures for more detail.\nApp is using cpu architecture: " + property + ", and the native libraries directory (with path " + file.getAbsolutePath() + ") contains the following files: " + Arrays.toString(file.list()), e10);
                }
            } catch (Throwable th) {
                if (n10 != null) {
                    try {
                        n10.close();
                    } catch (Throwable th2) {
                        th.addSuppressed(th2);
                    }
                }
                throw th;
            }
        }
    }

    private static class b {

        final String f13169a;

        final String f13170b;

        final String f13171c;

        private b(String str, String str2, String str3) {
            this.f13169a = str;
            this.f13170b = str2;
            this.f13171c = str3;
        }

        b(String str, String str2, String str3, a aVar) {
            this(str, str2, str3);
        }
    }

    public static class c {

        private String f13172a;

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

    public d() {
        this(n8.a.e().d().a());
    }

    public d(FlutterJNI flutterJNI) {
        this(flutterJNI, n8.a.e().b());
    }

    public d(FlutterJNI flutterJNI, ExecutorService executorService) {
        this.f13160a = false;
        this.f13164e = flutterJNI;
        this.f13165f = executorService;
    }

    static e a(d dVar, Context context) {
        dVar.k(context);
        return null;
    }

    private String h(String str) {
        return this.f13163d.f13155d + File.separator + str;
    }

    private e k(Context context) {
        return null;
    }

    private static boolean m(Bundle bundle) {
        if (bundle == null) {
            return true;
        }
        return bundle.getBoolean("io.flutter.embedding.android.LeakVM", true);
    }

    public boolean e() {
        return this.f13163d.f13158g;
    }

    public void f(Context context, String[] strArr) {
        if (this.f13160a) {
            return;
        }
        if (Looper.myLooper() != Looper.getMainLooper()) {
            throw new IllegalStateException("ensureInitializationComplete must be called on the main thread");
        }
        if (this.f13161b == null) {
            throw new IllegalStateException("ensureInitializationComplete must be called after startInitialization");
        }
        try {
            f n10 = f.n("FlutterLoader#ensureInitializationComplete");
            try {
                b bVar = this.f13166g.get();
                ArrayList arrayList = new ArrayList();
                arrayList.add("--icu-symbol-prefix=_binary_icudtl_dat");
                StringBuilder sb = new StringBuilder();
                sb.append("--icu-native-lib-path=");
                sb.append(this.f13163d.f13157f);
                String str = File.separator;
                sb.append(str);
                sb.append("libflutter.so");
                arrayList.add(sb.toString());
                if (strArr != null) {
                    Collections.addAll(arrayList, strArr);
                }
                arrayList.add("--aot-shared-library-name=" + this.f13163d.f13152a);
                arrayList.add("--aot-shared-library-name=" + this.f13163d.f13157f + str + this.f13163d.f13152a);
                StringBuilder sb2 = new StringBuilder();
                sb2.append("--cache-dir-path=");
                sb2.append(bVar.f13170b);
                arrayList.add(sb2.toString());
                if (this.f13163d.f13156e != null) {
                    arrayList.add("--domain-network-policy=" + this.f13163d.f13156e);
                }
                if (this.f13161b.a() != null) {
                    arrayList.add("--log-tag=" + this.f13161b.a());
                }
                Bundle bundle = context.getPackageManager().getApplicationInfo(context.getPackageName(), 128).metaData;
                int i10 = bundle != null ? bundle.getInt("io.flutter.embedding.android.OldGenHeapSize") : 0;
                if (i10 == 0) {
                    ((ActivityManager) context.getSystemService("activity")).getMemoryInfo(new ActivityManager.MemoryInfo());
                    i10 = (int) ((r6.totalMem / 1000000.0d) / 2.0d);
                }
                arrayList.add("--old-gen-heap-size=" + i10);
                DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
                arrayList.add("--resource-cache-max-bytes-threshold=" + (displayMetrics.widthPixels * displayMetrics.heightPixels * 12 * 4));
                arrayList.add("--prefetched-default-font-manager");
                if (bundle != null) {
                    if (bundle.getBoolean("io.flutter.embedding.android.EnableImpeller", false)) {
                        arrayList.add("--enable-impeller");
                    }
                    if (bundle.getBoolean("io.flutter.embedding.android.EnableVulkanValidation", false)) {
                        arrayList.add("--enable-vulkan-validation");
                    }
                    if (bundle.getBoolean("io.flutter.embedding.android.EnableOpenGLGPUTracing", false)) {
                        arrayList.add("--enable-opengl-gpu-tracing");
                    }
                    if (bundle.getBoolean("io.flutter.embedding.android.EnableVulkanGPUTracing", false)) {
                        arrayList.add("--enable-vulkan-gpu-tracing");
                    }
                    String string = bundle.getString("io.flutter.embedding.android.ImpellerBackend");
                    if (string != null) {
                        arrayList.add("--impeller-backend=" + string);
                    }
                }
                arrayList.add("--leak-vm=" + (m(bundle) ? "true" : "false"));
                this.f13164e.init(context, (String[]) arrayList.toArray(new String[0]), null, bVar.f13169a, bVar.f13170b, SystemClock.uptimeMillis() - this.f13162c);
                this.f13160a = true;
                if (n10 != null) {
                    n10.close();
                }
            } finally {
            }
        } catch (Exception e10) {
            n8.b.c("FlutterLoader", "Flutter initialization failed.", e10);
            throw new RuntimeException(e10);
        }
    }

    public String g() {
        return this.f13163d.f13155d;
    }

    public String i(String str) {
        return h(str);
    }

    public String j(String str, String str2) {
        StringBuilder sb = new StringBuilder();
        sb.append("packages");
        String str3 = File.separator;
        sb.append(str3);
        sb.append(str2);
        sb.append(str3);
        sb.append(str);
        return i(sb.toString());
    }

    public boolean l() {
        return this.f13160a;
    }

    public void n(Context context) {
        o(context, new c());
    }

    public void o(Context context, c cVar) {
        if (this.f13161b != null) {
            return;
        }
        if (Looper.myLooper() != Looper.getMainLooper()) {
            throw new IllegalStateException("startInitialization must be called on the main thread");
        }
        f n10 = f.n("FlutterLoader#startInitialization");
        try {
            Context applicationContext = context.getApplicationContext();
            this.f13161b = cVar;
            this.f13162c = SystemClock.uptimeMillis();
            this.f13163d = q8.a.e(applicationContext);
            n.f((DisplayManager) applicationContext.getSystemService("display"), this.f13164e).g();
            this.f13166g = this.f13165f.submit(new a(applicationContext));
            if (n10 != null) {
                n10.close();
            }
        } catch (Throwable th) {
            if (n10 != null) {
                try {
                    n10.close();
                } catch (Throwable th2) {
                    th.addSuppressed(th2);
                }
            }
            throw th;
        }
    }
}