Info Call to Random API

Description

List of all calls to methods that return pseudo-random values.

Recommendation

Do not seed Random with the current time because that value is more predictable to an attacker than the default seed.

The java.util.Random class must not be used either for security-critical applications or for protecting sensitive data. Use a more secure random number generator, such as the java.security.SecureRandom class.

Technical details

Method androidx.leanback.widget.y$a.draw() calling method java.util.Random.setSeed()


    public void draw(android.graphics.Canvas p7, CharSequence p8, int p9, int p10, float p11, int p12, int p13, int p14, android.graphics.Paint p15)
    {
        int v8_2 = ((int) p15.measureText(p8, p9, p10));
        int v9_3 = this.a.b.getWidth();
        int v10_1 = (v9_3 * 2);
        p12 = (v8_2 / v10_1);
        int v14_0 = ((v8_2 % v10_1) / 2);
        boolean v0_1 = androidx.leanback.widget.y.a(this.a);
        this.a.a.setSeed(((long) this.b));
        int v1_2 = p15.getAlpha();
        int v2_2 = 0;
        while ((v2_2 < p12) && ((this.c + v2_2) < this.a.d)) {
            float v4_3;
            android.graphics.Bitmap v3_5 = ((float) (((v2_2 * v10_1) + v14_0) + (v9_3 / 2)));
            if (!v0_1) {
                v4_3 = (p11 + v3_5);
            } else {
                v4_3 = (((((float) v8_2) + p11) - v3_5) - ((float) v9_3));
            }
            p15.setAlpha(((this.a.a.nextInt(4) + 1) * 63));
            if (!this.a.a.nextBoolean()) {
                p7.drawBitmap(this.a.b, v4_3, ((float) (p13 - this.a.b.getHeight())), p15);
            } else {
                p7.drawBitmap(this.a.c, v4_3, ((float) (p13 - this.a.c.getHeight())), p15);
            }
            v2_2++;
        }
        p15.setAlpha(v1_2);
        return;
    }

Method okhttp3.OkHttpClient.newWebSocket() calling method java.util.Random.<init>()


    public okhttp3.WebSocket newWebSocket(okhttp3.Request p8, okhttp3.WebSocketListener p9)
    {
        okhttp3.internal.ws.RealWebSocket v6 = new okhttp3.internal.ws.RealWebSocket;
        v6(p8, p9, new java.util.Random(), ((long) this.pingInterval));
        v6.connect(this);
        return v6;
    }

Method com.google.android.gms.internal.measurement.zzkd.zzln() calling method java.util.Random.<init>()


    public final long zzln()
    {
        if (this.zzasz.get() != 0) {
            try {
                this.zzasz.compareAndSet(-1, 1);
                return this.zzasz.getAndIncrement();
            } catch (Throwable v1_2) {
                throw v1_2;
            }
        } else {
            try {
                Throwable v1_5 = new java.util.Random((System.nanoTime() ^ this.zzbt().currentTimeMillis())).nextLong();
                long v3_1 = (this.zzadj + 1);
                this.zzadj = v3_1;
                return (v1_5 + ((long) v3_1));
            } catch (Throwable v1_7) {
                throw v1_7;
            }
        }
    }

Method com.mixpanel.android.java_websocket.drafts.Draft_76.generateKey() calling method java.util.Random.<init>()


    private static String generateKey()
    {
        java.util.Random v0_1 = new java.util.Random();
        long v2_2 = ((long) (v0_1.nextInt(12) + 1));
        StringBuilder v4_7 = Long.toString((((long) (v0_1.nextInt(Math.abs(new Long((2.1219957905e-314 / v2_2)).intValue())) + 1)) * v2_2));
        StringBuilder v1_2 = (v0_1.nextInt(12) + 1);
        int v5_0 = 0;
        String v6_0 = v4_7;
        StringBuilder v4_8 = 0;
        while (v4_8 < v1_2) {
            long v7_3 = Math.abs(v0_1.nextInt(v6_0.length()));
            char v8_3 = ((char) (v0_1.nextInt(95) + 33));
            if ((v8_3 >= 48) && (v8_3 <= 57)) {
                v8_3 = ((char) (v8_3 - 15));
            }
            v6_0 = new StringBuilder(v6_0).insert(v7_3, v8_3).toString();
            v4_8++;
        }
        while (((long) v5_0) < v2_2) {
            v6_0 = new StringBuilder(v6_0).insert(Math.abs((v0_1.nextInt((v6_0.length() - 1)) + 1)), " ").toString();
            v5_0++;
        }
        return v6_0;
    }

