Info Call to dynamic code loading API

Description

List of all dynamic code loading API calls in the application. Loading code from untrsuted sources could allow the execution of malicious code in the context of the current application.

Recommendation

This entry is informative, no recommendations applicable.

Technical details

Method okhttp3.internal.platform.Platform.isConscryptPreferred() calling method java.lang.System.getProperty()


    public static boolean isConscryptPreferred()
    {
        if (!"conscrypt".equals(System.getProperty("okhttp.platform"))) {
            return "Conscrypt".equals(java.security.Security.getProviders()[0].getName());
        } else {
            return 1;
        }
    }

Method java8.util.concurrent.TLRandom.i() calling method java.lang.System.getProperty()


    private static boolean i()
    {
        if (java8.util.concurrent.TLRandom.a("com.ibm.misc.JarVersion")) {
            int v0_6 = System.getProperty("java.class.version", "45");
            if ((v0_6 != 0) && ((v0_6.length() >= 2) && ("52".compareTo(v0_6.substring(0, 2)) > 0))) {
                return 1;
            }
        }
        return 0;
    }

Method java8.util.concurrent.ForkJoinPool.a() calling method java.lang.System.getProperty()


    private static Object a(String p2)
    {
        Object v2_3;
        Object v2_1 = System.getProperty(p2);
        if (v2_1 != null) {
            Class[] v1 = new Class[0];
            Object[] v0_0 = new Object[0];
            v2_3 = ClassLoader.getSystemClassLoader().loadClass(v2_1).getConstructor(v1).newInstance(v0_0);
        } else {
            v2_3 = 0;
        }
        return v2_3;
    }

Method java8.util.concurrent.ForkJoinPool.<init>() calling method java.lang.System.getProperty()

Couldn't retrieve source code

Method java8.util.concurrent.ForkJoinPool.<clinit>() calling method java.lang.System.getProperty()


    static ForkJoinPool()
    {
        java8.util.concurrent.ForkJoinPool.q = java8.util.concurrent.UnsafeAccess.a;
        try {
            java8.util.concurrent.ForkJoinPool.r = java8.util.concurrent.ForkJoinPool.q.objectFieldOffset(java8.util.concurrent.ForkJoinPool.getDeclaredField("d"));
            java8.util.concurrent.ForkJoinPool.s = java8.util.concurrent.ForkJoinPool.q.objectFieldOffset(java8.util.concurrent.ForkJoinPool.getDeclaredField("i"));
            java8.util.concurrent.ForkJoinPool.t = java8.util.concurrent.ForkJoinPool.q.arrayBaseOffset(java8.util.concurrent.ForkJoinTask[]);
            Throwable v0_7 = java8.util.concurrent.ForkJoinPool.q.arrayIndexScale(java8.util.concurrent.ForkJoinTask[]);
        } catch (Throwable v0_28) {
            throw new ExceptionInInitializerError(v0_28);
        }
        if (((v0_7 - 1) & v0_7) == 0) {
            java8.util.concurrent.ForkJoinPool.u = (31 - Integer.numberOfLeadingZeros(v0_7));
            Throwable v0_10 = 256;
            try {
                int v1_8 = System.getProperty("java.util.concurrent.ForkJoinPool.common.maximumSpares");
            } catch (Exception) {
                java8.util.concurrent.ForkJoinPool.o = v0_10;
                java8.util.concurrent.ForkJoinPool.defaultForkJoinWorkerThreadFactory = new java8.util.concurrent.ForkJoinPool$DefaultForkJoinWorkerThreadFactory(0);
                java8.util.concurrent.ForkJoinPool.a = new RuntimePermission("modifyThread");
                java8.util.concurrent.ForkJoinPool.b = ((java8.util.concurrent.ForkJoinPool) java.security.AccessController.doPrivileged(new java8.util.concurrent.ForkJoinPool$1()));
                java8.util.concurrent.ForkJoinPool.c = Math.max((java8.util.concurrent.ForkJoinPool.b.i & 65535), 1);
                try {
                    java8.util.concurrent.ForkJoinPool.v = Class.forName("java8.util.concurrent.CompletableFuture$AsynchronousCompletionTask");
                } catch (Throwable v0_25) {
                    java8.util.concurrent.ForkJoinPool.v = 0;
                    throw v0_25;
                } catch (Exception) {
                    java8.util.concurrent.ForkJoinPool.v = 0;
                }
                return;
            }
            if (v1_8 == 0) {
            } else {
                v0_10 = Integer.parseInt(v1_8);
            }
        } else {
            throw new ExceptionInInitializerError("array index scale not a power of two");
        }
    }

