mirror of
https://github.com/RfidResearchGroup/RFIDtools.git
synced 2026-05-12 11:19:59 -07:00
Some unused resource removed.
This commit is contained in:
@@ -65,7 +65,6 @@ dependencies {
|
||||
implementation project(':libnfc_pn53x')
|
||||
implementation project(':chameleon')
|
||||
implementation project(':communication')
|
||||
implementation project(':pm3rdv4rrg')
|
||||
|
||||
testImplementation 'junit:junit:4.12'
|
||||
implementation project(path: ':pm3flasher')
|
||||
|
||||
@@ -46,22 +46,10 @@
|
||||
<activity android:name=".activities.px53x.NfcListConsoleActivity" />
|
||||
<activity android:name=".activities.px53x.HardnestedConsoleActivity" />
|
||||
|
||||
<activity
|
||||
android:name=".activities.proxmark3.rdv4_rrg.Proxmark3Rdv4RRGConsoleActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout" />
|
||||
|
||||
<activity
|
||||
android:name=".activities.connect.Proxmark3Rdv4RRGConnectActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout" />
|
||||
|
||||
<activity
|
||||
android:name=".activities.main.Proxmark3Rdv4RRGMain"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout" />
|
||||
|
||||
<activity
|
||||
android:name=".activities.proxmark3.rdv4_rrg.Proxmark3Rdv4RRGRedTeamConsoleActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout" />
|
||||
|
||||
<activity android:name=".activities.main.GeneralNfcDeviceMain">
|
||||
<!-- NFC Tech Filter -->
|
||||
<intent-filter>
|
||||
|
||||
+2
-5
@@ -9,13 +9,10 @@ import android.os.Bundle;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import android.text.Html;
|
||||
import android.widget.TextView;
|
||||
import com.termux.app.TermuxActivity;
|
||||
|
||||
import cn.dxl.common.util.DisplayUtil;
|
||||
import cn.rrg.rdv.R;
|
||||
import cn.rrg.rdv.activities.main.PM3FlasherMainActivity;
|
||||
import cn.rrg.rdv.activities.main.Proxmark3Rdv4RRGMain;
|
||||
import cn.rrg.rdv.activities.tools.DeviceConnectActivity;
|
||||
import cn.rrg.rdv.callback.ConnectFailedCtxCallback;
|
||||
import cn.rrg.rdv.models.AbstractDeviceModel;
|
||||
@@ -54,7 +51,7 @@ public class Proxmark3Rdv4RRGConnectActivity
|
||||
@Override
|
||||
public Class getTarget() {
|
||||
//连接成功后将跳转到该界面!
|
||||
return Proxmark3Rdv4RRGMain.class;
|
||||
return TermuxActivity.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
package cn.rrg.rdv.activities.main;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import cn.rrg.rdv.R;
|
||||
import cn.rrg.rdv.activities.proxmark3.rdv4_rrg.Proxmark3Rdv4RRGRedTeamConsoleActivity;
|
||||
|
||||
/*
|
||||
* PM3 RDV4 功能界面!
|
||||
* */
|
||||
public class Proxmark3Rdv4RRGMain
|
||||
extends BaseActivity {
|
||||
|
||||
private Button btnGo2Proxmark3Rdv4RRGRedTeam;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.act_main_proxmark3_rdv4_rrg);
|
||||
|
||||
initViews();
|
||||
initActions();
|
||||
|
||||
// direct goto red team console!
|
||||
startActivity(new Intent(context, Proxmark3Rdv4RRGRedTeamConsoleActivity.class));
|
||||
finish();
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
btnGo2Proxmark3Rdv4RRGRedTeam = findViewById(R.id.btnGo2Proxmark3Rdv4RRGRedTeam);
|
||||
}
|
||||
|
||||
private void initActions() {
|
||||
btnGo2Proxmark3Rdv4RRGRedTeam.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// startActivity(new Intent(context, Proxmark3Rdv4RRGRedTeamConsoleActivity.class));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
-157
@@ -1,157 +0,0 @@
|
||||
package cn.rrg.rdv.activities.proxmark3.rdv4_rrg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.CompoundButton;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import cn.dxl.common.util.FileUtils;
|
||||
import cn.rrg.console.define.ICommandTools;
|
||||
import cn.rrg.console.define.ICommandType;
|
||||
import cn.rrg.freo.IORedirector;
|
||||
import cn.rrg.rdv.R;
|
||||
import cn.rrg.rdv.activities.tools.BaseConsoleActivity;
|
||||
import cn.rrg.rdv.implement.EntryICommandType;
|
||||
import cn.rrg.rdv.util.Paths;
|
||||
|
||||
public abstract class Proxmark3ConsoleActivity
|
||||
extends BaseConsoleActivity
|
||||
implements View.OnClickListener,
|
||||
CompoundButton.OnCheckedChangeListener {
|
||||
|
||||
//滞留一个视图实例,可用如GUI,子控件实现!
|
||||
protected View guiView = null;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//重定向!
|
||||
IORedirector.setStdEO(Paths.PM3_FORWARD_O, IORedirector.STD_OUT);
|
||||
IORedirector.setStdEO(Paths.PM3_FORWARD_E, IORedirector.STD_ERR);
|
||||
IORedirector.setStdIN(Paths.COMMON_FORWARD_I);
|
||||
}
|
||||
}).start();
|
||||
|
||||
//父类先初初始化!
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
//默认关闭错误消息输出区域(用不上...)
|
||||
ckBoxOpenOutputError.setChecked(false);
|
||||
//覆盖父类的停止按钮点击实例
|
||||
btnStop.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.getId() == R.id.btnStop) {//判断当前是否有客户端可终止的任务在执行,是的话则终止!
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//TODO 此处进行IO,模拟键盘输入!
|
||||
stopPM3Client4KeyBorad();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
|
||||
//通过键盘输入结束任务!
|
||||
protected void stopPM3Client4KeyBorad() {
|
||||
FileUtils.writeString(new File(Paths.COMMON_FORWARD_I), "\n", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
//非常有必要进行相关的结束操作!
|
||||
stopPM3Client4KeyBorad();
|
||||
mCMD.stopExecute();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
/*
|
||||
* 重写视图实例寻找,方便进行控制!
|
||||
* */
|
||||
@Override
|
||||
public <T extends View> T findViewById(int id) {
|
||||
T view = super.findViewById(id);
|
||||
return view != null ? view : guiView != null ? guiView.findViewById(id) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
//don't need process!!!
|
||||
}
|
||||
|
||||
@Override
|
||||
protected View getCommandGUI() {
|
||||
return guiView;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected File initOutTarget() {
|
||||
return new File(Paths.PM3_FORWARD_O);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected File initErrTarget() {
|
||||
return new File(Paths.PM3_FORWARD_E);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int startTest(ICommandTools cmd) {
|
||||
mDefaultCMD = "help";
|
||||
if (edtInputCmd.getText().toString().length() > 0) {
|
||||
mDefaultCMD = edtInputCmd.getText().toString();
|
||||
}
|
||||
//此处做出多行执行优化!
|
||||
int ret = -2;
|
||||
//优化,如果是多行命令的操作!
|
||||
if (mDefaultCMD.contains("\n")) {
|
||||
//包含换行,则当作多行处理!
|
||||
String[] cmds = mDefaultCMD.split("\n");
|
||||
Log.d(LOG_TAG, "警告,当前执行的是多行处理操作!");
|
||||
for (String c : cmds) {
|
||||
Log.d(LOG_TAG, "当前执行的命令: " + c);
|
||||
mCMD.startExecute(c);
|
||||
}
|
||||
return ret;
|
||||
} else {
|
||||
//直接执行命令并且在执行命令完成后进行回调!
|
||||
ret = cmd.startExecute(mDefaultCMD);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewOutLine(String line) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewErrLine(String line) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ICommandType initType() {
|
||||
return new EntryICommandType();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onTestEnd() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isTesting() {
|
||||
return super.isTesting();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void stopTest() {
|
||||
//super.stopTest();
|
||||
//TODO 无必要停止PM3的底层线程!
|
||||
}
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package cn.rrg.rdv.activities.proxmark3.rdv4_rrg;
|
||||
|
||||
import cn.rrg.console.define.ICommandTools;
|
||||
import cn.rrg.natives.Proxmark3RRGRdv4Tools;
|
||||
|
||||
public class Proxmark3Rdv4RRGConsoleActivity
|
||||
extends Proxmark3ConsoleActivity {
|
||||
|
||||
@Override
|
||||
protected ICommandTools initCMD() {
|
||||
//替换为rdv4的工具类!
|
||||
return new Proxmark3RRGRdv4Tools();
|
||||
}
|
||||
}
|
||||
-207
@@ -1,207 +0,0 @@
|
||||
package cn.rrg.rdv.activities.proxmark3.rdv4_rrg;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.GridView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import cn.rrg.freo.IORedirector;
|
||||
import cn.rrg.rdv.R;
|
||||
import cn.rrg.rdv.adapter.EasyBtnAdapter;
|
||||
import cn.rrg.rdv.javabean.EasyCMDEntry;
|
||||
import cn.rrg.rdv.util.EasyBtnUtil;
|
||||
import cn.dxl.common.widget.DoubleInputDialog;
|
||||
import cn.dxl.common.util.ArrayUtils;
|
||||
import cn.dxl.common.widget.ToastUtil;
|
||||
import cn.dxl.common.util.ViewUtil;
|
||||
import cn.rrg.rdv.util.Paths;
|
||||
|
||||
public class Proxmark3Rdv4RRGRedTeamConsoleActivity
|
||||
extends Proxmark3Rdv4RRGConsoleActivity {
|
||||
|
||||
private GridView gridViewShowEasyButton;
|
||||
private EasyBtnAdapter adapter;
|
||||
private List<EasyCMDEntry> easyCMDEntries = new ArrayList<>();
|
||||
|
||||
//构造一个简单的对话框,用于提示需要的操作!
|
||||
private AlertDialog operaDialog;
|
||||
//显示添加按钮!
|
||||
private TextView txtAddEasyBtn;
|
||||
//缓存当前要操作的项目!
|
||||
private int operaPosition;
|
||||
//配置文件操作工具
|
||||
private EasyBtnUtil easyBtnUtil = new EasyBtnUtil();
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
btnGui.setText(getString(R.string.console_dynamic_btn));
|
||||
//隐藏不需要的区域!
|
||||
skBarConsoleViewScale.setProgress(10);
|
||||
//设置pm3的输入提示
|
||||
edtInputCmd.setHint(getString(R.string.pm3_hint));
|
||||
|
||||
//不能让用户关闭通讯!
|
||||
btnStop.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
stopPM3Client4KeyBorad();
|
||||
}
|
||||
});
|
||||
|
||||
initViews();
|
||||
initActions();
|
||||
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// 更改工作目录!
|
||||
IORedirector.chdir(Paths.PM3_DIRECTORY);
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
//先初始化视图!
|
||||
guiView = ViewUtil.inflate(this, R.layout.easy_button_container);
|
||||
|
||||
gridViewShowEasyButton = findViewById(R.id.gridViewShowEasyButton);
|
||||
adapter = new EasyBtnAdapter(this, R.layout.item_easy__btn, easyCMDEntries);
|
||||
gridViewShowEasyButton.setAdapter(adapter);
|
||||
|
||||
//添加数据!
|
||||
EasyCMDEntry[] buttons = getCMDs();
|
||||
if (buttons != null) {
|
||||
easyCMDEntries.addAll(Arrays.asList(getCMDs()));
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
txtAddEasyBtn = findViewById(R.id.txtAddEasyBtn);
|
||||
}
|
||||
|
||||
private void initActions() {
|
||||
//列表项单击时执行相应的命令!
|
||||
gridViewShowEasyButton.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
//点击了对应项时,取出对应的实体,进行命令发送!
|
||||
EasyCMDEntry entry = easyCMDEntries.get(position);
|
||||
if (entry != null) {
|
||||
String cmd = entry.getCommand();
|
||||
if (cmd != null) {
|
||||
//先提交命令到输入框
|
||||
putCMDAndClosePop(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
//列表项长按时显示相关的操作项!
|
||||
gridViewShowEasyButton.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
|
||||
@Override
|
||||
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
operaDialog.show();
|
||||
operaPosition = position;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
//构建一个用于显示操作的对话框!
|
||||
operaDialog = new AlertDialog.Builder(this).setItems(new String[]{getString(R.string.delete), getString(R.string.modify)}, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
final EasyCMDEntry entry = easyCMDEntries.get(operaPosition);
|
||||
if (which == 0) {
|
||||
new AlertDialog.Builder(context).setTitle(R.string.warning).setMessage(getString(R.string.enter_delete)
|
||||
+ "\n\nItem name: " + entry.getCmdName())
|
||||
.setPositiveButton(getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
//做出删除操作!
|
||||
easyCMDEntries.remove(operaPosition);
|
||||
adapter.notifyDataSetChanged();
|
||||
//TODO 本地配置删除!
|
||||
if (easyBtnUtil.deleteButton(0, operaPosition)) {
|
||||
ToastUtil.show(context, getString(R.string.success), false);
|
||||
} else {
|
||||
ToastUtil.show(context, getString(R.string.failed), false);
|
||||
}
|
||||
}
|
||||
}).setNegativeButton(getString(R.string.no), null).show();
|
||||
} else {
|
||||
//做出修改操作,先取出原来的数据!
|
||||
DoubleInputDialog inputDialog = new DoubleInputDialog(context);
|
||||
inputDialog.setTitle(R.string.button_edit);
|
||||
inputDialog.getHint1().setText(R.string.title_input);
|
||||
inputDialog.getHint2().setText(R.string.command_input);
|
||||
//设置到视图上!
|
||||
inputDialog.getEdtInput1().setText(entry.getCmdName());
|
||||
inputDialog.getEdtInput2().setText(entry.getCommand());
|
||||
//然后设置操作回调并且显示!
|
||||
inputDialog.setSaveListener(new DoubleInputDialog.OnSaveListener() {
|
||||
@Override
|
||||
public void onSave(String[] content) {
|
||||
//操作成功,进行内存更新!
|
||||
entry.setCmdName(content[0]);
|
||||
entry.setCommand(content[1]);
|
||||
adapter.notifyDataSetChanged();
|
||||
//TODO 然后进行本地更新!
|
||||
if (easyBtnUtil.updateButton(0, operaPosition, entry.getCmdName(), entry.getCommand())) {
|
||||
//现在的话已经更新成功
|
||||
ToastUtil.show(context, getString(R.string.success), false);
|
||||
} else {
|
||||
ToastUtil.show(context, getString(R.string.failed), false);
|
||||
}
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
}
|
||||
}).create();
|
||||
//设置添加按钮的动作!
|
||||
txtAddEasyBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//做出增加操作,构建一个实体用于保存!
|
||||
EasyCMDEntry entry = new EasyCMDEntry();
|
||||
DoubleInputDialog inputDialog = new DoubleInputDialog(context);
|
||||
inputDialog.setTitle(R.string.btn_add);
|
||||
inputDialog.getHint1().setText(R.string.title_input);
|
||||
inputDialog.getHint2().setText(R.string.command_input);
|
||||
//然后设置操作回调并且显示!
|
||||
inputDialog.setSaveListener(new DoubleInputDialog.OnSaveListener() {
|
||||
@Override
|
||||
public void onSave(String[] content) {
|
||||
//操作成功,进行内存更新!
|
||||
entry.setCmdName(content[0]);
|
||||
entry.setCommand(content[1]);
|
||||
easyCMDEntries.add(entry);
|
||||
adapter.notifyDataSetChanged();
|
||||
//TODO 然后进行本地更新!
|
||||
if (easyBtnUtil.inertButton(0, entry.getCmdName(), entry.getCommand())) {
|
||||
//现在的话已经更新成功
|
||||
ToastUtil.show(context, getString(R.string.success), false);
|
||||
} else {
|
||||
ToastUtil.show(context, getString(R.string.failed), false);
|
||||
}
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private EasyCMDEntry[] getCMDs() {
|
||||
//默认先拿0组的按钮,以后做多组分页的时候再做其他组的处理!
|
||||
List<EasyCMDEntry> btns = easyBtnUtil.getButtons(0);
|
||||
if (btns == null) return null;
|
||||
return ArrayUtils.list2Arr(btns);
|
||||
}
|
||||
}
|
||||
@@ -4,16 +4,6 @@ package cn.rrg.rdv.application;
|
||||
* @author DXL
|
||||
*/
|
||||
public class Properties {
|
||||
/*
|
||||
* 程序参数缓存...
|
||||
* 类型_模块_作用
|
||||
* */
|
||||
public static String k_pm3_delayTime = "pm3DelayTime";
|
||||
public static int v_pm3_delayTime = 50;
|
||||
|
||||
public static String k_view_main_page_column_count = "mainPageColumnCount";
|
||||
public static int v_view_main_page_column_count = 4;
|
||||
|
||||
//变色龙的卡槽是否使用别名!
|
||||
public static String k_chameleon_aliases_status = "chameleonSlotAliasesStatus";
|
||||
public static boolean v_chameleon_aliases_status = false;
|
||||
@@ -23,8 +13,6 @@ public class Properties {
|
||||
|
||||
//语言切换设置!
|
||||
public static String k_app_language = "language";
|
||||
|
||||
//读写卡历史选择的秘钥!
|
||||
public static String k_common_rw_keyfile_selected = "commomRWKeyFilesSelected";
|
||||
public static String[] v_common_rw_keyfile_selected = null;
|
||||
//Key files select history!
|
||||
public static String k_common_rw_keyfile_selected = "commonRWKeyFilesSelected";
|
||||
}
|
||||
|
||||
@@ -15,26 +15,24 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.termux.app.TermuxActivity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import cn.dxl.common.util.AppUtil;
|
||||
import cn.dxl.mifare.StdMifareImpl;
|
||||
import cn.rrg.devices.PN53X;
|
||||
import cn.rrg.rdv.R;
|
||||
import cn.rrg.rdv.activities.chameleon.ChameleonGUIActivity;
|
||||
import cn.rrg.rdv.activities.connect.Acr122uHkUsbConnectActivity;
|
||||
import cn.rrg.rdv.activities.connect.ChameleonUsb2UartConnectActivity;
|
||||
import cn.rrg.rdv.activities.connect.PN532UartConnectActivity;
|
||||
import cn.rrg.rdv.activities.connect.PN53XUsbBulkTransferActivity;
|
||||
import cn.rrg.rdv.activities.connect.Proxmark3Rdv4RRGConnectActivity;
|
||||
import cn.rrg.rdv.activities.main.GeneralNfcDeviceMain;
|
||||
import cn.rrg.rdv.activities.main.PN53XNfcMain;
|
||||
import cn.rrg.rdv.activities.main.Proxmark3Rdv4RRGMain;
|
||||
import cn.rrg.rdv.binder.BannerImageViewBinder;
|
||||
import cn.rrg.rdv.binder.DeviceInfoViewBinder;
|
||||
import cn.rrg.rdv.binder.TitleTextViewBinder;
|
||||
@@ -45,9 +43,7 @@ import me.drakeet.multitype.Items;
|
||||
import me.drakeet.multitype.MultiTypeAdapter;
|
||||
|
||||
/**
|
||||
* 界面重构在2019/7/29启动!
|
||||
* 此次重构主要是将设备的可用列表迁移到主页面进行全览
|
||||
* 此页面应当只需要跳转到对应的设备的设备连接界面,不应当做过多的逻辑!
|
||||
* UI redesign starts on July 29, 2019!
|
||||
*
|
||||
* @author DXL
|
||||
*/
|
||||
@@ -175,17 +171,19 @@ public class AppMainDevicesFragment extends BaseFragment {
|
||||
}
|
||||
}
|
||||
});
|
||||
deviceItems.add(new DeviceInfoBean("Proxmark3 Rdv4.0", R.drawable.rdv4) {
|
||||
deviceItems.add(new DeviceInfoBean("Proxmark3 Rdv4.0 for Termux", R.drawable.rdv4) {
|
||||
@Override
|
||||
public void onClick() {
|
||||
deviceInfoBean = this;
|
||||
connectOrGotoFunctionMain(
|
||||
Proxmark3Rdv4RRGConnectActivity.class,
|
||||
Proxmark3Rdv4RRGMain.class
|
||||
TermuxActivity.class
|
||||
);
|
||||
}
|
||||
});
|
||||
deviceItems.add(new DeviceInfoBean("ChameleonMini RevE", R.drawable.chameleon_rdv2) {
|
||||
// TODO
|
||||
// The Chameleon have some problem, So we temporarily close the entrance.
|
||||
/*deviceItems.add(new DeviceInfoBean("ChameleonMini RevE", R.drawable.chameleon_rdv2) {
|
||||
@Override
|
||||
public void onClick() {
|
||||
deviceInfoBean = this;
|
||||
@@ -194,7 +192,7 @@ public class AppMainDevicesFragment extends BaseFragment {
|
||||
ChameleonGUIActivity.class
|
||||
);
|
||||
}
|
||||
});
|
||||
});*/
|
||||
deviceItems.add(new DeviceInfoBean(PN53X.NAME.PN532, R.drawable.pn532core) {
|
||||
@Override
|
||||
public void onClick() {
|
||||
@@ -226,7 +224,6 @@ public class AppMainDevicesFragment extends BaseFragment {
|
||||
}
|
||||
|
||||
private void updateDeviceStatus(boolean status) {
|
||||
Log.d("TAG", "新状态:" + status);
|
||||
// update device status to bean!
|
||||
if (status) {
|
||||
if (deviceInfoBean != null) {
|
||||
@@ -265,7 +262,6 @@ public class AppMainDevicesFragment extends BaseFragment {
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
//如果是横屏动作,那我们就没必要全部销毁。
|
||||
if (isBackPressed) {
|
||||
AppUtil.getInstance().finishAll();
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ import cn.rrg.rdv.presenter.AbsTagKeysCheckPresenter;
|
||||
import cn.rrg.rdv.presenter.AbsTagReadPresenter;
|
||||
import cn.rrg.rdv.presenter.AbsTagStatePresenter;
|
||||
import cn.rrg.rdv.presenter.AbsTagWritePresenter;
|
||||
import cn.rrg.rdv.util.Commons;
|
||||
import cn.rrg.rdv.util.DumpUtils;
|
||||
import cn.rrg.rdv.util.Paths;
|
||||
import cn.rrg.rdv.view.MfKeysCheckView;
|
||||
@@ -306,7 +307,7 @@ public abstract class AbsMfOperatesFragment
|
||||
for (File tmpFile : file) {
|
||||
keyFilesSelectedList.remove(tmpFile);
|
||||
// 从本地持久域中删除
|
||||
delSelected(tmpFile.getAbsolutePath());
|
||||
Commons.delKeyFileSelected(tmpFile.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -319,7 +320,7 @@ public abstract class AbsMfOperatesFragment
|
||||
if (!keyFilesSelectedList.contains(tmp)) {
|
||||
keyFilesSelectedList.add(tmp);
|
||||
// 添加到本地持久域!
|
||||
addSelected(tmp.getAbsolutePath());
|
||||
Commons.addKeyFileSelect(tmp.getAbsolutePath());
|
||||
Log.d(LOG_TAG, "添加了秘钥文件: " + tmp.getName());
|
||||
}
|
||||
}
|
||||
@@ -362,44 +363,30 @@ public abstract class AbsMfOperatesFragment
|
||||
}
|
||||
|
||||
private void initSelected() {
|
||||
if (Properties.v_common_rw_keyfile_selected != null) {
|
||||
for (String v : Properties.v_common_rw_keyfile_selected) {
|
||||
File f = new File(v);
|
||||
if (f.exists() && f.isFile()) {
|
||||
keyFilesSelectedList.add(new File(v));
|
||||
}
|
||||
}
|
||||
if (Properties.v_common_rw_keyfile_selected.length > 0) {
|
||||
updateKeyFileSelectedName();
|
||||
String[] ss = Commons.getKeyFilesSelected().toArray(new String[0]);
|
||||
for (String v : ss) {
|
||||
File f = new File(v);
|
||||
if (f.exists() && f.isFile()) {
|
||||
keyFilesSelectedList.add(new File(v));
|
||||
}
|
||||
}
|
||||
updateKeyFileSelectedName();
|
||||
}
|
||||
|
||||
private void updateKeyFileSelectedName() {
|
||||
txtShowKeyFileSelectedList.setText("");
|
||||
// 拼接显示!
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (int i = 0; i < keyFilesSelectedList.size(); i++) {
|
||||
if (i != keyFilesSelectedList.size() - 1) {
|
||||
Log.d(LOG_TAG, "添加了文件名: " + keyFilesSelectedList.get(i).getName());
|
||||
sb.append(keyFilesSelectedList.get(i).getName()).append("\n-\n");
|
||||
} else {
|
||||
sb.append(keyFilesSelectedList.get(i).getName());
|
||||
Log.d(LOG_TAG, "添加了文件名: " + keyFilesSelectedList.get(i).getName());
|
||||
if (keyFilesSelectedList.size() > 0) {
|
||||
// Show!
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (int i = 0; i < keyFilesSelectedList.size(); i++) {
|
||||
if (i != keyFilesSelectedList.size() - 1) {
|
||||
sb.append(keyFilesSelectedList.get(i).getName()).append("\n-\n");
|
||||
} else {
|
||||
sb.append(keyFilesSelectedList.get(i).getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
//Log.d(LOG_TAG, "本次设置的文件名: " + sb);
|
||||
txtShowKeyFileSelectedList.setText(sb);
|
||||
}
|
||||
|
||||
private void addSelected(String file) {
|
||||
File settingsFile = new File(Paths.SETTINGS_FILE);
|
||||
try {
|
||||
if (!DiskKVUtil.isKVExists(Properties.k_common_rw_keyfile_selected, file, settingsFile)) {
|
||||
DiskKVUtil.insertKV(Properties.k_common_rw_keyfile_selected, file, settingsFile);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
txtShowKeyFileSelectedList.setText(sb);
|
||||
} else {
|
||||
txtShowKeyFileSelectedList.setText("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,9 +5,10 @@ import android.bluetooth.BluetoothDevice;
|
||||
|
||||
import com.iobridges.com.DeviceChecker;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.proxgrind.com.DriverInterface;
|
||||
import cn.proxgrind.com.SppNonBlock;
|
||||
import cn.rrg.devices.Proxmark3RRGRdv4;
|
||||
|
||||
/*
|
||||
* PM3 RDV4 SPP连接实现!
|
||||
@@ -21,7 +22,16 @@ public class Proxmark3Rdv4SppModel extends AbstractSppDeviceModel {
|
||||
|
||||
@Override
|
||||
public DeviceChecker getDeviceInitImpl() {
|
||||
//此驱动对应的RDV4的客户端,因此需要返回的是RDV4的初始化测试实现!
|
||||
return new Proxmark3RRGRdv4(mDI);
|
||||
return new DeviceChecker(mDI) {
|
||||
@Override
|
||||
protected boolean checkDevice() throws IOException {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,21 @@ package cn.rrg.rdv.models;
|
||||
|
||||
import com.iobridges.com.DeviceChecker;
|
||||
|
||||
import cn.rrg.devices.Proxmark3RRGRdv4;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Proxmark3Rdv4UsbModel extends AbsUsb2UartModel {
|
||||
@Override
|
||||
public DeviceChecker getDeviceInitImpl() {
|
||||
return new Proxmark3RRGRdv4(mDI);
|
||||
return new DeviceChecker(mDI) {
|
||||
@Override
|
||||
protected boolean checkDevice() throws IOException {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
package cn.rrg.rdv.settings;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.dxl.common.util.DiskKVUtil;
|
||||
import cn.rrg.rdv.application.Properties;
|
||||
import cn.rrg.rdv.util.Paths;
|
||||
|
||||
public class CommonRWKeyFilesSelectedSettings implements BaseSetting {
|
||||
@Override
|
||||
public File getSettingsFile() {
|
||||
return new File(Paths.SETTINGS_FILE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onQuerySetting() {
|
||||
return Properties.k_common_rw_keyfile_selected;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNotFound(String key) {
|
||||
try {
|
||||
DiskKVUtil.insertKV(Properties.k_common_rw_keyfile_selected, "", getSettingsFile());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNormal(String[] value) {
|
||||
// 判断一下值是否有效!
|
||||
for (String v : value) {
|
||||
File file = new File(v);
|
||||
if (!file.exists()) {
|
||||
// 参数所指文件不存在,删除这个键值对!
|
||||
try {
|
||||
DiskKVUtil.deleteKV(Properties.k_common_rw_keyfile_selected, v, getSettingsFile());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Properties.v_common_rw_keyfile_selected = value;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package cn.rrg.rdv.settings;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.rrg.rdv.util.Paths;
|
||||
import cn.rrg.rdv.application.Properties;
|
||||
import cn.dxl.common.util.DiskKVUtil;
|
||||
|
||||
public class MainPageColumnCountSetting implements BaseSetting {
|
||||
@Override
|
||||
public File getSettingsFile() {
|
||||
return new File(Paths.SETTINGS_FILE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onQuerySetting() {
|
||||
return Properties.k_view_main_page_column_count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNotFound(String key) {
|
||||
//否则创建!
|
||||
try {
|
||||
DiskKVUtil.insertKV(Properties.k_view_main_page_column_count, "4", getSettingsFile());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNormal(String[] value) {
|
||||
Properties.v_view_main_page_column_count = DiskKVUtil.toInt(value[0], 4);
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package cn.rrg.rdv.settings;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.rrg.rdv.util.Paths;
|
||||
import cn.rrg.rdv.application.Properties;
|
||||
import cn.dxl.common.util.DiskKVUtil;
|
||||
|
||||
public class Proxmark3ConsleDelaySetting implements BaseSetting {
|
||||
@Override
|
||||
public File getSettingsFile() {
|
||||
return new File(Paths.SETTINGS_FILE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onQuerySetting() {
|
||||
return Properties.k_pm3_delayTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNotFound(String key) {
|
||||
//否则创建!
|
||||
try {
|
||||
DiskKVUtil.insertKV(key, "50", getSettingsFile());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNormal(String[] value) {
|
||||
Properties.v_pm3_delayTime = DiskKVUtil.toInt(value[0], 50);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,6 +12,7 @@ import android.widget.RadioGroup;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -198,4 +199,27 @@ public class Commons {
|
||||
FileUtils.createFile(file);
|
||||
return file;
|
||||
}
|
||||
|
||||
public static Set<String> getKeyFilesSelected() {
|
||||
return getPrivatePreferences()
|
||||
.getStringSet(Properties.k_common_rw_keyfile_selected, new HashSet<>());
|
||||
}
|
||||
|
||||
public static void addKeyFileSelect(String path) {
|
||||
Set<String> old = getKeyFilesSelected();
|
||||
old.add(path);
|
||||
getPrivatePreferences()
|
||||
.edit()
|
||||
.putStringSet(Properties.k_common_rw_keyfile_selected, old)
|
||||
.apply();
|
||||
}
|
||||
|
||||
public static void delKeyFileSelected(String path) {
|
||||
Set<String> old = getKeyFilesSelected();
|
||||
old.remove(path);
|
||||
getPrivatePreferences()
|
||||
.edit()
|
||||
.putStringSet(Properties.k_common_rw_keyfile_selected, old)
|
||||
.apply();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,6 @@ import java.io.IOException;
|
||||
import cn.rrg.rdv.settings.BaseSetting;
|
||||
import cn.rrg.rdv.settings.ChameleonSlotAliasesSetting;
|
||||
import cn.rrg.rdv.settings.ChameleonSlotAliasesStatusSetting;
|
||||
import cn.rrg.rdv.settings.CommonRWKeyFilesSelectedSettings;
|
||||
import cn.rrg.rdv.settings.MainPageColumnCountSetting;
|
||||
import cn.rrg.rdv.settings.Proxmark3ConsleDelaySetting;
|
||||
import cn.dxl.common.util.AssetsUtil;
|
||||
import cn.dxl.common.util.DiskKVUtil;
|
||||
|
||||
@@ -224,9 +221,6 @@ public class InitUtil {
|
||||
BaseSetting[] baseSettings = new BaseSetting[]{
|
||||
new ChameleonSlotAliasesSetting(),
|
||||
new ChameleonSlotAliasesStatusSetting(),
|
||||
new MainPageColumnCountSetting(),
|
||||
new Proxmark3ConsleDelaySetting(),
|
||||
new CommonRWKeyFilesSelectedSettings()
|
||||
};
|
||||
//迭代设置配置实现类,进行设置参数的初始化!
|
||||
for (BaseSetting setting : baseSettings) {
|
||||
|
||||
@@ -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,67 +0,0 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.2"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
arguments '-DANDROID_STL=c++_static'
|
||||
abiFilters "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
|
||||
}
|
||||
}
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
/*externalNativeBuild {
|
||||
cmake {
|
||||
version '3.10.2'
|
||||
path 'src/main/cpp/proxmark3/client/android/CMakeLists.txt'
|
||||
}
|
||||
}*/
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
/*android.libraryVariants.all { variant ->
|
||||
def rootPath = getRootDir();
|
||||
File targetPath = new File(rootPath.path + "/app_main/src/main/assets/pm3/resources");
|
||||
def sourcePath = "src/main/cpp/proxmark3/client/resources"
|
||||
// first we need delete history
|
||||
// delete targetPath
|
||||
if (!targetPath.exists()) targetPath.mkdirs()
|
||||
variant.mergeAssets.doLast {
|
||||
println "${targetPath}"
|
||||
copy {
|
||||
from "${sourcePath}"
|
||||
into "${targetPath}"
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation 'com.github.xianglin1998:nfctag:1.0'
|
||||
implementation 'com.github.xianglin1998:nfc_console:1.0'
|
||||
|
||||
implementation 'com.github.xianglin1998:ComBridge:1.0.7'
|
||||
// implementation project(path: ':iobridges')
|
||||
|
||||
implementation project(':communication')
|
||||
implementation project(path: ':utils')
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user