yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi A1 Guides, News, & Discussion] AsusGhost:
My MIA1 is rooted with magisk and some modules installed.

Should I flash the latest released stock rom with "flash_all_except_storage" option after disabling the LOCK command at the end of the script, will it work properly even if I skip uninstalling Magisk and restoring the stock boot image? By "work properly" I mean new stock installed, all apps and data intact, rooted or unrooted and unlocked.
[Xiaomi Mi A1 Guides, News, & Discussion] jack_21:
Just disable the lock command at the end of the script, then it will restore default boot images so you will be unrooted.

Then when you reinstall a patched boot image, Magisk will work with same modules ecc.

---------- Post added at 02:18 PM ---------- Previous post was at 02:17 PM ----------

The stable is released (not globally however) but it has some troubles with 4G Bands, so wait to install it if you care about 4G
[Xiaomi Mi A1 Guides, News, & Discussion] anil-kmr:
Is this under testing,

Or working fine
[Xiaomi Mi A1 Guides, News, & Discussion] jack_21:
Magisk boot patch works fine
[Xiaomi Mi A1 Guides, News, & Discussion] XtraWater:
Hello everybody

My question is quite off topic. I hope, someone can answer it anyways. So far I only have practice with twrp, xposed and gapps.

Because of the safety net, I would like to use magisk. I use a few modules for xposed which I won't miss. If I install xposed as a module under magisk, might there be some disadvantages in functionality regarding to xposed modules?

For instance I use the module xposed edge. I couldn't imagine to use a smartphone without it.
[Xiaomi Mi A1 Guides, News, & Discussion] Ridz4:
Is this wipe my data?I have mi A1 with oreo 8.1 patch november
[Xiaomi Mi A1 Guides, News, & Discussion] OsR14:
Yes, the prosses will erase your data. Make a backup first :p
[Xiaomi Mi A1 Guides, News, & Discussion] jack_21:
I need to unroot my phone in order to install the Pie patch (80 mb circa) that has been released this morning, but if i uninstall Magisk, restoring the original boot image, my phone won't boot up correctly (actually it boots up after 4-5 minutes on the splash screen, but the system is so slow that i can't even enter my unlock code)

I tried to flash the stock boot image extracted from payload.bin without success, the result is the same.

The only thing I can do in order to get the phone working again is to flash patched_boot.img, then it works normally but it's rooted.

[EDIT]

Reflashing also stock Pie system.img solved the problem
[Xiaomi Mi A1 Guides, News, & Discussion] Stealtherthreat:
Does anyone has the stock boot image of android 9.0 global version?
[Xiaomi Mi A1 Guides, News, & Discussion] jack_21:
Do you need it in order to root or unroot?
[Xiaomi Mi A1 Guides, News, & Discussion] Stealtherthreat:
I need to root my device
[Xiaomi Mi A1 Guides, News, & Discussion] jack_21:
Mi A1 | Android Pie 10.0.3.0 images

Patched Boot

http://s000.tinyupload.com/index.php?file_id=51493593658965566289

Stock boot (compressed in ZIP)

http://s000.tinyupload.com/index.php?file_id=86684559827511992039
[Xiaomi Mi A1 Guides, News, & Discussion] RedNas74:
Why not just boot twrp using fastboot and flash the magisk zip. Works for me every time.
[Xiaomi Mi A1 Guides, News, & Discussion] Stealtherthreat:
Booting twrp wipes the data, so i always root with the patched boot image method.
[Xiaomi Mi A1 Guides, News, & Discussion] RedNas74:
Booting twrp never wiped my data. I don't know what you're doing wrong.
[Xiaomi Mi A1 Guides, News, & Discussion] freekarol:
I never lost my data booting TWRP via fastboot.

