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.here.services.playback.internal.util.PlaybackReader.<init>() calling method java.util.Random.<init>()


    private PlaybackReader(android.content.Context p4, com.here.services.playback.internal.PlaybackOptions p5, com.here.services.playback.internal.util.PlaybackReader$IListener p6)
    {
        this.mRandom = new java.util.Random();
        this.mWifiListeners = new java.util.HashSet();
        this.mCellListeners = new java.util.HashSet();
        this.mGnssListeners = new java.util.HashSet();
        this.mBleListeners = new java.util.HashSet();
        this.mScheduledMeasurements = new java.util.HashSet();
        if (p6 != null) {
            if (p5.getPlaybackFile() != null) {
                this.mHandlerThread = new android.os.HandlerThread(new StringBuilder().append("PlaybackReader@").append(this.hashCode()).toString());
                this.mHandlerThread.start();
                this.mHandler = new com.here.odnp.util.SafeHandler(this.mHandlerThread.getLooper());
                this.mContext = p4;
                this.mListener = p6;
                this.mPlaybackFile = p5.getPlaybackFile();
                this.mRepeat = p5.getRepeat();
                if (!this.mPlaybackFile.getName().toLowerCase(java.util.Locale.US).endsWith(".ist")) {
                    this.mParser = new com.here.services.playback.internal.util.LtaPullParser(p5);
                } else {
                    this.mParser = new com.here.services.playback.internal.util.IstPullParser(p5);
                }
                this.initializeParser();
                switch (com.here.services.playback.internal.util.PlaybackReader$17.$SwitchMap$com$here$services$playback$internal$PlaybackOptions$Mode[p5.getMode().ordinal()]) {
                    case 1:
                        this.mModeProcessor = new com.here.services.playback.internal.util.PlaybackReader$ImmediateModeProcessor(this);
                        break;
                    default:
                        this.mModeProcessor = new com.here.services.playback.internal.util.PlaybackReader$SchedulingModeProcessor(this);
                }
                return;
            } else {
                throw new IllegalArgumentException("file is null");
            }
        } else {
            throw new IllegalArgumentException("listener is null");
        }
    }

Method com.here.android.mpa.service.MapService.onStartCommand() calling method java.util.Random.<init>()


    public int onStartCommand(android.content.Intent p9, int p10, int p11)
    {
        int v0_0 = 3;
        java.util.concurrent.Semaphore v1_15 = 0;
        try {
            if (!p9.getBooleanExtra("nukeservice", 0)) {
                if ((this.g == 1) && (this.p != null)) {
                    int v2_15 = p9.getStringExtra("diskcachepath");
                    if ((!new java.io.File(this.p).exists()) && (this.p.compareTo(v2_15) != 0)) {
                        this.f.drainPermits();
                        com.nokia.maps.MapServiceClient.stopServer();
                        this.g = 0;
                        this.u = 0;
                    }
                }
                if (!this.g) {
                    this.m = p9.getStringExtra("mapdataserverurl");
                    this.n = p9.getStringExtra("mapsatelliteserverurl");
                    this.o = p9.getStringExtra("terrainserverurl");
                    this.p = p9.getStringExtra("diskcachepath");
                    this.q = p9.getStringExtra("sliserverurl");
                    this.r = p9.getShortExtra("mapvariant", 0);
                    com.here.android.mpa.service.MapService.k = p9.getBooleanExtra("USESSL", 1);
                    v0_0 = p9.getIntExtra("shutdownmode", 3);
                    if ((this.m == null) || (this.m.length() == 0)) {
                        this.m = "hybrid.api.here.com";
                    }
                    if ((this.n == null) || (this.n.length() == 0)) {
                        this.n = "http://1.sps.data.here.com";
                    }
                    if ((this.o == null) || (this.o.length() == 0)) {
                        this.o = "http://hterrain.mfs.data.here.com";
                    }
                    if ((this.q == null) || (this.q.length() == 0)) {
                        this.q = "sli.data.here.com";
                    }
                    if ((this.p == null) || (this.p.length() == 0)) {
                        this.p = com.nokia.maps.MapSettings.b();
                    }
                    if (p9.getBooleanExtra("isolated_diskcache_enabled", 0)) {
                        this.s = p9.getStringExtra("client_app_id");
                        this.t = p9.getStringExtra("client_app_token");
                    }
                    int v2_12 = com.here.android.mpa.service.MapService.j;
                    Object[] v3_1 = v2_12.length;
                    while (v1_15 < v3_1) {
                        int v4_2 = v2_12[v1_15];
                        try {
                            System.loadLibrary(v4_2);
                        } catch (String v5) {
                            if (v4_2.compareTo(com.here.android.mpa.service.MapService.j[3]) == 0) {
                            } else {
                                if (v4_2.compareTo(com.here.android.mpa.service.MapService.j[4]) == 0) {
                                } else {
                                    if (v4_2.compareTo(com.here.android.mpa.service.MapService.j[5]) != 0) {
                                    } else {
                                    }
                                }
                            }
                        } catch (int v4) {
                        }
                        v1_15++;
                    }
                    com.nokia.maps.BaseNativeObject.w();
                    com.nokia.maps.ApplicationContext.b(this.getApplicationContext());
                    if (android.os.Build$VERSION.SDK_INT == 15) {
                        com.here.network.NetworkProtocol.setAppContext(this.getApplicationContext());
                    }
                    if (!new java.io.File(this.p).mkdirs()) {
                        Object[] v3_6 = new Object[0];
                        com.nokia.maps.bp.f("MapService", new StringBuilder().append("Failed to mkdirs() for ").append(this.p).toString(), v3_6);
                    }
                    com.nokia.maps.SSLCertManager.a(this.getApplicationContext());
                    if (this.e == 0) {
                        this.e = (new java.util.Random().nextInt(1000) + 25000);
                    }
                    this.g = 1;
                    this.f.release();
                }
            } else {
                int v0_1 = this.g;
                this.g = 0;
                this.u = 0;
                if (v0_1 == 1) {
                    com.nokia.maps.MapServiceClient.stopServer();
                }
                this.stopSelf();
                System.exit(0);
                v0_0 = 2;
            }
        } catch (int v0_3) {
            throw v0_3;
        }
        return v0_0;
    }