Method com.mixpanel.android.java_websocket.drafts.Draft_76.<init>() calling method java.util.Random.<init>()


    public Draft_76()
    {
        this.failed = 0;
        this.reuseableRandom = new java.util.Random();
        return;
    }

Method com.google.android.gms.internal.ads.zztu.onAdClosed() calling method java.util.Random.<init>()


    public final void onAdClosed()
    {
        if (com.google.android.gms.internal.ads.zzud.zzlv()) {
            long v0_1 = ((Integer) com.google.android.gms.internal.ads.zzkb.zzik().zzd(com.google.android.gms.internal.ads.zznk.zzazg)).intValue();
            int v1_3 = ((Integer) com.google.android.gms.internal.ads.zzkb.zzik().zzd(com.google.android.gms.internal.ads.zznk.zzazh)).intValue();
            if ((v0_1 > 0) && (v1_3 >= 0)) {
                com.google.android.gms.internal.ads.zzakk.zzcrm.postDelayed(com.google.android.gms.internal.ads.zztv.zzboj, ((long) (v0_1 + new java.util.Random().nextInt((v1_3 + 1)))));
            } else {
                com.google.android.gms.ads.internal.zzbv.zzex().zzld();
            }
        }
        this.zzboi.onAdClosed();
        return;
    }

Method com.google.android.gms.internal.ads.zzkc.<init>() calling method java.util.Random.<init>()


    public zzkc()
    {
        this.mLock = new Object();
        this.zzasg = new java.util.Random();
        this.zzil();
        return;
    }

Method com.mixpanel.android.java_websocket.drafts.Draft_75.<init>() calling method java.util.Random.<init>()


    public Draft_75()
    {
        this.readingState = 0;
        this.readyframes = new java.util.LinkedList();
        this.reuseableRandom = new java.util.Random();
        return;
    }

Method com.mixpanel.android.java_websocket.drafts.Draft_10.<init>() calling method java.util.Random.<init>()


    public Draft_10()
    {
        this.fragmentedframe = 0;
        this.reuseableRandom = new java.util.Random();
        return;
    }

Method com.paypal.android.sdk.onetouch.core.e.b.<init>() calling method java.util.Random.<init>()


    b()
    {
        String v0_3 = System.currentTimeMillis();
        if (this.a == null) {
            this.b = v0_3;
        }
        if ((this.b + 1800000) > v0_3) {
            this.b = (v0_3 + 1800000);
            String v0_2 = new java.util.Random(this.b);
            StringBuilder v1_2 = new StringBuilder();
            int v2_0 = 0;
            while (v2_0 < 8) {
                v1_2.append(((char) ((Math.abs(v0_2.nextInt()) % 10) + 48)));
                v2_0++;
            }
            this.a = v1_2.toString();
        }
        return;
    }

Method com.paypal.android.sdk.onetouch.core.e.a.a() calling method java.util.Random.<init>()


    void a(String p5)
    {
        new android.os.Handler(android.os.Looper.getMainLooper()).postDelayed(new ark>com.paypal.android.sdk.onetouch.core.e.aark>$1(this, p5), ((long) ((new java.util.Random().nextInt(190) + 10) * 1000)));
        return;
    }

Method com.mixpanel.android.mpmetrics.SessionMetadata.initSession() calling method java.util.Random.<init>()


    protected void initSession()
    {
        this.mEventsCounter = 0;
        this.mPeopleCounter = 0;
        this.mSessionID = Long.toHexString(new java.util.Random().nextLong());
        this.mSessionStartEpoch = (System.currentTimeMillis() / 1000);
        return;
    }

Method com.mixpanel.android.mpmetrics.SessionMetadata.<init>() calling method java.util.Random.<init>()


    SessionMetadata()
    {
        this.initSession();
        this.mRandom = new java.util.Random();
        return;
    }

