Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #311: transient bus protocol violation


comp / comp.mobile.android / Re: home screen icon to connect to wi-fi network

Subject: Re: home screen icon to connect to wi-fi network
From: Enrico Papaloma
Newsgroups: comp.mobile.android
Organization: Hispagatos.org
Date: Sun, 15 Sep 2024 17:18 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.hispagatos.org!.POSTED!not-for-mail
From: enrico@papaloma.net (Enrico Papaloma)
Newsgroups: comp.mobile.android
Subject: Re: home screen icon to connect to wi-fi network
Date: Sun, 15 Sep 2024 19:18:14 +0200
Organization: Hispagatos.org
Message-ID: <vc74sn$at3p$1@matrix.hispagatos.org>
References: <vc5nt0$30lb$1@news.gegeweb.eu> <1g80yhgozelcl.dlg@v.nguard.lh>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 15 Sep 2024 17:18:15 -0000 (UTC)
Injection-Info: matrix.hispagatos.org;
logging-data="357497"; mail-complaints-to="abuse@hispagatos.org"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1?Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Language: en-US
View all headers

On 9/15/2024 12:15 PM, VanguardLH wrote:
> I doubt your finger is faster to click an icon, and run a process to
> select a wifi hotspot, than the scanning to determine which wifi hotspot
> is within reach and has the strongest signal. Of course, that assume
> automatic hotspot connect, not where you have to authorize the connect.
>
> https://source.android.com/docs/core/connect/wifi-network-selection

Thank you for trying to help me as I have spent hours and hours on this,
where all I want is something so basic that I don't know why it's hard.

All I want is to put a shortcut on my home screen that connects to a known
access point bssid/ssid pairing, which should be simple to create, right?

That link goes to "Wi-Fi network selection" which "outlines the algorithms
and procedures used in Android 12 for selecting and switching between Wi-Fi
networks" (I'm on Android 13, but it shouldn't be much different than 12).

Reading that was interesting because I've always wondered what the
algorithm is for how Android orders the possible wi-fi connections
(for example, if an RSSI is rapidly changing, it falls down in the list).

That nice article explains how the candidates are evaluated, where it says
"The candidate with the highest score is the winning candidate", which is
neat but which doesn't solve the problem of creating a shortcut to an ap.

