Episode: 3110 Title: HPR3110: Finding an Android phone to run LineageOS Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr3110/hpr3110.mp3 Transcribed: 2025-10-24 17:01:28 --- This is Hacker Public Radio episode 3,110 for Friday 3 July 2020. Today's show is entitled Finding an Android Phone to Run Linear JoS. It is hosted by Ken Farlun and is about 38 minutes long and carries an explicit flag. The summary is Join Ken on the six-year-long journey of success but also failure. This episode of HPR is brought to you by archive.org. Support universal access to all knowledge by heading over to archive.org forward slash donate. Music Hi everybody, my name is Ken Farlun and you're listening to another episode of Hacker Public Radio. This is an episode about Android phones running lineage OS. The goal is to make an affordable phone capable of supporting school apps and allowing a firewall. The reason why I want a firewall is not so much that I don't trust my children is that I don't trust the phone. Particularly people on work have had situations where the phone has decided to turn on mobile data and the data plans that I have are really expensive. So they don't need data. They use Wi-Fi here and use Wi-Fi in school and Wi-Fi at their friends and they have 1,400 Wi-Fi networks that they can access. Also in the library, everywhere they're going. So you're not allowed to be on your phone anywhere here in the Netherlands while you're on the bike. So yeah, they have phone whenever they need it. I can always bring up a hotspot for them if they need data. So good and well. That said, data has become a lot more affordable now. But I also don't like the idea of all the apps and stuff that are going out, monitoring kids and loads of reasons not to have a lot of crap in it for the run slower as well. And it just bugs me that you buy a device and you spend lots of money buying the device physically and you can uninstall an application from Facebook or from Google or someone. I know. What sort of world are we living in? That you buy something and you don't own it. Anyhow. Long story short, don't do this. Don't do this unless you're willing to lose all the money that you have spent on your phone. If you are rich and you're getting it from a company, then you'll go to a Google phone that's supported for developer applications and you won't have this problem. But if they cost the phones that I'm talking about here, sub 200 euros, sort of around the 150 mark, up to the 300 euro mark. They make the money from the apps and stuff. So yeah. My requirements. It's supposed to be supported for three to five years. I need apps, so therefore it needs to be Android and therefore that needs to be lineage OS. So some of the apps coming from school, like Magister or whatever, they need Android. So therefore the need OS is my option. I need a firewall and the firewall to use is a WF plus. That was another one that you could use. That needs root, so therefore it needs to be unlockable. So getting a brand new phone means that developers have not had time to release the code first. And catch 22 with that is older phones are no longer available for purchase and actually become more expensive. And two older version and the apps are no longer available. So if you buy as I did a phone for myself, not three months ago, that it up and running, everything was perfect. And then I went to buy it again and that phone is no longer available. So then I tried to find a... I found one in a strange color, which my daughter happened to like and we got that. But then when I unboxed it, it actually had a different model number. Luckily it was in the same family, so it still worked. But anyway, here are the steps that you need to follow if you're thinking of doing a phone. In the Netherlands, first of all, you go to a parameter search website that you can use to narrow down the phone on prices and stuff and the features that you want. There's this good site here in the Netherlands called tweakers.net that allows you to set the maximum price that you want them to pay. So for example, you might want to go and say, well, I only want phones with Android 10 because I know those are the newest ones. And then you want to select the amount of RAM and the amount of storage. So I selected four gig of RAM and 64 gig the first time. And I sorted by price from low to high. And as I was doing this, I checked support for TWRP, which is the recovery application that you're going to need. And they tell you if the manufacturer supports the unlocking or not. If they don't, then you need to remove those from the list. So you also can check the lineage OS devices to find your phone there. So you need to loop through this list. So you go through the first time and you find a HTC phone that looks perfect or a Motorola phone. And you heard good things about Motorola. But since Lenovo have taken them over, they've basically stopped supporting unlocking other phones. Then you hear that HTC has unlocking service and whatever, but they don't release any code to developers. So none of the developers have supported for the phones. The phones are ideal, but they're way too expensive. Then you have the ZOME phones, which requires you to wait 14 days before you can unlock them. Which is convenient because that just happens to be the amount of time before the EU mandatory return policy thing kicks in. So yeah, you can throw all of those off the list. And then you'll find that your list actually disappears. So I had to change from Android 10 down to Android 9. And I ended up having to change from 4 gigs of RAM down to 3. Before I found a phone that was affordable, which was a lot more expensive than I would actually pay for it. That worked with TWRP and worked with lineage OS. And the reason I spend more on it is that the kids do use the phones a lot. And the phones that they have are genuinely years old because I was using them before they got their phones. And then as I got a new phone, then the next person upgraded. And when I got the next one, then the next person upgraded. So that's pretty much how it worked. The policy then was just I would debug it for a while. Then I'd see go through this pain and torture that I'm going to explain to you shortly. And then I would pass it on to them. No, I'm trying to get the same model of phones, but basically, yeah, it's very likely you're not going to find a phone. And then you're faced with a choice of adjust parameters. So you're going to end up finding something that's more expensive or something that may or may not work. And then if you find a phone, you're likely going to get one delivered to you that has a slightly different model version. But it's one that isn't supported. But then you go looking and there's a non-efficial ROM somewhere out there first. I had this with my youngest daughter's phone where I got it. It was supposed to be supported. It was supposed to be exactly the same phone. Yes, the model number had a letter or something at the end, which was not supported. Somebody had a non-efficial ROM and I was able to get a version on sort of. The phone has never been right since day one, but she's happy enough with it, but it's not ideal. So don't do any of this if you want to stress free life and you're not willing to accept all your money has been thrown away. But I went and I got ended up getting two phones out of this process because I just wanted to get this done. Well, actually, I ended up getting three phones out of this process. One is the same model as my own, only slightly different. Thankfully, fingers crossed it was supported by the same developer, so that's good. It ran into issues as you'll hear later running Lineage OS 10, but I went back to 9 and it's fine because I'm comfortable with that. And the other phone is a Sony Xperia 10, so Sony Xperia A2 model number, which L4113 is supposed to mine, which is a H4113. But I ended up going over to the pine phone and basically ordered one of those because those guys, it might be a slower phone, but at least it'll be your phone. And you won't be dealing with this crap of unknocking and boot loading and whatever, it'll just work. Okay, well, first thing to do is turn it on and then run through all the, over their updates for the installed operating system. So I'm selecting English-United States, I get started. I am aware of the important safety information and where data charges may apply, but I don't want to share any information. I connect to a mobile network, no skipping that, connecting to a Wi-Fi. You have to connect to a Wi-Fi network in order for the over-their updates and you need to do all the over-their updates, otherwise the unlocking tool won't work. So the first thing I need to do is log into a network, so let's do that. I connect it to my network here on my laptop and then check for updates. This may take a few minutes. It's installing updates. Okay, so now it says copy, apps and data. I'm going don't copy. It's checking info and it's asking me to sign into Google, which I skip. Are you sure, basically? And I'm going to turn off use location, allow scanning, send statistics, install updates. And you have to accept the Google privacy policies, which I've read before and I don't particularly like it, but otherwise I can't unlock the phone. So I'm skipping a fingerprint unlock and I'm skipping the screen lock, skip anyway. The whole point of this is I just want to get bare bones of Android thing running so that I can do the updates. Don't want support from Expedia services. Don't want to use other IDs. So I'm skipping that now. Yes, are you sure you want to skip? Yes, yes. So, so far, updates. So on here, booking.com, ARFX, PlayStation, movie creator, club creator. So I'm selecting, deselecting all of them and they're press OK and it's added in the finishing touches. So your phone is ready to go. Or is it? So pull down from the top and pull down from the top again to get the little gear icon and scroll down to the bottom. Then I go to support menu, new, new, not that system system and go to advanced. I'm making note about about phone. It's L for Lima 4113 and I write that down. And at the bottom it says software updates, update is tune Android 9.1, go to system. Your device is already at the latest updates. So that is excellent user. OK, so sometime later, in fact, a lot of time later, we, I went through the following steps. I went to lineage OS to the devices and the one that I'm going to be talking to you about now is this Sony Xperia 10. Not that it matters because every phone will be absolutely different. So you need to follow the instructions for that one. And once you go to devices and the code name is Kirin, K-I-R-I-N, Kilo, India, Romeo, India, November, forward slash install, then you need to follow the instructions. My advice is to copy and paste that and have text-to-speech playback to you so that you are sure that you don't miss anything. And my experience has also been that if you go back again in a few months time, the instructions will be slightly different that you will skip over. That's possible to skip over a particular part, but anyway. So once you have the phone installed, you need to make sure that you have Android debugging and fast boot installed. Come on from Windows Linux and Mac and they're available on all distros and the instructions are always linked on each of the wiki pages. You need to enable USB debugging so you go down to the settings somewhere. Usually I get to the settings but pulling down from the top twice and then there's a gear icon. You go down to about, you hit build number seven times and then you go back. So go down to the bottom about phone and then scroll down to build number. And then you go back one and then under system, then you have under advanced, you will have developer options. You can also find it if you just type it into the search and settings. So there's two things you need to look for. Scroll down, check for Android debugging, USB debugging or debugging. And enable that. And Ruchy debugging I put on as well. And then let's go back to the instructions here. So then you can plug in your phone into your USB slot. And if you go ADB devices, you'll get a list of devices that are attached. Now usually they will not pop up. You will get permission tonight and there'll be a pop up that comes up. So you tick that pop up and to give permission to this mac address. So you need to remember to do that. I've noticed that on some older phones, when you plug in the USB, you first need to go to pull down the USB. Well, it'll say USB debugging connected, so tap to turn off. But actually what you want is to go down slightly further and it says, charging this device via USB. So I found that if you just press file transfer on that, then that triggers ADB to work. On the newer phones, you don't seem to need to do that. On the older phones, you always need to do that. So ADB devices, you can go ADB shell and LS-AL. You'll see your phone there. This is just general on any Android phone. It's kind of cool. You might also be interested in the tool called Scripti. SCR-C-P-Y. Not sure what that's about. But I installed it as a not-a-flap pack, but a snap-d. And it allows you to, once you have USB debugging enabled, it allows you to control your phone from your computer, which is handy when you're typing in commands and stuff. Swiping left is you click the mouse, click and hold scroll, to press the unlock button and you hit the left key. So nice little tool there. You can remember to put a link to that into the show lots. Okay, after that side note, back to the instructions. So on my device, there's a hidden menu that's not available on all devices. This is particular to Sony. It could be even particular to this particular type of hole. So you go to the DOM menu and you dial asterix hash, asterix hash, service, asterix hash, asterix hash. No, hash asterix hash asterix. But no, it doesn't matter. Unless you have a Sony phone, this isn't going to be an issue for you. Then there's a hidden menu that comes up called service configuration, configuration, and then routing status. And if it says bootloader of lock allowed, yes, then you're good to go. So this is actually reassuring. There's two things I think Sony have done well here. This is the first one. The second one is that when you go to unlock your phone, when you unlock your device, you go to a website that they have. So you need to read the terms and conditions. And they're not pedantic about it. They're basically saying you need to go and get this code. So you need the I-I-M-E-I number, the I-D-I-D, or the M-E-I-D in order to generate the code. And they basically ask you to fill out some terms and conditions, which are reasonable. In fact, I'll go to that again. And let me put in another one. So they ask you to enter your I-M-E-I-I-D number, whatever, which you'll find in that hidden menu and make a note of at least one of them. I have a dual SIM phone, so if you have multiple SIMs, you'll have multiple of those members. And they ask you to acknowledge that I may void the warranty of my device by unlocking the bootloader. Seems reasonable. I acknowledge that if Sony does perform some warranty repairs, Sony may charge a service fee for additional costs associated with the modified software. Which I also think is reasonable. So, yeah, fair enough. And when you do that, you get a number, which you need to copy and paste somewhere and remember. So the good news is, from Sony point of view, is that at that point, you haven't damaged the warranty of your phone. You've requested them, I'm not cold, but you haven't in fact voided your warranty because of that bootloader unlock allowed just to know. If that was set to know, you just wrap the whole thing back up and you send it back to them. Within the European Union, there's a 14-day return period, no questions asked where you don't even have to give an explanation as to why you're returning it. So now this is where the heart attack central comes in, because from this point on, you're modifying your phone. And it has not always gone well, I can tell you from previous experiences. But at least with this, you have some confidence that it's going to work on this phone. So you drop to console and you type ADB, Android debug, space reboot, space bootloader. In my case, nothing seemed to happen except a notice that was a tiny little blue light shining and that's all the notice that you get. And then you type fast boot devices and similar to a DB devices that will list any of the devices that are identified. If there's no device identified, it's going to work. So then you need to try your actual on-lock code. And the command for that is fast boot, OEM, on-lock. And then the code that I got earlier. I'm not going to go into too much details about this, because they're pretty much custom to this device, as I said before. So now that has unlocked your bootloader. So if you reboot your phone at this point, you will get a warning saying, please consider re-locking your bootloader. So it's not obnoxious. The one on Motorola was very obnoxious. Warning, this device has been rooted with this one. It's subtle, but it's also as clear. And it's at this point, I want to point you to a tech tab article about the Android boot process, because it does explain, at least to me, what the difference is with a bootloader and recovery mode and how it works. And it's got an excellent diagram saying that you power off. You always go into a bootloader. And normally the Linux kernel will be loaded in it, and then all the Dalvik stuff and all the systems, and then you're in normal mode. You can load into two other modes called fastboot, or bootloader fastboot, mode, and on the other side you have load recovery kernel and RAM disk in recovery mode. So all that is in RAM. So I have a quick gander at that diagram, and the rest of this will make more sense. So what we're going to be doing now is we're going to be booting into a temporary recovery using fastboot, yeah. And to do that, we go ADB reboot bootloader. Again, we'll have the blue line. We've got fastboot devices, which allows us to control the form with this. And then it goes fastboot flash, space, boot space, and the recovery image. And the recovery image, in this case, is the TWRP. And that's the team win recovery project. So that's a tool that will allow you to enter into recovery. It's kind of like the bias mode on a laptop, or a PC. Now, some phones, at this point, you have a temporary loaded so that it'll load the first time you've basically selected the equivalent to F10 and boot from CD or something like that. So sometimes you need to do a weird key combination in order to get a working. So you turn off the phone physically, you press and hold the volume up button, then you press power on or something. In the case of the Sony, you have to press and hold the volume up button with the phone turned off. Keep it hold, plug in the USB cable, and then the blue light should turn on. But thankfully, a lot of devices now support just after typing in the previous command. You can just type fastboot devices. And that's pretty much it. Now, this is where I come across a weird one on mine. It gives some error messages about boot A and boot B, blah, blah, blah, problems. And then reading the thing, it says, if you don't do the following steps, you will break your phone. So you really kind of want to pay attention to that. And the answer is, in some cases, sloppy can be unpopulated or contain much older firmware than slot A, leading to issues and a potential brick situation. So then you need to do this Android debugging side load thing. So at this point, looking at the diagram again, we fastboot it into recovery image. And then you will have a little application called TWRP, which would be open running. And you need to go to the advanced tab and hit ADB side load. And the side loading concept is where you send programs down via the USB cable. It's very handy and I've used it quite a lot. So ADB side load runs a space, copy-partitions.zip. And that will, has a bash script, I think, for all intensive purposes, that copies from one slot to the next. A lot of this seems mysterious, but the natural fact, a lot of the stuff is just bash scripts working in the background. So installing the recovery image again, you're now in still in recovery. And you go to the TWRP menu, you type wipe, and then you format, you have to type YES in order to do that. And then you enable side loading again, ADB side loading. And you download the image that you have for this device. So the command there is ADB side load. And then lineage dash, one seven dash, blah, blah, blah, whatever it is, that I already downloaded. So that's going to take a long time. And as with baby's crying, it takes an awful lot longer than you think time. The pace of time seems to slow down dramatically. So once it started, and you see it doing something, it hasn't obviously erred, then go away, for 10, 15 minutes at least, and come back then, and it should be done, because it pauses several times during the process. And it's heart attack central time. Okay, then optionally to install additional add-ons. Now, in some cases, you need to do a reboot in order for that to work. In other cases, you're supposed to be doing it at the same time that you've installed. That's the firmware, and if you don't do it then, you break the phone. That was the case with the Motorola. So this is why I'm saying you really need to read the instructions for your particular device. So I'm just going through these instructions as I said again, just to give you an idea of what you can expect. In my case, then I can run ADB reboot side load. And what that happens, is it allows a lineage OS bootloader, not a bootloader, a lineage OS recovery, fastboot mode, not sure what actually it is. And that allows you to have an off-hop that you can do a side loading. You can get into some sort of custom kernel that can write to the devices. One thing I noticed about Android devices is that it is lying to you the whole time. It uses change on right-by-file systems. The SD card is not the SD card. What is presented to you as a file system is an amalgamation of stuff. So yeah, it'd be very careful in assuming that it's telling you the truth. They use simling cellos, I know, for these file systems. For example, if you ever wondered why if you put in an SD card with music on it, you only have one folder with music, not two, is that it's helpfully merges those two together. You might actually run into problems if one has a lowercase m from music, then it merges as well. So really, really confusing. I found that once I'm using ADB shell, life gets a lot easier. But only a back to the phone. So once it's rebooted into the side load command, you can go ADB side load. And if you want access to root applications, I recommend installing magic. M-A-G-I-S-K, version 20 as well, I have at the minute. And that will install that. And that basically is the phone done. You have the option of installing Google Apps. I don't. There are various different packages of Google Apps. They have nano ones, which just gives you the Play Store, and then they have NanoPico, and then the full Monty, and they've got one that actually contains applications that Google no longer have available that they put on there. I don't install on a Google Apps. There's a completely Google app free environment here. And if there is an application I need for the kids for school or something, I have one phone that I have, one of my old phones that I have just sitting on the desk. It's physically broken, but it actually, you know, physical connections don't work on it anymore for headphones and stuff like that. So no, the kids want to use it. But I use that to download the Google applications from the Google Store that they need, and they use APK extractor to extract those out, and then they make those available on the other phones. So yeah, that's works. So therefore, I don't need to install on the Google Apps on there. It means some of the applications won't work. Google classrooms, for example, won't work, but fair enough. That is a sacrifice I'm willing to make. But if you did want to install them, this is where you do it. And then you do ADV reboot, and bam, all go well, your phone works. Or you've just practice, and you're out all that money. So yeah, you're called the, even at this stage, some of the issues that I've had with the Sony phones, which are very well supported, to be honest, has been Bluetooth and Wi-Fi stopped working. If you wanted to use Bluetooth, Bluetooth Wi-Fi turned off, and then it went into a vicious cycle with the Wi-Fi turning the Bluetooth off, and the Bluetooth turning the Wi-Fi off. I needed to go to the IRC channel, and the developer was able to give me a fix which involved using SED. Following a specific session instructions, SED all can grip. The first time I did this, when I did the recording of the intro of this, I was actually working on Modotus phone, and we installed Android 10, which is Lineage 17, and everything was perfect. She had everything transferred over, and all customizations, and three or four days later, she realized that YouTube videos were not working, but they were working fine in VLC. So I said, okay, forget about it, and we put the same version that's on my phone on, because we know that works, and that seems to work as of yesterday. Then on my son's phone, the Sony Xperia 10, it seems to be okay, it seems to be working fine, but who knows? Check that it can send a receive phone calls, check that it can send, and receive text messages, check with SATs.stat, that the SATLite navigation works, check that the photo, with the photo app that you can take a photo and playback, photo videos and playback. And then at that point, what I do is load the ADB tools and ADB push asterix and all the APK files that I've transferred over. So I download, I run the Google Play Store, and do an update on this other phone that isn't in use. I do the ADB pull, and sorry, run APK Extractor from the FDroid Store, then use ADB pull to pull them over to my computer, and then I can use ADB push to push them to the new phone, remembering also to download the FDroid APK. And that's the first thing I install, go to the file manager, APK for FDroid, you need informations to install that, then do an FDroid update, then install any of those weird apps that are that you got from the other phone. I have some stuff as well that are no longer supported on the FDroid Store that just disappeared for some reason. Kids camera controls, that sort of stuff, probably the COVID. COVID applications, whenever they come along, we'll need to do that way. So that's it, and if you're lucky, you have a working phone, but you, oh yeah, and then the very first thing I install from FDroid is the AW firewall. So the AW firewall, you install that, and the very first thing you'll get is a pop-up from magic around this root axis, and if so for how long. So that's one thing that you need to do, that will tell you that you do have root axis on your phone, and everything is hunky-dory there. If not, you may need to reboot and do a side loader thing again for magic. Then, with that enables your AF firewall, I've noticed that it will connect to the Wi-Fi, but it will say that there's no internet access available. So there's a few things that you need to check on that. I allow GPS out, because that gives faster look-up times, allow NTP, and I allow VPN. You need to allow captive portal, and get this, you need to allow FM radio, plus you need to allow network stack Android server so that's the one that you need to turn on in order to get AW firewall working as well. Okay? So with that, I'm going to record the introduction to the show. This has been very choppy. I understand that, but to be honest, let me check when I started doing this about this was going to be a show that I did about six years ago, literally when I decided to give my daughter a form for the first time, actually, you know, almost six years ago. Yeah, no, it was six years ago, because then I had run lineage myself for a few years, and I've been every time has been, yeah, this is great, this is so easy, get as it follows the instructions, and then you go back six months later, looking for that form, thinking hey, it's going to be exactly the same, and each time, it's slightly different, so not for the faint hearted. And as I said, I hope this is the last times that I need to do this, and that we can go to something like a pine phone that is just open and full stop, and that if you can, but all honesty, go to developers, and there's no fear for, so this I will admit is not my, not the best show ever, but to be honest, I just want this one done, because it was on my list for too long. There's information there, during this process, of the last six years, I've even asked several people for help, and some of the people who are very enthusiastic about what I've enjoyed at the beginning are just giving up, and it is too too dangerous, it's just too difficult, it's too many complications, too many hacks, and too much risk, so they have just opted to treat the phone as a monitoring device. So that's pretty much it. The main reason for doing this is to get a firewall on, and that's it. Hope it's of some help to you. Music You've been listening to Hecker Public Radio at Hecker Public Radio.org. We are a community podcast network that releases shows every week day, Monday through Friday. Today's show, like all our shows, was contributed by an HPR listener like yourself. If you ever thought of recording a podcast, then click on our contributing to how easy it really is. Hecker Public Radio was founded by the Digital Dove Pound and the Infonomicon Computer Club, and it's part of the binary revolution at binrev.com. If you have comments on today's show, please email the host directly, leave a comment on the website or record a follow-up episode yourself. Unless otherwise stated, today's show is released under Creative Commons, Science. Music