Method com.google.common.cache.m.<clinit>() calling method java.util.Random.<init>()


    static m()
    {
        com.google.common.cache.m.a = new ThreadLocal();
        com.google.common.cache.m.b = new java.util.Random();
        com.google.common.cache.m.c = Runtime.getRuntime().availableProcessors();
        try {
            com.google.common.cache.m.g = com.google.common.cache.m.a();
            com.google.common.cache.m.h = com.google.common.cache.m.g.objectFieldOffset(com.google.common.cache.m.getDeclaredField("base"));
            com.google.common.cache.m.i = com.google.common.cache.m.g.objectFieldOffset(com.google.common.cache.m.getDeclaredField("busy"));
            return;
        } catch (Exception v0_7) {
            throw new Error(v0_7);
        }
    }

Method com.google.android.gms.tagmanager.zzai.<init>() calling method java.util.Random.<init>()


    public zzai(android.content.Context p2, String p3)
    {
        this(p2, p3, new java.util.Random());
        return;
    }

Method com.google.android.gms.internal.ads.zzcc.zzy() calling method java.util.Random.<init>()


    private static java.util.Random zzy()
    {
        if (com.google.android.gms.internal.ads.zzcc.zzpw == null) {
            try {
                if (com.google.android.gms.internal.ads.zzcc.zzpw == null) {
                    com.google.android.gms.internal.ads.zzcc.zzpw = new java.util.Random();
                }
            } catch (java.util.Random v1_3) {
                throw v1_3;
            }
        }
        return com.google.android.gms.internal.ads.zzcc.zzpw;
    }

Method com.google.android.gms.analytics.Tracker.<init>() calling method java.util.Random.<init>()


    Tracker(com.google.android.gms.internal.measurement.zzat p3, String p4, com.google.android.gms.internal.measurement.zzck p5)
    {
        super(p3);
        super.zzsm = new java.util.HashMap();
        super.zzsn = new java.util.HashMap();
        if (p4 != null) {
            super.zzsm.put("&tid", p4);
        }
        super.zzsm.put("useSecure", "1");
        super.zzsm.put("&a", Integer.toString((new java.util.Random().nextInt(2147483647) + 1)));
        super.zzso = new com.google.android.gms.internal.measurement.zzck("tracking", super.zzbt());
        super.zzsp = new com.google.android.gms.analytics.Tracker$zza(super, p3);
        return;
    }

Method com.crashlytics.android.answers.RandomBackoff.<init>() calling method java.util.Random.<init>()


    public RandomBackoff(io.fabric.sdk.android.services.concurrency.a.a p2, double p3)
    {
        this(p2, p3, new java.util.Random());
        return;
    }

Method com.facebook.internal.Utility.generateRandomString() calling method java.util.Random.<init>()


    public static String generateRandomString(int p2)
    {
        return new java.math.BigInteger((p2 * 5), new java.util.Random()).toString(32);
    }

Method androidx.leanback.widget.y.<init>() calling method java.util.Random.<init>()


    public y(android.content.Context p1, android.util.AttributeSet p2, int p3)
    {
        super(p1, p2, p3);
        super.a = new java.util.Random();
        return;
    }

Method androidx.leanback.widget.y.<init>() calling method java.util.Random.<init>()


    public y(android.content.Context p1, android.util.AttributeSet p2)
    {
        super(p1, p2);
        super.a = new java.util.Random();
        return;
    }

Method net.skyscanner.nid.entity.g.a() calling method java.security.SecureRandom.<init>()


    String a()
    {
        String v0_1 = new byte[16];
        new java.security.SecureRandom().nextBytes(v0_1);
        return android.util.Base64.encodeToString(new javax.crypto.spec.SecretKeySpec(v0_1, "AES").getEncoded(), 0);
    }

Method net.openid.appauth.i.a() calling method java.security.SecureRandom.<init>()


    public static String a()
    {
        return ark>net.openid.appauth.iark>.a(new java.security.SecureRandom(), 64);
    }

Method net.openid.appauth.d.f() calling method java.security.SecureRandom.<init>()


    private static String f()
    {
        byte[] v1_1 = new byte[16];
        new java.security.SecureRandom().nextBytes(v1_1);
        return android.util.Base64.encodeToString(v1_1, 11);
    }

Method com.google.android.gms.internal.measurement.zzkd.zzlo() calling method java.security.SecureRandom.<init>()


    final java.security.SecureRandom zzlo()
    {
        this.zzab();
        if (this.zzasy == null) {
            this.zzasy = new java.security.SecureRandom();
        }
        return this.zzasy;
    }

