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 android.support.v17.leanback.widget.StreamingTextView$DottySpan.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.this$0.mOneDot.getWidth();
        int v10_1 = (v9_3 * 2);
        p12 = (v8_2 / v10_1);
        int v14_0 = ((v8_2 % v10_1) / 2);
        boolean v0_1 = android.support.v17.leanback.widget.StreamingTextView.isLayoutRtl(this.this$0);
        this.this$0.mRandom.setSeed(((long) this.mSeed));
        int v1_2 = p15.getAlpha();
        int v2_2 = 0;
        while ((v2_2 < p12) && ((this.mPosition + v2_2) < this.this$0.mStreamPosition)) {
            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.this$0.mRandom.nextInt(4) + 1) * 63));
            if (!this.this$0.mRandom.nextBoolean()) {
                android.graphics.Bitmap v3_16 = this.this$0.mOneDot;
                p7.drawBitmap(v3_16, v4_3, ((float) (p13 - v3_16.getHeight())), p15);
            } else {
                android.graphics.Bitmap v3_18 = this.this$0.mTwoDot;
                p7.drawBitmap(v3_18, v4_3, ((float) (p13 - v3_18.getHeight())), p15);
            }
            v2_2++;
        }
        p15.setAlpha(v1_2);
        return;
    }

Method android.support.v17.leanback.widget.StreamingTextView.<init>() calling method java.util.Random.<init>()


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

Method android.support.v17.leanback.widget.StreamingTextView.<init>() calling method java.util.Random.<init>()


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

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


    static PutDataRequest()
    {
        com.google.android.gms.wearable.PutDataRequest.CREATOR = new com.google.android.gms.wearable.zzh();
        com.google.android.gms.wearable.PutDataRequest.zzt = java.util.concurrent.TimeUnit.MINUTES.toMillis(30);
        com.google.android.gms.wearable.PutDataRequest.zzu = new java.security.SecureRandom();
        return;
    }

Method com.urbandroid.lux.integration.taskerplugin.TaskerPlugin.getPositiveNonRepeatingRandomInteger() calling method java.security.SecureRandom.<init>()


    public static int getPositiveNonRepeatingRandomInteger()
    {
        if (com.urbandroid.lux.integration.taskerplugin.TaskerPlugin.sr == null) {
            com.urbandroid.lux.integration.taskerplugin.TaskerPlugin.sr = new java.security.SecureRandom();
            int v0_7 = new int[100];
            com.urbandroid.lux.integration.taskerplugin.TaskerPlugin.lastRandomsSeen = v0_7;
            int v0_1 = 0;
            while(true) {
                int[] v3_0 = com.urbandroid.lux.integration.taskerplugin.TaskerPlugin.lastRandomsSeen;
                if (v0_1 >= v3_0.length) {
                    break;
                }
                v3_0[v0_1] = -1;
                v0_1++;
            }
        }
        int v0_3 = com.urbandroid.lux.integration.taskerplugin.TaskerPlugin.sr.nextInt(2147483647);
        int[] v3_2 = com.urbandroid.lux.integration.taskerplugin.TaskerPlugin.lastRandomsSeen;
        int v5 = 0;
        while (v5 < v3_2.length) {
            if (v3_2[v5] != v0_3) {
                v5++;
            } else {
                v0_3 = -1;
                break;
            }
        }
        if (v0_3 == -1) {
        } else {
            int v1_0 = com.urbandroid.lux.integration.taskerplugin.TaskerPlugin.lastRandomsSeen;
            int v2_1 = com.urbandroid.lux.integration.taskerplugin.TaskerPlugin.randomInsertPointer;
            v1_0[v2_1] = v0_3;
            com.urbandroid.lux.integration.taskerplugin.TaskerPlugin.randomInsertPointer = ((v2_1 + 1) % v1_0.length);
            return v0_3;
        }
    }