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 com.google.android.exoplayer2.trackselection.RandomTrackSelection.<init>() calling method java.util.Random.<init>()


    public RandomTrackSelection(com.google.android.exoplayer2.source.TrackGroup p2, int[] p3, long p4)
    {
        this(p2, p3, new java.util.Random(p4));
        return;
    }

Method com.google.android.exoplayer2.trackselection.RandomTrackSelection.<init>() calling method java.util.Random.<init>()


    public varargs RandomTrackSelection(com.google.android.exoplayer2.source.TrackGroup p1, int[] p2)
    {
        super(p1, p2);
        super.random = new java.util.Random();
        super.bTC = super.random.nextInt(super.length);
        return;
    }

Method com.google.android.exoplayer2.trackselection.RandomTrackSelection$Factory.<init>() calling method java.util.Random.<init>()


    public RandomTrackSelection$Factory(int p4)
    {
        this.random = new java.util.Random(((long) p4));
        return;
    }

Method com.google.android.exoplayer2.trackselection.RandomTrackSelection$Factory.<init>() calling method java.util.Random.<init>()


    public RandomTrackSelection$Factory()
    {
        this.random = new java.util.Random();
        return;
    }

Method com.google.android.exoplayer2.source.ShuffleOrder$DefaultShuffleOrder.fq() calling method java.util.Random.<init>()


    public com.google.android.exoplayer2.source.ShuffleOrder fq(int p7)
    {
        int[] v0_3 = new int[(this.bOs.length - 1)];
        int v2_2 = 0;
        int v3 = 0;
        while (v2_2 < this.bOs.length) {
            if (this.bOs[v2_2] != p7) {
                int v4_2;
                if (v3 == 0) {
                    v4_2 = v2_2;
                } else {
                    v4_2 = (v2_2 - 1);
                }
                int v5_3;
                if (this.bOs[v2_2] <= p7) {
                    v5_3 = this.bOs[v2_2];
                } else {
                    v5_3 = (this.bOs[v2_2] - 1);
                }
                v0_3[v4_2] = v5_3;
            } else {
                v3 = 1;
            }
            v2_2++;
        }
        return new com.google.android.exoplayer2.source.ShuffleOrder$DefaultShuffleOrder(v0_3, new java.util.Random(this.random.nextLong()));
    }

Method com.google.android.exoplayer2.source.ShuffleOrder$DefaultShuffleOrder.ag() calling method java.util.Random.<init>()


    public com.google.android.exoplayer2.source.ShuffleOrder ag(int p9, int p10)
    {
        long v0_0 = new int[p10];
        int[] v1 = new int[p10];
        int v2 = 0;
        int[] v3_0 = 0;
        while (v3_0 < p10) {
            v0_0[v3_0] = this.random.nextInt((this.bOs.length + 1));
            int v5_8 = (v3_0 + 1);
            int v4_5 = this.random.nextInt(v5_8);
            v1[v3_0] = v1[v4_5];
            v1[v4_5] = (v3_0 + p9);
            v3_0 = v5_8;
        }
        java.util.Arrays.sort(v0_0);
        int[] v3_5 = new int[(this.bOs.length + p10)];
        int v4_0 = 0;
        int v5_0 = 0;
        while (v2 < (this.bOs.length + p10)) {
            if ((v4_0 >= p10) || (v5_0 != v0_0[v4_0])) {
                int v7 = (v5_0 + 1);
                v3_5[v2] = this.bOs[v5_0];
                if (v3_5[v2] >= p9) {
                    v3_5[v2] = (v3_5[v2] + p10);
                }
                v5_0 = v7;
            } else {
                int v6_5 = (v4_0 + 1);
                v3_5[v2] = v1[v4_0];
                v4_0 = v6_5;
            }
            v2++;
        }
        return new com.google.android.exoplayer2.source.ShuffleOrder$DefaultShuffleOrder(v3_5, new java.util.Random(this.random.nextLong()));
    }

Method com.google.android.exoplayer2.source.ShuffleOrder$DefaultShuffleOrder.acK() calling method java.util.Random.<init>()


    public com.google.android.exoplayer2.source.ShuffleOrder acK()
    {
        return new com.google.android.exoplayer2.source.ShuffleOrder$DefaultShuffleOrder(0, new java.util.Random(this.random.nextLong()));
    }

Method com.google.android.exoplayer2.source.ShuffleOrder$DefaultShuffleOrder.<init>() calling method java.util.Random.<init>()


    public ShuffleOrder$DefaultShuffleOrder(int p2, long p3)
    {
        this(p2, new java.util.Random(p3));
        return;
    }

