利用Termux-tasker實(shí)現(xiàn)嘀卡執(zhí)行自定義命令
進(jìn)入Tasker的應(yīng)用權(quán)限配置界面
? ? 授予com.termux.permission.RUN_COMMAND權(quán)限
? ? 操作:Android Settings -> Apps -> Tasker -> Permissions -> Additional permissions -> Run commands in Termux environment.
編輯termux配置文件 ~/.termux/termux.properties
? ? 將 allow-external-apps 屬性值設(shè)為 true?
? ? (allow-external-apps = true)
打開(kāi)Tasker
? ? 1、Create a new Action in a Task,設(shè)置任務(wù)名稱例如 "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目錄中,也可用 ~/ 開(kāi)頭的路徑. 如 "~/bin/enable-frpc.sh"
? ? 7、創(chuàng)建事件,選擇NFC,填入自定義的內(nèi)容,如"termux-frpc-enable",并選擇"termux-frpc-enable"任務(wù).
寫卡
? ? 1、準(zhǔn)備一張沒(méi)用的NFC卡
? ? 2、隨便找個(gè)寫卡工具app例如NFC Tools Pro,將"termux-frpc-enable"以文本內(nèi)容形式寫入卡
測(cè)試
? ? 拿出剛才寫好的卡,手機(jī)感應(yīng)之,如果彈出app選擇,就選擇tasker