12 ms·
Alternatively, if you don't want to run the whole Electron app, the money is this line: sudo.exec("/System/Library/PrivateFrameworks/Apple80211.framework/Ver
by classichasclass 1y ago
Alternatively, if you don't want to run the whole Electron app, the money is this line:
sudo.exec("/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport en0 -z && ifconfig en0 ether `openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`",
- paxys 1y ago200 bytes for the business logic. 47MB for the UI & boilerplate around the business logic. I get that this may be the easiest way to develop and publish an application today, but it's sad that this is the direction we have taken in recent years.
- ryandrake 1y agoI so strongly wish more developers gave even a single shit about this. The current state of desktop app development is truly an embarrassment.
- malnourish 1y agoWho is embarrassed? What are the realized harms?
- PaulHoule 1y agoMicrosoft seems to have given up on guidance for how to write desktop apps, Windows 8 had that Metro thing that got rejected by the world. I guess you could use Win32, WinForms, WPF or something else. The incoherence is second only to the Linux world, I remember how developers were crazy about theming in Win32 in the ‘95 age so something like Back Orifice or the app for your scanner looks atrocious. WPF added really great support for theming but at the point everybody was burned out in theming so it hardly ever got used.
- chuckadams 1y agoMetro goes back to Windows XP Media Center, and frankly was one of the best UIs ever. Also used by the very underappreciated Zune (which was not helped by its drab hardware design or MS's PlayForSureWeMeanItThisTime DRM)
- PaulHoule 1y agoI had a $99 Windows tablet that I thought was a great value and totally easy to use, but, like every other tablet I've had, I mostly used it to browse the web. Zune was pretty good but the only program that deserves the name "It plays for sure" is VLC.
- LauraMedia 1y agoThere is a deeper problem in this: The DX for native applications is too annoying, undocumented or hard for most people. I tried to build some of my tools without Electron, it's always a battle of multiple documentations for multiple systems and creating a bespoke system or having to deal with UI documentations that are glorified API references without examples. The last few tools I built used PhotinoNET, which gave me an electron-esque framework but not bundling it's own chromium, instead using the browser already on the system. And even that required a complicated build script so I can just export a simple flatpak, exe and dmg...
- aeonik 1y agoModern app bloat in one analogy: Business logic size: ~20 bytes Total app size: ~47 MB = 47,000,000 bytes Bloat factor: 47,000,000 / 20 = 2,350,000 Let’s scale this up and say the business logic is 1 pound. Then the whole app would weigh: 1 lb × 2,350,000 = 2,350,000 pounds What weighs ~2.35 million pounds? - A fully loaded Boeing 747-8: ~987,000 lbs - Another fully loaded 747-8: ~987,000 lbs - A blue whale: ~330,000 lbs TOTAL: ~2,304,000 lbs The business logic is like shipping a 1 lb object (a book, a flash drive, whatever) by loading it into two fully loaded 747s and strapping a blue whale on top. Just to run 20 bytes of logic.
- WD-42 1y agoThis is a cool visualization, thanks.
- aquafox 1y agoOn a related note: Transporting a human in a car is (in relation to weight and size) like using a standard shopping cart to transport two 1L bottles of water. So the next time you walk through a pedestrian area, imagine everyone carrying a bag would use a shopping cart instead. That would be a huge traffic jam -- exactly like what you see on the road!
- WD-42 1y agoI've been pretty aware of this ever since I became a cyclist. I will ride down to the corner store to pick up a six pack and some chips, throw them in a backpack and ride back. It's easy. I see people driving their cars to do the same thing. All that weight and space for a 6 bottles of beer. There is massive waste all around us.
- lostlogin 1y agoThere is also the time component. Off peak and with a decent sized backpack (change of clothes, laptop, food etc) it takes me the same time to go 6km as it does to drive it. At peak it’s 1/4 to 1/3rd the time. Cars are slow around town.
- righthand 1y agoIt’s not the easiest way just the most evangelized. A Qt app even would be a few lines of code, but we’ve done a good job scaring people that learning other languages is bad because we can’t ship features fast enough with non-evangelized frameworks.
- anthk 1y agoEven TCL/TK would be smaller.
- righthand 1y agoEvery framework under the sun gives you a `main()` func to call your program code. But if all you’ve ever used is blogs telling you how to hack together an electron app, you’d probably assume electron was the gold standard for simplicity sake but in reality is the gold standard for Google’s sake (and whatever marketing company’s).
- PaulHoule 1y agoYuck! Funny though I wrote a program for making red-cyan anaglyph stereograms using TkInter/Python. Stereograms work best when you can put important objects at the plane of the paper/screen and this is done by sliding the left and right images relative to each other. Tk has no color management, unlike newer frameworks, which was good in this case because I asked for (255,0,0) and got (255,0,0). When I exported to JPEG and views on a web browser though I got something like (186, 16, 16) because on my wide gamut monitor the native primaries are more saturated than sRGB primaries so some white gets blended in to make them less saturated. Turns out in Windows, screenshots are in the color space of your monitor! It’s something you’d never notice unless you made stereograms because that little bit of green and blue goes to the wrong eye.
- mistercow 1y agoI keep thinking that this could be solved by just building Electron into the OS as a shared framework so we don't have to have a separate copy for every app, but the more I dig into it, the more I realize I'm just reinventing the web browser.
- mixmastamyk 1y agoTauri: https://tauri.app/ https://tauri.app/
- paxys 1y agoYou are describing PWAs, but they'll never have the same API access & permissions as a native app.
- mistercow 1y agoYeah, and I think it’s worth asking why there. Why do we not just have a standard for PWAs with privileged OS access? There are two obvious answers. The first is portability. And sure, but Electron provides an answer here, so why can’t we provide one with PWAs? We could even have OSes define this interface for different browsers to target in a standardized way. Yes, you need platform specific code, but that’s often the situation with Electron too. The other answer is security. But how is Electron / any other installed app any better? Because we require more explicit consent before installing a “real” app than for installing a PWA? OK so, just let’s just do that for PWAs too.
- thisislife2 1y agoThere is something called the "WebView" in all the major platforms. The idea is that it allows you to use the browser engine only for creating the UI. But people complain its not "enough" because it is not the same on all the platform (it is if you use it just for UI), restricts access to some browser APIs (ignoring the fact that the OS often offers the same, even and more APIs) and Javascript (a crappy language for creating software applications).
- lxgr 1y agoWow, they optimized the minimal Electron app down to 47 MB?
- runlaszlorun 1y agoSadly this was also my reaction.
- CommenterPerson 1y agoAre they doing something additional with the 47MB - 200 bytes? Like selling you to the brokers?
- WJW 1y agoNot even. It's just overhead.
- dbalatero 1y agoTo be fair, the author didn't make this to impress people with byte optimizations, they probably just wanted to publish an app quickly that is useful, and was familiar enough with Electron or JS to do so.
- thwarted 1y agoThose who don't learn /usr/bin are destined to reinvent it, poorly.
- tomrod 1y agoWhat does this mean? I've always understood /usr/bin to be the storage dump for system binaries. Do you see or use it another way?
- GTP 1y agoThey likely mean that you already have in there all what is needed to change your laptop WiFi card's MAC address, without needing an additional application.
- unixhero 1y agoYes but you need a space station OS (Unix) to enjoy the terseness of 47-200 bytes of business logic. ps: I love both space stations and Unix
- yjftsjthsd-h 1y agoI guess, but the OS is a fixed cost that you already have
- amlib 1y agoThe solution to this problem requires you to interact with the OS, so a solution that requires tools found in the OS itself isn't a bad one. Its so simple you can have a script triggered by a desktop shortcut and be done with it. That all said, a simple GUI API provided by the OS for simple programs like this would be nice, just to give the user better feedback on the process. Is it done? Is it doing anything? Did it run correctly? Etc.. Zenity on linux kinda does that but is not guaranteed to be installed...
- kjkjadksj 1y agoWhy do you need that in gui when you already have it in cli through pid?
- deleted 1y ago[deleted]
- kzrdude 1y agoAnd notice the other abstraction too. This is not 'an app to change MAC address' but an app to 'overcome WiFi time limits'.
- ncr100 1y agoCough, AI Training Models, Cough There's great power in abstraction. Disagree? Your point is that an operating system, and its shell, all running on a machine, and a collection of apps, are somehow smaller than a wrapper application. I'm curious the amount of bytes the entire stack, minus the chrome which is the complaint I believe, how many bytes that is. I would say probably a gig.
- PaulHoule 1y agoA few years back I did an eval of ways to make cross platform apps, specifically to escape Electron, and came to the conclusion that ‘they all suck’ except maybe JavaFX. Thing is, most x-platform frameworks still require a big download. Java and Python runtimes are in the same ballpark as Electron.
- runlaszlorun 1y agoAnd sadly my reaction to 47MB these days is "hey not bad" given that I see 6 or 700 MB apps not doing much .
- sli 1y agoIt just seems to me like far less work to just write a real binary that execs this static command than it does to setup a whole Electron project.
- virtualritz 1y agoAnd you could ask an LLM to whip up the Swift code or whatever to wrap this line into a Dock app etc., if you want that convenience.
- leshenka 1y agoApple’s Siri Shortcuts. No programming. No dependencies.
- cozzyd 1y agothe hilarious thing is it shells out for the random mac...
- tommoor 1y agoNice, added it as a bash alias. alias randommac='sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport en0 -z && sudo ifconfig en0 ether $(openssl rand -hex 6 | sed "s/../&:/g; s/:$//")'
- commandersaki 1y agoSo I tried this out on macOS 26 and the `airport` command is no longer there. There is a `airportd.sb` file, which appears to be some permissions based thing in s-expression/LISP. Weird. Edit: Spun up a macOS 15 VM and I got this: WARNING: The airport command line tool is deprecated and will be removed in a future release. For diagnosing Wi-Fi related issues, use the Wireless Diagnostics app or wdutil command line tool. I guess they weren't kidding.
- bc569a80a344f9c 1y agoLooking around briefly, you can replace it with this: `networksetup -setairportpower en0 on && [... set MAC ...] && networksetup -setairportpower en0 off` I think it's pretty safe to assume that modern Macs will always have en0 as the WiFi adapter, but if you wanted, you could use `networksetup -listnetworkserviceorder` to find the associated device.
- JonathonW 1y agoModern Macs do not always have en0 as the WiFi adapter (it's en1 on current iMacs and on the Mac Studio; en0 is the ethernet jack). But you're unlikely to be taking one of the machines that has built-in ethernet to the airport or coffeeshop.
- bc569a80a344f9c 1y agoDuh, also true on my Mac Mini. But yeah, “modern Mac laptops” probably makes the statement correct enough and still describes the entire set of targets.
- 1y ago
- 101008 1y agoWow. Don't you need to pay a Apple license as well to distribute apps in Macs?
- tengwar2 1y agoNot for Mac. MacOS is an open garden: there is an app store; or you can install signed apps (requires Apple cooperation); or you can install unsigned applications. MacOS gives you a nudge to the app store (which has genuine advantages) and a much stronger nudge away from unsigned non-app-store apps, but it is still an open garden. iOS is closed garden, which makes some sense for the security guarantees it can give for financial applications.
- preciousoo 1y agoIs this possible on mobile (read iPhone) devices without root?
- scarface_74 1y agoSettings -> WiFi -> choose your WiFi network -> private WiFi address -> set to “rotating” It will change every time you disconnect/connect
- preciousoo 1y agoThanks!
- MattSayar 1y agoThe best part is right after the money line: 'Please check ' + issues_url + ' for help.' where issues_url is a github.com link. How are you going to check GitHub if you can't connect to WiFi in the first place?
- greyface- 1y agoThis will generate a multicast MAC 50% of the time, which will usually work, but can theoretically cause problems if there's a multicast-aware Ethernet bridge in your path. Ideally, the LSB of the first octet should be fixed to 0 to indicate a unicast address. https://en.wikipedia.org/wiki/MAC_address#Unicast_vs._multicast_(I/G_bit) https://en.wikipedia.org/wiki/MAC_address#Unicast_vs._multic...
- nine_k 1y agoFine, Electron is a complete overkill for that. What would you use instead to build a macOS GUI program with comparable ease? SwiftUI? Python + Tk (using the ancient system Python)? Something like Red?
- rafram 1y agoWhy does a Mac-only app that shows a menu bar icon and a notification popup need to be Electron…? That’s 30 lines of Swift, max.
- outofpaper 1y agoPeople forget to think about Swift let alone tools like Platypus.
- encom 1y agoBecause that's all anyone knows, and PC development is dead. >content-length: 47262814 Sigh...
- SR2Z 1y agoIf you want a frontend for you app, you probably just use Electron and get it over with in a few minutes instead of digging through the docs for Qt or some other framework. Is it worth it? Probably not, since this is a single-platform app to start with, but JS+HTML are easy to theme and customize, and Qt is... not quite as simple.
- manbitesdog 1y agoNow that you can build such an app with AI in under 20 minutes with a manageable codebase you can properly understand and control, I don't think that's a good excuse anymore
- Alifatisk 1y agoI feel like using Electron for such a little thing is way overkill. The newer laptops are very powerful so I don't think anyone would have any performance issues, but on older macbooks, having too many little Electron apps running in the background makes the fan go brrrrrrrr
- hk1337 1y agoWhat exactly is that doing? Is there some backend limitation for WiFi interfaces that making it think it’s Ethernet is faster?
- sodality2 1y agoIt just resets the MAC address, making the router believe it's a new device, thus not subject to the "x minute" free WiFi.
- dizhn 1y agoThat won't circumvent the sms code requirement most free wifi services use.
- deleted 1y ago[deleted]
- catlifeonmars 1y agoI have never seen this before
- dizhn 1y agoThere's at least one country with laws that say you have to keep track of national ID numbers (and times) if you want to provide wifi service.
- popularonion 1y agoNever seen it in the US, but it was fairly common when I was on vacation in Europe
- lavezzi 1y agoMaybe you haven't flown recently then, even T-Mobile has introduced message based verification for trying to use their free in-flight WiFi now.