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 io.intercom.android.sdk.nexus.NexusSocket.calculateReconnectTimerInSeconds() calling method java.util.Random.<init>()


    static long calculateReconnectTimerInSeconds(int p4)
    {
        long v0_5 = ((int) Math.min(Math.pow(2.0, ((double) p4)), 900.0));
        return ((long) (v0_5 + new java.util.Random().nextInt((v0_5 + 1))));
    }

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


    private static String e()
    {
        java.util.Random v4_1 = new java.util.Random();
        long v6 = ((long) (v4_1.nextInt(12) + 1));
        int v2_3 = Long.toString((((long) (v4_1.nextInt(Math.abs(new Long((2.1219957905e-314 / v6)).intValue())) + 1)) * v6));
        int v5_1 = (v4_1.nextInt(12) + 1);
        StringBuilder v3_0 = 0;
        while (v3_0 < v5_1) {
            int v8 = Math.abs(v4_1.nextInt(v2_3.length()));
            int v0_13 = ((char) (v4_1.nextInt(95) + 33));
            if ((v0_13 >= 48) && (v0_13 <= 57)) {
                v0_13 = ((char) (v0_13 - 15));
            }
            v2_3 = new StringBuilder(v2_3).insert(v8, v0_13).toString();
            v3_0++;
        }
        int v0_6 = 0;
        String v1_1 = v2_3;
        while (((long) v0_6) < v6) {
            v1_1 = new StringBuilder(v1_1).insert(Math.abs((v4_1.nextInt((v1_1.length() - 1)) + 1)), " ").toString();
            v0_6++;
        }
        return v1_1;
    }

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


    public e()
    {
        this.i = 0;
        this.k = new java.util.Random();
        return;
    }

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


    public d()
    {
        this.f = 0;
        this.g = new java.util.LinkedList();
        this.i = new java.util.Random();
        return;
    }

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


    public b()
    {
        this.h = 0;
        this.i = new java.util.Random();
        return;
    }

