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.gms.c.c.fw.g() calling method java.util.Random.<init>()


    public final long g()
    {
        if (this.c.get() != 0) {
            try {
                this.c.compareAndSet(-1, 1);
                return this.c.getAndIncrement();
            } catch (Throwable v1_2) {
                throw v1_2;
            }
        } else {
            try {
                Throwable v1_5 = new java.util.Random((System.nanoTime() ^ this.m().a())).nextLong();
                long v3_1 = (this.d + 1);
                this.d = v3_1;
                return (v1_5 + ((long) v3_1));
            } catch (Throwable v1_7) {
                throw v1_7;
            }
        }
    }

Method com.crashlytics.android.a.u.<init>() calling method java.util.Random.<init>()


    public u(io.a.a.a.a.c.a.a p2, double p3)
    {
        this(p2, p3, new java.util.Random());
        return;
    }

Method com.google.android.gms.c.c.fw.h() calling method java.security.SecureRandom.<init>()


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

Method com.google.android.gms.c.c.fw.f() calling method java.security.SecureRandom.<init>()


    protected final void f()
    {
        this.d();
        com.google.android.gms.c.c.bd v0_5 = new java.security.SecureRandom();
        long v1 = v0_5.nextLong();
        if (v1 == 0) {
            v1 = v0_5.nextLong();
            if (v1 == 0) {
                this.r().i().a("Utils falling back to Random for random id");
            }
        }
        this.c.set(v1);
        return;
    }