Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

replaced java.util.Random with java.security.SecureRandom in RNPushNo… #1497

Merged
merged 1 commit into from
Jul 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import com.facebook.react.bridge.WritableMap;

import java.io.IOException;
import java.security.SecureRandom;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;

import android.util.Log;

Expand All @@ -42,7 +42,7 @@ public class RNPushNotification extends ReactContextBaseJavaModule implements Ac
public static final String LOG_TAG = "RNPushNotification";// all logging should use this tag

private RNPushNotificationHelper mRNPushNotificationHelper;
private final Random mRandomNumberGenerator = new Random(System.currentTimeMillis());
private final SecureRandom mRandomNumberGenerator = new SecureRandom();
private RNPushNotificationJsDelivery mJsDelivery;

public RNPushNotification(ReactApplicationContext reactContext) {
Expand All @@ -60,6 +60,8 @@ public RNPushNotification(ReactApplicationContext reactContext) {
mRNPushNotificationHelper.checkOrCreateDefaultChannel();
}



@Override
public String getName() {
return "RNPushNotification";
Expand Down