Odesláno z mého Mi A1 pomocí Tapatalk
[Xiaomi Mi A1 Guides, News, & Discussion] Stealtherthreat:
Well, then i might need to look into that method again.
[Xiaomi Mi A1 Guides, News, & Discussion] swnny:
Thank you! Just booted using the patches img and then used magisk manager to directly install it. Now it's rooted and i have backup of my own boot img
[Xiaomi Mi A1 Guides, News, & Discussion] jack_21:
No problem man
[Xiaomi Mi A1 Guides, News, & Discussion] fixxxer102:
It doesn't wipe anything. I root via twrp and nothing was erased.
[Xiaomi Mi A1 Guides, News, & Discussion] Mazen550:
How did you guys have Pie anyway? .. cause I still getting that my system is up to date with Novmber update
[Xiaomi Mi A1 Guides, News, & Discussion] _jis_:
Because update was stopped till they iron out bugs, you have certainly read many error reports of missing LTE bands after update to Pie...
[Xiaomi Mi A1 Guides, News, & Discussion] vhick:
Anyone have the new boot.img for January patch?
[Xiaomi Mi A1 Guides, News, & Discussion] _jis_:
January update is out :)
[Xiaomi Mi A1 Guides, News, & Discussion] jasmeet21:
could anyone upload the patched boot for pie january so we can root + install magisk?
[Xiaomi Mi A1 Guides, News, & Discussion] Razoralpha:
Interesting, I was able to update to Pie in December, but now this one is failing.

-Tried the "restore images" from magisk manager before the OTA -> failed

-Tried to uninstall magisk (unroot/uninstall from the manager then uninstall the manager too) completely -> failed

-Tried fastboot boot stock.img too -> failed

They all failed the same way, OTA downloaded (rather slowly) then told it was unsuccessful, no extra info I could find about it.

I might be missing something or the January update has some extra issues. If someone has a suggestion I'm all ears and eyes.
[Xiaomi Mi A1 Guides, News, & Discussion] Parnas72:
If you want to find out what the problem is, connect the phone to the PC, in a DOS prompt run "adb logcat *:E", then run the system update on the phone. On the adb window you will catch the error, most probably it will tell you that some of the system partitions have been tampered with.

Short answer, to fix it you need to reflash the stock rom. :)
[Xiaomi Mi A1 Guides, News, & Discussion] Razoralpha:
Thank you.

Yeah, I did check logcat - the hash on the system partition changed.

Unfortunately, it lead me nowhere - I haven't used any additional extensions to magisk, no exposed fw, no custom kernels and such, still wondering what changed it so I can avoid it in the future.

I had the impression that magisk does work systemless-ly.
[Xiaomi Mi A1 Guides, News, & Discussion] Parnas72:
Magisk works systemlessly, yes.

But if you have given root access to any app, nobody guarantees that they don't touch the system partition... it's enough that they mount /system in read/write, even without modifying anything, to change the hash of the file-system as the timestamps will change.
[Xiaomi Mi A1 Guides, News, & Discussion] ltf_195:
I though I'm the only one who having this problem, small update of 71.5MB, I have no problem when updating to Pie last month, completely uninstall magisk but still unable to update, need more people to confirm this.
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
I had the same issue, but it was definitely problem with some app mounting and writing to the system partition (in my case it was most probably "systemless" Substratum). You can verify it very easily, type in command via adb or from terminal app on the phone as root:

"tune2fs -l /dev/block/mmcblk0p25"

or

"tune2fs -l /dev/block/mmcblk0p26"

Depending on you active partition. I am pretty sure that you will see "mount count" number higher than 0 and very recent last mount date. I fixed it by flashing just system.img from this OTA extracted ROM 10.0.3.0 https://mega.nz/#!l8dy1AiA!cbc6iiLjsTCLIB8vVn_O7mIZ3AjaUAtVlyBfhrJSI-0. After flashing, OTA update to 10.0.4.0 went through on the first try with the standard Magisk procedure (restore image, apply OTA, reinstall Magisk and reboot).
[Xiaomi Mi A1 Guides, News, & Discussion] dixtir:
Now we all need January Patched Boot image :)
[Xiaomi Mi A1 Guides, News, & Discussion] ltf_195:
May I know how do you flash system.img. Is it safe?

