添加数据模型NfcTermuxCmd类的NFC卡写入和读取。

This commit is contained in:
2026-03-16 14:50:42 +08:00
parent 0d2394c842
commit 528935fab7
11 changed files with 537 additions and 407 deletions

View File

@@ -1,46 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="20dp">
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- 状态显示 -->
<TextView
android:id="@+id/tv_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="等待NFC卡片..."
android:textSize="16sp"
android:textColor="#FF666666"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<EditText
android:id="@+id/et_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="输入要写入的NFC文本"
android:minHeight="50dp"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="脚本名称 script:"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="写入NFC"
android:onClick="onWriteClick"/>
<EditText
android:id="@+id/et_script"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="如 auth.sh"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="读取结果"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="参数 args (逗号分隔):"/>
<TextView
android:id="@+id/tv_result"
android:layout_width="match_parent"
android:layout_height="120dp"
android:background="#f5f5f5"
android:gravity="center"/>
<EditText
android:id="@+id/et_args"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="user1,pass123"/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="工作目录 workDir:"/>
<EditText
android:id="@+id/et_workDir"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="/data/data/com.termux/files/home"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="后台执行 background (true/false):"/>
<EditText
android:id="@+id/et_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="结果目录 resultDir:"/>
<EditText
android:id="@+id/et_resultDir"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="/data/data/com.termux/files/log"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:onClick="onFillTestDataClick"
android:text="填入调试数据 (BuildWinBoLLProject.sh)"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:onClick="onWriteClick"
android:text="写入 NFC (NfcTermuxCmd JSON)"/>
<TextView
android:id="@+id/tv_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="状态"/>
<TextView
android:id="@+id/tv_result"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:scrollbars="vertical"
android:textSize="14sp"/>
</LinearLayout>
</ScrollView>