2018-05-30

New Phone Part 2: Installing LineageOS

As promised, here is my walkthrough on installing LineageOS on the Lenovo (which bought Motorola) Moto Z.


  1. Get a USB -> USB-C cable. The one I received (from QuickMobile.ro) seems to be USB -> MicroUSB, and it was most likely by accident. The charger does not have the pluggable USB cable like most phones nowadays.
  2. Read through the entire installation guide, to get an idea of what's expected of you.
  3. Make sure you download all the software, and that the software you downloaded is at least showing its version when you ask it to.
    • There may be trouble still. I installed LOS on a friend's Galaxy S5; and it required "Heimdall". The version coming with Debian did not work (1.4.0), because Samsung updated something (even for such an old phone). I needed to compile the latest version from source (1.4.1), and then it worked.
  4. Make sure the website where you beg your manufacturer to unlock your bootloader works. In the case of Motorola, it sends you the unlock key via e-mail (even though you are logged in).

Unlocking the bootloader


When I started performing the guide, I was worried about the following error:

(bootloader) 'device-info' is not a supported oem command
(bootloader) See 'fastboot oem help'
But it turns out it was no big deal.

After I performed the steps on Motorola's website to unlock my phone, I got a very strange response via fastboot:

dan@debian:~$ fastboot oem unlock <key here> 
...
(bootloader) invalid boot state
OKAY [  0.002s]
finished. total time: 0.002s

I thought it's not unlocked, but then I found a forum post; it said the device should show "Flashing unlocked: Yes". For me, it shows "flashing_unlocked", as you can see here:


Pretty, isn't it? :D


However, the device did not restart by itself, as it said on the website and the guide. However, it did reset the USB debugging to off, as said in the LOS guide.

Flashing the recovery firmware

Continuing the guide, I encountered another obstacle at the following step:

6. Now reboot into recovery to verify the installation:
  • With the device powered off, hold Volume Up + Power.

You should NOT press the power key when you see the "START" option (blue speech bubble). You should NOT attempt to turn off the device either. This is because, when you start holding the power key to try to turn it off, it INSTANTLY continues booting. This step DELETES the recovery firmware you just flashed (called TWRP), because the phone wants to forget the trauma =)

What you SHOULD do after flashing recovery is press the DOWN ARROW two times, so that the option shown is the RECOVERY MODE one. 


Only THEN click the power button to confirm it, and you get TWRP :)

Sweet success!

It takes about 30 seconds to load, then you can continue with the guide from "Installing LineageOS from recovery".

F-Droid

I finished installing.
It seems I am not allowed to install APKs (including F-Droid).

Addressing this problem: I found out about this privileged F-Droid. Thankfully installing it is not that hard anymore:
  1. Reboot to recovery again:
    • adb reboot recovery
  2. Copy the F-Droid package to the phone:
    • adb push org.fdroid.fdroid.privileged.ota_2070.zip /sdcard/
  3. Use TWRP to install that package (DO NOT WIPE THIS TIME!).
  4. Reboot to System.
I then had F-Droid installed and ready to update itself.

Fun fact: You can avoid installing Google Services completely; you can use YALP Store. There are some caveats however.

Conclusion

It seems that the GPS is getting a location fix quite slowly. This could be due to missing Wifi/network-based location servers. Will update this post later about this issue; and will also update about what else I test. I couldn't make a phone call yet, because my Romanian SIM card is too big. But the Ukrainian one seems to be working and connecting to the network :)

Also, I am amazed that the files were left mostly intact (photos, videos and documents). But you should back them up just in case. Also, sharing contacts via Bluetooth worked!

Hope you enjoyed this walkthrough! Here are two screenshots from the phone.


Update

The GPS works (but still takes about 30 seconds to load; I tried the "GPS Status & Toolbox" app.
What I tested and also works: taking photos, video recording in 1080p, calls, browsing via mobile data, NewPipe (unofficial YouTube client, supporting background playback), gestures, fingerprint reader. If you want anything else tested, leave me a comment.

What does not work: Recording 4K videos (says "Video Failed"); "High-framerate recording" (option is greyed out), and the video stabilization option doesn't seem to do much (I can see motion blur when pausing on a shaken frame).
Also, the Clever Taxi app requires Google Play services, which I did not install. It might work if you install microG.

Even newer update 

The phone broke 8 months in, because it overheated. The service contractor claimed it was because of LineageOS.
 
This made me start boycotting new smartphones. My current one is a second-hand phone running Android 5; I never use it with my security-sensitive logins.

2018-05-26

Buying a phone with Free Software support

Free Software

I started being more aware of Free Software (not "Open Source" as defined by Richard Stallman). The importance of it can not be overstated.

The difference (in Android's case) is that while Android is Open Source, you can't change the source code running on your device. However, Free Software (codified in GNU GPL 3.0) requires distributing installation instructions as well.

Many times "Open Source" poses the same restrictions as if it were not open source (the freedom is gone!), so the apps running might as well be a binary or a proprietary web service (which is the case, in many cases!). This means the provider has full control over what you do with your phone - and many times it exerts that control.

However, there are quite some important Free Software initiatives about Android phones:

  • F-Droid, a free-software repository alternative to Google Play.
    • Here you can find apps that don't spy on you, such as QR Code readers and a game with more than 1000 Solitaire variants.
      • Imagine you want to scan the QR code of a password. Do you trust it with nonfree software which has Internet permissions?
      • Games without ads! You should donate to the authors if you appreciate them.
  • LineageOS, a free-software distribution of Android; the successor of CyanogenMod.
  • Replicant; an even freer-software project; but it has missing support for some features.

Buying a phone

The sad fact is that given a random recent phone, there's not much chance that it's supported by LineageOS (LOS). The reason is that a volunteer must take time to port LOS to that particular combination of hardware (some of which may be entirely new).

Also, the manufacturers are not particularly interested in helping the project, since it goes against their plans. Since profit margins on the hardware are very thin, manufacturers want to push their own software (proprietary binaries with proprietary web services). Samsung even wants to use a separate OS, which is no small feat.

Voting with your money

However, some recent phones are still supported (see here). And how else to tell manufacturers to quit bundling nonfree software, than by ONLY buying phones supported by LOS?

I wanted to buy a new phone, and I will show you how I went about it.

Researching candidates

EDIT: There is a Reddit thread where people recommend devices. You can use that also.

Sadly, there is no user-facing way to sort the supported devices. So, I made use of software freedom, and found a way: download the LOS wiki's source code, and grep for each device's release date to find the newest-released supported phones.

git clone https://github.com/LineageOS/lineage_wiki.git
cd lineage_wiki/_data/devices/
grep "release:" * | sort -k 2

Now you get something like:

mido.yml:release: 2017-01
a5y17lte.yml:release: 2017-01-02
a7y17lte.yml:release: 2017-01-02
h870.yml:release: 2017-02
us997.yml:release: 2017-02
sagit.yml:release: 2017-04
cheeseburger.yml:release: 2017-06
chiron.yml:release: 2017-09
dumpling.yml:release: 2017-11
star2lte.yml:release: 2018-03-11
starlte.yml:release: 2018-03-11

These are the YML entries of the devices. You can check each one individually, and find out what the device name is (AFAIK you can't install LOS on a cheeseburger :)).

(Writing this I noticed I forgot to look at the devices at the top of the output, which are missing the release date. But I don't want to; I already ordered my phone. If you want to; you can take a look yourself.)

I did this myself manually , and filtered out the phones with less than 32GB of storage, and those outside my budget (though I kept Galaxy S9 as a reference).
I then manually linked them to features I cared about (its review on China-prices.com, benchmarks, Jack audio, MicroSD slots, and physical durability, tested by JerryRigEverything on YouTube).
I also created a "score/RON" column, where I take the China-prices reviews and benchmarks, normalize them (0-1), average them, and divide them by the price.
Here is the resulting output: Google Drive spreadsheet

I ordered the Moto Z Dual Sim, and it was the last piece (sorry you won't get it).

Word of warning

There are still some dark truths lying deep within smartphone hardware:
In case you can no longer find and install sufficiently-free hardware/software combinations, I urge you to forego mobile computing for good.
For me personally, LOS is enough; but you may have other needs. Perhaps the best and easiest choice for some less-technical people is simply installing F-Droid alongside the black-box binary-blob OS that came with their phone.

Conclusion

While we may be quite free in general, sometimes there is a price to pay for living in a such developed society: society takes more control of the individual.
That is why the individual should fight against that price, and negotiate with society.

By not giving companies your hard-earned money to enable them to spy on you, while getting little in return, you draw the line, as an individual.

The more people become aware of this, the more "society" will give in, and your influence as an individual will increase.

Stand up for your ideals, even if only once in a while!

There will be a part 2 of this post, which will detail my installation of LOS on the Motorola Moto Z.

2018-05-24

Despre revizuit Constituții

Aveți citate din Constituție, copiate de aici:

Art. 1 – Statul român
(1) România este stat naţional, suveran şi independent, unitar şi indivizibil.
(2) Forma de guvernământ a statului român este republica.
(3) România este stat de drept, democratic şi social, în care demnitatea omului, drepturile şi libertăţile cetăţenilor, libera dezvoltare a personalităţii umane, dreptatea şi pluralismul politic reprezintă valori supreme, în spiritul tradiţiilor democratice ale poporului român şi idealurilor Revoluţiei din decembrie 1989, şi sunt garantate.
(4) Statul se organizează potrivit principiului separaţiei şi echilibrului puterilor – legislativă, executivă şi judecătorească – în cadrul democraţiei constituţionale.
(5) În România, respectarea Constituţiei, a supremaţiei sale şi a legilor este obligatorie.

Art. 152 – Limitele revizuirii

(1) Dispoziţiile prezentei Constituţii privind caracterul naţional, independent, unitar şi indivizibil al statului român, forma republicană de guvernământ, integritatea teritoriului, independenţa justiţiei, pluralismul politic şi limba oficială nu pot forma obiectul revizuirii.
(2) De asemenea, nici o revizuire nu poate fi făcută dacă are ca rezultat suprimarea drepturilor şi a libertăţilor fundamentale ale cetăţenilor sau a garanţiilor acestora.
(3) Constituţia nu poate fi revizuită pe durata stării de asediu sau a stării de urgenţă şi nici în timp de război.


Să zicem că poporul român ar dori să se dividă.
E clar că nu poate în acest moment, deoarece Constituția interzice acest lucru ("independent, unitar și indivizibil").
Nu doar că interzice diviziunea, dar interzice și modificarea dispozițiilor privind caracterul indivizibil.

Articolul 152 nu își interzice propria revizuire, în mod explicit. Acum vă întreb, acest Articol 152 (adică limitarea revizuirii) e o dispoziție ce privește caracterul indivizibil?

  • Dacă da, atunci România nu s-ar putea divide niciodată, în mod constituțional.
  • Dacă nu, atunci se poate:
    • Pasul 1. Revizuim Art. 152 încât să putem revizui mai târziu indivizibilitatea.
    • Pasul 2. Revizuim Art. 1, scoțând indivizibilitatea.
Cam tras de coadă, ce-i drept, dar poți încerca să zici că Art 152 privește revizuirea și nu divizibilitatea.