Btw there typo "mmcblk0p25" instead of "mmclbk0p25"
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
"fastboot flash system_a system.img" or "fastboot flash system_b system.img", depending on the active partition. In my case it was absolutely safe and without any issues. I just flashed it and booted up the phone.

Typo fixed in the previous post, thanks :)
[Xiaomi Mi A1 Guides, News, & Discussion] butcher33:
just updated to pie... please give me a hint on how to disable the stupid google search bar at the bottom :)
[Xiaomi Mi A1 Guides, News, & Discussion] _jis_:
https://xdaforums.com/showpost.php?p=78628202&postcount=1650
[Xiaomi Mi A1 Guides, News, & Discussion] butcher33:
googled a bit prior to posting but could not find any answer, so looks like nova is the only solution :(
[Xiaomi Mi A1 Guides, News, & Discussion] _jis_:
I am Nova Prime happy user too.
[Xiaomi Mi A1 Guides, News, & Discussion] kecrekchord:
How to check which partition is actived?

I will try to flash the system only.

Maybe that's solution to fix failed installation on January Patch.

Thanks

Sorry 4 My English
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
Via adb:

"adb shell getprop ro.boot.slot_suffix"

Via terminal emulator on the phone:

"getprop ro.boot.slot_suffix"

Via fastboot:

"fastboot getvar current-slot"
[Xiaomi Mi A1 Guides, News, & Discussion] dixtir:
Has anybody managed to get January Patched boot image?
[Xiaomi Mi A1 Guides, News, & Discussion] ltf_195:
Working great, thanks. I only have one module which is systemless host for adaway, been using for long time but this never happen before.

Thanks again, at least i don't have to flash whole ROM to get OTA.:good::good::good:
[Xiaomi Mi A1 Guides, News, & Discussion] vhick:
We cannot get the OTA? So this thread is dead? Any other forms to root our device without breaking OTA?
[Xiaomi Mi A1 Guides, News, & Discussion] Parnas72:
There are many launchers out there, not only Nova.
[Xiaomi Mi A1 Guides, News, & Discussion] lafactorial:
Here it is..
[Xiaomi Mi A1 Guides, News, & Discussion] kecrekchord:
I download that ROM it say above but can't flash the system.img, always error : cannot load..

then I full flash.. it show this message
[Xiaomi Mi A1 Guides, News, & Discussion] Razoralpha:
fastboot flash system system.img
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
That's normal, just wait until it flashes. Can take a couple of minutes. Don't interrupt the process.
[Xiaomi Mi A1 Guides, News, & Discussion] vhick:
After flashing system.img, update to OTA, what is next?

Can we proceed to boot on boot.img and direct magisk rooting?

So everytime we need to flash system.img to be able to update in OTA?
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
I am using TWRP for Magisk installation. Reflash of system.img is needed only if some app (or misconfigured TWRP) mounts system partition as R/W. Otherwise you can follow the standard OTA update procedure with Magisk (restore images, apply OTA, install Magisk to second slot, reboot).
[Xiaomi Mi A1 Guides, News, & Discussion] vhick:
System.img or boot.img?
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
Restore images function in Magisk, so boot.img :)
[Xiaomi Mi A1 Guides, News, & Discussion] Tony D.U.Y:
can you show me how to flash this ?
[Xiaomi Mi A1 Guides, News, & Discussion] Razoralpha:
I don't think it is always normal, the same happens on mine, the command terminates right after that message and no flashing happens regardless of how many we wait.

Had to use WinRAR to extract so it wont stop instantly.
[Xiaomi Mi A1 Guides, News, & Discussion] janforga:
Hi, I have a similar issue but idk how to flash that rom you posted. I tried it with twrp but it doesn't work. How can i do it? thx!
[Xiaomi Mi A1 Guides, News, & Discussion] vhick:
One last question, so we need to install it to non-active partition and not direct install?
[Xiaomi Mi A1 Guides, News, & Discussion] sushant4191:
Can you provide the system.img ? I don't want to download the whole ROM