Method com.google.android.gms.internal.measurement.zzkd.zzgo() calling method java.security.SecureRandom.<init>()


    protected final void zzgo()
    {
        this.zzab();
        com.google.android.gms.internal.measurement.zzfk v0_5 = new java.security.SecureRandom();
        long v1 = v0_5.nextLong();
        if (v1 == 0) {
            v1 = v0_5.nextLong();
            if (v1 == 0) {
                this.zzgi().zziy().log("Utils falling back to Random for random id");
            }
        }
        this.zzasz.set(v1);
        return;
    }

Method io.jsonwebtoken.impl.crypto.SignatureProvider.<clinit>() calling method java.security.SecureRandom.<init>()


    static SignatureProvider()
    {
        io.jsonwebtoken.impl.crypto.SignatureProvider.DEFAULT_SECURE_RANDOM = new java.security.SecureRandom();
        byte[] v1_1 = new byte[64];
        io.jsonwebtoken.impl.crypto.SignatureProvider.DEFAULT_SECURE_RANDOM.nextBytes(v1_1);
        return;
    }

Method com.paypal.android.sdk.onetouch.core.c.c.d() calling method java.security.SecureRandom.<init>()


    private static void d()
    {
        if (android.os.Build$VERSION.SDK_INT <= 18) {
            String v0_13 = java.security.Security.getProviders("SecureRandom.SHA1PRNG");
            if ((v0_13 == null) || (v0_13.length < 1)) {
                java.security.Security.insertProviderAt(new com.paypal.android.sdk.onetouch.core.c.c$b(), 1);
            } else {
                if (!v0_13[0].getClass().getSimpleName().equals("LinuxPRNGSecureRandomProvider")) {
                }
            }
            String v0_8 = new java.security.SecureRandom();
            if (!"LinuxPRNGSecureRandomProvider".equals(v0_8.getProvider().getClass().getSimpleName())) {
                StringBuilder v3_6 = new StringBuilder();
                v3_6.append("new SecureRandom() backed by wrong Provider: ");
                v3_6.append(v0_8.getProvider().getClass());
                throw new SecurityException(v3_6.toString());
            } else {
                String v0_15 = java.security.SecureRandom.getInstance("SHA1PRNG");
                if (!"LinuxPRNGSecureRandomProvider".equals(v0_15.getProvider().getClass().getSimpleName())) {
                    StringBuilder v3_12 = new StringBuilder();
                    v3_12.append("SecureRandom.getInstance(\"SHA1PRNG\") backed by wrong Provider: ");
                    v3_12.append(v0_15.getProvider().getClass());
                    throw new SecurityException(v3_12.toString());
                } else {
                    return;
                }
            }
        } else {
            return;
        }
    }

Method com.paypal.android.sdk.onetouch.core.c.a.<clinit>() calling method java.security.SecureRandom.<init>()


    static a()
    {
        com.paypal.android.sdk.onetouch.core.c.c.a();
        com.paypal.android.sdk.onetouch.core.c.a.a = new java.security.SecureRandom();
        return;
    }

Method com.google.android.gms.internal.ads.zzbk.zza() calling method java.security.SecureRandom.<init>()


    private static byte[] zza(byte[] p5, String p6, boolean p7)
    {
        int v0_0;
        if (p7 == null) {
            v0_0 = 255;
        } else {
            v0_0 = 239;
        }
        if (p5.length > v0_0) {
            p5 = com.google.android.gms.internal.ads.zzbfi.zzb(com.google.android.gms.internal.ads.zzbk.zzc(4096));
        }
        byte[] v5_1;
        if (p5.length >= v0_0) {
            v5_1 = java.nio.ByteBuffer.allocate((v0_0 + 1)).put(((byte) p5.length)).put(p5);
        } else {
            int v1_5 = new byte[(v0_0 - p5.length)];
            new java.security.SecureRandom().nextBytes(v1_5);
            v5_1 = java.nio.ByteBuffer.allocate((v0_0 + 1)).put(((byte) p5.length)).put(p5).put(v1_5);
        }
        byte[] v5_3 = v5_1.array();
        if (p7 != null) {
            v5_3 = java.nio.ByteBuffer.allocate(256).put(com.google.android.gms.internal.ads.zzbk.zzb(v5_3)).put(v5_3).array();
        }
        byte[] v7_3 = new byte[256];
        int v0_10 = new com.google.android.gms.internal.ads.zzbn().zzpq;
        int v1_9 = v0_10.length;
        int v3 = 0;
        while (v3 < v1_9) {
            v0_10[v3].zza(v5_3, v7_3);
            v3++;
        }
        if ((p6 != null) && (p6.length() > 0)) {
            if (p6.length() > 32) {
                p6 = p6.substring(0, 32);
            }
            new com.google.android.gms.internal.ads.zzazx(p6.getBytes("UTF-8")).zzn(v7_3);
        }
        return v7_3;
    }