Method com.google.android.exoplayer2.source.ShuffleOrder$DefaultShuffleOrder.<init>() calling method java.util.Random.<init>()


    public ShuffleOrder$DefaultShuffleOrder(int p2)
    {
        this(p2, new java.util.Random());
        return;
    }

Method com.eurosport.player.epg.presenter.SchedulePresenterImpl.KG() calling method java.util.Random.<init>()


    long KG()
    {
        try {
            return (((long) new java.util.Random().nextInt(((int) this.aFZ.longValue()))) + this.aFY.longValue());
        } catch (long v0_2) {
            Object[] v2_2 = new Object[1];
            v2_2[0] = v0_2;
            timber.log.Timber.l("getDateBoundaryOffsetMillis error %s", v2_2);
            return 0;
        }
    }

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


    static Striped64()
    {
        com.google.common.cache.Striped64.dtz = new ThreadLocal();
        com.google.common.cache.Striped64.dtA = new java.util.Random();
        com.google.common.cache.Striped64.dtB = Runtime.getRuntime().availableProcessors();
        try {
            com.google.common.cache.Striped64.UNSAFE = com.google.common.cache.Striped64.aBE();
            com.google.common.cache.Striped64.dtF = com.google.common.cache.Striped64.UNSAFE.objectFieldOffset(com.google.common.cache.Striped64.getDeclaredField("base"));
            com.google.common.cache.Striped64.dtG = com.google.common.cache.Striped64.UNSAFE.objectFieldOffset(com.google.common.cache.Striped64.getDeclaredField("busy"));
            return;
        } catch (Exception v0_7) {
            throw new Error(v0_7);
        }
    }

Method com.google.android.exoplayer2.upstream.cache.CachedContentIndex.agZ() calling method java.util.Random.<init>()


    private void agZ()
    {
        try {
            java.io.DataOutputStream v1_5 = this.bJh.ahf();
        } catch (java.io.DataOutputStream v1_3) {
            java.io.DataOutputStream v1_2 = 0;
            java.security.InvalidKeyException v0_2 = v1_3;
            com.google.android.exoplayer2.util.Util.closeQuietly(v1_2);
            throw v0_2;
        } catch (java.io.DataOutputStream v1_1) {
            v1_2 = 0;
            java.security.InvalidKeyException v0_1 = v1_1;
            throw new com.google.android.exoplayer2.upstream.cache.Cache$CacheException(v0_1);
        } catch (java.security.InvalidKeyException v0_2) {
        }
        if (this.coU != null) {
            this.coU.c(v1_5);
        } else {
            this.coU = new com.google.android.exoplayer2.util.ReusableBufferedOutputStream(v1_5);
        }
        v1_2 = new java.io.DataOutputStream(this.coU);
        try {
            v1_2.writeInt(2);
            v1_2.writeInt(this.cpI);
        } catch (java.security.InvalidKeyException v0_1) {
        }
        if (this.cpI) {
            int v3_3 = new byte[16];
            new java.util.Random().nextBytes(v3_3);
            v1_2.write(v3_3);
            this.cpG.init(1, this.cpH, new javax.crypto.spec.IvParameterSpec(v3_3));
            v1_2.flush();
            v1_2 = new java.io.DataOutputStream(new javax.crypto.CipherOutputStream(this.coU, this.cpG));
        }
        v1_2.writeInt(this.cpE.size());
        int v3_9 = 0;
        javax.crypto.CipherOutputStream v4_8 = this.cpE.values().iterator();
        while (v4_8.hasNext()) {
            int v5_4 = ((com.google.android.exoplayer2.upstream.cache.CachedContent) v4_8.next());
            v5_4.a(v1_2);
            v3_9 += v5_4.gY(2);
        }
        v1_2.writeInt(v3_9);
        this.bJh.b(v1_2);
        com.google.android.exoplayer2.util.Util.closeQuietly(0);
        return;
    }

