利用Termux-tasker實現(xiàn)嘀卡執(zhí)行自定義命令
進入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、創(chuàng)建事件,選擇NFC,填入自定義的內容,如"termux-frpc-enable",并選擇"termux-frpc-enable"任務.
寫卡
? ? 1、準備一張沒用的NFC卡
? ? 2、隨便找個寫卡工具app例如NFC Tools Pro,將"termux-frpc-enable"以文本內容形式寫入卡
測試
? ? 拿出剛才寫好的卡,手機感應之,如果彈出app選擇,就選擇tasker