Method java8.util.Spliterators.a() calling method java.lang.System.getProperty()


    private static boolean a(String p2, double p3)
    {
        try {
            int v2_1 = System.getProperty(p2);
        } catch (Exception) {
            return 0;
        }
        if ((v2_1 == 0) || (Double.parseDouble(v2_1) >= p3)) {
            return 0;
        } else {
            return 1;
        }
    }

Method java8.util.Spliterators$2.a() calling method java.lang.System.getProperty()


    public Boolean a()
    {
        try {
        } catch (IllegalArgumentException) {
        }
        return Boolean.valueOf(Boolean.parseBoolean(System.getProperty(this.b, Boolean.toString(this.a)).trim()));
    }

Method io.realm.internal.RealmCore.osIsWindows() calling method java.lang.System.getProperty()


    public static boolean osIsWindows()
    {
        return System.getProperty("os.name").toLowerCase(java.util.Locale.getDefault()).contains("win");
    }

Method io.realm.internal.RealmCore.loadLibraryWindows() calling method java.lang.System.getProperty()


    private static String loadLibraryWindows()
    {
        io.realm.internal.RealmCore.addNativeLibraryPath(io.realm.internal.RealmCore.BINARIES_PATH);
        io.realm.internal.RealmCore.resetLibraryPath();
        RuntimeException v0_3 = io.realm.internal.RealmCore.loadCorrectLibrary(new String[] {"realm_jni32d", "realm_jni64d"}));
        if (v0_3 == null) {
            v0_3 = io.realm.internal.RealmCore.loadCorrectLibrary(new String[] {"realm_jni32", "realm_jni64"}));
            if (v0_3 == null) {
                String v1_2 = new StringBuilder();
                v1_2.append("Searched java.library.path=");
                v1_2.append(System.getProperty("java.library.path"));
                System.err.println(v1_2.toString());
                throw new RuntimeException("Couldn\'t load the Realm JNI library \'realm_jni32.dll or realm_jni64.dll\'. Please include the directory to the library in java.library.path.");
            }
        } else {
            System.out.println("!!! Realm debug version loaded. !!!\n");
        }
        return v0_3;
    }

Method io.realm.internal.RealmCore.addNativeLibraryPath() calling method java.lang.System.getProperty()


    public static void addNativeLibraryPath(String p2)
    {
        try {
            RuntimeException v0_1 = new StringBuilder();
            v0_1.append(System.getProperty("java.library.path"));
            v0_1.append(io.realm.internal.RealmCore.PATH_SEP);
            v0_1.append(p2);
            v0_1.append(io.realm.internal.RealmCore.PATH_SEP);
            System.setProperty("java.library.path", v0_1.toString());
            return;
        } catch (Exception v2_2) {
            throw new RuntimeException("Cannot set the library path!", v2_2);
        }
    }

