canteen's blog

my phone

what happen

I recently switched back to a lineageos with microg phone so I could have something that isn't spying on me all the time. It's nice.

software

To prevent spying of apps I use even though I probably shouldn't (e.g. insta. I'm a young person and I like to talk to my friends okay), I have magisk, lsposed and xprivacylua. Xprivacylua is no longer supported but what it does (pretend things have permissions and then spoof the input) is something I have not found elsewhere.

lil bugs

what to fix

Lineageos has little bugs on this phone, and it is also missing some features (turn on flight mode at night, turn off my lights when I go to bed, etc) that I had available on my old phone.

how

For fixing this I use tasker, which is a great app. I bought it via the web interface of the play store and then got it through the replacement store I have installed, which can install apps but not buy them.

I would really like to have AutoInput so I can automatically dismiss popups of the system without creating macros that just trust they exist and push buttons. Sadly I cannot get this via the usual channels as it requires an IaP and working license fetch from the play store. Those things don't work for me. I've emailed the author to see if I can just give them some money and get it done that way.

I'm aware that I can use uiautomate probably to hack together a script that polls until something exists and then clicks a place, but it was a lot of work and I didn't feel like it.

what have we done

We've created some automations!

I'm in bed

When we go to bed I have a few actions automated:

canteen's blog

I want the lights to turn off, my phone to be in airplane mode, the display to be gray-scale, have blessed silence and the WiFi to be on. This last part is important because some of us read in bed:

canteen's blog

When I wake up I just turn airplane mode, gray-scale and quiet time off:

canteen's blog

I also set a variable in both cases that indicates that I'm in bed (or not). I use this with other automations to prevent them going off when I am sleeping.

I'm home

Sometimes I just want to know whether or not I'm home:

canteen's blog

I thought about doing this with geofencing but that drains a lot of battery and I have WiFi at home that barely reaches beyond the door so it is a fine presence detector. When I get home I just set a variable to indicate this is the case, and vice-versa:

canteen's blog

I got home and I want lamps

I have smart home lamps. They're from IKEA because they are both cheap and passably dependable, my favourite combination. To control the lights I use a plugin for tasker, which is a little buggy (it has errors sometimes even though it works) but is free and works basically so the dev deserves much praise!

When I get home I check that it is late and I'm not currently in bed:

canteen's blog

Then I tell the lamps to be on:

canteen's blog

In the future I want one of those fancy presence sensors, f.e. that Tuya ZY-M100. That will be better because it will allow me to see if I'm in bed and for the lights to follow me around the house like I'm in a horror movie. The dream.

fix sim

After my phone has been in airplane mode, it needs some gentle root-based bonking to start using it's SIM cards properly again. Supposedly this is a bug, but it's sort of fixed with this. It waits for the SIM cards changed notification and then fixes them:

canteen's blog

And by fixing I mean changing the settings so it has a clear default phone and message SIM. That bit was easy.

What was much harder was figuring out that I need to use service call phone 158 i32 5 i32 1 to turn the data on for the second SIM (the first one can be turned on with i32 1 in place of i32 5 on my phone). If you tell tasker to listen in the "custom setting" action and then change it in the settings UI you will get a variable back that got changed. When you set that variable in tasker, the UI will pretend that that SIM is the data SIM. Sadly in the background nothing has happened so that doesn't work.

After that there is also a popup from the system that I just cannot figure out how to prevent:

canteen's blog

To mitigate this the action waits for the toast, turns on the data for the second SIM and fixes the other settings and then pushes the back button. This is really bad automation because it's fragile and relies on how fast or slow my system is. Thankfully is is basically foolproof so I didn't have to mess with sleep type solutions:

canteen's blog

edit

I have since fixed the detection so that it waits for the current window to be the select SIM card dialog. This was not possible before as I did not have the window detection set to use the accessibility detection method. I didn't realise this was the issue until I read online that this is how to make it work.

Once this window opens it will just close it. The correct settings are put in as before:

canteen's blog

in conclusion

I guess microg and lineageos on a cheap phone will always be a little janky, but with some automation it is very bearable. The automation makes other parts of my life way less irritating also, which is very nice.

Thanks for reading!

#review