Method com.google.firebase.iid.k.a() calling method java.util.Random.<init>()


    final void a(android.content.Intent p14)
    {
        String v1_0 = 0;
        if (p14 != null) {
            if ("com.google.android.c2dm.intent.REGISTRATION".equals(p14.getAction())) {
                String v0_15 = p14.getStringExtra("registration_id");
                if (v0_15 == null) {
                    v0_15 = p14.getStringExtra("unregistered");
                }
                if (v0_15 != null) {
                    this.m = android.os.SystemClock.elapsedRealtime();
                    this.q = 0;
                    this.o = 0;
                    this.p = 0;
                    if (v0_15.startsWith("|")) {
                        String v3_13 = v0_15.split("\\|");
                        if (!"ID".equals(v3_13[1])) {
                            String v0_58;
                            String v0_56 = String.valueOf(v0_15);
                            if (v0_56.length() == 0) {
                                v0_58 = new String("Unexpected structured response ");
                            } else {
                                v0_58 = "Unexpected structured response ".concat(v0_56);
                            }
                            android.util.Log.w("InstanceID/Rpc", v0_58);
                        }
                        int v2_31 = v3_13[2];
                        if (v3_13.length > 4) {
                            if (!"SYNC".equals(v3_13[3])) {
                                if ("RST".equals(v3_13[3])) {
                                    String v0_64 = this.g;
                                    com.google.firebase.iid.i.a(this.g, 0);
                                    com.google.firebase.iid.FirebaseInstanceId.a(v0_64, com.google.firebase.iid.i.c());
                                    p14.removeExtra("registration_id");
                                    this.a(v2_31, p14);
                                    return;
                                }
                            } else {
                                com.google.firebase.iid.FirebaseInstanceId.c(this.g);
                            }
                        }
                        String v0_70 = v3_13[(v3_13.length - 1)];
                        if (v0_70.startsWith(":")) {
                            v0_70 = v0_70.substring(1);
                        }
                        p14.putExtra("registration_id", v0_70);
                        v1_0 = v2_31;
                    }
                    if (v1_0 != null) {
                        this.a(v1_0, p14);
                    } else {
                        if (android.util.Log.isLoggable("InstanceID/Rpc", 3)) {
                            android.util.Log.d("InstanceID/Rpc", "Ignoring response without a request ID");
                        }
                    }
                } else {
                    int v2_0 = p14.getStringExtra("error");
                    if (v2_0 != 0) {
                        if (android.util.Log.isLoggable("InstanceID/Rpc", 3)) {
                            String v0_5;
                            String v0_3 = String.valueOf(v2_0);
                            if (v0_3.length() == 0) {
                                v0_5 = new String("Received InstanceID error ");
                            } else {
                                v0_5 = "Received InstanceID error ".concat(v0_3);
                            }
                            android.util.Log.d("InstanceID/Rpc", v0_5);
                        }
                        String v1_1;
                        String v0_9;
                        if (!v2_0.startsWith("|")) {
                            v0_9 = 0;
                            v1_1 = v2_0;
                        } else {
                            String v3_1 = v2_0.split("\\|");
                            if (!"ID".equals(v3_1[1])) {
                                String v0_16;
                                String v0_13 = String.valueOf(v2_0);
                                if (v0_13.length() == 0) {
                                    v0_16 = new String("Unexpected structured response ");
                                } else {
                                    v0_16 = "Unexpected structured response ".concat(v0_13);
                                }
                                android.util.Log.w("InstanceID/Rpc", v0_16);
                            }
                            if (v3_1.length <= 2) {
                                v1_1 = "UNKNOWN";
                                v0_9 = 0;
                            } else {
                                v0_9 = v3_1[2];
                                v1_1 = v3_1[3];
                                if (v1_1.startsWith(":")) {
                                    v1_1 = v1_1.substring(1);
                                }
                            }
                            p14.putExtra("error", v1_1);
                        }
                        this.a(v0_9, v1_1);
                        int v2_5 = p14.getLongExtra("Retry-After", 0);
                        if (v2_5 <= 0) {
                            if ((("SERVICE_NOT_AVAILABLE".equals(v1_1)) || ("AUTHENTICATION_FAILED".equals(v1_1))) && ("com.google.android.gsf".equals(ark>com.google.firebase.iid.kark>.a))) {
                                this.o = (this.o + 1);
                                if (this.o >= 3) {
                                    if (this.o == 3) {
                                        this.p = (new java.util.Random().nextInt(1000) + 1000);
                                    }
                                    this.p = (this.p << 1);
                                    this.q = (android.os.SystemClock.elapsedRealtime() + ((long) this.p));
                                    android.util.Log.w("InstanceID/Rpc", new StringBuilder((String.valueOf(v1_1).length() + 31)).append("Backoff due to ").append(v1_1).append(" for ").append(this.p).toString());
                                }
                            }
                        } else {
                            this.n = android.os.SystemClock.elapsedRealtime();
                            this.p = (((int) v2_5) * 1000);
                            this.q = (android.os.SystemClock.elapsedRealtime() + ((long) this.p));
                            android.util.Log.w("InstanceID/Rpc", new StringBuilder(52).append("Explicit request from server to backoff: ").append(this.p).toString());
                        }
                    } else {
                        String v1_10 = String.valueOf(p14.getExtras());
                        android.util.Log.w("InstanceID/Rpc", new StringBuilder((String.valueOf(v1_10).length() + 49)).append("Unexpected response, no error or registration id ").append(v1_10).toString());
                    }
                }
            } else {
                if (android.util.Log.isLoggable("InstanceID/Rpc", 3)) {
                    String v0_52;
                    String v0_50 = String.valueOf(p14.getAction());
                    if (v0_50.length() == 0) {
                        v0_52 = new String("Unexpected response ");
                    } else {
                        v0_52 = "Unexpected response ".concat(v0_50);
                    }
                    android.util.Log.d("InstanceID/Rpc", v0_52);
                }
            }
        } else {
            if (android.util.Log.isLoggable("InstanceID/Rpc", 3)) {
                android.util.Log.d("InstanceID/Rpc", "Unexpected response: null");
            }
        }
        return;
    }

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


    public zzjp()
    {
        this.c = new Object();
        this.a = new java.util.Random();
        this.zzhw();
        return;
    }

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


    private static java.util.Random b()
    {
        if (com.google.android.gms.internal.zzco.e == null) {
            if (com.google.android.gms.internal.zzco.e == null) {
                com.google.android.gms.internal.zzco.e = new java.util.Random();
            }
        }
        return com.google.android.gms.internal.zzco.e;
    }

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


    public final long zzazw()
    {
        try {
            Throwable v0_2;
            if (this.c.get() != 0) {
                try {
                    this.c.compareAndSet(-1, 1);
                    v0_2 = this.c.getAndIncrement();
                } catch (Throwable v0_3) {
                    throw v0_3;
                }
            } else {
                Throwable v0_7 = new java.util.Random((System.nanoTime() ^ this.zzvu().currentTimeMillis())).nextLong();
                int v3_1 = (this.d + 1);
                this.d = v3_1;
                v0_2 = (v0_7 + ((long) v3_1));
            }
        } catch (Throwable v0_8) {
            throw v0_8;
        }
        return v0_2;
    }

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


    public final void onAdClosed()
    {
        if (com.google.android.gms.internal.su.a()) {
            int v1_0 = ((Integer) com.google.android.gms.ads.internal.zzbv.zzen().zzd(com.google.android.gms.internal.zzmu.zzbki)).intValue();
            long v0_4 = ((Integer) com.google.android.gms.ads.internal.zzbv.zzen().zzd(com.google.android.gms.internal.zzmu.zzbkj)).intValue();
            if ((v1_0 > 0) && (v0_4 >= 0)) {
                com.google.android.gms.internal.zzahf.zzdbo.postDelayed(com.google.android.gms.internal.sp.a, ((long) (new java.util.Random().nextInt((v0_4 + 1)) + v1_0)));
            } else {
                com.google.android.gms.ads.internal.zzbv.zzep().a();
            }
        }
        this.a.onAdClosed();
        return;
    }

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


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