Method com.eurosport.player.vpp.presenter.VideoPlaybackPresenter.<init>() calling method java.util.Random.<init>()


    public VideoPlaybackPresenter(com.eurosport.player.vpp.presenter.VideoPlaybackView p3, com.eurosport.player.vpp.interactor.VideoPlaybackInteractor p4, com.eurosport.player.configuration.AppConfigProvider p5, com.eurosport.player.cast.CastHelper p6, com.eurosport.player.core.util.DevToolsInjector p7, com.eurosport.player.vpp.interactor.VideoPlaybackUsageTrackingInteractor p8)
    {
        this.aUs = com.eurosport.player.vpp.presenter.VideoPlaybackPresenter.aUm;
        this.aUt = com.eurosport.player.vpp.presenter.VideoPlaybackPresenter.aUn;
        this.aUu = com.eurosport.player.vpp.presenter.VideoPlaybackPresenter.aUo;
        this.aUv = com.eurosport.player.vpp.presenter.VideoPlaybackPresenter.aUp;
        this.aUw = 10;
        this.random = new java.util.Random();
        this.aUC = 0;
        this.aUD = new com.eurosport.player.vpp.presenter.VideoPlaybackPresenter$1(this);
        this.aUq = p4;
        this.aUr = p3;
        this.aqx = p6;
        this.aqX = p7;
        this.aTC = p8;
        this.compositeDisposable = new io.reactivex.disposables.CompositeDisposable();
        int v3_3 = p5.getAppConfig();
        if (v3_3 != 0) {
            this.aUs = v3_3.getVideoInfoRefreshIntervalMilliSeconds();
            this.aUt = v3_3.getVideoInfoRefreshMaxIntervalOffsetMilliSeconds();
            this.aUu = v3_3.getVideoInfoProgramEndOffsetMilliSeconds();
            this.aUv = v3_3.getVideoInfoStreamFutureQueryMilliSeconds();
            this.aUw = v3_3.getVideoPlaybackMaxLiveEvents();
        }
        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.crashlytics.android.answers.RandomBackoff.<init>() calling method java.util.Random.<init>()


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

Method com.adobe.mobile.AnalyticsWorker.<clinit>() calling method java.security.SecureRandom.<init>()


    static AnalyticsWorker()
    {
        com.adobe.mobile.AnalyticsWorker.lU = new java.security.SecureRandom();
        com.adobe.mobile.AnalyticsWorker.lO = new Object();
        return;
    }

Method com.adobe.mobile.MessageTemplateCallback.<init>() calling method java.security.SecureRandom.<init>()


    MessageTemplateCallback()
    {
        this.lU = new java.security.SecureRandom();
        return;
    }

Method com.adobe.mobile.MessageLocalNotification.show() calling method java.security.SecureRandom.<init>()


    protected void show()
    {
        super.show();
        try {
            String v1_4 = com.adobe.mobile.StaticMethods.getCurrentActivity();
            String v2_6 = new java.security.SecureRandom().nextInt();
            Object[] v3_3 = java.util.Calendar.getInstance();
            v3_3.add(13, this.sv.intValue());
            String v4_2 = new android.content.Intent("android.intent.action.VIEW");
            v4_2.setClass(v1_4, com.adobe.mobile.MessageNotificationHandler);
            v4_2.putExtra("adbMessageCode", com.adobe.mobile.Messages.tB);
            v4_2.putExtra("adb_m_l_id", this.rj);
            v4_2.putExtra("requestCode", v2_6);
            v4_2.putExtra("userData", this.su);
            v4_2.putExtra("adb_deeplink", this.st);
            v4_2.putExtra("alarm_message", this.content);
            try {
                ((android.app.AlarmManager) com.adobe.mobile.StaticMethods.gy().getSystemService("alarm")).set(0, v3_3.getTimeInMillis(), android.app.PendingIntent.getBroadcast(com.adobe.mobile.StaticMethods.gy(), v2_6, v4_2, 134217728));
            } catch (String v1_11) {
                Object[] v3_2 = new Object[1];
                v3_2[0] = v1_11.getMessage();
                com.adobe.mobile.StaticMethods.b("Messaging - Error scheduling local notification (%s)", v3_2);
            }
            return;
        } catch (String v1_7) {
            Object[] v0_1 = new Object[0];
            com.adobe.mobile.StaticMethods.b(v1_7.getMessage(), v0_1);
            return;
        }
    }

Method com.conviva.utils.Random.qt() calling method java.security.SecureRandom.<init>()


    public static int qt()
    {
        return Math.abs(new java.security.SecureRandom().nextInt());
    }

Method com.adobe.mobile.StaticMethods.gq() calling method java.security.SecureRandom.<init>()


    private static String gq()
    {
        String v0_1 = java.util.UUID.randomUUID().toString().replace("-", "").toUpperCase(java.util.Locale.US);
        String v1_1 = java.util.regex.Pattern.compile("^[89A-F]");
        StringBuilder v2_1 = java.util.regex.Pattern.compile("^[4-9A-F]");
        String v1_2 = v1_1.matcher(v0_1.substring(0, 16));
        String v0_3 = v2_1.matcher(v0_1.substring(16, 32));
        StringBuilder v2_3 = new java.security.SecureRandom();
        String v1_3 = v1_2.replaceAll(String.valueOf(v2_3.nextInt(7)));
        String v0_5 = v0_3.replaceAll(String.valueOf(v2_3.nextInt(3)));
        StringBuilder v2_7 = new StringBuilder();
        v2_7.append(v1_3);
        v2_7.append("-");
        v2_7.append(v0_5);
        return v2_7.toString();
    }

Method com.adobe.mobile.MessageNotificationHandler.onReceive() calling method java.security.SecureRandom.<init>()


    public void onReceive(android.content.Context p14, android.content.Intent p15)
    {
        android.app.Notification v14_0 = p15.getExtras();
        if (v14_0 != null) {
            try {
                int v2_11 = v14_0.getString("alarm_message");
                android.app.Activity v3_0 = v14_0.getInt("adbMessageCode");
                reflect.Method v4_5 = v14_0.getInt("requestCode");
                int v5_1 = v14_0.getString("adb_m_l_id");
                Object[] v6_6 = v14_0.getString("adb_deeplink");
                android.app.Notification v14_6 = v14_0.getString("userData");
            } catch (android.app.Notification v14_19) {
                Object[] v1_4 = new Object[1];
                v1_4[0] = v14_19.getMessage();
                com.adobe.mobile.StaticMethods.d("Messages - unable to load message from local notification (%s)", v1_4);
                return;
            }
            if (v3_0 == com.adobe.mobile.Messages.tB.intValue()) {
                if (v2_11 != 0) {
                    try {
                        android.app.Activity v3_1 = com.adobe.mobile.StaticMethods.getCurrentActivity();
                        try {
                            String v7_18 = com.adobe.mobile.StaticMethods.gy();
                            try {
                                int v8_10 = com.adobe.mobile.StaticMethods.getCurrentActivity();
                            } catch (com.adobe.mobile.StaticMethods$NullActivityException) {
                                Class v10_0 = new Object[0];
                                com.adobe.mobile.StaticMethods.b("Messages - unable to find activity for your notification, using default", v10_0);
                            }
                            if ((v6_6 == null) || (v6_6.isEmpty())) {
                                if (v8_10 != 0) {
                                    p15 = v8_10.getIntent();
                                }
                            } else {
                                p15 = new android.content.Intent("android.intent.action.VIEW");
                                p15.setData(android.net.Uri.parse(v6_6));
                            }
                            p15.setFlags(603979776);
                            p15.putExtra("adb_m_l_id", v5_1);
                            p15.putExtra("userData", v14_6);
                            android.app.Notification v14_25 = android.os.Build$VERSION.SDK_INT;
                            try {
                                android.app.NotificationManager v15_23 = android.app.PendingIntent.getActivity(v7_18, v4_5, p15, 134217728);
                            } catch (android.app.Notification v14_15) {
                                Object[] v1_3 = new Object[1];
                                v1_3[0] = v14_15.getMessage();
                                com.adobe.mobile.StaticMethods.b("Messages - error posting notification, class not found (%s)", v1_3);
                                return;
                            } catch (android.app.Notification v14_13) {
                                Object[] v1_2 = new Object[1];
                                v1_2[0] = v14_13.getMessage();
                                com.adobe.mobile.StaticMethods.b("Messages - error posting notification, method not found (%s)", v1_2);
                                return;
                            } catch (android.app.Notification v14_11) {
                                Object[] v1_1 = new Object[1];
                                v1_1[0] = v14_11.getMessage();
                                com.adobe.mobile.StaticMethods.b("Messages - error posting notification (%s)", v1_1);
                                return;
                            } catch (android.app.Notification v14_9) {
                                Object[] v1_0 = new Object[1];
                                v1_0[0] = v14_9.getMessage();
                                com.adobe.mobile.StaticMethods.b("Messages - unexpected error posting notification (%s)", v1_0);
                                return;
                            }
                            if (v15_23 != null) {
                                android.app.Notification v14_3;
                                if (v14_25 < 11) {
                                    v14_3 = new android.app.Notification();
                                    Class[] v9_11 = new Class[4];
                                    v9_11[0] = android.content.Context;
                                    v9_11[1] = String;
                                    v9_11[2] = String;
                                    v9_11[3] = android.app.PendingIntent;
                                    reflect.Method v4_0 = android.app.Notification.getDeclaredMethod("setLatestEventInfo", v9_11);
                                    Object[] v6_0 = new Object[4];
                                    v6_0[0] = v7_18;
                                    v6_0[1] = this.eM();
                                    v6_0[2] = v2_11;
                                    v6_0[3] = v15_23;
                                    v4_0.invoke(v14_3, v6_0);
                                    android.app.Notification.getField("icon").set(v14_3, Integer.valueOf(this.eN()));
                                    v14_3.flags = 16;
                                } else {
                                    reflect.Method v4_4 = android.content.BroadcastReceiver.getClassLoader().loadClass("android.app.Notification$Builder");
                                    Object[] v6_2 = new Class[1];
                                    v6_2[0] = android.content.Context;
                                    Object[] v6_3 = v4_4.getConstructor(v6_2);
                                    v6_3.setAccessible(1);
                                    String v7_2 = new Object[1];
                                    v7_2[0] = com.adobe.mobile.StaticMethods.gy();
                                    Object[] v6_4 = v6_3.newInstance(v7_2);
                                    int v8_1 = new Class[1];
                                    v8_1[0] = Integer.TYPE;
                                    String v7_4 = v4_4.getDeclaredMethod("setSmallIcon", v8_1);
                                    int v8_2 = new Object[1];
                                    v8_2[0] = Integer.valueOf(this.eN());
                                    v7_4.invoke(v6_4, v8_2);
                                    int v8_3 = new Class[1];
                                    v8_3[0] = android.graphics.Bitmap;
                                    String v7_6 = v4_4.getDeclaredMethod("setLargeIcon", v8_3);
                                    int v8_4 = new Object[1];
                                    v8_4[0] = this.getLargeIcon();
                                    v7_6.invoke(v6_4, v8_4);
                                    int v8_5 = new Class[1];
                                    v8_5[0] = CharSequence;
                                    String v7_8 = v4_4.getDeclaredMethod("setContentTitle", v8_5);
                                    int v8_6 = new Object[1];
                                    v8_6[0] = this.eM();
                                    v7_8.invoke(v6_4, v8_6);
                                    int v8_7 = new Class[1];
                                    v8_7[0] = CharSequence;
                                    String v7_10 = v4_4.getDeclaredMethod("setContentText", v8_7);
                                    int v8_8 = new Object[1];
                                    v8_8[0] = v2_11;
                                    v7_10.invoke(v6_4, v8_8);
                                    String v7_11 = new Class[1];
                                    v7_11[0] = android.app.PendingIntent;
                                    int v2_4 = v4_4.getDeclaredMethod("setContentIntent", v7_11);
                                    String v7_12 = new Object[1];
                                    v7_12[0] = v15_23;
                                    v2_4.invoke(v6_4, v7_12);
                                    int v2_5 = new Class[1];
                                    v2_5[0] = Boolean.TYPE;
                                    android.app.NotificationManager v15_4 = v4_4.getDeclaredMethod("setAutoCancel", v2_5);
                                    int v2_6 = new Object[1];
                                    v2_6[0] = Boolean.valueOf(1);
                                    v15_4.invoke(v6_4, v2_6);
                                    if (v14_25 < 16) {
                                        android.app.NotificationManager v15_5 = new Class[0];
                                        android.app.NotificationManager v15_6 = new Object[0];
                                        v14_3 = v4_4.getDeclaredMethod("getNotification", v15_5).invoke(v6_4, v15_6);
                                    } else {
                                        android.app.NotificationManager v15_7 = new Class[0];
                                        android.app.NotificationManager v15_8 = new Object[0];
                                        v14_3 = v4_4.getDeclaredMethod("build", v15_7).invoke(v6_4, v15_8);
                                    }
                                    if (v14_3 == null) {
                                        return;
                                    }
                                }
                                ((android.app.NotificationManager) v3_1.getSystemService("notification")).notify(new java.security.SecureRandom().nextInt(), ((android.app.Notification) v14_3));
                                return;
                            } else {
                                android.app.NotificationManager v15_12 = new Object[0];
                                com.adobe.mobile.StaticMethods.d("Messages - could not retrieve sender from broadcast, unable to post notification", v15_12);
                                return;
                            }
                        } catch (android.app.Notification v14_23) {
                            android.app.NotificationManager v15_21 = new Object[0];
                            com.adobe.mobile.StaticMethods.b(v14_23.getMessage(), v15_21);
                            return;
                        }
                    } catch (android.app.Notification v14_21) {
                        android.app.NotificationManager v15_20 = new Object[0];
                        com.adobe.mobile.StaticMethods.b(v14_21.getMessage(), v15_20);
                        return;
                    }
                } else {
                    android.app.NotificationManager v15_17 = new Object[0];
                    com.adobe.mobile.StaticMethods.d("Messages - local notification message was empty ", v15_17);
                    return;
                }
            } else {
                return;
            }
        } else {
            android.app.NotificationManager v15_18 = new Object[0];
            com.adobe.mobile.StaticMethods.d("Messages - unable to load extras from local notification intent", v15_18);
            return;
        }
    }