From 91682ed3b18239b2b5235c828559cc728c90e010 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 9 Dec 2020 16:20:49 +0100 Subject: [PATCH] Uses SecureRandom - Fix issue #32 --- .../exodus_privacy/exodusprivacy/manager/NetworkManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/manager/NetworkManager.java b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/manager/NetworkManager.java index 0cf1a44..bd86bd2 100644 --- a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/manager/NetworkManager.java +++ b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/manager/NetworkManager.java @@ -41,6 +41,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; +import java.security.SecureRandom; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -53,7 +54,6 @@ import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.Random; import java.util.TimeZone; import java.util.concurrent.Semaphore; @@ -268,7 +268,7 @@ public class NetworkManager { packages.retainAll(handles.keySet()); // Add some random packages to avoid tracking - Random rand = new Random(Thread.currentThread().getId()); + SecureRandom rand = new SecureRandom(); int alea = rand.nextInt(120) % 10 + 11; for (int i = 0; i < alea; i++) { int val = rand.nextInt(applications.length());