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 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.C));
        v6.connect(this);
        return v6;
    }

Method q.rorbin.badgeview.BadgeAnimator$BitmapFragment.<init>() calling method java.util.Random.<init>()


    public BadgeAnimator$BitmapFragment(q.rorbin.badgeview.BadgeAnimator p2)
    {
        this.h = p2;
        this.g = new android.graphics.Paint();
        this.g.setAntiAlias(1);
        this.g.setStyle(android.graphics.Paint$Style.FILL);
        this.a = new java.util.Random();
        return;
    }

Method pl.tajchert.nammu.PermissionRequest.<init>() calling method java.util.Random.<init>()


    public PermissionRequest(java.util.ArrayList p1, pl.tajchert.nammu.PermissionCallback p2)
    {
        this.permissions = p1;
        this.permissionCallback = p2;
        if (pl.tajchert.nammu.PermissionRequest.random == null) {
            pl.tajchert.nammu.PermissionRequest.random = new java.util.Random();
        }
        this.requestCode = pl.tajchert.nammu.PermissionRequest.random.nextInt(255);
        return;
    }

Method org.jsoup.helper.DataUtil.b() calling method java.util.Random.<init>()


    static String b()
    {
        String v0_0 = org.jsoup.internal.StringUtil.borrowBuilder();
        java.util.Random v1_1 = new java.util.Random();
        int v2 = 0;
        while (v2 < 32) {
            char v3_0 = org.jsoup.helper.DataUtil.mimeBoundaryChars;
            v0_0.append(v3_0[v1_1.nextInt(v3_0.length)]);
            v2++;
        }
        return org.jsoup.internal.StringUtil.releaseBuilder(v0_0);
    }

Method org.apache.http.entity.mime.MultipartEntityBuilder.generateBoundary() calling method java.util.Random.<init>()


    private String generateBoundary()
    {
        String v0_1 = new StringBuilder();
        java.util.Random v1_1 = new java.util.Random();
        int v2_2 = (v1_1.nextInt(11) + 30);
        int v3 = 0;
        while (v3 < v2_2) {
            char v4_0 = org.apache.http.entity.mime.MultipartEntityBuilder.MULTIPART_CHARS;
            v0_1.append(v4_0[v1_1.nextInt(v4_0.length)]);
            v3++;
        }
        return v0_1.toString();
    }

Method org.apache.commons.lang.math.JVMRandom.<init>() calling method java.util.Random.<init>()


    public JVMRandom()
    {
        this.constructed = 0;
        this.constructed = 1;
        return;
    }

Method org.apache.commons.lang.RandomStringUtils.<clinit>() calling method java.util.Random.<init>()


    static RandomStringUtils()
    {
        org.apache.commons.lang.RandomStringUtils.RANDOM = new java.util.Random();
        return;
    }

Method kotlinx.coroutines.scheduling.CoroutineScheduler.<init>() calling method java.util.Random.<init>()


    public CoroutineScheduler(int p3, int p4, long p5, String p7)
    {
        String v3_6;
        kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(p7, "schedulerName");
        this.corePoolSize = p3;
        this.maxPoolSize = p4;
        this.idleWorkerKeepAliveNs = p5;
        this.schedulerName = p7;
        if (this.corePoolSize < 1) {
            v3_6 = 0;
        } else {
            v3_6 = 1;
        }
        if (v3_6 == null) {
            String v3_10 = new StringBuilder();
            v3_10.append("Core pool size ");
            v3_10.append(this.corePoolSize);
            v3_10.append(" should be at least 1");
            throw ((Throwable) new IllegalArgumentException(v3_10.toString().toString()));
        } else {
            String v3_14;
            if (this.maxPoolSize < this.corePoolSize) {
                v3_14 = 0;
            } else {
                v3_14 = 1;
            }
            if (v3_14 == null) {
                String v3_16 = new StringBuilder();
                v3_16.append("Max pool size ");
                v3_16.append(this.maxPoolSize);
                v3_16.append(" should be greater than or equals to core pool size ");
                v3_16.append(this.corePoolSize);
                throw ((Throwable) new IllegalArgumentException(v3_16.toString().toString()));
            } else {
                String v3_20;
                if (this.maxPoolSize > 2097150) {
                    v3_20 = 0;
                } else {
                    v3_20 = 1;
                }
                if (v3_20 == null) {
                    String v3_22 = new StringBuilder();
                    v3_22.append("Max pool size ");
                    v3_22.append(this.maxPoolSize);
                    v3_22.append(" should not exceed maximal supported number of threads 2097150");
                    throw ((Throwable) new IllegalArgumentException(v3_22.toString().toString()));
                } else {
                    String v3_27;
                    if (this.idleWorkerKeepAliveNs <= 0) {
                        v3_27 = 0;
                    } else {
                        v3_27 = 1;
                    }
                    if (v3_27 == null) {
                        String v3_29 = new StringBuilder();
                        v3_29.append("Idle worker keep alive time ");
                        v3_29.append(this.idleWorkerKeepAliveNs);
                        v3_29.append(" must be positive");
                        throw ((Throwable) new IllegalArgumentException(v3_29.toString().toString()));
                    } else {
                        this.globalQueue = new kotlinx.coroutines.scheduling.GlobalQueue();
                        this.cpuPermits = new java.util.concurrent.Semaphore(this.corePoolSize, 0);
                        this.parkedWorkersStack = 0;
                        String v3_5 = new kotlinx.coroutines.scheduling.CoroutineScheduler$Worker[(this.maxPoolSize + 1)];
                        this.workers = v3_5;
                        this.controlState = 0;
                        this.random = new java.util.Random();
                        this._isTerminated = 0;
                        return;
                    }
                }
            }
        }
    }

