pig-monkey.com

You are currently viewing all posts tagged with telephone.

Managing Android Wifi with Tasker

One of the earliest programs I installed when I bought my first smartphone in 2013 was Kismet’s Smarter Wi-Fi Manager. It kept the phone’s wireless radio disabled unless I explicitly enabled it and connected to a network. When that happened, it would store the location by identifying nearby cell towers. Whenever it saw those towers again, it would turn the wireless radio on. In all other cases it would keep the radio off. This was a simple solution to the problem of only wanting wifi turned on at known locations, like home and work. It helped save battery, and prevented information leaks when wandering around meatspace.

Recently, when setting up a new phone, I discovered that Smarter Wi-Fi Manager had been abandoned. I thought I had heard something about the behaviour being integrated into the latest version of Android, but it seems that is not the case. Fortunately I found that Tasker can be configured to replicate the behaviour.

In Tasker, a profile can be created to recognize a location using a few different means. I setup one profile for home and one for work, both using the “cell near” context state. Like the Smarter Wi-Fi Manager of old, this just stores the identities of nearby cell towers. Then I created two tasks: one to turn wifi on and one to turn it off. The first task is added to both profiles as the main task. The latter is added to the profiles as the exit task. The result is that when the phone sees the cell towers near my trusted locations, the wireless radio turns on. When I leave, the wireless radio turns off.