Method com.newrelic.agent.android.harvest.HarvestConnection.createPost() calling method java.lang.System.getProperty()


    public java.net.HttpURLConnection createPost(String p6)
    {
        try {
            int v6_2 = ((java.net.HttpURLConnection) new java.net.URL(p6).openConnection());
            try {
                v6_2.setRequestMethod("POST");
                v6_2.setConnectTimeout(com.newrelic.agent.android.harvest.HarvestConnection.CONNECTION_TIMEOUT);
                v6_2.setReadTimeout(com.newrelic.agent.android.harvest.HarvestConnection.CONNECTION_TIMEOUT);
                v6_2.setDoInput(1);
                v6_2.setDoOutput(1);
                v6_2.setUseCaches(0);
                v6_2.setRequestProperty("X-App-License-Key", this.applicationToken);
                v6_2.setRequestProperty("Content-Type", "application/json");
                String v0_9 = System.getProperty("http.agent");
            } catch (String v0_14) {
                v0_14.printStackTrace();
                String v1_6 = this.log;
                long v2_2 = new StringBuilder();
                v2_2.append("Failed to create data POST: ");
                v2_2.append(v0_14.getMessage());
                v1_6.error(v2_2.toString());
                return v6_2;
            }
            if ((v0_9 != null) && (v0_9.length() > 0)) {
                v6_2.setRequestProperty("User-Agent", System.getProperty("http.agent"));
            }
            if (this.serverTimestamp == 0) {
                return v6_2;
            } else {
                v6_2.setRequestProperty("X-NewRelic-Connect-Time", Long.valueOf(this.serverTimestamp).toString());
                return v6_2;
            }
        } catch (int v6_3) {
            v0_14 = v6_3;
            v6_2 = 0;
        }
    }

Method com.newrelic.agent.android.AndroidAgentImpl.getDeviceInformation() calling method java.lang.System.getProperty()


    public com.newrelic.agent.android.harvest.DeviceInformation getDeviceInformation()
    {
        if (this.deviceInformation == null) {
            com.newrelic.agent.android.harvest.DeviceInformation v0_2 = new com.newrelic.agent.android.harvest.DeviceInformation();
            v0_2.setOsName("Android");
            v0_2.setOsVersion(android.os.Build$VERSION.RELEASE);
            v0_2.setOsBuild(android.os.Build$VERSION.INCREMENTAL);
            v0_2.setModel(android.os.Build.MODEL);
            v0_2.setAgentName("AndroidAgent");
            v0_2.setAgentVersion(com.newrelic.agent.android.Agent.getVersion());
            v0_2.setManufacturer(android.os.Build.MANUFACTURER);
            v0_2.setDeviceId(this.getUUID());
            v0_2.setArchitecture(System.getProperty("os.arch"));
            v0_2.setRunTime(System.getProperty("java.vm.version"));
            v0_2.setSize(com.newrelic.agent.android.AndroidAgentImpl.deviceForm(this.context).name().toLowerCase(java.util.Locale.getDefault()));
            v0_2.setApplicationPlatform(this.agentConfiguration.getApplicationPlatform());
            v0_2.setApplicationPlatformVersion(this.agentConfiguration.getApplicationPlatformVersion());
            this.deviceInformation = v0_2;
            return this.deviceInformation;
        } else {
            return this.deviceInformation;
        }
    }

Method com.newrelic.agent.android.instrumentation.okhttp3.OkHttp3Instrumentation.logReflectionError() calling method java.lang.System.getProperty()


    private static void logReflectionError(String p4)
    {
        String v0_1 = System.getProperty("line.separator");
        StringBuilder v2_1 = new StringBuilder();
        v2_1.append("Unable to resolve method \"");
        v2_1.append(p4);
        v2_1.append("\".");
        v2_1.append(v0_1);
        v2_1.append("This is usually due to building the app with unsupported OkHttp versions.");
        v2_1.append(v0_1);
        v2_1.append("Check your build configuration for compatibility.");
        com.newrelic.agent.android.instrumentation.okhttp3.OkHttp3Instrumentation.log.error(v2_1.toString());
        return;
    }

Method com.google.gson.util.VersionUtils.a() calling method java.lang.System.getProperty()


    private static int a()
    {
        int v0_4 = System.getProperty("java.version").split("[._]");
        int v1_3 = Integer.parseInt(v0_4[0]);
        if ((v1_3 != 1) || (v0_4.length <= 1)) {
            return v1_3;
        } else {
            return Integer.parseInt(v0_4[1]);
        }
    }

