Readit News logoReadit News
classichasclass · 2 months 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 · 2 months ago
200 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.

aeonik · 2 months ago
Modern 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.

dbalatero · 2 months ago
To 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.
righthand · 2 months ago
It’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.
ryandrake · 2 months ago
I so strongly wish more developers gave even a single shit about this. The current state of desktop app development is truly an embarrassment.
mistercow · 2 months ago
I 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.
lxgr · 2 months ago
Wow, they optimized the minimal Electron app down to 47 MB?
kzrdude · 2 months ago
And notice the other abstraction too.

This is not 'an app to change MAC address' but an app to 'overcome WiFi time limits'.

PaulHoule · 2 months ago
A 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.

thwarted · 2 months ago
Those who don't learn /usr/bin are destined to reinvent it, poorly.

Deleted Comment

ncr100 · 2 months ago
Cough, 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.

unixhero · 2 months ago
Yes 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

sli · 2 months ago
It 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.
runlaszlorun · 2 months ago
And sadly my reaction to 47MB these days is "hey not bad" given that I see 6 or 700 MB apps not doing much .
CommenterPerson · 2 months ago
Are they doing something additional with the 47MB - 200 bytes? Like selling you to the brokers?
rafram · 2 months ago
Why 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.
ajsnigrutin · 2 months ago
1) the dev only had a hammer and he nailed the screw in

2) the dev has 64gigs of ram and a newest CPU and doesn't care about performance issues for people on older computers... that's why you need gigs of ram just to read a weather report online.

jeroenhd · 2 months ago
If you don't know Swift, but do know Electron, it's easier to do it in 30 lines of Javascript.

People who don't like the developers work can always write and publish their own application, of course.

k4rli · 2 months ago
Looks like ai-generated bloat. It even has deps for deb+rpm builds yet is mac only.

Honestly would not expect anything more from js devs who use macs/windows. I see this so often.

encom · 2 months ago
Because that's all anyone knows, and PC development is dead.

>content-length: 47262814

Sigh...

SR2Z · 2 months ago
If 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.

outofpaper · 2 months ago
People forget to think about Swift let alone tools like Platypus.
thisislife2 · 2 months ago
It doesn't need to be - on macOS, it could even just as well have been a simple Xbar Plug-In! ( https://xbarapp.com/ ).
palata · 2 months ago
Electron is an overkill way to not have to learn how to do stuff properly, if you ask me. And people love not to learn.
gopher_space · 2 months ago
Is ActionScript still a thing on Macs? I feel like that tech was almost criminally overlooked while being the backbone for a lot of processing pipelines back in the day.

Dead Comment

greyface- · 2 months ago
This 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._multic...

tommoor · 2 months ago
Nice, 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 · 2 months ago
So 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.

Alifatisk · 2 months ago
I 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
virtualritz · 2 months ago
And 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 · 2 months ago
Apple’s Siri Shortcuts. No programming. No dependencies.
hk1337 · 2 months ago
What exactly is that doing? Is there some backend limitation for WiFi interfaces that making it think it’s Ethernet is faster?
sodality2 · 2 months ago
It just resets the MAC address, making the router believe it's a new device, thus not subject to the "x minute" free WiFi.
nine_k · 2 months ago
Fine, 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?

cozzyd · 2 months ago
the hilarious thing is it shells out for the random mac...
101008 · 2 months ago
Wow. Don't you need to pay a Apple license as well to distribute apps in Macs?
tengwar2 · 2 months ago
Not 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.
MattSayar · 2 months ago
The 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?
preciousoo · 2 months ago
Is this possible on mobile (read iPhone) devices without root?
scarface_74 · 2 months ago
Settings -> WiFi -> choose your WiFi network -> private WiFi address -> set to “rotating”

It will change every time you disconnect/connect

ammar2 · 2 months ago
Glad this feature is built into most modern operating systems these days.

For MacOS (Sequoia+) you can just forget the network and reconnect to get a new MAC address [1].

Android's documentation for if it decides to generate a new address per connection is a little vague [2], but I'm guessing forgetting and reconnecting works as well, you may also need to flip the "Wi-Fi non-persistent MAC randomization" bit in developer settings.

On Windows, flipping the "Random hardware address" switch seems to cause it to generate a new seed/address for me.

[1] https://support.apple.com/en-euro/102509

[2] https://source.android.com/docs/core/connect/wifi-mac-random...

lxgr · 2 months ago
Per [1], this only works once per 24 hours on new iOS/macOS versions, and only once per two weeks on older ones though.
km3r · 2 months ago
Yeah I had to flip the developer setting toggle, but worked flawlessly for my flight (American Airlines has a watch an ad for 20 minutes of free internet that only works once per MAC)
fendale · 2 months ago
Are you saying that on IOS 18 if you enable developer mode then each time you forgot the network it gets a new Mac? But without developer mode it does not get a new Mac each time you forget it? The Apple docs linked elsewhere in this thread suggest it only gets a new Mac once per 24 hours when you forget the network normally. I’m going on a long boat trip in the next week where this trick might work for me if so!
userbinator · 2 months ago
I have a generic Android phone from many years ago where the manufacturer didn't even bother to program the WiFi NVRAM, so every time you load and unload the driver, you get a new randomly generated MAC address. Interesting that that has become a feature these days.
bapak · 2 months ago
I think the rotating address is limited to 3, right? The script here generates one at random.
purplehat_ · 2 months ago
Here's an equivalent little script for Debian Linux (but should work on most distros), based on classhasclass's comment:

  NEW_MAC=$(printf '02:%02x:%02x:%02x:%02x:%02x\n' $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)))

  sudo ip link set wlan0 down

  sudo ip link set wlan0 address "$NEW_MAC"

  sudo ip link set wlan0 up