Method com.appsflyer.m.b() calling method java.util.Random.<init>()


    private static String b(android.content.Context p4)
    {
        String v0_2;
        String v0_6 = p4.getPackageManager().getPackageInfo(p4.getPackageName(), 0);
        if (android.os.Build$VERSION.SDK_INT < 9) {
            v0_2 = java.util.UUID.randomUUID().toString();
        } else {
            v0_2 = new StringBuilder().append(v0_6.firstInstallTime).append("-").append(Math.abs(new java.util.Random().nextLong())).toString();
        }
        return v0_2;
    }

Method com.amazonaws.retry.PredefinedRetryPolicies$SDKDefaultBackoffStrategy.<init>() calling method java.util.Random.<init>()


    private PredefinedRetryPolicies$SDKDefaultBackoffStrategy(int p2, int p3)
    {
        this.b = new java.util.Random();
        this.c = p2;
        this.d = p3;
        return;
    }

Method jp.moneytree.moneytree.fcm.e.a() calling method java.security.SecureRandom.<init>()


    public final void a(com.google.firebase.messaging.a p12)
    {
        if ((p12 != null) && (p12.b() != null)) {
            android.app.NotificationManager v0_0 = p12.b();
            android.support.v4.app.NotificationCompat$Builder v5_0 = new Object[1];
            v5_0[0] = v0_0.toString();
            b.a.a.b("Received push notification %s", v5_0);
            if (!this.b.isIntercomPush(v0_0)) {
                String v4_6 = p12.c();
                android.support.v4.app.NotificationCompat$Builder v5_2 = new android.content.Intent(((android.content.Context) this.a), jp.moneytree.moneytree.view.MTStartupActivity);
                v5_2.addFlags(67108864);
                v5_2.setAction(v4_6.e());
                int v6_2 = new java.security.SecureRandom().nextInt();
                android.support.v4.app.NotificationCompat$Builder v5_3 = android.app.PendingIntent.getActivity(((android.content.Context) this.a), v6_2, v5_2, 1073741824);
                android.support.v4.app.NotificationCompat$Builder v5_4 = new android.support.v4.app.NotificationCompat$Builder(((android.content.Context) this.a)).setAutoCancel(1).setOnlyAlertOnce(0).setAutoCancel(1).setSound(android.media.RingtoneManager.getDefaultUri(2)).setContentIntent(v5_3).setDefaults(7).setContentIntent(v5_3).setWhen(System.currentTimeMillis());
                if (!android.text.TextUtils.isEmpty(((CharSequence) v4_6.a()))) {
                    v5_4.setContentTitle(((CharSequence) v4_6.a()));
                }
                if (!android.text.TextUtils.isEmpty(((CharSequence) v4_6.b()))) {
                    v5_4.setContentText(((CharSequence) v4_6.b())).setTicker(((CharSequence) v4_6.b()));
                }
                android.app.NotificationManager v0_44 = jp.moneytree.moneytree.fcm.b.a(v4_6);
                if (v0_44 >= null) {
                    v5_4.setColor(v0_44);
                }
                android.app.NotificationManager v0_2;
                android.app.NotificationManager v0_46 = ((CharSequence) v4_6.c());
                if ((v0_46 != null) && (v0_46.length() != 0)) {
                    v0_2 = 0;
                } else {
                    v0_2 = 1;
                }
                android.app.NotificationManager v0_5;
                if (v0_2 == null) {
                    v0_5 = this.a.getResources().getIdentifier(v4_6.c(), "drawable", this.a.getPackageName());
                } else {
                    v0_5 = 2130838090;
                }
                if (v0_5 < null) {
                    v0_5 = 2130838090;
                }
                android.app.Notification v1_0;
                Object[] v7_1 = new Object[2];
                v7_1[0] = Integer.valueOf(v0_5);
                if (2130838090 != v0_5) {
                    v1_0 = 0;
                } else {
                    v1_0 = 1;
                }
                v7_1[1] = Boolean.valueOf(v1_0);
                b.a.a.b("Notification small iconID: %s\nIs chibi_gray: %s", v7_1);
                v5_4.setSmallIcon(v0_5);
                android.app.NotificationManager v0_7 = this.a.getSystemService("notification");
                if (v0_7 != null) {
                    ((android.app.NotificationManager) v0_7).notify(v6_2, v5_4.build());
                } else {
                    throw new kotlin.TypeCastException("null cannot be cast to non-null type android.app.NotificationManager");
                }
            } else {
                this.b.handlePush(this.a, v0_0);
            }
        } else {
            android.app.Notification v1_8;
            StringBuilder vtmp2 = new StringBuilder().append("\n              |Firebase Message was invalid\n              |Message Object: ");
            if (p12 == null) {
                v1_8 = "Null";
            } else {
                v1_8 = p12;
            }
            android.app.Notification v1_10;
            String v3_3 = vtmp2.append(v1_8).append("\n              |Message Data: ");
            if (p12 == null) {
                v1_10 = "Null";
            } else {
                v1_10 = p12.b();
                if (v1_10 == null) {
                }
            }
            b.a.a.a(((Throwable) new IllegalStateException(kotlin.i.j.a(v3_3.append(v1_10).append("\n              ").toString(), 0, 1, 0))));
        }
        return;
    }