---------- Post added at 02:07 AM ---------- Previous post was at 01:49 AM ----------
[Xiaomi Mi A1 Guides, News, & Discussion] kecrekchord:
Mine normal, I have to wait a little longer after the command appears. Finally I can update the patch January. Thanks to _mysiak_.

But, if i just flash system.img whis this command :

fastboot flash system system.img or fastboot flash system_a system.img or fastboot flash system_b system.img

Always error.. error cannot load the system.img

---------- Post added at 06:51 AM ---------- Previous post was at 06:39 AM ----------

If you wanna make your own patched boot, you can try on this tutorial

https://xdaforums.com/mi-a1/how-to/guide-rooting-mi-a1-twrp-wiping-post-t3824550

---------- Post added at 06:56 AM ---------- Previous post was at 06:51 AM ----------
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
Yes. After OTA install Magisk to the second slot.

---------- Post added at 09:01 AM ---------- Previous post was at 08:55 AM ----------

You must have different error then. "Invalid sparse file format at header magi" means that Fastboot must split big system.img to smaller chunks by itself. Stock images come with some kind of flags in the files and flashing process is faster. More info http://2net.co.uk/tutorial/android-sparse-image-format
[Xiaomi Mi A1 Guides, News, & Discussion] TrueMS:
Patched boot img is used to avoid wiping during he unlocking process?
[Xiaomi Mi A1 Guides, News, & Discussion] paolocorpo:
No

patched_boot.img is used to root the system without flash by TWRP the .zip of MAGISK
[Xiaomi Mi A1 Guides, News, & Discussion] kecrekchord:
Can you tell me ... step by step.

for example ... I have rooted and came OTA update ... what should I do? so that the update works ... and I want to be rooted again.

thanks
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
Read this guide https://github.com/topjohnwu/Magisk/blob/master/docs/tutorials.md
[Xiaomi Mi A1 Guides, News, & Discussion] kecrekchord:
In that guide, on oreo I always failed, I don't know why, maybe face factors ... :laugh:

I haven't tried it yet on pie
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
If it failed for you, you must have some app which mounts system partition as R/W (TWRP and some old apps with root access come to mind). If system partition is untouched, guide works every time.
[Xiaomi Mi A1 Guides, News, & Discussion] paolocorpo:
Related to this ... And based on your knowledge ... Is the app Root Explorer approaching the system in this way and creating OTA issue ?

Inviato dal mio Mi A1 utilizzando Tapatalk
[Xiaomi Mi A1 Guides, News, & Discussion] kecrekchord:
can u mentioned, what the name of the olds app it is? and please provide me how to mount system partition with that app. coz i dont wanna flash twrp again. Yesterday, when i reboot to twrp.. its said error and i lost my data.
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
I don't use this app, but it is easy to verify. Run these commands in terminal emulator (or via adb):

For system_a

tune2fs -l /dev/block/mmcblk0p25

For system_b

tune2fs -l /dev/block/mmcblk0p26

And make a note of the last mount time and mount count. Run the app with root access, do your usual things in it and run above commands again. If there is increase in the mount count and time of the last mount/write, you have the answer :)

---------- Post added at 08:06 PM ---------- Previous post was at 08:04 PM ----------

For example this one mounts system as RW, even if it doesn't do any action on it. https://play.google.com/store/apps/details?id=com.SystemCleanup.Inteks.org

And you don't want to mount system as R/W as it breaks OTA :) Don't flash TWRP, just boot it when you need it..It's much safer and easier to do.
[Xiaomi Mi A1 Guides, News, & Discussion] paolocorpo:
Thanks

If I install the app, I test it as you suggested, find it as touching the system in bad way, uninstall the app, Have I lost OTA just because I had installed it ?

Or the OTA is safe because I uninstalled it ?