Method kotlin.random.KotlinRandom.<init>() calling method java.util.Random.<init>()


    public KotlinRandom(kotlin.random.Random p2)
    {
        kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(p2, "impl");
        this.impl = p2;
        return;
    }

Method kotlin.random.FallbackThreadLocalRandom$implStorage$1.a() calling method java.util.Random.<init>()


    protected java.util.Random a()
    {
        return new java.util.Random();
    }

Method com.swapcard.apps.old.utils.ActionUtils.getContactRandomColor() calling method java.util.Random.<init>()


    public static int getContactRandomColor(android.content.Context p2)
    {
        int v2_4 = p2.getResources().getStringArray(2130903041);
        return android.graphics.Color.parseColor(v2_4[new java.util.Random().nextInt(v2_4.length)]);
    }

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.mixpanel.android.java_websocket.drafts.Draft_75.<init>() calling method java.util.Random.<init>()


    public Draft_75()
    {
        this.c = 0;
        this.d = 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.mixpanel.android.mpmetrics.SessionMetadata.a() calling method java.util.Random.<init>()


    protected void a()
    {
        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.a();
        this.mRandom = new java.util.Random();
        return;
    }

Method com.mapbox.services.android.location.MockLocationEngine.addNoiseToRoute() calling method java.util.Random.<init>()


    private void addNoiseToRoute(double p13)
    {
        int v0 = 0;
        while (v0 < (this.positions.size() - 1)) {
            int v3 = (v0 + 1);
            this.positions.set(v0, com.mapbox.services.api.utils.turf.TurfMeasurement.destination(((com.mapbox.services.commons.models.Position) this.positions.get(v0)), p13, (((double) new java.util.Random().nextInt(30)) + com.mapbox.services.api.utils.turf.TurfMeasurement.bearing(((com.mapbox.services.commons.models.Position) this.positions.get(v0)), ((com.mapbox.services.commons.models.Position) this.positions.get(v3)))), "kilometers"));
            v0 = v3;
        }
        return;
    }

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


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

Method com.gigamole.library.navigationtabstrip.NavigationTabStrip.onMeasure() calling method java.util.Random.<init>()


    protected void onMeasure(int p4, int p5)
    {
        super.onMeasure(p4, p5);
        int v4_7 = ((float) android.view.View$MeasureSpec.getSize(p4));
        float v5_9 = ((float) android.view.View$MeasureSpec.getSize(p5));
        float v1 = 0;
        this.mBounds.set(0, 0, v4_7, v5_9);
        int v0_0 = this.mTitles;
        if ((v0_0.length != 0) && ((v4_7 != 0) && (v5_9 != 0))) {
            this.mTabSize = (v4_7 / ((float) v0_0.length));
            if (((int) this.mTitleSize) == 0) {
                this.setTitleSize(((v5_9 - this.mStripWeight) * 1051931443));
            }
            if ((this.isInEditMode()) || (!this.mIsViewPagerMode)) {
                this.mIsSetIndexFromTabBar = 1;
                if (this.isInEditMode()) {
                    this.mIndex = new java.util.Random().nextInt(this.mTitles.length);
                }
                if (this.mStripType == com.gigamole.library.navigationtabstrip.NavigationTabStrip$StripType.POINT) {
                    v1 = (this.mTabSize * 1056964608);
                }
                this.mStartStripX = ((((float) this.mIndex) * this.mTabSize) + v1);
                this.mEndStripX = this.mStartStripX;
                this.updateIndicatorPosition(1065353216);
            }
        }
        return;
    }

Method com.gigamole.library.navigationtabstrip.NavigationTabStrip.<init>() calling method java.util.Random.<init>()


    public NavigationTabStrip(android.content.Context p8, android.util.AttributeSet p9, int p10)
    {
        super(p8, p9, p10);
        super.mBounds = new android.graphics.RectF();
        super.mStripBounds = new android.graphics.RectF();
        super.mTitleBounds = new android.graphics.Rect();
        super.mStripPaint = new com.gigamole.library.navigationtabstrip.NavigationTabStrip$1(super, 5);
        super.mTitlePaint = new com.gigamole.library.navigationtabstrip.NavigationTabStrip$2(super, 5);
        super.mAnimator = new android.animation.ValueAnimator();
        super.mColorEvaluator = new android.animation.ArgbEvaluator();
        String[] v2_3 = 0;
        super.mResizeInterpolator = new com.gigamole.library.navigationtabstrip.NavigationTabStrip$ResizeInterpolator(0);
        super.mLastIndex = -1;
        super.mIndex = -1;
        super.setWillNotDraw(0);
        super.setLayerType(2, 0);
        android.content.res.TypedArray v8_1 = p8.obtainStyledAttributes(p9, com.gigamole.library.R$styleable.NavigationTabStrip);
        try {
            super.setStripColor(v8_1.getColor(com.gigamole.library.R$styleable.NavigationTabStrip_nts_color, -65536));
            super.setTitleSize(v8_1.getDimension(com.gigamole.library.R$styleable.NavigationTabStrip_nts_size, 0));
            super.setStripWeight(v8_1.getDimension(com.gigamole.library.R$styleable.NavigationTabStrip_nts_weight, 1092616192));
            super.setStripFactor(v8_1.getFloat(com.gigamole.library.R$styleable.NavigationTabStrip_nts_factor, 1075838976));
            super.setStripType(v8_1.getInt(com.gigamole.library.R$styleable.NavigationTabStrip_nts_type, 0));
            super.setStripGravity(v8_1.getInt(com.gigamole.library.R$styleable.NavigationTabStrip_nts_gravity, 0));
            super.setTypeface(v8_1.getString(com.gigamole.library.R$styleable.NavigationTabStrip_nts_typeface));
            super.setInactiveColor(v8_1.getColor(com.gigamole.library.R$styleable.NavigationTabStrip_nts_inactive_color, -7829368));
            super.setActiveColor(v8_1.getColor(com.gigamole.library.R$styleable.NavigationTabStrip_nts_active_color, -1));
            super.setAnimationDuration(v8_1.getInteger(com.gigamole.library.R$styleable.NavigationTabStrip_nts_animation_duration, 350));
            super.setCornersRadius(v8_1.getDimension(com.gigamole.library.R$styleable.NavigationTabStrip_nts_corners_radius, 1084227584));
            try {
                com.gigamole.library.navigationtabstrip.NavigationTabStrip$3 v10_38 = v8_1.getResourceId(com.gigamole.library.R$styleable.NavigationTabStrip_nts_titles, 0);
            } catch (com.gigamole.library.navigationtabstrip.NavigationTabStrip$3 v10_8) {
                if (!super.isInEditMode()) {
                    android.animation.ValueAnimator v9_1 = new String[0];
                } else {
                    v9_1 = new String[(new java.util.Random().nextInt(5) + 1)];
                    java.util.Arrays.fill(v9_1, "Title");
                }
                super.setTitles(v9_1);
                throw v10_8;
            } catch (com.gigamole.library.navigationtabstrip.NavigationTabStrip$3 v10_39) {
                v10_39.printStackTrace();
                if (!super.isInEditMode()) {
                    com.gigamole.library.navigationtabstrip.NavigationTabStrip$3 v10_2 = new String[0];
                } else {
                    v10_2 = new String[(new java.util.Random().nextInt(5) + 1)];
                    java.util.Arrays.fill(v10_2, "Title");
                }
                super.setTitles(v10_2);
                com.gigamole.library.navigationtabstrip.NavigationTabStrip$3 v10_15 = super.mAnimator;
                float[] v0_1 = new float[2];
                v0_1[0] = 0;
                v0_1[1] = 1065353216;
                v10_15.setFloatValues(v0_1);
                super.mAnimator.setInterpolator(new android.view.animation.LinearInterpolator());
                super.mAnimator.addUpdateListener(new com.gigamole.library.navigationtabstrip.NavigationTabStrip$3(super));
                v8_1.recycle();
                return;
            }
            if (v10_38 != null) {
                v2_3 = v8_1.getResources().getStringArray(v10_38);
            } else {
            }
            if (v2_3 == null) {
                if (!super.isInEditMode()) {
                    v2_3 = new String[0];
                } else {
                    v2_3 = new String[(new java.util.Random().nextInt(5) + 1)];
                    java.util.Arrays.fill(v2_3, "Title");
                }
            }
            super.setTitles(v2_3);
            v10_15 = super.mAnimator;
            v0_1 = new float[2];
            v0_1[0] = 0;
            v0_1[1] = 1065353216;
            v10_15.setFloatValues(v0_1);
            super.mAnimator.setInterpolator(new android.view.animation.LinearInterpolator());
            super.mAnimator.addUpdateListener(new com.gigamole.library.navigationtabstrip.NavigationTabStrip$3(super));
            v8_1.recycle();
            return;
        } catch (android.animation.ValueAnimator v9_2) {
            v8_1.recycle();
            throw v9_2;
        }
    }

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.google.common.cache.Striped64$HashCode.<clinit>() calling method java.util.Random.<init>()


    static Striped64$HashCode()
    {
        com.google.common.cache.Striped64$HashCode.a = new java.util.Random();
        return;
    }

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


    public final long generateEventId()
    {
        long v0_1 = new com.google.android.gms.internal.measurement.zzm();
        this.zza(new com.google.android.gms.internal.measurement.zzap(this, v0_1));
        long v0_3 = ((Long) com.google.android.gms.internal.measurement.zzm.zza(v0_1.zzb(500), Long));
        if (v0_3 != 0) {
            return v0_3.longValue();
        } else {
            long v0_7 = new java.util.Random((System.nanoTime() ^ this.zzaa.currentTimeMillis())).nextLong();
            long v2_1 = (this.zzae + 1);
            this.zzae = v2_1;
            return (v0_7 + ((long) v2_1));
        }
    }

Method org.apache.http.impl.auth.DigestScheme.createCnonce() calling method java.security.SecureRandom.<init>()


    public static String createCnonce()
    {
        byte[] v1_1 = new byte[8];
        new java.security.SecureRandom().nextBytes(v1_1);
        return org.apache.http.impl.auth.DigestScheme.a(v1_1);
    }

Method freemarker.debug.impl.DebuggerServer.<clinit>() calling method java.security.SecureRandom.<init>()


    static DebuggerServer()
    {
        freemarker.debug.impl.DebuggerServer.LOG = freemarker.log.Logger.getLogger("freemarker.debug.server");
        freemarker.debug.impl.DebuggerServer.R = new java.security.SecureRandom();
        return;
    }

Method com.twitter.sdk.android.core.internal.oauth.OAuth1aParameters.<clinit>() calling method java.security.SecureRandom.<init>()


    static OAuth1aParameters()
    {
        com.twitter.sdk.android.core.internal.oauth.OAuth1aParameters.RAND = new java.security.SecureRandom();
        return;
    }

Method com.squareup.okhttp.internal.ws.WebSocket.newWebSocket() calling method java.security.SecureRandom.<init>()


    public static com.squareup.okhttp.internal.ws.WebSocket newWebSocket(com.squareup.okhttp.OkHttpClient p2, com.squareup.okhttp.Request p3)
    {
        com.squareup.okhttp.OkHttpClient v2_1 = p2.clone();
        v2_1.setProtocols(java.util.Collections.singletonList(com.squareup.okhttp.Protocol.HTTP_1_1));
        return new com.squareup.okhttp.internal.ws.WebSocket(v2_1, p3, new java.security.SecureRandom());
    }

Method com.google.gdata.client.http.AuthSubUtil.<clinit>() calling method java.security.SecureRandom.<init>()


    static AuthSubUtil()
    {
        com.google.gdata.client.http.AuthSubUtil.RANDOM = new java.security.SecureRandom();
        return;
    }

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


    final java.security.SecureRandom zzgl()
    {
        this.zzq();
        if (this.zztc == null) {
            this.zztc = new java.security.SecureRandom();
        }
        return this.zztc;
    }

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


    protected final void zzal()
    {
        this.zzq();
        com.google.android.gms.measurement.internal.zzaw v0_5 = new java.security.SecureRandom();
        long v1 = v0_5.nextLong();
        if (v1 == 0) {
            v1 = v0_5.nextLong();
            if (v1 == 0) {
                this.zzad().zzdd().zzaq("Utils falling back to Random for random id");
            }
        }
        this.zztd.set(v1);
        return;
    }

Method com.google.api.client.auth.oauth.OAuthParameters.<clinit>() calling method java.security.SecureRandom.<init>()


    static OAuthParameters()
    {
        com.google.api.client.auth.oauth.OAuthParameters.RANDOM = new java.security.SecureRandom();
        com.google.api.client.auth.oauth.OAuthParameters.ESCAPER = new com.google.api.client.util.escape.PercentEscaper("-_.~", 0);
        return;
    }