Method jp.moneytree.moneytree.data.MTKeyStoreManager.b() calling method java.security.SecureRandom.<init>()


    public void b(String p5, String p6)
    {
        String v0_3 = jp.moneytree.moneytree.common.g.b().a(p6, jp.moneytree.moneytree.model.db.MTGuest);
        if ((!p5.matches("^[0-9]+$")) || (p5.length() == 4)) {
            String v0_1 = ((jp.moneytree.moneytree.model.db.MTGuest) v0_3).getUid();
            if (!android.text.TextUtils.isEmpty(v0_1)) {
                jp.moneytree.moneytree.common.i.a.a(new jp.moneytree.moneytree.data.b.a());
                if (this.b(p5)) {
                    jp.moneytree.moneytree.data.d v1_6 = new byte[64];
                    new java.security.SecureRandom().nextBytes(v1_6);
                    this.b.b(this.a(v1_6));
                    this.b.a(this.g(v0_1));
                    return;
                } else {
                    throw new IllegalStateException("Failed to create keyPair in PIN Registration.");
                }
            } else {
                throw new jp.moneytree.moneytree.view.common.NoGuestException();
            }
        } else {
            jp.moneytree.moneytree.data.d v2_7 = new Object[1];
            v2_7[0] = p5;
            throw new IllegalArgumentException(String.format("PIN length isn\'t valid: %s", v2_7));
        }
    }