Inviato dal mio Mi A1 utilizzando Tapatalk
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
As soon as mount count is higher than 0, OTA will fail. One of the first checks of OTA engine is to compute and compare hash of system partition parameters, if they don't match with expected result, OTA will fail. So even if you find problematic app and uninstall it, you need to reflash stock system.img to be able to install next OTA update.
[Xiaomi Mi A1 Guides, News, & Discussion] paolocorpo:
Thanks

As I was imagining ...

So I can't try the app ... :(

Inviato dal mio Mi A1 utilizzando Tapatalk
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
It's not a big deal, official fastboot image of 10.0.4.0 has been released, so you can reflash system.img from fastboot quickly if anything goes wrong..[emoji846]
[Xiaomi Mi A1 Guides, News, & Discussion] paolocorpo:
... without loose data ... ?

Inviato dal mio Mi A1 utilizzando Tapatalk
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
If you are asking about apps with root access, I suppose that you have root, so you must have unlocked bootloader. In such case, flashing of system.img will not cause any loss of data. Just don't relock your bootloader (don't use MiFlash).. :)
[Xiaomi Mi A1 Guides, News, & Discussion] kecrekchord:
Now, I wanna root just to enable Camera2 API for Gcam, will it change the system partition?
[Xiaomi Mi A1 Guides, News, & Discussion] paolocorpo:
You can enable Api2 wo Root

It is necessary only an unlocked bootloader

Inviato dal mio Mi A1 utilizzando Tapatalk

---------- Post added at 10:13 AM ---------- Previous post was at 10:09 AM ----------

So in your opinion the flash of stock system partition (fastboot flash system system.img) is equivalent to the official procedure suggested by magisk's developer in order to correctly manage a new OTA ?

Or it fixes only the modifications created by some apps and so it must be applied WHITH the official procedure ?

Inviato dal mio Mi A1 utilizzando Tapatalk
[Xiaomi Mi A1 Guides, News, & Discussion] _jis_:
Setprop commands you need for Camera2API and EIS for GC are changing just data partition.
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
This :) You need to reflash stock system.img only if OTA fails. You still have to follow Magisk OTA update procedure (or reflash whole ROM, apply OTA and root phone again).
[Xiaomi Mi A1 Guides, News, & Discussion] kecrekchord:
How to?. I have unlocked it. Can you guide me?

I once activated API 2 in December by rooting it first and then unrooting it by flashing the stock boot. But when there was a January OTA it failed to install.
[Xiaomi Mi A1 Guides, News, & Discussion] paolocorpo:
I am imagining that you are running Mi A1 with January patch 10.0.4.0

Download patched_boot image here:

https://drive.google.com/open?id=1wsIOmJWR8VCaJ-KA_1bZJxAOeqc-w2HL

and put it into folder of adb/fastboot relevant files

Start in fastboot mode your device

Give the comand:

fastboot boot patched_boot.img

The device will restart and it will have temporarly root

OPen a terminal emulator on device

Give the comand:

su

setprop persist.camera.HAL3.enabled 1

Restart

Your device will loose root but the API2 will be enabled

Ciao

Paolo
[Xiaomi Mi A1 Guides, News, & Discussion] malise:
When I first installed GCam (back to Oreo 8.0) I only needed to unlock oem, boot a temporary TWRP and directly from the TWRP command line i gave the "setprop ...." commands, then reboot and if you want you can lock oem. I don't know if this still work but I would give it a try. I have always done OTA updates after that and never had a problem, now I am running official Pie and GCam still works, because the activation of API2 with the setprop command is stored in the data partition, so if you don't wipe your phone it won't be erased by system updates.
[Xiaomi Mi A1 Guides, News, & Discussion] paolocorpo:
Some users have tried that procedure with out success with Pie

I have personally used the other one (Let see my previous post) with success

Inviato dal mio Mi A1 utilizzando Tapatalk
[Xiaomi Mi A1 Guides, News, & Discussion] malise:
Oh, well, I'm sorry, so just ignore my message if you alredy updated to Pie.
[Xiaomi Mi A1 Guides, News, & Discussion] kecrekchord:
Correct, i'm on January patch 10.0.4.0.

