mirror of
https://github.com/RfidResearchGroup/RFIDtools.git
synced 2026-05-12 11:19:59 -07:00
Project rebuild & clean up.
This commit is contained in:
@@ -55,10 +55,11 @@ dependencies {
|
||||
// This my project maven from github release!
|
||||
implementation 'com.github.xianglin1998:IORedirector:1.0'
|
||||
implementation 'com.github.xianglin1998:Crapto1:1.3'
|
||||
implementation 'com.github.xianglin1998:nfctag:1.0'
|
||||
implementation 'com.github.xianglin1998:nfc_console:1.0'
|
||||
|
||||
implementation project(':utils')
|
||||
implementation project(':libnfc_pn53x')
|
||||
implementation project(':console')
|
||||
implementation project(':chameleon')
|
||||
implementation project(':communication')
|
||||
implementation project(':pm3rdv4rrg')
|
||||
|
||||
@@ -24,7 +24,7 @@ import cn.dxl.common.util.LanguageUtil;
|
||||
import cn.dxl.common.util.StatusBarUtil;
|
||||
import cn.dxl.common.widget.ToastUtil;
|
||||
import cn.dxl.common.util.VibratorUtils;
|
||||
import cn.dxl.mifare.GlobalTag;
|
||||
import cn.dxl.mifare.NfcTagListenUtils;
|
||||
import cn.dxl.mifare.StdMifareIntent;
|
||||
import cn.rrg.rdv.R;
|
||||
import cn.rrg.rdv.application.Properties;
|
||||
@@ -33,7 +33,7 @@ import cn.rrg.rdv.application.Properties;
|
||||
* Created by DXL on 2017/10/26.
|
||||
*/
|
||||
public abstract class BaseActivity
|
||||
extends AppCompatActivity implements GlobalTag.OnNewTagListener {
|
||||
extends AppCompatActivity implements NfcTagListenUtils.OnNewTagListener {
|
||||
|
||||
protected String LOG_TAG = this.getClass().getSimpleName();
|
||||
protected Context context = this;
|
||||
@@ -50,7 +50,7 @@ public abstract class BaseActivity
|
||||
//实例化一个标准NFC设备工具对象!
|
||||
mStdMfUtil = new StdMifareIntent(this);
|
||||
//添加全局的标签状态监听!
|
||||
GlobalTag.addListener(this);
|
||||
NfcTagListenUtils.addListener(this);
|
||||
//建立事件观察数列!
|
||||
onTouchListeners = new ArrayList<>();
|
||||
|
||||
@@ -134,12 +134,12 @@ public abstract class BaseActivity
|
||||
Tag tag = data.getParcelable(NfcAdapter.EXTRA_TAG);
|
||||
if (tag != null) {
|
||||
//存入全局操作域!
|
||||
GlobalTag.setTag(tag);
|
||||
NfcTagListenUtils.setTag(tag);
|
||||
//显示 UID!
|
||||
ToastUtil.show(this, getString(R.string.tips_uid) + HexUtil.toHexString(tag.getId()), true);
|
||||
//震动一下!
|
||||
VibratorUtils.runOneAsDelay(context, 1000);
|
||||
GlobalTag.notifyOnNewTag(tag);
|
||||
NfcTagListenUtils.notifyOnNewTag(tag);
|
||||
}
|
||||
}
|
||||
super.onNewIntent(intent);
|
||||
@@ -183,7 +183,7 @@ public abstract class BaseActivity
|
||||
protected void onDestroy() {
|
||||
//Log.d(LOG_TAG, "Act is destory");
|
||||
super.onDestroy();
|
||||
GlobalTag.removeListener(this);
|
||||
NfcTagListenUtils.removeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,7 +10,7 @@ import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import cn.dxl.mifare.MifareUtils;
|
||||
import cn.dxl.mifare.MifareClassicUtils;
|
||||
import cn.rrg.rdv.R;
|
||||
import cn.dxl.common.util.ContextUtil;
|
||||
import cn.dxl.common.util.TextStyleUtil;
|
||||
@@ -34,25 +34,25 @@ public class DumpEqualAdapter extends AbsResIdArrayAdapter<String> {
|
||||
showBlock.setText(String.valueOf(position));
|
||||
//判断是否试起始扇区,是的话就显示扇区索引值
|
||||
LinearLayout layout = view.findViewById(R.id.layout_sector_label);
|
||||
if (MifareUtils.isFirstBlock(position)) {
|
||||
if (MifareClassicUtils.isFirstBlock(position)) {
|
||||
layout.setVisibility(View.VISIBLE);
|
||||
//填充扇区值!
|
||||
TextView txtShowSector = layout.findViewById(R.id.txtShowSector);
|
||||
int sector = MifareUtils.blockToSector(position);
|
||||
int sector = MifareClassicUtils.blockToSector(position);
|
||||
txtShowSector.setText(String.valueOf(sector));
|
||||
} else {
|
||||
layout.setVisibility(View.GONE);
|
||||
}
|
||||
//判断是否需要显示尾部的分割线!
|
||||
View endDivider = view.findViewById(R.id.view_divider);
|
||||
if (MifareUtils.isTrailerBlock(position)) {
|
||||
if (MifareClassicUtils.isTrailerBlock(position)) {
|
||||
endDivider.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
endDivider.setVisibility(View.GONE);
|
||||
}
|
||||
//判断是否需要显示块数据的分割线!
|
||||
View dataBlckDivider = view.findViewById(R.id.view_divider_1);
|
||||
if (!MifareUtils.isTrailerBlock(position)) {
|
||||
if (!MifareClassicUtils.isTrailerBlock(position)) {
|
||||
dataBlckDivider.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
dataBlckDivider.setVisibility(View.GONE);
|
||||
@@ -91,7 +91,7 @@ public class DumpEqualAdapter extends AbsResIdArrayAdapter<String> {
|
||||
//厂商块!
|
||||
ssb.append(TextStyleUtil.getStyleString(getContext(), data, R.style.ManufacturerStyle));
|
||||
if (i != contents.length - 1) ssb.append('\n');
|
||||
} else if (MifareUtils.isTrailerBlock(position)) {
|
||||
} else if (MifareClassicUtils.isTrailerBlock(position)) {
|
||||
//尾部块!
|
||||
//尾部块需要进行截取设置,无需最终的换行!!!
|
||||
String keyA = data.substring(0, 12);
|
||||
|
||||
@@ -35,7 +35,7 @@ import cn.dxl.common.util.HexUtil;
|
||||
import cn.dxl.common.util.LogUtils;
|
||||
import cn.dxl.common.widget.FilesSelectorDialog;
|
||||
import cn.dxl.common.widget.ToastUtil;
|
||||
import cn.dxl.mifare.MifareUtils;
|
||||
import cn.dxl.mifare.MifareClassicUtils;
|
||||
import cn.rrg.rdv.R;
|
||||
import cn.rrg.rdv.activities.standard.AbsStandardM1Activity;
|
||||
import cn.rrg.rdv.activities.tools.DumpEditActivity;
|
||||
@@ -715,7 +715,7 @@ public abstract class AbsMfOperatesFragment
|
||||
// TODO 后期可以做类似MCT的多扇区(非全部扇区)或者单扇区读写实现!
|
||||
// 目前只返回用户输入的扇区即可!
|
||||
sector = Integer.parseInt(edtInputReadTagSingleSector.getText().toString());
|
||||
if (!MifareUtils.validateSector(sector)) sector = -1;
|
||||
if (!MifareClassicUtils.validateSector(sector)) sector = -1;
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
for (M1KeyBean keyBean : keyBeans) {
|
||||
|
||||
@@ -17,7 +17,7 @@ import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import cn.dxl.common.util.FragmentUtil;
|
||||
import cn.dxl.mifare.GlobalTag;
|
||||
import cn.dxl.mifare.NfcTagListenUtils;
|
||||
import cn.rrg.rdv.R;
|
||||
import cn.rrg.rdv.fragment.base.BaseFragment;
|
||||
import cn.rrg.rdv.presenter.AbsTagInformationsPresenter;
|
||||
@@ -29,7 +29,7 @@ import cn.rrg.rdv.view.TagInformationsView;
|
||||
public abstract class AbsShowInformationFragment
|
||||
extends BaseFragment implements
|
||||
TagInformationsView<CharSequence>,
|
||||
GlobalTag.OnNewTagListener {
|
||||
NfcTagListenUtils.OnNewTagListener {
|
||||
|
||||
private AbsTagInformationsPresenter presenter;
|
||||
|
||||
@@ -42,7 +42,7 @@ public abstract class AbsShowInformationFragment
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
GlobalTag.addListener(this);
|
||||
NfcTagListenUtils.addListener(this);
|
||||
workingMsgDialog = new AlertDialog.Builder(getContext())
|
||||
.setTitle(R.string.tips)
|
||||
.setCancelable(false)
|
||||
@@ -100,7 +100,7 @@ public abstract class AbsShowInformationFragment
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
GlobalTag.removeListener(this);
|
||||
NfcTagListenUtils.removeListener(this);
|
||||
presenter.detachView();
|
||||
workingMsgDialog.dismiss();
|
||||
workingMsgDialog = null;
|
||||
|
||||
@@ -10,7 +10,7 @@ import cn.dxl.common.util.FileUtils;
|
||||
import cn.dxl.common.util.HexUtil;
|
||||
import cn.dxl.common.util.LogUtils;
|
||||
import cn.dxl.mifare.MifareAdapter;
|
||||
import cn.dxl.mifare.MifareUtils;
|
||||
import cn.dxl.mifare.MifareClassicUtils;
|
||||
import cn.rrg.rdv.callback.KeysAuthCallback;
|
||||
import cn.rrg.rdv.javabean.M1KeyBean;
|
||||
import cn.rrg.rdv.util.DumpUtils;
|
||||
@@ -197,7 +197,7 @@ public abstract class AbsTagKeysCheckModel extends AbsStopableTask {
|
||||
private void authkeysInSector(int sector, KeysAuthCallback callBack) {
|
||||
// 初始化标签
|
||||
MifareAdapter stdMf = getTag();
|
||||
if (!MifareUtils.validateSector(sector)) {
|
||||
if (!MifareClassicUtils.validateSector(sector)) {
|
||||
//不是有效的扇区,可能是出现了BUG
|
||||
callBack.onResults(null);
|
||||
return;
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.Arrays;
|
||||
import cn.dxl.common.util.HexUtil;
|
||||
import cn.dxl.common.util.LogUtils;
|
||||
import cn.dxl.mifare.MifareAdapter;
|
||||
import cn.dxl.mifare.MifareUtils;
|
||||
import cn.dxl.mifare.MifareClassicUtils;
|
||||
import cn.rrg.rdv.callback.ReaderCallback;
|
||||
import cn.rrg.rdv.javabean.M1Bean;
|
||||
import cn.rrg.rdv.javabean.M1KeyBean;
|
||||
@@ -54,9 +54,9 @@ public abstract class AbsTagReadModel extends AbsStopableTask {
|
||||
ret = new M1Bean();
|
||||
ret.setSector(sector);
|
||||
//验证成功,则得到当前扇区的块数量,进行遍历读取
|
||||
int blockCount = MifareUtils.getBlockCountInSector(sector);
|
||||
int blockCount = MifareClassicUtils.getBlockCountInSector(sector);
|
||||
//得到块开始的位置
|
||||
int startBlock = MifareUtils.sectorToBlock(sector);
|
||||
int startBlock = MifareClassicUtils.sectorToBlock(sector);
|
||||
//得到块结束的位置
|
||||
int endBlock = startBlock + blockCount;
|
||||
//建立一个数组,存放数据!
|
||||
@@ -186,11 +186,11 @@ public abstract class AbsTagReadModel extends AbsStopableTask {
|
||||
//设置扇区
|
||||
ret.setSector(sector);
|
||||
//得到扇区总数量
|
||||
int blockCount = MifareUtils.getBlockCountInSector(sector);
|
||||
int blockCount = MifareClassicUtils.getBlockCountInSector(sector);
|
||||
//建立数据块字符串数组
|
||||
String[] datas = new String[blockCount];
|
||||
//这个扇区的第一块
|
||||
int firstBlock = MifareUtils.sectorToBlock(sector);
|
||||
int firstBlock = MifareClassicUtils.sectorToBlock(sector);
|
||||
//迭代扇区中的块!
|
||||
for (int i = 0, j = firstBlock; i < blockCount; ++i, ++j) {
|
||||
//Log.d(LOG_TAG, "读取块: " + i);
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Comparator;
|
||||
|
||||
import cn.dxl.common.util.HexUtil;
|
||||
import cn.dxl.mifare.MifareAdapter;
|
||||
import cn.dxl.mifare.MifareUtils;
|
||||
import cn.dxl.mifare.MifareClassicUtils;
|
||||
import cn.rrg.rdv.javabean.M1KeyBean;
|
||||
import cn.rrg.rdv.javabean.M1Bean;
|
||||
import cn.rrg.rdv.callback.WriterCallback;
|
||||
@@ -69,7 +69,7 @@ public abstract class AbsTagWriteModel
|
||||
if (block == 0 && !writeZero) return false;
|
||||
boolean ret = false;
|
||||
boolean auth;
|
||||
int sector = MifareUtils.blockToSector(block);
|
||||
int sector = MifareClassicUtils.blockToSector(block);
|
||||
try {
|
||||
if (useKeyB) {
|
||||
auth = tag.authB(sector, key);
|
||||
@@ -96,7 +96,7 @@ public abstract class AbsTagWriteModel
|
||||
}
|
||||
MifareAdapter tag = getTag();
|
||||
//判断给出的密钥是否可以用来验证这个块
|
||||
if (MifareUtils.blockToSector(block) != keys.getSector()) {
|
||||
if (MifareClassicUtils.blockToSector(block) != keys.getSector()) {
|
||||
Log.d(LOG_TAG, "给出的密钥bean不符合输入的block值!");
|
||||
callback.onFinish();
|
||||
return;
|
||||
@@ -135,7 +135,7 @@ public abstract class AbsTagWriteModel
|
||||
//取出数据尝试写入!
|
||||
String[] datas = data.getDatas();
|
||||
//进一步验证数据和卡片类型的映射!
|
||||
if (datas.length != MifareUtils.getBlockCountInSector(data.getSector())) {
|
||||
if (datas.length != MifareClassicUtils.getBlockCountInSector(data.getSector())) {
|
||||
//数据长度跟卡片对应扇区的块数量不匹配!
|
||||
Log.d(LOG_TAG, "发现了致命的问题,传入的数据块数量与标签的块数量不匹配!");
|
||||
stopLable = true;
|
||||
@@ -146,7 +146,7 @@ public abstract class AbsTagWriteModel
|
||||
if (order) {
|
||||
//正序写!
|
||||
int sector = data.getSector();
|
||||
int startBlobk = MifareUtils.sectorToBlock(sector);
|
||||
int startBlobk = MifareClassicUtils.sectorToBlock(sector);
|
||||
for (int i = 0, j = startBlobk; i < datas.length; ++i, ++j) {
|
||||
//Log.d(LOG_TAG, "写入块" + j);
|
||||
//TODO 当前是扇区顺写,数据也要是倒写的,因此,我们需要进行验证流程!!
|
||||
@@ -187,7 +187,7 @@ public abstract class AbsTagWriteModel
|
||||
}
|
||||
} else {
|
||||
int sector = data.getSector();
|
||||
int lastBlock = MifareUtils.sectorToBlock(sector) + MifareUtils.getBlockCountInSector(sector) - 1;
|
||||
int lastBlock = MifareClassicUtils.sectorToBlock(sector) + MifareClassicUtils.getBlockCountInSector(sector) - 1;
|
||||
for (int i = datas.length - 1, j = lastBlock; i >= 0; --i, --j) {
|
||||
//Log.d(LOG_TAG, "写入块" + j);
|
||||
//TODO 当前是扇区倒写,数据也要是倒写的,因此,我们需要进行验证流程!!
|
||||
@@ -205,7 +205,7 @@ public abstract class AbsTagWriteModel
|
||||
if (!retA && !retB) {
|
||||
Log.d(LOG_TAG, "使用AB密钥写入块" + j + "失败!");
|
||||
}
|
||||
if (MifareUtils.isTrailerBlock(j)) {
|
||||
if (MifareClassicUtils.isTrailerBlock(j)) {
|
||||
//写入了尾部块后应当重新截取密钥!
|
||||
if (retA) {
|
||||
keyA = HexUtil.hexStringToByteArray(datas[i].substring(0, 12));
|
||||
@@ -366,7 +366,7 @@ public abstract class AbsTagWriteModel
|
||||
}
|
||||
String[] datas = data.getDatas();
|
||||
//验证将要被写入的数据个数是否与卡片的块个数一致
|
||||
if (datas.length != MifareUtils.getBlockCountInSector(data.getSector())) {
|
||||
if (datas.length != MifareClassicUtils.getBlockCountInSector(data.getSector())) {
|
||||
//不一致,需要反馈!
|
||||
Log.d(LOG_TAG, "致命的错误发生在写扇区 " + data + ",要写入的数据个数与标签支持的个数无法成功对应上!");
|
||||
callback.onFinish();
|
||||
@@ -374,7 +374,7 @@ public abstract class AbsTagWriteModel
|
||||
}
|
||||
int _sector = data.getSector();
|
||||
//获得当前扇区最后一个块
|
||||
int lastBlock = MifareUtils.sectorToBlock(_sector) + MifareUtils.getBlockCountInSector(_sector) - 1;
|
||||
int lastBlock = MifareClassicUtils.sectorToBlock(_sector) + MifareClassicUtils.getBlockCountInSector(_sector) - 1;
|
||||
//经过必要写入前步骤判断之后,开始写入,倒着写!
|
||||
for (int i = datas.length - 1, j = lastBlock; i >= 0; --i, --j) {
|
||||
if (DumpUtils.isValidBlockData(datas[i])) {
|
||||
|
||||
@@ -6,13 +6,13 @@ import android.nfc.tech.MifareClassic;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.dxl.common.util.IOUtils;
|
||||
import cn.dxl.mifare.GlobalTag;
|
||||
import cn.dxl.mifare.NfcTagListenUtils;
|
||||
|
||||
public class StandardNFCTagStateModel extends AbsTagStateModel {
|
||||
@Override
|
||||
protected boolean checkTagState() {
|
||||
//判断标准设备MF是否存在实例引用
|
||||
Tag tag = GlobalTag.getTag();
|
||||
Tag tag = NfcTagListenUtils.getTag();
|
||||
// 直接判断全局的标签状态是否正常!
|
||||
if (tag != null) {
|
||||
//判断能否链接!
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.Arrays;
|
||||
import cn.dxl.common.util.FileUtils;
|
||||
import cn.dxl.common.util.HexUtil;
|
||||
import cn.dxl.common.util.AppUtil;
|
||||
import cn.dxl.mifare.GlobalTag;
|
||||
import cn.dxl.mifare.NfcTagListenUtils;
|
||||
import cn.rrg.rdv.R;
|
||||
import cn.rrg.rdv.callback.TagInformationsCallback;
|
||||
import cn.rrg.rdv.util.Paths;
|
||||
@@ -31,7 +31,7 @@ public class StdNfcInformationsModel {
|
||||
|
||||
public void collect(TagInformationsCallback<CharSequence> callback) {
|
||||
//获得最新的标签对象!
|
||||
Tag tag = GlobalTag.getTag();
|
||||
Tag tag = NfcTagListenUtils.getTag();
|
||||
int mMFCSupport;
|
||||
if (tag != null) {
|
||||
Log.d(LOG_TAG, "collect调用,卡片存在!");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.rrg.rdv.presenter;
|
||||
|
||||
import cn.dxl.mifare.MifareUtils;
|
||||
import cn.dxl.mifare.MifareClassicUtils;
|
||||
import cn.rrg.rdv.javabean.M1KeyBean;
|
||||
import cn.rrg.rdv.callback.WriterCallback;
|
||||
import cn.rrg.rdv.models.AbsTagWriteModel;
|
||||
@@ -42,7 +42,7 @@ public abstract class AbsTagWritePresenter extends BasePresenter<TagWriteView> {
|
||||
if (data != null && keyBeans != null && keyBeans.length > 0 && sector != -1 && block != -1) {
|
||||
writeModel = getWriteModel();
|
||||
writeModel.reset();
|
||||
block = MifareUtils.sectorToBlock(sector) + block;
|
||||
block = MifareClassicUtils.sectorToBlock(sector) + block;
|
||||
writeModel.writeBlock(
|
||||
view.isWriteManufacturerAllow(),
|
||||
block, keyBeans[0],
|
||||
@@ -76,7 +76,7 @@ public abstract class AbsTagWritePresenter extends BasePresenter<TagWriteView> {
|
||||
if (data != null && keyBeans != null && keyBeans.length > 0 && sector != -1 && block != -1) {
|
||||
writeModel = getWriteModel();
|
||||
writeModel.reset();
|
||||
block = MifareUtils.sectorToBlock(sector) + block;
|
||||
block = MifareClassicUtils.sectorToBlock(sector) + block;
|
||||
writeModel.writeBlock(block, data, callback);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.Comparator;
|
||||
import cn.dxl.common.util.FileUtils;
|
||||
import cn.dxl.common.util.HexUtil;
|
||||
import cn.dxl.common.util.RegexGroupUtil;
|
||||
import cn.dxl.mifare.MifareUtils;
|
||||
import cn.dxl.mifare.MifareClassicUtils;
|
||||
import cn.rrg.rdv.javabean.M1Bean;
|
||||
import cn.rrg.rdv.javabean.M1KeyBean;
|
||||
|
||||
@@ -96,7 +96,7 @@ public class DumpUtils {
|
||||
// 根据扇区号来获取相应的空扇区!
|
||||
public static M1Bean getEmptyM1Bean(int sector) {
|
||||
M1Bean ret = new M1Bean();
|
||||
int blockCount = MifareUtils.getBlockCountInSector(sector);
|
||||
int blockCount = MifareClassicUtils.getBlockCountInSector(sector);
|
||||
String[] datas = new String[blockCount];
|
||||
for (int i = 0; i < blockCount; i++) {
|
||||
datas[i] = i < (blockCount - 1) ? BLANK_DATA : BLANK_TRAIL_BLOCK;
|
||||
@@ -619,10 +619,10 @@ public class DumpUtils {
|
||||
for (int i = 0; i < blockCount; ) {
|
||||
M1Bean bean = new M1Bean();
|
||||
//获取当前的扇区
|
||||
int sector = MifareUtils.blockToSector(i);
|
||||
int sector = MifareClassicUtils.blockToSector(i);
|
||||
bean.setSector(sector);
|
||||
//获取当前的块数量统计!
|
||||
int blockCountInSecrot = MifareUtils.getBlockCountInSector(sector);
|
||||
int blockCountInSecrot = MifareClassicUtils.getBlockCountInSector(sector);
|
||||
String[] dataArray = new String[blockCountInSecrot];
|
||||
//进行迭代添加!
|
||||
for (int j = i, k = 0; j < blockCountInSecrot; ++j, ++k) {
|
||||
@@ -801,7 +801,7 @@ public class DumpUtils {
|
||||
String[] _tmps = null;
|
||||
for (int i = 0; i < contents.length; ) {
|
||||
// 进行尾部的判断,如果是256的扇区的话我们需要进行偏移量的重新设置!
|
||||
int count = MifareUtils.getBlockCountInSector(MifareUtils.blockToSector(i));
|
||||
int count = MifareClassicUtils.getBlockCountInSector(MifareClassicUtils.blockToSector(i));
|
||||
if (DumpUtils.isHeader(i)) {
|
||||
//在首部块!
|
||||
bean = new M1Bean();
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
//这里指定构建工具支持的版本仓库
|
||||
classpath 'com.android.tools.build:gradle:3.6.1'
|
||||
classpath 'com.android.tools.build:gradle:3.6.2'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.2"
|
||||
buildToolsVersion "29.0.3"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
@@ -22,9 +22,10 @@ android {
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation 'com.github.xianglin1998:mfkey:1.1'
|
||||
implementation 'com.github.xianglin1998:nfctag:1.0'
|
||||
|
||||
implementation project(path: ':utils')
|
||||
implementation project(path: ':communication')
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
api project(path: ':mifaretag')
|
||||
implementation project(path: ':communication')
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.dxl.mfkey.Nonce32;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.dxl.mifare.MifareUtils;
|
||||
import cn.dxl.mifare.MifareClassicUtils;
|
||||
import cn.rrg.chameleon.javabean.ResultBean;
|
||||
import cn.rrg.chameleon.javabean.DetectionDatas;
|
||||
import cn.dxl.common.util.HexUtil;
|
||||
@@ -126,8 +126,8 @@ public class ChameleonDetection {
|
||||
//如果成功,则拼装解密的结果!
|
||||
ResultBean resultBean = new ResultBean();
|
||||
resultBean.setId(HexUtil.toHexString(resultUtil.getUid()));
|
||||
resultBean.setSector(MifareUtils.blockToSector(data1.getBlock()));
|
||||
resultBean.setBlock(MifareUtils.getIndexOnSector(data1.getBlock(), resultBean.getSector()));
|
||||
resultBean.setSector(MifareClassicUtils.blockToSector(data1.getBlock()));
|
||||
resultBean.setBlock(MifareClassicUtils.getIndexOnSector(data1.getBlock(), resultBean.getSector()));
|
||||
resultBean.setKeyA(data1.getType() == 1);
|
||||
resultBean.setKey(key);
|
||||
//拼装完成,进行解密!
|
||||
@@ -162,8 +162,8 @@ public class ChameleonDetection {
|
||||
//如果成功,则拼装解密的结果!
|
||||
ResultBean resultBean = new ResultBean();
|
||||
resultBean.setId(HexUtil.toHexString(resultUtil.getUid()));
|
||||
resultBean.setSector(MifareUtils.blockToSector(d1.getBlock()));
|
||||
resultBean.setBlock(MifareUtils.getIndexOnSector(d1.getBlock(), resultBean.getSector()));
|
||||
resultBean.setSector(MifareClassicUtils.blockToSector(d1.getBlock()));
|
||||
resultBean.setBlock(MifareClassicUtils.getIndexOnSector(d1.getBlock(), resultBean.getSector()));
|
||||
resultBean.setKeyA(d1.getType() == 0);
|
||||
resultBean.setKey(key);
|
||||
//拼装完成,进行解密!
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import cn.dxl.mifare.MifareUtils;
|
||||
import cn.dxl.mifare.MifareClassicUtils;
|
||||
import cn.rrg.chameleon.javabean.DetectionDatas;
|
||||
import cn.dxl.common.util.HexUtil;
|
||||
|
||||
@@ -142,7 +142,7 @@ public class DetectionResult {
|
||||
HexUtil.byte2Int(sources, (i + 1) * 16 + 12)
|
||||
));
|
||||
// skip sectors with 0xFF
|
||||
if (MifareUtils.validateBlock(dds.getBlock()))
|
||||
if (MifareClassicUtils.validateBlock(dds.getBlock()))
|
||||
mResultList.add(dds);
|
||||
}
|
||||
//进行数据排序,按照块顺序!
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
# Built application files
|
||||
*.apk
|
||||
*.ap_
|
||||
|
||||
# Files for the ART/Dalvik VM
|
||||
*.dex
|
||||
|
||||
# Java class files
|
||||
*.class
|
||||
|
||||
# Generated files
|
||||
bin/
|
||||
gen/
|
||||
out/
|
||||
|
||||
# Cmake gen
|
||||
.cxx/
|
||||
|
||||
# Gradle files
|
||||
.gradle/
|
||||
build/
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
local.properties
|
||||
|
||||
# Proguard folder generated by Eclipse
|
||||
proguard/
|
||||
|
||||
# Log Files
|
||||
*.log
|
||||
|
||||
# Android Studio Navigation editor temp files
|
||||
.navigation/
|
||||
|
||||
# Android Studio captures folder
|
||||
captures/
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
.idea/
|
||||
|
||||
# Keystore files
|
||||
# Uncomment the following line if you do not want to check your keystore files in.
|
||||
#*.jks
|
||||
|
||||
# External native build folder generated in Android Studio 2.2 and later
|
||||
.externalNativeBuild
|
||||
|
||||
# Google Services (e.g. APIs or Firebase)
|
||||
google-services.json
|
||||
|
||||
# Freeline
|
||||
freeline.py
|
||||
freeline/
|
||||
freeline_project_description.json
|
||||
|
||||
# fastlane
|
||||
fastlane/report.xml
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots
|
||||
fastlane/test_output
|
||||
fastlane/readme.md
|
||||
@@ -1,30 +0,0 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.2"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
debug {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
}
|
||||
Vendored
-21
@@ -1,21 +0,0 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -1,2 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="cn.rrg.console" />
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user