However, one useful point they hammer home is that the connection is to the
BSSID and not to the human-readable SSID (which everyone thinks it is, but
it's not). The BSSID is what's unique. Not the SSID (which is just words).

What's also very important is that deep down in that nice article is says
"Android has a user connect choice algorithm that allows the selection
process to prefer Wi-Fi networks that a user has explicitly connected to,
for example, a home network", which is a fundamental thing to understand.

> If you are at home, your phone should automatically switch to the wifi
> modem in your house, not try to use a wifi hotspot across the country
> where you were vacationing up until yesterday.

By setup design, mine doesn't automatically connect to any wi-fi hotspot.

That's because automatic connections require a repetitive broadcast packet
of the known wi-fi network bssid, which is a detrimental privacy issue.

That's why I just want to tap once on one of a set of prepared home screen
icons to connect to any given known wi-fi access point, in a single tap.

> Personally I don't want auto-connect except for my home wifi cable
> modem. Anyone can pretend they're a hotspot to which you were connected
> before, or pretend they're the hotspot where you are, like running their
> own hotspot named StarbucksFreeWifi at a Starbucks shop. I prefer to
> get prompted to allow a hotspot connect rather than allow automatically.
>
> https://news.uthsc.edu/announcements/cybersecurity-tip-of-the-week-how-to-disable-wi-fi-auto-connect-and-bluetooth/

You are wise to not automatically connect, not only because of an
access-point-name impersonation (which isn't really likely given they use
the bssid, and not the ssid to do the connection) but because the bssid of
every autoconnect setting has to be broadcast in order to connect to it.

As an example, if there is a location that is collecting the broadcast
packets (which is easy to do), then that location can tell you are there
every Monday and Wednesday but never on Saturdays (for example), simply by
collecting your unique bssid broadcast packets seeking your access point.

That means your phone is always shouting out who you are everywhere you go.

> Except for your home wifi hotspot, auto-connect should be disabled for
> the other hotspots saved on your phone (for those you haven't
> deleted/forgotten, because you're not going back there again). If only
> your home wifi hotspot has auto-connect enabled, and the rest don't (you
> get prompted to allow those), the auto-connect to your home wifi should
> be extremely fast, and faster then your finger.

I disagree but I understand you are assuming that there is a duplication in
the human-readable name of the home access point - but as I understand
wi-fi connections, the phone connects to a bssid - and not to an ssid.

Even so, the problem is when you're away from your home access point.
Then the phone is shouting out your ssid/bssid pair everywhere you go.

Which is unique to your phone, so it betrays you everywhere you go.
(Well, it could also be unique to all the phones in your household.)

> https://play.google.com/store/apps/details?id=com.pw.wifishortcut
>
> That puts an icon on your screen to quickly jump to wifi settings
> instead of having to drop the shade to navigate through the settings
> menus to the wifi settings. Never tried it since Android 10 minimum is
> required, and I'm on an ancient Android 8 phone.

Thanks for that pointer to com.pw.wifishortcut, which I hopefully installed
and tested, but it doesn't do anything more than running the intent
com.android.settings/com.android.settings.Settings$WifiSettingsActivity
which you can show by connecting the phone to adb and running this command
adb shell am start -n com.android.settings/com.android.settings.Settings$WifiSettingsActivity

That's not a different number of steps than longpressing the wi-fi tile at
the top of your screen (if you have the wi-fi icon in the first 5 tiles).

It's not a bad program though. But it doesn't connect to a known network.
Too bad. But thanks for finding that application for the question.

I especially appreciate you found a well rated free app with no ads.
> https://play.google.com/store/apps/details?id=net.opengait.wifishortcuts
>
> Maybe that gives you what you want. It defines a widget to a specified
> wifi network, and you can set the widget to connect when tapped. No
> idea if it works on your phone (no Android version mentioned). This
> says it works back to Android 5, was last updated in 2020, but that
> doesn't mean it will work on whatever Android you have.

Thanks for that pointer to net.opengait.wifishortcuts, which sounded
promising until I started it up and it requires a whole bunch of
permissions that it shouldn't need - like location being always on.

Again I appreciate you found a well rated free app with no ads,
but it says after Android 8.1 (Oreo) it needs location permission to scan
for nearby access points, which I simply don't understand since Android
itself scans for nearby access points WITHOUT needing location permission
to always be on. It says "The app won't function without location being
turned on" and they're right. Too bad, as it's a nice app otherwise.

I wish this Pixel suggestion would work for my Galaxy but it doesn't.
How to create shortcut for hotspot on home screen
https://support.google.com/pixelphone/thread/203734046/how-to-create-shortcut-for-hotspot-on-home-screen

That's too bad because the title is EXACTLY what I want to be able to do!

I did find this rather complex potential solution by searching.
https://discuss.grapheneos.org/d/5477-absolutely-tired-of-the-wifi-toggle-in-android-13-alternatives

It was more of a gripe session but the basic task the guy was asking for is
similar, which is a shortcut to connect to a known wi-fi access point.

After an hour of trying the solution, I gave up as it suggests something
called "Better Internet Tiles" which needs "Shizuku" for its Shell Access.
https://github.com/CasperVerswijvelt/Better-Internet-Tiles/releases/tag/v3.0.0
Name: app-release-github.apk
Size: 5213175 bytes (5090 KiB)
SHA256: 7390BE3640B3E21155E4F325ABC2F29CD4F0CB4692D3FC065601449A0051B4D4
which requires pairing of adb with the Shizuku for non-root Android phones
and which itself requires developer options wireless debugging=on, which is
no problem as most of the time I'll be home when I want a wifi connection.
Since I'm not rooted, I need to use adb to start Shizuku on Android 13.
https://github.com/RikkaApps/Shizuku/releases/tag/v13.5.4
Name: shizuku-v13.5.4.r1049.0e53409-release.apk
Size: 3442426 bytes (3361 KiB)
SHA256: A05832CE3716AFB1FCCCF46F348006D2A296CA777E1FF3D223797DC74D06B31F

Since I'm not rooted, I had to also use adb to pair adb to the phone.
adb pair 192.168.0.10:38623 55898 (you get the pairing code from wireless
debugging tile which you turn on in the developer options settings).

And then I had to use the adb shell to connect that pairing to Shizuku.
adb shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh

Then I had to grant access for "Better Internet Tiles" to "Shizuku" in the
Android settings for the "Better Internet Tiles" settings, which was fine.

Only then could I run "Better Internet Tiles" (which put a shortcut on my
home screen when I had installed it) which then said "Missing permissions"
which said "Shell Access is required" (which I gave it via Shizuku) which
worked as the Better Internet Tiles GUI went from pink to green saying
"Shizuku allows normal apps to use system API's directly with elevated
privileges using ADB on non-rooted devices", so that part worked perfectly.

When in the "Better Internet Tiles" GUI, everything was green, there were a
few "plus" (+) buttons to add new tiles to the Android home screen top bar.

One was a "Wi-Fi" tile, while other improved tiles were for "Mobile data",
"Internet", "Airplane mode", "NFC" and an improved "Bluetooth" tile.

While adding improved tiles to the top swipe of an Android home screen is
probably useful (especially perhaps the improved "Mobile data" tile), when
I added the improved "Wi-Fi" tile, it doesn't do anything that the old
original "Wi-Fi" tile didn't do, so all that effort turned out ineffective.

All I want is a shortcut that connects to a known access point, so I'll
keep looking as it shouldn't be this hard to do something that obvious.

SubjectRepliesAuthor
o home screen icon to connect to wi-fi network

By: Enrico Papaloma on Sun, 15 Sep 2024

37Enrico Papaloma

rocksolid light 0.9.8
clearnet tor