Yota
Very Senior Member
Windows/macOS/Linux all support curl, and curl is a powerful command line tool that can simulate almost all behaviors of the browser through get/post. So your desktop app will most likely achieve cross-platform compatibility.Lots and lots of valuable take away here. Thank you very much!!! Especially the SourceForge stuff and the idea on the backup to the USB.
You've given both valuable points and ideas to alternative solutions and I like that, it's really what the discussion was aiming to achieve. @RMerlin as well, you've just stayed on track the entire time and never did anything but just provide straight up information to the best of your knowledge. It's much appreciated.
Like I mentioned I had actually though about the browser emulation (login and upload) before posting about this really when starting the project, but because I had already worked so far down this path, hnd-write was the easier choice to include in this all-in-one type solution.
However discussing openly the restrains around hnd-writre and the hesitation on actually relying on it (which I completely understand, it is unknowable what ASUS may change, just because it works today and in the last 8 months doesn't mean it will work forever).
These other alternatives of triggering the systems natural update process once you dump the file in the right location feels like the natural next step, however requires a bit more digging, I won't lie, I didn't click these links the first time they were posted and I'm a big enough man to admit when I was wrong.
For the desktop app, I would probably work as you said on splitting it from the rest of the script I have now, and really focus on the browser emulation part, find a way to prompt for credentials, cache those somewhere locally and login and do the update, if I can do that on the desktop (where I have extra tools and knowledge) then naturally I can move over lots of the logic to Shell and have the router try the steps itself of logging into it's own UI and doing the update that way.
I'll probably be going down a rabbit hole for a while, like Merlin said some of this stuff is fairly complex and closed source, but the whole point was the challenge of finding a reliable way to accomplish this update/flashing step, however possible.
It's important to note however that Asuswrt's GUI has many protections against access by automated scripts, (even including browser header referrers) but don't worry curl can still simulate all this, you just need to spend some time understanding how to do it.
The browser console and curl's man page will be the most helpful places.
(In fact, this reminds me of a script I had planned to launch on the SNB forums a few years ago to automatically update the SNB forums signature after every router/add-on update, but after discussing it with Tim, it may cause DDOS to the forums, so this script has never been made public. that script will automatically log in to the SNB forums on the router, save the cookies, and use the post to update the signature.)