Method io.intercom.okhttp3.OkHttpClient.newWebSocket() calling method java.security.SecureRandom.<init>()


    public io.intercom.okhttp3.WebSocket newWebSocket(io.intercom.okhttp3.Request p3, io.intercom.okhttp3.WebSocketListener p4)
    {
        io.intercom.okhttp3.internal.ws.RealWebSocket v0_1 = new io.intercom.okhttp3.internal.ws.RealWebSocket(p3, p4, new java.security.SecureRandom());
        v0_1.connect(this);
        return v0_1;
    }

Method com.google.android.gms.internal.zzdij.<clinit>() calling method java.security.SecureRandom.<init>()


    static zzdij()
    {
        com.google.android.gms.internal.zzdij.a = new java.security.SecureRandom();
        return;
    }

Method com.google.android.gms.internal.zzcfo.b() calling method java.security.SecureRandom.<init>()


    final java.security.SecureRandom b()
    {
        this.zzug();
        if (this.b == null) {
            this.b = new java.security.SecureRandom();
        }
        return this.b;
    }

Method com.google.android.gms.internal.zzcfo.a() calling method java.security.SecureRandom.<init>()


    protected final void a()
    {
        com.google.android.gms.internal.zzcbq v2_4 = new java.security.SecureRandom();
        long v0 = v2_4.nextLong();
        if (v0 == 0) {
            v0 = v2_4.nextLong();
            if (v0 == 0) {
                this.zzauk().zzaye().log("Utils falling back to Random for random id");
            }
        }
        this.c.set(v0);
        return;
    }

Method com.google.android.gms.internal.fo.a() calling method java.security.SecureRandom.<init>()


    private static byte[] a(byte[] p6, String p7, boolean p8)
    {
        byte[] v0_5;
        if (!p8) {
            v0_5 = 255;
        } else {
            v0_5 = 239;
        }
        if (p6.length > v0_5) {
            p6 = com.google.android.gms.internal.zzego.zzc(ark>com.google.android.gms.internal.foark>.a(4096));
        }
        byte[] v0_4;
        if (p6.length >= v0_5) {
            v0_4 = java.nio.ByteBuffer.allocate((v0_5 + 1)).put(((byte) p6.length)).put(p6).array();
        } else {
            byte[] v1_5 = new byte[(v0_5 - p6.length)];
            new java.security.SecureRandom().nextBytes(v1_5);
            v0_4 = java.nio.ByteBuffer.allocate((v0_5 + 1)).put(((byte) p6.length)).put(p6).put(v1_5).array();
        }
        if (p8) {
            v0_4 = java.nio.ByteBuffer.allocate(256).put(ark>com.google.android.gms.internal.foark>.a(v0_4)).put(v0_4).array();
        }
        byte[] v1_9 = new byte[256];
        new com.google.android.gms.internal.zzbz().a(v0_4, v1_9);
        if ((p7 != null) && (p7.length() > 0)) {
            if (p7.length() > 32) {
                p7 = p7.substring(0, 32);
            }
            new com.google.android.gms.internal.zzecf(p7.getBytes("UTF-8")).zzap(v1_9);
        }
        return v1_9;
    }

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


    PasswordSpecification(String p9, java.util.List p10, java.util.List p11, int p12, int p13)
    {
        this.b = p9;
        this.c = java.util.Collections.unmodifiableList(p10);
        this.d = java.util.Collections.unmodifiableList(p11);
        this.e = p12;
        this.f = p13;
        int[] v3 = new int[95];
        java.util.Arrays.fill(v3, -1);
        java.util.Iterator v4 = this.c.iterator();
        int v1 = 0;
        while (v4.hasNext()) {
            char[] v5 = ((String) v4.next()).toCharArray();
            int v6 = v5.length;
            int v0_8 = 0;
            while (v0_8 < v6) {
                v3[(v5[v0_8] - 32)] = v1;
                v0_8++;
            }
            v1++;
        }
        this.g = v3;
        this.h = new java.security.SecureRandom();
        return;
    }