利用Termux-tasker实现嘀卡执行自定义命令
进入Tasker的应用权限配置界面
授予com.termux.permission.RUN_COMMAND权限
操作:Android Settings -> Apps -> Tasker -> Permissions -> Additional permissions -> Run commands in Termux environment.
编辑termux配置文件 ~/.termux/termux.properties
将 allow-external-apps 属性值设为 true
(allow-external-apps = true)
打开Tasker
1、Create a new Action in a Task,设置任务名称例如 "termux-frpc-enable"
2、In the resulting Select Action Category dialog, select Plugin.
3、In the resulting Action Plugin dialog, select Termux:Tasker.
4、Click the edit button to edit the configuration.
5、Run the task once the configuration is complete.
6、在命令行框填写 shell 文件的路径,如果在termux目录中,也可用 ~/ 开头的路径. 如 "~/bin/enable-frpc.sh"
7、创建事件,选择NFC,填入自定义的内容,如"termux-frpc-enable",并选择"termux-frpc-enable"任务.
写卡
1、准备一张没用的NFC卡
2、随便找个写卡工具app例如NFC Tools Pro,将"termux-frpc-enable"以文本内容形式写入卡
测试
拿出刚才写好的卡,手机感应之,如果弹出app选择,就选择tasker