Method com.facebook.soloader.SoLoader.loadLibrary() calling method java.lang.System.getProperty()


    public static void loadLibrary(String p3, int p4)
    {
        if (com.facebook.soloader.SoLoader.sSoSources == null) {
            if (!"http://www.android.com/".equals(System.getProperty("java.vendor.url"))) {
                if (com.facebook.soloader.SoLoader.sSystemLoadLibraryWrapper == null) {
                    System.loadLibrary(p3);
                } else {
                    com.facebook.soloader.SoLoader.sSystemLoadLibraryWrapper.loadLibrary(p3);
                }
                return;
            } else {
                com.facebook.soloader.SoLoader.assertInitialized();
            }
        }
        String v1_1;
        String v0 = com.facebook.soloader.MergedSoMapping.mapLibName(p3);
        if (v0 == null) {
            v1_1 = p3;
        } else {
            v1_1 = v0;
        }
        com.facebook.soloader.SoLoader.loadLibraryBySoName(System.mapLibraryName(v1_1), p3, v0, p4, 0);
        return;
    }

Method bolts.BoltsExecutors.d() calling method java.lang.System.getProperty()


    private static boolean d()
    {
        boolean v0_2 = System.getProperty("java.runtime.name");
        if (v0_2) {
            return v0_2.toLowerCase(java.util.Locale.US).contains("android");
        } else {
            return 0;
        }
    }

Method com.facebook.soloader.SoLoader.initImpl() calling method java.lang.System.getenv()


    private static declared_synchronized void initImpl(android.content.Context p7, int p8, com.facebook.soloader.SoFileLoader p9)
    {
        try {
            if (com.facebook.soloader.SoLoader.sSoSources == null) {
                android.util.Log.d("SoLoader", "init start");
                com.facebook.soloader.SoLoader.sFlags = p8;
                com.facebook.soloader.SoLoader.initSoLoader(p9);
                String v9_8 = new java.util.ArrayList();
                int v1_2 = System.getenv("LD_LIBRARY_PATH");
                if (v1_2 == 0) {
                    v1_2 = "/vendor/lib:/system/lib";
                }
                int v1_3 = v1_2.split(":");
                int v3_0 = 0;
                while (v3_0 < v1_3.length) {
                    v9_8.add(new com.facebook.soloader.DirectorySoSource(new java.io.File(v1_3[v3_0]), 2));
                    v3_0++;
                }
                if (p7 != null) {
                    int v1_4 = 1;
                    if ((p8 & 1) == 0) {
                        int v3_5;
                        String v8_2 = p7.getApplicationInfo();
                        if (((v8_2.flags & 1) == 0) || ((v8_2.flags & 128) != 0)) {
                            v3_5 = 0;
                        } else {
                            v3_5 = 1;
                        }
                        if (v3_5 == 0) {
                            int v3_7;
                            if (android.os.Build$VERSION.SDK_INT > 17) {
                                v3_7 = 0;
                            } else {
                                v3_7 = 1;
                            }
                            v9_8.add(0, new com.facebook.soloader.DirectorySoSource(new java.io.File(v8_2.nativeLibraryDir), v3_7));
                        } else {
                            v1_4 = 0;
                        }
                        v9_8.add(0, new com.facebook.soloader.ApkSoSource(p7, com.facebook.soloader.SoLoader.SO_STORE_NAME_MAIN, v1_4));
                    } else {
                        v9_8.add(0, new com.facebook.soloader.ExoSoSource(p7, com.facebook.soloader.SoLoader.SO_STORE_NAME_MAIN));
                    }
                }
                String v7_3 = new com.facebook.soloader.SoSource[v9_8.size()];
                String v7_5 = ((com.facebook.soloader.SoSource[]) v9_8.toArray(v7_3));
                String v8_8 = com.facebook.soloader.SoLoader.makePrepareFlags();
                String v9_1 = v7_5.length;
                while(true) {
                    int v1_7 = (v9_1 - 1);
                    if (v9_1 <= null) {
                        break;
                    }
                    String v2_4 = new StringBuilder();
                    v2_4.append("Preparing SO source: ");
                    v2_4.append(v7_5[v1_7]);
                    android.util.Log.d("SoLoader", v2_4.toString());
                    v7_5[v1_7].prepare(v8_8);
                    v9_1 = v1_7;
                }
                com.facebook.soloader.SoLoader.sSoSources = v7_5;
                String v8_10 = new StringBuilder();
                v8_10.append("init finish: ");
                v8_10.append(com.facebook.soloader.SoLoader.sSoSources.length);
                v8_10.append(" SO sources prepared");
                android.util.Log.d("SoLoader", v8_10.toString());
            }
        } catch (String v7_1) {
            throw v7_1;
        }
        return;
    }