You should replace `wlan0` with whatever you see in `ip link show` for your wireless interface, for me it is `wlp0s20f3`. I replaced the `openssl rand` command because it was generating some invalid MACs; this is hopefully only valid ones.

righthand · 2 months ago
KDE Plasma has a “Random” button next to the MAC address field in the Network Manager UI. I’m on Debian Testing so not sure when it was added.
vachina · 2 months ago
I used to strap 20 virtual eths to my Linux box because my dorm gave only like 512kbps per account, and then aggregated the 20 interfaces.
xrisk · 2 months ago
How was the auth done? And for that matter what logic did the traffic shaping use?
vachina · 2 months ago
Auth is username/password over captive portal. You could pay for more bandwidth. The system was so pwned I ended up giving myself unlimited bandwidth.
o_____________o · 2 months ago
Alternatively for Mac,

https://github.com/halo/LinkLiar

visiondude · 2 months ago
^ seems like the way to go. open source and more features.
mannyv · 2 months ago
If you really want to screw with these set your MAC address to 00:00:00:00:00:00

It’s an illegal address, but most equipment will take it because test devices occasionally come from the factory with that MAC. But higher level stuff might barf on it because it’s technically illegal.

totetsu · 2 months ago
I tired this once and it bypassed the captive portal and time limits entirely
varenc · 2 months ago
alas, macOS refuses:

     $ sudo ifconfig en0 ether 00:00:00:00:00:01
    ifconfig: ioctl (SIOCAIFADDR): Can't assign requested address
edit: but this worked on my external NIC! Network wasn't happy though and DHCP didn't work. Ubiquiti had a funny note about this MAC: "Officially Xerox, but 0:0:0:0:0:0 is more common"

mannyv · 2 months ago
If you stash the IP/netmask/router IP you might be able to get it to work by setting a static IP on the connection with a 0 MAC address.

As always, ymmv.

On some equipment this may cause a broadcast storm, depending on how they implement things. Cisco equipment with some configs will send a packet to all the ports if it receives a packet and can't figure out where it's supposed to go.

kazinator · 2 months ago
This has been an option in Android network settings forever: randomize your MAC. I think it's enabled by default now? It's a basic privacy feature; you can be fingerprinted by your device's MAC.
jck · 2 months ago
Yep. Android does this by default, but each ssid gets a randomized MAC which persists. It is still straightforward to trigger a MAC change manually tho. It is useful for privacy but imo useless for the public wifi limits use case since they almost always require an OTP via SMS to log in.
rahimnathwani · 2 months ago

  For devices running Android 11 or higher, users can enable non-persistent MAC randomization globally for all Wi-Fi networks (that have MAC randomization enabled) through the developer options screen. The option to enable non-persistent MAC randomization for all profiles is found at Settings > Developer Options > Wi-Fi non-persistent MAC randomization.

matsemann · 2 months ago
Could you describe how? Quick searching doesn't show it to be "straightforward" as far as I can find.
tengwar2 · 2 months ago
OTP via SMS: depends on the country. These days it's not very common in the UK. They often ask for an email address, but my experience is that most of the time they don't check it for validity.
hhh · 2 months ago
you have both options in ios/macos, fixed random mac per ssid, and rotating
NoahZuniga · 2 months ago
No, this setting randomizes your MAC address between networks, but you keep the same MAC for a specific network. So if you want the network to think you're a new user, you'll need to change this specific network MAC address, and this isn't a setting enabled by default (and oftentimes is not even a setting)
khimaros · 2 months ago
GrapheneOS has per-connection (as an alternative to per-network) randomization which is enabled by default
netsharc · 2 months ago
It's also in the Apple devices, you just have to "forget network" and reconnect for the device to tell the network of its new fake MAC address.
alt227 · 2 months ago
How does that work with MAC address conflicts and clashes? I naively thought every MAC address had to be unique.
BobbyTables2 · 2 months ago
They must be unique in a LAN segment. And only the lower 3 bytes in a MAC are “unique” as the upper 3 are the vendor ID and relatively fixed.

In practice people put fewer than 256 devices on networks (class C), so they have less than 1/65536 possibility of complete failure. And far less because they have a mix of OUIs.

But yeah, if you put a few hundred or thousand security cameras or other device from a single vendor, all on the same network, conflicts are certainly possible.

MAC conflicts are also a bit nasty to troubleshoot, and less obvious than IP conflicts.

diggan · 2 months ago
There are like 50 trillion possible addresses, unlikely to clash in one network :)
josh_carterPDX · 2 months ago
This reminded me of an old app that would scan the MAC addresses of devices already connected to a paid WiFi network. You would then just change your MAC to one that already paid for the WiFi, and then reset it once you were done.
WJW · 2 months ago
Wouldn't that lead to interference with the original device using that MAC address? Ie both of you getting packets meant for the other etc?
rafram · 2 months ago
Yes. It’s a bad (maybe even illegal?) thing to do. The victim device will start losing packets, and it’ll look to them like the network is just unreliable. Eventually they give up and disconnect, and you take full control.
bongodongobob · 2 months ago
Yeah. I think any network with STP/anti-flapping enabled will shut that down pretty quickly though.
bibelo · 2 months ago
tried that in a hotel in Paris and it worked