Compare commits
2 Commits
d7ff69da3c
...
f86fa0d6a7
Author | SHA1 | Date |
---|---|---|
Sasha MOREL | f86fa0d6a7 | |
Sasha MOREL | 867c6daca5 |
|
@ -15,3 +15,9 @@ These libraries are under GNU GPL v3. See [license](LICENSE) for more details.
|
|||
This program requires Python interpretator and access to Android API. Access to Android API is provided by the API addon and the termux-api package.
|
||||
|
||||
Once installed, just run the sms.py script with the python interpretator and connect a browser to phone, on port 8080.
|
||||
|
||||
# Note on security
|
||||
|
||||
This webserver listen on HTTP, so the traffic between phone and browser is in plain text.
|
||||
|
||||
The webserver will only serve the first IP (v4 ou v6) that connect to it, all the other will recieve a 403 error. The server log will show that the server locks on a specific IP when the first client will connect.
|
6
sms.py
6
sms.py
|
@ -8,7 +8,7 @@ from socket import AF_INET6
|
|||
from threading import Thread
|
||||
from time import sleep
|
||||
from cgi import FieldStorage
|
||||
from sys import exit
|
||||
from os import kill, getpid
|
||||
|
||||
sms_list_program = '/data/data/com.termux/files/usr/bin/termux-sms-list'
|
||||
sms_send_program = '/data/data/com.termux/files/usr/bin/termux-sms-send'
|
||||
|
@ -357,4 +357,6 @@ if __name__ == '__main__':
|
|||
except KeyboardInterrupt:
|
||||
print ('Interrupt received, closing process…')
|
||||
server.server_close ()
|
||||
exit (0)
|
||||
# BUG: the program must kill itself to end or the user must send Ctrl+C several time to close
|
||||
# TODO: find another way to close the program in one action, suicide is never the solution
|
||||
kill (getpid (), 15)
|
Loading…
Reference in New Issue