Method com.google.android.gms.internal.ads.zzazl.zzaar() calling method java.security.SecureRandom.<init>()


    private static java.security.SecureRandom zzaar()
    {
        java.security.SecureRandom v0_1 = new java.security.SecureRandom();
        v0_1.nextLong();
        return v0_1;
    }

Method com.google.android.gms.auth.api.credentials.PasswordSpecification.<init>() calling method java.security.SecureRandom.<init>()


    PasswordSpecification(String p4, java.util.List p5, java.util.List p6, int p7, int p8)
    {
        this.zzdi = p4;
        this.zzdj = java.util.Collections.unmodifiableList(p5);
        this.zzdk = java.util.Collections.unmodifiableList(p6);
        this.zzdl = p7;
        this.zzdm = p8;
        java.security.SecureRandom v4_2 = new int[95];
        java.util.Arrays.fill(v4_2, -1);
        java.util.Iterator v5_3 = this.zzdj.iterator();
        int v7_1 = 0;
        while (v5_3.hasNext()) {
            char[] v8_4 = ((String) v5_3.next()).toCharArray();
            int v0 = v8_4.length;
            int v1 = 0;
            while (v1 < v0) {
                v4_2[(v8_4[v1] - 32)] = v7_1;
                v1++;
            }
            v7_1++;
        }
        this.zzdn = v4_2;
        this.zzdo = new java.security.SecureRandom();
        return;
    }

Method com.appsflyer.t.ˋ() calling method java.security.SecureRandom.<init>()


    public static declared_synchronized String ˋ(ref.WeakReference p7)
    {
        try {
            if (p7.get() != null) {
                if (com.appsflyer.t.ˎ == null) {
                    String v3_0 = 0;
                    if (p7.get() != null) {
                        v3_0 = ((android.content.Context) p7.get()).getSharedPreferences("appsflyer-data", 0).getString("AF_INSTALLATION", 0);
                    } else {
                    }
                    if (v3_0 == null) {
                        try {
                            int v1_5 = new java.io.File(((android.content.Context) p7.get()).getFilesDir(), "AF_INSTALLATION");
                        } catch (android.content.SharedPreferences$Editor v7_5) {
                            com.appsflyer.AFLogger.afErrorLog("Error getting AF unique ID", v7_5);
                        }
                        if (v1_5.exists()) {
                            com.appsflyer.t.ˎ = com.appsflyer.t.ˎ(v1_5);
                            v1_5.delete();
                        } else {
                            int v1_9;
                            if (android.os.Build$VERSION.SDK_INT < 9) {
                                v1_9 = java.util.UUID.randomUUID().toString();
                            } else {
                                long v5_0 = System.currentTimeMillis();
                                int v1_11 = new StringBuilder();
                                v1_11.append(v5_0);
                                v1_11.append("-");
                                v1_11.append(Math.abs(new java.security.SecureRandom().nextLong()));
                                v1_9 = v1_11.toString();
                            }
                            com.appsflyer.t.ˎ = v1_9;
                        }
                        android.content.SharedPreferences$Editor v7_4 = ((android.content.Context) p7.get()).getSharedPreferences("appsflyer-data", 0).edit();
                        v7_4.putString("AF_INSTALLATION", com.appsflyer.t.ˎ);
                        if (android.os.Build$VERSION.SDK_INT < 9) {
                            v7_4.commit();
                        } else {
                            v7_4.apply();
                        }
                    } else {
                        com.appsflyer.t.ˎ = v3_0;
                    }
                    if (com.appsflyer.t.ˎ != null) {
                        com.appsflyer.AppsFlyerProperties.getInstance().set("uid", com.appsflyer.t.ˎ);
                    }
                }
                return com.appsflyer.t.ˎ;
            } else {
                return com.appsflyer.t.ˎ;
            }
        } catch (android.content.SharedPreferences$Editor v7_8) {
            throw v7_8;
        }
    }