Profile: Home (1)
    Restore: no
    State: Cell Near [ ... bunch o' towers here ... ]
    Enter: Wifi On (4)
        A1: WiFi [ Set:On ]
    Exit: Wifi Off (9)
        A1: WiFi [ Set:Off ]

Profile: Work (2)
    Restore: no
    State: Cell Near [ ... bunch o' towers here ... ]
    Enter: Wifi On (4)
        A1: WiFi [ Set:On ]
    Exit: Wifi Off (9)
        A1: WiFi [ Set:Off ]

The task to turn the wireless off is only triggered when I leave the location, which means I can still manually turn the radio on when I am somewhere unknown without Tasker immediately turning it back off. That new location will not automatically be stored as a trusted location, but if I want it to be remembered it only takes a minute to create a new profile and hook it up to my two wifi tasks.

I found the Tasker interface to be somewhat confusing. It took me a while to figure out how to achieve my desired behaviour. This is probably because Tasker can do a lot of other things. I don’t think my phone is integrated enough into my life to make its other capabilities relevant to me (though I might set it up to only enable GPS when mapping applications are open), but I was happy to pay the low price to retake control of my wireless radio.

This post was published on . It was tagged with telephone.

Tracking My Phone Bill with Ledger

Back in 2013 I bought my first smartphone and signed up for a T-Mobile prepaid plan, referred to at the time as the “Walmart Plan”. The plan cost $30 per month, was intended for new customers only, and was supposed to only be available to those who purchased the SIM card at a Walmart. It offered a small amount of voice minutes and a large amount of data, which struck me as what one would want with one of these newfangled computer-phones. I bought a SIM card, figured out how to get T-Mobile to sign me up on the plan despite not stepping foot into a Walmart, and haven’t looked back since.

One of the things that appeals to me about the setup is the level of separation it gives me from the service provider. I purchased the phone from the manufacturer and the SIM card I bought with cash. I fund the plan by purchasing refill cards from third-party vendors. I have never provided T-Mobile with any financial information. They have no ability to take any money from me, except what I give them when trading in the refill cards. Obviously, the primary business of any mobile communications provider is location tracking, so I can’t refer to my relationship with them as “privacy preserving”, but I like to think it does allow me to retain some level of agency that is lost in a more traditional relationship.

If there is a downside to this setup, it is that it can be difficult to understand what I actually pay per month. The plan costs $30. There is some limit to the number of SMS messages, but I have no idea what it is. Data is “unlimited”, which means throttled over 4GB, but I don’t think I’ve ever approached even half that limit. Minutes are limited, and if I go over the allotment I’m charged a higher rate, but the service continues as long as the balance of the account remains positive.

I always want to keep more than $30 in the account, in case I do go over the allotted minutes. So I buy $50 refill cards. They have $50 of value, and are supposed to cost me $50. But the vendor I tend to by them from charges a $1 service fee, offers a points program that sometimes results in a discount being applied, and frequently has sales that offer a couple dollars off. So I end up paying something like $48-51. If I do exceed the limits of the plan, I may end up buying a $50 card one month and the next. More often, I buy a $50 card one month and have enough left over in the account that I do not need to refill it the following month. My plan renews on the 5th of the month, so some months I may end up spending $100 by buying one refill card on the first day of the month and another on the last in anticipation of the following month’s renewal.

All of that is to say that it is difficult to have an intuitive feel for what my average monthly phone expense is, but it’s important that I can get that number so that I can determine if the plan is still working or if I should look for a better offer. Fortunately, this is a thing that Ledger makes extremely simple.

Whenever I purchase a refill card, I log the transaction in the Expenses:Utilities:Phone account. With that done, I can ask Ledger to report on all transactions in that account, grouped by month, with a running average in the final column.

$ ledger register utilities:phone --monthly --average --begin 2019-08
2019-09-01 - 2019-09-30     Expenses:Utilities:Phone    $48.50      $48.50
2019-10-01 - 2019-10-31     <None>                      0           $24.25
2019-11-01 - 2019-11-30     Expenses:Utilities:Phone    $46.50      $31.67
2019-12-01 - 2019-12-31     <None>                      0           $23.75
2020-01-01 - 2020-01-31     Expenses:Utilities:Phone    $51.00      $29.20
2020-02-01 - 2020-02-29     <None>                      0           $24.33
2020-03-01 - 2020-03-31     Expenses:Utilities:Phone    $48.50      $27.79
2020-04-01 - 2020-04-30     <None>                      0           $24.31
2020-05-01 - 2020-05-31     Expenses:Utilities:Phone    $48.50      $27.00
2020-06-01 - 2020-06-30     Expenses:Utilities:Phone    $46.50      $28.95
2020-07-01 - 2020-07-31     <None>                      0           $26.32
2020-08-01 - 2020-08-31     Expenses:Utilities:Phone    $51.00      $28.38

Over the past 12 months, I have spent an average of $28.38 per month on phone service. I’m ok with that.

I use Blokada to reduce the amount of advertisements on my telephone.

Blokada registers itself as a VPN service on the phone so that it can intercept all network traffic. It then downloads filter lists to route the domains of known advertisers, trackers, etc to a black hole, exactly like what I do on my real computer with hostsctl. For me it has had no noticeable impact on battery life. I have found it especially useful when travelling internationally and purchasing cellular plans with small data caps. The only disadvantage I have found is that Blokada must be disabled when I want to connect to a real VPN via WireGuard or OpenVPN.

Blokada must be installed via F-Droid (or directly through the APK) because Google frowns upon blocking advertisements (but at least Google allows you to install software on your telephone outside of their walled garden, unlike their competitor).

Mobile Weather

Los Angeles is suing The Weather Channel for selling the data of mobile users. This behaviour shouldn’t be surprising. Most mobile software, from the operating system on up, seems to exist primarily to provide some base modicum of functionality in exchange for the privilege of fucking you in new and exciting ways.

There are exceptions to the rule. I starting using Arcus for mobile weather in 2014, and it seems pretty respectable. But it exists solely to display data from the Dark Sky API, which is something that a web browser is also capable of doing, thus raising the question: why install anything?

About a month ago I simply bookmarked Dark Sky‘s website and had Firefox add a shortcut to that bookmark on my home screen. Dark Sky’s website is responsive, so it works fine in any viewport size. I bookmarked the URL for my home location, allowing me to see weather at home in a single tap. Elsewhere, it required two taps: one tap to open the bookmark, and one tap on their geolocation icon to get the correct forecast for my current location.

I find Dark Sky’s data to be great for reporting on the hyper-local now. For reports that are wider in scope – either in terms of time or space – nothing beats the National Weather Service. They provide a mobile specific site that is perfectly usable on small viewports. Annoyingly, they don’t make use of the web geolocation API, instead requiring users to manually enter a location. When travelling I may not know what zip code I’m in or have a nearby address. To work around this I created a shim with a few lines of Javascript that geolocates the user, uses the resulting coordinates to build the proper NWS URL, and redirects the user to that URL. I also added support for building a Dark Sky URL so that I could avoid that second tap when not at home. The resulting HTML page is available on GitHub.

Now I have two URLs bookmarked on my home screen that accomplish everything I need: one for NWS and one for Dark Sky.

Shortly after creating this shim I discovered that the NWS has a beta website that is intended to replace both the current mobile and standard sites with a consistent interface. This site does make use of the geolocation API, requiring the user to click an icon to get the current location. It is unclear why they have yet to deploy this to their main domain. It’s been available since August 2017 and the data on the beta site seems to be the same as the data on the standard site and the data on the mobile site. For now I’m sticking with the officially supported domains in my shim.

A locally installed weather program is useful if your requirements include lock screen widgets or notifications of hazardous conditions. Mine do not. These two bookmarks provide all the weather information I need on my telephone, and do so in a way that does not expand my attack surface in the way installing software does. They are indicative of the usefulness of this World Wide Web thing – an emerging technology that I intend to watch with great interest. I think it’ll go places.

This post was published on . It was modified on . It was tagged with telephone.

I track disasters via RSOE EDIS.

Operated by the Hungarian National Association of Radio Distress-Signalling and Infocommunications (RSOE), the Emergency and Disaster Information Service (EDIS) collects disaster information from around the globe, and disseminates it using the Common Alerting Protocol. They offer the data via web map, email, RSS, and Android application (an API is also available, though keys are apparently restricted to government organizations). There is a wide range of “disasters” included, but the normalized protocol supports filtering the events based on criteria such as scope, severity, and urgency. I use the Android application, configured to only show emergency-level alerts.

For earthquakes, I supplement RSOE EDIS with the USGS Earthquake Notification Service, which provides regional-based subscriptions. I subscribe to email alerts for earthquakes greater than 6.0 for all of the US, and greater than 4.0 for my local area.

Breaking News

In the past I’ve struggled to find a way to be alerted to breaking news, were “breaking news” is defined as things that matter1.

For some time, Scanner Radio Pro was my preferred solution. The Android application uses Broadcastify to stream feeds of police and EMS radio (among other sources). While a police scanner is always a good thing to have, the application is relevant here because of its notification support. It will push notifications when a channel has a certain number of users listening to it. The application default threshold is 3500 listeners for all channels, but it also allows you to configure per-channel thresholds. I set the threshold to 200 listeners for San Francisco police and EMS channels. I also have the threshold set to 200 for any station within 50 miles of my current location. Those two are redundant when I’m in San Francisco, but it means that if I’m travelling I’ll receive alerts for wherever I am, and I’ll be able to stay up to date on what’s happening back in the city.

The alerts simply tell me that a large number of people are listening to a certain channel, which indicates that something is probably going on in that location. It doesn’t tell me what is happening, but prompts me to figure that out for myself. When the shooting started in Dallas a couple weeks ago, I was alerted immediately that something was happening due to the unusually high number of people listening to the Dallas PD channel. When I saw that, I performed a quick search for Dallas news and discovered the reason.

I’ve had good success with these alerts. It has worked well for shootings like in Dallas. The alerts kept me informed of disruptions in the area this past winter when the Super Bowl was in town. Unfortunately, most of the Broadcastify feeds and listeners are US-focused, so it tends not to help with events outside of the country. There were no alerts for the attack in Nice, France.

More recently I’ve begun supplementing Scanner Radio Pro with the conveniently named Breaking News. They are basically a modern wire service, collating data from traditional news sources, social media channels like Twitter, and direct user submissions. Human editors manage the service, which does seem to take care of some of the cruft. Events are grouped into topics, and topics can be muted or subscribed to. Their mobile application supports push notifications for global major stories, as well as stories based on geographic proximity to the device’s current location.

I’ve noticed that the application does have an impact on my battery (even with the “battery saver” option enabled), but I think it’s worth it for the service provided. They provide alerts for a wider breadth of topics than the police scanner, and provide immediate context for the alert. If they provide an alert for an event that I don’t care about, I can mute the topic and never hear about it again. It’s rare that I need to do this, as they seem judicious in their use of push notifications.

Scanner Radio Pro and the Breaking News application live on the home screen of my phone in a directory labelled “Intelligence”. Along with applications like Flightradar24 and Marine Traffic (like Flightradar24 but for boats), they help provide context for and build awareness of the world around me.

Notes

  1. Not celebrities. Not sports.

This post was published on . It was tagged with telephone, osint.