(no title)
c6401 | 1 year ago
../bin/ok:
#!/usr/bin/env xonsh
"""
$> ok android shell
$> ok android ssh
$> ok android sshd
$> ok android sms
"""
import fire as _fire
class android:
ip = '...;
def shell(self):
adb connect f'{self.ip}:5555'
adb shell
def sshd(self):
adb connect f'{self.ip}:5555'
adb shell input keyevent 26
adb shell input swipe 500 800 500 300 200
sleep 1
adb shell am start -n com.termux/.app.TermuxActivity
adb shell input text "sshd"
adb shell input keyevent 66
adb shell input text "exit"
adb shell input keyevent 66
def ssh(self):
ssh -p 8022 f'user@{self.ip}'
def sms(self):
result = $(ssh -p 8022 f'user@{self.ip}' termux-sms-list -l 20 | jq ".[].body")
print(result)
def long_echo(): print(result)
@(long_echo) | llm -m llama3 -s 'please translate messages to English, quote the original messages too'
if __name__ == '__main__':
_fire.Fire()
No comments yet.