Thanks for your guides.

Regards
[Xiaomi Mi A1 Guides, News, & Discussion] kecrekchord:
Based on your knowledge, what applications can change or touch the system partition ...? Whether adaway, greenify, termux and root explore are also included, what about magisk modules, such as modules to block ads and so on?
[Xiaomi Mi A1 Guides, News, & Discussion] Parnas72:
A magisk module by definition must not modify /system, it must work systemlessly.

Adaway has two configurable modes of working, one is systemless the other one not... it depends if Magisk has "systemless hosts" module enabled and/or Adaway has the "systemless mode" enabled in settings.

About Greenify, I have no idea what it does with root access, but I don't think it would modify system files.

A root explorer might mount system read/write to allow modifications, but usually there is a flag/setting to do it. Some other apps, like a build.prop editor for instance, obviously will need to modify /system.

That really depends on the app.
[Xiaomi Mi A1 Guides, News, & Discussion] anirbannath:
Do we use this procedure after restoring stock boot image or something? I am having the same problem that some others have stated before that no method to restore the stock boot image is working. I tried flashing the system.img to my active partition from 10.0.3.0 but even after doing that and rebooting, the OTA fails to install. What am I missing?
[Xiaomi Mi A1 Guides, News, & Discussion] _mysiak_:
Boot and system images are different. System image can be restored only from factory image (or OTA extracted), boot image from either factory image or backup created during Magisk installation for example.

For you it will be easier to just flash whole factory 10.0.4.0 image (do not forget to edit the flashing script so it won't lock your bootloader). See this post-> https://xdaforums.com/mi-a1/how-to/official-pie-fastboot-link-t3888781
[Xiaomi Mi A1 Guides, News, & Discussion] essam_alasmi:
Nice
[Xiaomi Mi A1 Guides, News, & Discussion] francwalter:
I just got my A1 today, the installed system is 8.0.0 with security updates from 1. March 2018

In system I have a system update "November 2018 security update", says: Updates to Android 8.0.0

Now I don't know which patched boot image I can use to root!?

Can somebody tell me?

Thanks.

frank
[Xiaomi Mi A1 Guides, News, & Discussion] Parnas72:
First install all the system updates (the last one is January 2019, Android 9.0), then unlock the bootloader, then you can root the phone following the guides in this section.

Rooting before installing the system updates doesn't make sense, as you'll lose root when you update the system.
[Xiaomi Mi A1 Guides, News, & Discussion] francwalter:
I just want to be sure, that with the latest updates I still can root the phone and I don't find the patched boot image even for my system.

Did I understand something wrong, if I think, that I need the patched boot image for exactly my system update version? Where are they all?
[Xiaomi Mi A1 Guides, News, & Discussion] francwalter:
Where can I find patched boot.img for update from 1. March 2018 (Android 8.0.0)?

Or for the actual update from January 2019 (Android 9.0)?
[Xiaomi Mi A1 Guides, News, & Discussion] FajardoMalone:
I'm currently on Android 8 with Magisk root. The Android Pie update came, but I can't install it without rebooting. Is there any way to bypass this reboot? It seems like the update has been downloaded and it's waiting for my confirmation to install.
[Xiaomi Mi A1 Guides, News, & Discussion] GeeOctz97:
Hey guys, I'm currently on December update (Pie) and I want to update to the latest patch (January). My phone is rooted. How do I do this without wiping everything in my phone? Thank you so much
[Xiaomi Mi A1 Guides, News, & Discussion] paolocorpo:
Let use the procedure in OP

Inviato dal mio Mi A1 utilizzando Tapatalk
[Xiaomi Mi A1 Guides, News, & Discussion] GeeOctz97:
That "USE THIS GUIDE WHEN OTA ARRIVES"?

The link is dead
[Xiaomi Mi A1 Guides, News, & Discussion] francwalter:
I think it is now here: Tutorials - OTA Installation