1 Install F-Droid
2 Install from F-Droid
⚠️ Must use F-Droid versions, NOT Play Store!
3 Run in Termux
Paste this first:
pkg upgrade -y && pkg install -y python termux-api
When done, paste this:
cat > ~/s.py << 'E'
from http.server import HTTPServer,BaseHTTPRequestHandler
import subprocess,json
class H(BaseHTTPRequestHandler):
def do_GET(self):
if self.path=="/ping":
self.send_response(200);self.send_header('Content-type','application/json');self.end_headers()
self.wfile.write(json.dumps({"ok":1,"d":subprocess.getoutput('getprop ro.product.model')}).encode())
elif self.path=="/battery":
self.send_response(200);self.send_header('Content-type','application/json');self.end_headers()
self.wfile.write(subprocess.getoutput('termux-battery-status').encode())
else:self.send_response(404);self.end_headers()
def log_message(s,f,*a):pass
HTTPServer(('0.0.0.0',8080),H).serve_forever()
E
mkdir -p ~/.termux/boot && echo 'termux-wake-lock
python ~/s.py &' > ~/.termux/boot/start.sh && chmod +x ~/.termux/boot/start.sh && python ~/s.py &