Compare commits

..

No commits in common. "f86fa0d6a7713a090d238df79c2b6146ddda0bbd" and "d7ff69da3c734e1bbc6904bc3eae5ca215255a1c" have entirely different histories.

2 changed files with 3 additions and 11 deletions

View File

@ -14,10 +14,4 @@ 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.
Once installed, just run the sms.py script with the python interpretator and connect a browser to phone, on port 8080.

6
sms.py
View File

@ -8,7 +8,7 @@ from socket import AF_INET6
from threading import Thread
from time import sleep
from cgi import FieldStorage
from os import kill, getpid
from sys import exit
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,6 +357,4 @@ if __name__ == '__main__':
except KeyboardInterrupt:
print ('Interrupt received, closing process…')
server.server_close ()
# 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)
exit (0)