Remove webcrypto polyfill, as it's no longer needed
This commit is contained in:
parent
4eb8bc1249
commit
810fcf9910
11 changed files with 11 additions and 10364 deletions
|
@ -1,28 +0,0 @@
|
|||
package xyz.blueskyweb.app;
|
||||
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
||||
import com.facebook.react.bridge.ReactMethod;
|
||||
import com.facebook.react.bridge.Promise;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import android.util.Base64;
|
||||
|
||||
public class AppSecureRandomModule extends ReactContextBaseJavaModule {
|
||||
public AppSecureRandomModule(ReactApplicationContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void generateSecureRandomAsBase64(int length, Promise promise) {
|
||||
SecureRandom secureRandom = new SecureRandom();
|
||||
byte[] buffer = new byte[length];
|
||||
secureRandom.nextBytes(buffer);
|
||||
promise.resolve(Base64.encodeToString(buffer, Base64.NO_WRAP));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "AppSecureRandomModule";
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package xyz.blueskyweb.app;
|
||||
|
||||
import com.facebook.react.ReactPackage;
|
||||
import com.facebook.react.bridge.NativeModule;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.uimanager.ViewManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class AppSecureRandomPackage implements ReactPackage {
|
||||
|
||||
@Override
|
||||
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
||||
List<NativeModule> modules = new ArrayList<>();
|
||||
modules.add(new AppSecureRandomModule(reactContext));
|
||||
return modules;
|
||||
}
|
||||
|
||||
}
|
|
@ -28,7 +28,6 @@ public class MainApplication extends Application implements ReactApplication {
|
|||
List<ReactPackage> packages = new PackageList(this).getPackages();
|
||||
// Packages that cannot be autolinked yet can be added manually here, for example:
|
||||
// packages.add(new MyReactNativePackage());
|
||||
packages.add(new AppSecureRandomPackage());
|
||||
return packages;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue