Updated on 2026-08-14
This commit is contained in:
parent
0bc2d0a1d1
commit
49c3ff4427
18 changed files with 78 additions and 90 deletions
|
|
@ -364,7 +364,7 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
public void onTagDiscovered(Tag tag) {
|
||||
try {
|
||||
Log.w(getClass().getName(), "Ignore discovered tag!");
|
||||
mNfcManager.IgnoreTag(tag);
|
||||
mNfcManager.ignoreTag(tag);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class CreateNewWalletActivity extends AppCompatActivity implements NfcAda
|
|||
createNewWalletTask.start();
|
||||
} else {
|
||||
Log.d(logTag, "Mismatch card UID (" + sUID + " instead of " + mCard.getUID() + ")");
|
||||
mNfcManager.IgnoreTag(isoDep.getTag());
|
||||
mNfcManager.ignoreTag(isoDep.getTag());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ public class CreateNewWalletActivity extends AppCompatActivity implements NfcAda
|
|||
protocol.run_Read();
|
||||
|
||||
} finally {
|
||||
mNfcManager.IgnoreTag(mIsoDep.getTag());
|
||||
mNfcManager.ignoreTag(mIsoDep.getTag());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ public class EmptyWalletActivity extends AppCompatActivity implements NfcAdapter
|
|||
String sUID = Util.byteArrayToHexString(UID);
|
||||
if (!mCard.getUID().equals(sUID)) {
|
||||
Log.d(logTag, "Invalid UID: " + sUID);
|
||||
mNfcManager.IgnoreTag(isoDep.getTag());
|
||||
mNfcManager.ignoreTag(isoDep.getTag());
|
||||
return;
|
||||
} else {
|
||||
Log.v(logTag, "UID: " + sUID);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.nfc.NfcAdapter;
|
||||
import android.nfc.Tag;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
|
@ -92,7 +91,6 @@ public class MainActivity extends AppCompatActivity implements PopupMenu.OnMenuI
|
|||
lp.topMargin = (int) (dp * (-100 + antenna.Y * 250));
|
||||
lp2.topMargin = (int) (dp * (-125 + antenna.Y * 250));
|
||||
nfc.setLayoutParams(lp2);
|
||||
|
||||
Animation a = new Animation() {
|
||||
@Override
|
||||
protected void applyTransformation(float interpolatedTime, Transformation t) {
|
||||
|
|
@ -115,13 +113,13 @@ public class MainActivity extends AppCompatActivity implements PopupMenu.OnMenuI
|
|||
hideCleanButton();
|
||||
|
||||
// NFC
|
||||
Intent intent = getIntent();
|
||||
if (intent != null && (NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction()) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction()))) {
|
||||
Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
|
||||
if (tag != null && onNFCReaderCallback != null) {
|
||||
onNFCReaderCallback.onTagDiscovered(tag);
|
||||
}
|
||||
}
|
||||
// Intent intent = getIntent();
|
||||
// if (intent != null && (NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction()) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction()))) {
|
||||
// Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
|
||||
// if (tag != null && onNFCReaderCallback != null) {
|
||||
// onNFCReaderCallback.onTagDiscovered(tag);
|
||||
// }
|
||||
// }
|
||||
|
||||
// check if device root
|
||||
RootBeer rootBeer = new RootBeer(this);
|
||||
|
|
@ -129,16 +127,16 @@ public class MainActivity extends AppCompatActivity implements PopupMenu.OnMenuI
|
|||
new RootFoundDialog().show(getFragmentManager(), RootFoundDialog.TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
if (intent != null && (NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction()) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction()))) {
|
||||
Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
|
||||
if (tag != null && onNFCReaderCallback != null) {
|
||||
onNFCReaderCallback.onTagDiscovered(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
// @Override
|
||||
// protected void onNewIntent(Intent intent) {
|
||||
// super.onNewIntent(intent);
|
||||
// if (intent != null && (NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction()) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction()))) {
|
||||
// Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
|
||||
// if (tag != null && onNFCReaderCallback != null) {
|
||||
// onNFCReaderCallback.onTagDiscovered(tag);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keycode, KeyEvent e) {
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ public class PreparePaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
public void onTagDiscovered(Tag tag) {
|
||||
try {
|
||||
Log.w(getClass().getName(), "Ignore discovered tag!");
|
||||
mNfcManager.IgnoreTag(tag);
|
||||
mNfcManager.ignoreTag(tag);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class PurgeActivity extends AppCompatActivity implements NfcAdapter.Reade
|
|||
purgeTask.start();
|
||||
} else {
|
||||
Log.d(logTag, "Mismatch card UID (" + sUID + " instead of " + mCard.getUID() + ")");
|
||||
mNfcManager.IgnoreTag(isoDep.getTag());
|
||||
mNfcManager.ignoreTag(isoDep.getTag());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -173,7 +173,7 @@ public class PurgeActivity extends AppCompatActivity implements NfcAdapter.Reade
|
|||
if (isCancelled) return;
|
||||
|
||||
} finally {
|
||||
mNfcManager.IgnoreTag(mIsoDep.getTag());
|
||||
mNfcManager.ignoreTag(mIsoDep.getTag());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ public class RequestPINActivity extends AppCompatActivity implements NfcAdapter.
|
|||
public void onTagDiscovered(Tag tag) {
|
||||
try {
|
||||
Log.w(getClass().getName(), "Ignore discovered tag!");
|
||||
mNfcManager.IgnoreTag(tag);
|
||||
mNfcManager.ignoreTag(tag);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -76,7 +76,7 @@ public class SwapPINActivity extends AppCompatActivity implements NfcAdapter.Rea
|
|||
swapPinTask.start();
|
||||
} else {
|
||||
Log.d(logTag, "Mismatch card UID (" + sUID + " instead of " + mCard.getUID() + ")");
|
||||
mNfcManager.IgnoreTag(isoDep.getTag());
|
||||
mNfcManager.ignoreTag(isoDep.getTag());
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
|
@ -166,7 +166,7 @@ public class SwapPINActivity extends AppCompatActivity implements NfcAdapter.Rea
|
|||
mNotifications.OnReadProgress(protocol, 100);
|
||||
|
||||
} finally {
|
||||
mNfcManager.IgnoreTag(mIsoDep.getTag());
|
||||
mNfcManager.ignoreTag(mIsoDep.getTag());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue