1376
Simple trick (programming.dev)
you are viewing a single comment's thread
view the rest of the comments
[-] WarmSoda@lemm.ee 107 points 1 year ago

Let's pretend someone didn't know how to do that on an android. How would you explain it to them?

[-] pineapplelover@lemm.ee 126 points 1 year ago

On android when you go to the wifi settings you're currently connected to there should be a setting for randomizing mac address per connection or per network. If you change it to per connection, once you disconnect and reconnect your mac address should change. On per network, it will randomly generate the mac address for the first connection and keep that address for that wifi forever.

[-] WarmSoda@lemm.ee 26 points 1 year ago

Excellent explanation, thank you. Never knew what that difference was.

[-] AnarchistArtificer@slrpnk.net 4 points 1 year ago

Thanks for asking the question! I've never needed to know it, and I've done enough android tinkering that I'm fairly sure I could find it quite easily if needed, but I enjoy my social media being peppered with bits of learning wherever possible. I'm a big fan of ambient curiosity

[-] WarmSoda@lemm.ee 3 points 1 year ago

Same here. Thanks :)

[-] pineapplelover@lemm.ee 3 points 1 year ago

Yeah, recently I was on school wifi and it kept bothering me to log in and figured I needed to switch to per network or it would bother me everytime to sign into the captive portal.

[-] kspatlas@artemis.camp 4 points 1 year ago

I think per connection is a GrapheneOS thing unless I'm wrong

[-] SuperIce@lemmy.world 35 points 1 year ago

On stock (Pixel) Android, if you enable Developer Options, there is a setting under Networking called "Wi-Fi non-persistent MAC randomization" that randomizes the MAC per connection for networks that have randomization enabled.

[-] Meruten@lemmy.dbzer0.com 8 points 1 year ago

Samsung's OneUI does this by default for all connections .

[-] SteveTech@programming.dev 4 points 1 year ago

I don't have a Samsung, but I'm pretty sure that's still randomised per network, per connection can be enabled in the developer options somewhere.

[-] derock@lemmy.derock.dev 6 points 1 year ago

I have a Samsung and it's per network, even if you forget and rejoin it keeps the same random Mac address. You need to enable a developer setting to have it randomize when you join.

[-] Tibert@compuverse.uk 2 points 1 year ago

Per connexion would be pretty bad. Per network.

Let's say you want to set a static DHCP ip from your router. The only way to do so (from the router, I'm not talking from the phone), is by assigning an IP to a MAC address.

If the address is randomised per connection, affecting a static DHCP ip would be impossible.

Another thing a router often has is some sort of dhcp memory. It remembers the ip it gave to a certain MAC address for some time, then when the device connects back, it assigns the same IP it had before.

So if the ip changes each time either the MAC address changes each time (not sure it's default), or the router has no memory.

[-] example@reddthat.com 2 points 1 year ago

for a device without inbound connectors and no ip based lan firewall rules, which applies to most phones, random per connection macs seem like a pretty good default for privacy.

some networks doing "unusual" things like hotel wifi limiting you to few devices (implemented by mac counting) may be thrown off though.

[-] jasondj@ttrpg.network 1 points 1 year ago

I’ve run samba servers from my phones in the past (android, at least) which was nice for a “portable file server” when out and about.

[-] example@reddthat.com 2 points 1 year ago

I didn't say there were no use cases for this, but the average phone user will not need it. someone using samba on their phone would likely be capable of switching the network config to not randomize every time.

[-] Fosheze@lemmy.world 1 points 1 year ago* (last edited 1 year ago)

That's the point though. The address is randomized per connection specifically so the device can't be identified. It's to prevent tracking, blocking, or assigning, anything based on mac address without the device owners knowledge. Every time your phone connects the network has to treat it like a new device. If it was randomized per network that would defeat the point.

I personally can't think of any reason you would need a static IP on your phone but if you did then you should know enough to know how to turn off the randomized mac address. You can even change the setting per network so if you need a static ip at home then you just set your phone to use a static mac address on your home network and continue using a randomized one on every other network.

[-] steersman2484@sh.itjust.works 5 points 1 year ago

Graphene just changed it to be enabled by default

But maybe they hat this feature earlier than AOSP

Yeah, on Android 12 I can only choose between "randomized MAC" and "phone MAC". Doesn't specify if it's randomized per network or connection, but I'd guess it's per network.

[-] SuperIce@lemmy.world 9 points 1 year ago

By default it's per network, but if you enable Developer Options, there is a setting under Networking called "Wi-Fi non-persistent MAC randomization" that randomizes the MAC per connection for networks that have randomization enabled. I am on Android 13 though, so I'm not sure if 12 has this option.

Hey, cool! It's here on Android 12 also! I take it as the network has to support randomization though, so it won't work in all networks?

[-] Steeve@lemmy.ca 102 points 1 year ago

Just google it you dumb piece of shit - Stack overflow user

Marked as duplicate

[-] HellAwaits@lemm.ee 47 points 1 year ago

Thanks, I figured it out and got free food as a bonus!!!

Doesn't share solution

[-] Lightor@lemmy.world 25 points 1 year ago* (last edited 1 year ago)

No worries, it's outlined in detail, with pictures and a video here: (deadlink)

[-] Agent641@lemmy.world 20 points 1 year ago

This comment chain has injured my soul.

Or more recently...

The top comment:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Redacted with PowerDeleteSuite. F*ck Spez.

All the replies: "OMG, thank you so much, this was exactly what I needed! You just saved me hours of work!"

[-] bappity@lemmy.world 26 points 1 year ago

I know you wanted this solution but that solution is shit here's my one instead

[-] noli@programming.dev 29 points 1 year ago
[-] bappity@lemmy.world 29 points 1 year ago* (last edited 1 year ago)

WHAT WAS THE SOLUTION!!!!!!!!1!!1!!!!
9 years ago

[-] hitmyspot@aussie.zone 4 points 1 year ago

I'm sorry, your comment has not been posted. This thread is closed as it has been marked as [SOLVED]

[-] FooBarrington@lemmy.world 6 points 1 year ago

Most Android phones have an option to randomize MAC per WiFi, enabled by default. Maybe you can trigger a new MAC by forgetting the network and reconnecting?

[-] SuperIce@lemmy.world 8 points 1 year ago

If you enable Developer Options, there is a setting under Networking called "Wi-Fi non-persistent MAC randomization" that randomizes the MAC per connection for networks that have randomization enabled.

[-] Odo@lemm.ee 3 points 1 year ago

Would airport networks have randomization enabled?

[-] FooBarrington@lemmy.world -2 points 1 year ago

That's neat, thank you for the tip!

[-] notthebees@reddthat.com 2 points 1 year ago

There was a way to do it on older Android phones with a specific Mac address changer but it broke after android 6 got released.

this post was submitted on 23 Aug 2023
1376 points (98.9% liked)

Programmer Humor

19623 readers
1 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS