Sunday, May 15. 2022
Installing magisk in my lineage phone
A very quick personal entry to summarize how to install magisk in my lineage device. It seems that now every time the OS is upgraded magisk should also be re-installed on it. The procedure is described in the project documentation but I prefer my usual detailed steps.
Download and install/upgrade the latest magisk app on the phone once it is upgraded.
Magisk need to patch the boot.img of the lineage distribution. Download the used lineage bundle for your phone.
Install python and the protobuf package on your laptop in order to extract the zip.
dnf install python python-protobuf
Download extract_android_ota_payload tool and execute it over the zip file.
wget https://raw.githubusercontent.com/cyxx/extract_android_ota_payload/master/extract_android_ota_payload.py wget https://raw.githubusercontent.com/cyxx/extract_android_ota_payload/master/update_metadata_pb2.py python extract_android_ota_payload.py lineage-18.1-YYYYMMDD-nightly-XXX-signed.zip . Extracting 'payload.bin' from OTA file... Extracting 'boot.img' Extracting 'system.img'
Use adb to push the image to the phone:
adb push boot.img /sdcard/Download/
Open the application on the phone, click install, Select and patch File and locate the image. Click Let's go. A patched magisk_patched-XXXXX_XXXXX.img is generated. Copy it to your laptop.
adb pull /sdcard/Download/magisk_patched-XXXXX_XXXXX.img
Now just flash the new boot image to your phone.
adb reboot-bootloader fastboot devices fastboot flash boot magisk_patched-XXXXX_XXXXX.img
And that is all. Magisk is installed and now my firewall can be configured again.
Regards!
Tuesday, April 30. 2019
Upgrading tissot to LienageOS 16
Just a very quick entry today. The previous weekend I wasted a lot of time trying to upgrade my phone to LineageOS 16. In general I followed the upgrading guide for my phone model but when I started the adb sideload it always failed with the error: "Error applying update: 7(ErrorCode:: kInstallDeviceOpenError)". I tried Friday evening with no success, I was searching for information a couple of hours at Saturday and I finally got it working on Sunday. I think summarizing what was needed in the blog would be better, maybe it is useful for someone else.
In general the reason seems to be that tissot (my phone model, Xiaomi Mi A1) needs something special in the TWRP boot loader. Finally I got it working after reading this beautiful issue. The problem is explained by the maintainer himself in this thread. My model, unlike most of the usual A/B devices, has a weird partitioning where most partitions are not slotted (except of boot, system, modem). By default, TWRP does not expect to have any non-slotted partition in the A/B OTA package. That is why the installation fails on all TWRP packages except the one provided by the maintainer. So, if having this model, you need to download that exact TWRP image in order to upgrade the system.
After using the correct TWRP version everything went successfully and I have LineageOS 16 in my phone. The main problem was finding the issue, I needed to google a lot until I found that page which described my exact problem.
Regards!
Saturday, January 19. 2019
OpenWeatherMapProvider needs to be compiled again for Lineage 15.1
Short entry this time to upload the OpenWeatherMapProvider APK to the blog. More than two years ago I wrote another entry about this same topic and how I needed to compile the OpenWeatherMap provider for CyanogenMod 13. Since them I have been using the same APK file in CM 13 and Lineage 14 but, it seems that it's not valid anymore in version 15.1. I have just retired my old phone and in the new one the old APK was not working (it was installed without issues but then the weather app did not detect any provider installed).
So, after knowing that there are APKs available for other providers but not for OpenWeatherMap, I repeated the same steps than in my old entry.
git clone https://github.com/LineageOS/android_packages_apps_OpenWeatherMapProvider.git
cd android_packages_apps_OpenWeatherMapProvider/
git checkout lineage-15.1
./gradlew
./gradlew build
This time I changed to branch 15.1 although it was unnecessary (the are no differences between branches 15.1 and 16.0). I received a rebuke the previous time so here you have the debug OpenWeatherMapWeatherProvider.apk. You can compile it by yourselves if you do not trust me (I would not do it). It is nice to see my new phone smoothly working now with lineage OS 15.1.
Best regards.
Comments