Method com.getkeepsafe.relinker.SystemLibraryLoader.loadPath() calling method java.lang.System.load()


    public void loadPath(String p1)
    {
        System.load(p1);
        return;
    }

Method com.facebook.soloader.SoLoader$1.load() calling method java.lang.System.load()


    public void load(String p7, int p8)
    {
        if (!this.val$hasNativeLoadMethod) {
            System.load(p7);
        } else {
            Throwable v8_7;
            if ((p8 & 4) != 4) {
                v8_7 = 0;
            } else {
                v8_7 = 1;
            }
            Throwable v8_1;
            if (v8_7 == null) {
                v8_1 = this.val$localLdLibraryPathNoZips;
            } else {
                v8_1 = this.val$localLdLibraryPath;
            }
            try {
            } catch (Throwable v8_6) {
                RuntimeException v0_3 = new StringBuilder();
                v0_3.append("Error: Cannot load ");
                v0_3.append(p7);
                String v7_1 = v0_3.toString();
                android.util.Log.e("SoLoader", v7_1);
                throw new RuntimeException(v7_1, v8_6);
            }
            String v3_0 = this.val$nativeLoadRuntimeMethod;
            Runtime v4 = this.val$runtime;
            Object[] v5_1 = new Object[3];
            v5_1[0] = p7;
            v5_1[1] = com.facebook.soloader.SoLoader.getClassLoader();
            v5_1[2] = v8_1;
            Throwable v8_3 = ((String) v3_0.invoke(v4, v5_1));
            if (v8_3 == null) {
            } else {
                String v2_1 = new StringBuilder();
                v2_1.append("Error when loading lib: ");
                v2_1.append(v8_3);
                android.util.Log.e("SoLoader", v2_1.toString());
                throw new UnsatisfiedLinkError(v8_3);
            }
        }
        return;
    }

Method io.realm.internal.RealmCore.loadCorrectLibrary() calling method java.lang.System.loadLibrary()


    private static varargs String loadCorrectLibrary(String[] p3)
    {
        int v0 = p3.length;
        int v1 = 0;
        while (v1 < v0) {
            String v2 = p3[v1];
            try {
                System.loadLibrary(v2);
                return v2;
            } catch (Throwable) {
                v1++;
            }
        }
        return 0;
    }

Method com.getkeepsafe.relinker.SystemLibraryLoader.loadLibrary() calling method java.lang.System.loadLibrary()


    public void loadLibrary(String p1)
    {
        System.loadLibrary(p1);
        return;
    }

Method com.facebook.soloader.SoLoader.loadLibrary() calling method java.lang.System.loadLibrary()


    public static void loadLibrary(String p3, int p4)
    {
        if (com.facebook.soloader.SoLoader.sSoSources == null) {
            if (!"http://www.android.com/".equals(System.getProperty("java.vendor.url"))) {
                if (com.facebook.soloader.SoLoader.sSystemLoadLibraryWrapper == null) {
                    System.loadLibrary(p3);
                } else {
                    com.facebook.soloader.SoLoader.sSystemLoadLibraryWrapper.loadLibrary(p3);
                }
                return;
            } else {
                com.facebook.soloader.SoLoader.assertInitialized();
            }
        }
        String v1_1;
        String v0 = com.facebook.soloader.MergedSoMapping.mapLibName(p3);
        if (v0 == null) {
            v1_1 = p3;
        } else {
            v1_1 = v0;
        }
        com.facebook.soloader.SoLoader.loadLibraryBySoName(System.mapLibraryName(v1_1), p3, v0, p4, 0);
        return;
    }

Method com.google.android.gms.dynamite.zzh.<init>() calling method dalvik.system.PathClassLoader.<init>()


    zzh(String p1, ClassLoader p2)
    {
        super(p1, p2);
        return;
    }