@@ -0,0 +1,3169 @@
+package ru.enlight.nfcreactnativesimple;%0Aimport com.facebook.react.bridge.ActivityEventListener;%0Aimport com.facebook.react.bridge.ReactApplicationContext;%0Aimport com.facebook.react.bridge.ReactContext;%0Aimport com.facebook.react.bridge.ReactContextBaseJavaModule;%0Aimport com.facebook.react.bridge.ReactMethod;%0Aimport com.facebook.react.bridge.WritableMap;%0Aimport com.facebook.react.bridge.WritableArray;%0Aimport com.facebook.react.bridge.ReadableMap;%0Aimport com.facebook.react.bridge.ReadableArray;%0Aimport com.facebook.react.bridge.ReadableNativeArray;%0Aimport com.facebook.react.bridge.Arguments;%0Aimport com.facebook.react.bridge.Promise;%0Aimport com.facebook.react.modules.core.DeviceEventManagerModule;%0Aimport android.util.Log;%0Aimport android.app.Activity;%0Aimport android.content.Intent;%0Aimport android.nfc.NfcAdapter;%0Aimport android.nfc.Tag;%0Aimport android.support.annotation.Nullable;%0Aimport java.io.PrintWriter;%0Aimport java.io.StringWriter;%0Aimport java.math.BigInteger;%0Aimport java.nio.ByteBuffer;%0Aimport java.nio.IntBuffer;%0Aimport static android.R.attr.data;%0Aimport static android.R.attr.defaultValue;%0Aimport static android.R.attr.x;%0Aimport static com.facebook.common.util.Hex.hexStringToByteArray;%0A%0Aclass NfcReactNativeSimpleModule extends ReactContextBaseJavaModule implements ActivityEventListener %7B%0A    private ReactApplicationContext reactContext;%0A    private ReadableArray sectores;%0A%0A    final protected static char%5B%5D hexArray = %220123456789ABCDEF%22.toCharArray();%0A%0A    public NfcReactNativeModule(ReactApplicationContext reactContext) %0A    %7B%0A        super(reactContext);%0A        this.reactContext = reactContext;%0A        this.reactContext.addActivityEventListener(this);%0A    %7D%0A%0A    @Override%0A    public void onNewIntent(Intent intent) %0A    %7B%0A%09      String action = intent.getAction();%0A//%09    Log.i(%22!intent! %22, action);%0A%0A%09      Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);%0A%0A        byte%5B%5D id = tag.getId();%0A        String serialNumber = bytesToHex(id);%0A        WritableMap idData = Arguments.createMap();%0A        idData.putString(%22id%22, serialNumber);%0A%0A        sendEvent(this.reactContext, %22NFCCardID%22, idData);%0A%0A    %7D//onNewIntent()%0A%0A    private void sendEvent(ReactContext reactContext, String eventName, @Nullable WritableMap params)%0A    %7B%0A      reactContext%0A      .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)%0A      .emit(eventName, params);%0A    %7D//sendEvent()%0A%0A%0A    public static String bytesToHex(byte%5B%5D bytes) %0A    %7B%0A      char%5B%5D hexChars = new char%5Bbytes.length * 2%5D;%0A      for ( int j = 0; j %3C bytes.length; j++ ) %7B%0A          int v = bytes%5Bj%5D & 0xFF;%0A          hexChars%5Bj * 2%5D = hexArray%5Bv %3E%3E%3E 4%5D;%0A          hexChars%5Bj * 2 + 1%5D = hexArray%5Bv & 0x0F%5D;%0A      %7D%0A      return new String(hexChars);%0A    %7D//bytesToHex()%0A%0A%0A    @Override%0A    public void onActivityResult(%0A      final Activity activity,%0A      final int requestCode,%0A      final int resultCode,%0A      final Intent intent) %7B%0A    %7D%0A%0A    /**%0A     * @return the name of this module. This will be the name used to %7B@code require()%7D this module%0A     * from javascript.%0A     */%0A    @Override%0A    public String getName() %7B%0A        return %22NfcReactNativeSimple%22;%0A    %7D%0A%7D%0A

Create NfcReactNativeSimpleModule.java