Hello everyone!
Since there is Minetest for Android, it's possible to run a server on a smartphone (I've done it). I wonder, whether game or mods installed on such a server can send or read SMS (whether if it's theoretically possible to write such a mod). For example, users can receive SMS notification for some events, and can reset their password via SMS.
(just wondering)
If Minetest server runs on a smartphone, can it send or read SMS?
-
- Member
- Posts: 53
- Joined: Sun May 03, 2020 05:38
- GitHub: ChrysoliteAzalea
Re: If Minetest server runs on a smartphone, can it send or read SMS?
Try luajit's FFI. Maybe there are some native calls you can make that allow you to request access to the baseband and use it, I don't know much about Android though. Maybe it'll let you do this, maybe it won't.
An alternative, if you want cell functionality but don't specifically need to use Android, is to use a computer with a USB modem that contains a phone baseband, like a 3G or 4G sim card dongle.
The PC drivers for those modems work by opening a virtual serial port to it and sending AT and AT+ commands. Those commands vary by modem but they're usually documented. If you can't figure out the exact way to control the modem, you can try sniffing the traffic on this serial port to see exactly how their crappy app does it.
I once managed to control my modem in this way by breaking into my router which already had all the software needed to talk to dongle modems. After figuring out the utils and the necessary AT codes, I was actually able to receive SMS into a telnet shell. (no ssh on crappy routers) Sending texts should be no harder than reading them.
Once you have some way to talk to the baseband, it just becomes a matter of wrapping the commands in some scripts and executing that from your server's VM, be it via FFI calls or an os.execute process, or even a shell to a different machine.
An alternative, if you want cell functionality but don't specifically need to use Android, is to use a computer with a USB modem that contains a phone baseband, like a 3G or 4G sim card dongle.
The PC drivers for those modems work by opening a virtual serial port to it and sending AT and AT+ commands. Those commands vary by modem but they're usually documented. If you can't figure out the exact way to control the modem, you can try sniffing the traffic on this serial port to see exactly how their crappy app does it.
I once managed to control my modem in this way by breaking into my router which already had all the software needed to talk to dongle modems. After figuring out the utils and the necessary AT codes, I was actually able to receive SMS into a telnet shell. (no ssh on crappy routers) Sending texts should be no harder than reading them.
Once you have some way to talk to the baseband, it just becomes a matter of wrapping the commands in some scripts and executing that from your server's VM, be it via FFI calls or an os.execute process, or even a shell to a different machine.
Re: If Minetest server runs on a smartphone, can it send or read SMS?
Oh but before you run and do this on a public facing server, you might want to really harden your MT->baseband interface so that even when some punk finds a hole in the MT engine, he won't be able to use your phone number for bad things.
- rubenwardy
- Moderator
- Posts: 6425
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: United Kingdom
- Contact:
Re: If Minetest server runs on a smartphone, can it send or read SMS?
You would need to modify the minetest client to give it permission to send SMS. Android doesn't make a very good server host, and not everyone has or wants to give their phone number to a random server - especially one that lags as much as an Android one would
You could run the server on another machine, and then use an app on your phone to check for pending messages and send them. Or you could use sofars 2fa mod to have email verification
You could run the server on another machine, and then use an app on your phone to check for pending messages and send them. Or you could use sofars 2fa mod to have email verification
Core Developer | Donate | Join the Matrix chat! | My Twitter | Mods | Minetest Modding Book
Hello profile reader
Hello profile reader
Who is online
Users browsing this forum: No registered users and 7 guests