yashsingh1/xdaforums huggingface dataset:
[General Topics] TheExcitedTech:
Tested and verified working via a Mac.

Verified the blocks of my device matches the script (Good call on double checking)

Backing up all the partitions took about 4-5 hours. (The total img folder size was roughly 120GB )But it got the job done. Longest imgs to copy were super and userdata. The all thorough dd haha

Some notes for anyone trying this. Make sure when booting to flashboot you run

adb reboot bootloader

instead of adb reboot flashboot. I was getting errors with flashing vbmeta in fastbootd, and Google saved the day.

Magisk prompted to reboot to fix some settings - I did that and it was successful and no longer giving that popup.

It's nice to be able to access my root user directory. Can't wait to setup syncthing directly with my apps!

Thanks for posting your findings and tutorial!
[General Topics] breakingspell:
Very cool success, thanks for your notes too! Hope your Syncthing solution works out, I've thought about using rclone to automate save syncing, but I just move them manually with mixplorer, don't want to overwrite a play session on my desktop by accident. Syncthing would have that covered with versioning/trash!

I'm wanting to test a general fastboot factory restore script with my 7GB image dump, minus userdata and device specific partitions, but i'm having too much fun playing games on it. At least now I can grab all my data with Neo Backup before a wipe.

If i'm correct, Magisk will try and survive an OTA by default, following into the new boot slot while vbmeta may get updated too. This will probably cause a bootloop or worse! With previous generations I've read that these devices do become paperweights with a bad flash, there is no EDL/USB restore mode or similar, only Vol+Up for recovery.

If recovery -> bootloader is still available, it can be patched and boot again, but i'm not sure what state the device could be in if boot itself is hosed or flagged as invalid (recovery is located in boot.img these days). I hear an OTA is coming fairly soon, so it will be useful to test against that and inspect the image.
[General Topics] TheExcitedTech:
Yea, I have syncthing set for simple versioning on my Android end. And I have it backing up to OneDrive and iCloud Drive. I do worry that iCloud Drive will clear the local directory on my Mac and that will sync over, but I can set it to "Receive Only" for that sync point. I have been messing with syncthing for a few days so I am still early into it.

My current workflow is to use X-Plorer to do a file sync at night between app data folders and my external SD > Sync thing is pointed to check for changes in those folders, in which case it will then sync it to my Mac and my other computer when it's on and connected to my personal network. I have syncthing disabled for any other network.

I am on the fence if I am going to have Syncthing do a direct sync of the app datat because I also do like it to be separate as a precautionary, but I am a huge fan of the relatively straightforward backup solution I have setup.

I wonder what the OTA fixes will include. I am happy with my device now, curious to see if any improvements will want me to update.
[General Topics] caitsith810:
I wonder if its worth rooting now...or to wait for the next OTA update(whenever that happens), and then root.

How would updating work over root?
[General Topics] breakingspell:
EDIT: This FAQ on reddit details the upcoming OTA for refresh rate issues (some devices running at 67hz).

https://www.reddit.com/r/retroid/comments/1aqvbtw

On that note, haven't had any vsync issues with my handheld, like screen tearing. It runs fine at 60hz!

AFAIK un-rooting is required before taking an OTA update.

This just entails flashing back the stock boot and vbmeta, then re-enabling the disabled OTA app. I don't think a data wipe/bootloader lock is necessary for OTA, but just in case back up!
[General Topics] Kylewolf:
Thank you for your guide! Think I'm going to wait until an ota comes out and see how your devices handle it, then I can't wait to root mine!
[General Topics] breakingspell:
So the new update dropped today to some fanfare (1.0.0.28). Very much worth updating, here's the changelog from the OTA app:

View attachment 6074276

As it were, the OTA does fail after just a simple unroot with no wipe (flashing back stock boot.img and vbmeta). Dug into it a little, truncated logcat shows what seems to be the reason:

W update_engine: [WARNING:verified_source_fd.cc(100)] Source hash from RAW device mismatched: found 9BADC973CCC73C4CAF6F8BC45BC575914821A69035174266D69C9BF6CB91DE64, expected 7726C269ADF6AD1B0D34AE62E8339F19A6A92058DE0B9E3FFF9F1BD089A6D1A5

E update_engine: [ERROR:utils.cc(232)] rc >= 0 failed: Bad address
E update_engine: [ERROR:extent_reader.cc(85)] utils::ReadAll( fd_, bytes + bytes_read, bytes_to_read, cur_extent_->start_block() * block_size_ + cur_extent_bytes_read_, &out_bytes_read) failed.
E update_engine: [ERROR:delta_performer.cc(199)] Failed to perform BROTLI_BSDIFF operation 745, which is the operation 0 in partition "system"
E update_engine: [ERROR:download_action.cc(227)] Error ErrorCode::kDownloadOperationExecutionError (28) in DeltaPerformer's Write method when processing the received payload -- Terminating processing

I believe it's comparing hashes against system_b and not finding what it expects? That partition should be unmodified though. Re-flashing super.img and performing a factory reset from within Recovery mode did not make a difference (same error).

What DID work, a full factory reset from Settings -> System -> Reset options. Yes unfortunate, but we can back up and restore with root apps, much less of a hassle than it could be.

I followed the OTA update over ADB logcat, and where it failed within a few minutes before the wipe, it took a good 20-30 minutes and everything matched up. Was quite relieved to see this output:

I update_engine: [INFO:delta_performer.cc(113)] Completed 5633/5659 operations (99%), 480264192/585677533 bytes downloaded (82%), overall progress 90%

Currently on 1.0.0.28, re-dumped the partitions to archive everything, now re-rooting and restoring to get back to some games. To note, I am on slot B now after the OTA!
[General Topics] TheExcitedTech:
You are a pioneer my friend. Thank you for your findings! I will be following suit this weekend and reporting back.
[General Topics] breakingspell:
Totally agreed! I'll PM a moderator and ask if they can move all posts from #33 onward to a new thread.

---

Thanks a ton for detailing your exact steps btw! Just like with mine, all update attempts failed until flashing the imgs back (including super.img) and performing the in-system reset (not recovery mode factory reset). Glad this works!

I've edited the first post I made to specify backing up super.img rather than omitting for time/space. Definitely need it.

I'll update the backup script to be more useful too: was under the impression these stock root scripts needed to be very basic line-by-line sh files, but i've seen examples from other uses that look much nicer and log to file, etc.
[General Topics] TheExcitedTech:
Yea man, you pinged me just as I finished rooting the device! Sounds like a plan. I'm thankful for backups
[General Topics] TheExcitedTech:
Hello from a new thread :D

What scripts are you referencing that looks nicer, can you link me? Also, I didn't think the script would work at all without pointing at a shell binary, but I learn something new everyday lol
[General Topics] breakingspell:
Hey yeah! User /u/BitingChaos has these scripts for a few known android-level issues/tweaks.

And same, I've never seen scripts parsed without the #! header, that's why I assumed the files were being processed line-for-line.

Been meaning to sit down and test some changes like setting the backup script to have the SD label as a single-set variable, but it's hard to tear away from playing games on the device 🤣
[General Topics] TheExcitedTech:
I edited the script to have a log and be easier to set one variable. I was thinking of finding a way to have the script auto detect the external SD identifier, but I didn't want to tackle that. Maybe in the future.

My original issue with the script not creating the directory was a syntax issue in the way I wrote it, not anything to do with permissions 😅. This script works with the proper syntax included lol

Tested on my RP4 Pro

RP4 Block Backup - Pastebin.com

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

pastebin.com
[General Topics] Kylewolf:
Just to confirm, this is replacing the file in this step, correct? If not, is someone able to reupload what it was? the link is breaking for me.

View attachment 6085028
[General Topics] TheExcitedTech:
Yea that replaces OP's script. They both backup; my edited version adds a log and only needs to replace one instance of '####-####.' If that's not working, the original should work!

Oh I see the original isn't loading for you. I PM'd you the original script so you have access to it.
[General Topics] breakingspell:
Yo! Late reply but thanks so much for the improved backup script @TheExcitedTech. Haven't had a chance to test it myself, but i'll replace the link in the OP so users are directed there.

Got a notification today from the Retroid Discord that a new OTA Update just dropped, i'll test soon using the same steps as last time.
[General Topics] TheExcitedTech:
I feel like I might hold off on this update cuz I am going to be doing a lot of traveling this month and I want to play with my RP4 on the planes! I will def try to update again when I am back home and not running around.

Let me know how that goes!

This will also give me some motivation to start looking into potentially having the script auto detect the SD card ID. I'll need something to do when I get bored of playing videogames on the flight haha.
[General Topics] breakingspell:
OTA worked again 👍

Running your backup script for a fresh dump before re-rooting and restore, but it seems to be ignoring the variables after they are set in the header. Setting absolute paths does work, but these variables should work too 🤔

The variables return properly when running in a regular sh env as a test, but they don't seem to set properly with the Retroid's .sh runner (echo $EXTERNAL_SD > file right after the assignment simply returns blank). The log file doesn't write unless specified as an absolute path as well.
[General Topics] TheExcitedTech:
Did you have to do a fresh erase, restore of super, then root? Or were you able to just update it directly from OTA app?

I tested it via ADB Shell, when I tried to do it directly in Advanced, I also didn't find success (boooo). I am going to try another method of writing the log but if it doesn't even handle variables then it's just going to be a lot of hardcoded values.

I wonder if someone has an 'official' Retroid script that they had to use. I wonder what the limitations of the shell that's on the RP4.
[General Topics] breakingspell:
I ran the full unroot: boot, vbmeta and super.img flash, and then in-rom restore before trying the OTA app, the same step-by-step in the OP.

Worked the first time, then I re-dumped, re-rooted and restored quickly after. I didn't try without the wipe, but I'm pretty sure it's required each time :(

If we can obtain a viable dump from ADB shell, that may be an even better method. I tried creating a dd dump using Termux early on, but it was rejected due to permissions, didn't consider ADB shell.

I have a feeling "official" scripts mentioned in the disclaimer are only provided in one-on-one support sessions. I did take a close look at these scripts, the only one that sets and uses a variable is grant_accessibility.sh:

It seems this variable would be stored unquoted after evaluating, like a=b, and it's used for a loop. Other vars and evals are also made in the code:

Using this exact same structure in my own test file simply does not work the same. Bummer though, i'll swap the link in the OP back to the semi hardcoded script while we work on this
[General Topics] breakingspell:
So turns out the 1.0.0.58 OTA wasn't much of an improvement, they removed the quick notification toggles I used often to swap A/B on the fly. It's been mentioned on Reddit and Discord already, so I assume another hotfix may be coming soon.

In the meantime, I threw caution to the wind and tried a full flashback of my 1.0.0.28 backup, sure enough it did work! The quick toggles are back, re-rooted and restored from SD, back in action.

The only partitions fastboot was unable to flash by name were the protected preloader partitions. As I understand those can potentially be unlocked to flash to as well using a separate fastboot command, but it was unnecessary.

I noticed that fastboot format userdata as my last step actively created a new f2fs image before flashing it, so that takes care of needing a populated userdata img in the backups.

I'm inclined to craft a fastboot-restore package using my own image dumps. I'm not entirely sure which partitions include potentially device-specific information (not to mention the a/b slot placement), so i'll examine a few existing mediatek device restore packages before determining what all it needs.

Also very tempted to reach out to Retroid either via email or Discord to see if they're keen to provide a factory recovery package (SPFlashTool). As far as I know, hosting wouldn't be a problem (AndroidFileHost) and the Retroid Pocket 2 was provided with a recovery that did allow LineageOS development, while the RP3 was ignored on the few requests made
[General Topics] HisokaRyodan:
I actually have 2 RP4P's and rooted both with this guide. Had to restore a 1.0.16 backup on one when trying to go from .28 to .58 but i believe i just had a bad dump of the super partition. Anywho, this is awesome and am so grateful for these scripts!

Does anyone know if you backup userdata and then restore it to another device if it will act as a complete backup? I know we can use things like neobackup, but i have had to readd all the file paths for daijisho (not a huge deal) but it also would be nice if i could have a userdata backup, flash boot vbmeta and super, upgrade, reroot, flash userdata to have a complete backup for upgrade!
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] caioruiz23:
Hello everyone, sorry for my terrible English, I'm using a translator to post.

Yesterday my mother's Poco F3 restarted by itself and from then on it was in bootloop.

I searched on the internet, but all the methods I found require activating the developer options to unlock the bootloader, but since I can't turn on the device, I can't do that.

Is there any option to reinstall firmware to resolve this bootloop problem?
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] jwchips:
Check damage hasn't caused a button to be stuck

You should be able to get the device into fastboot by turning it off & holding the vol down button as you connect it to your PC with a USB cable. From there you can flash official firmware.

It may also be worth mentioning how far the boot process gets before rebooting in any replies
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] caioruiz23:
I tried to reinstall the firmware using fastboot and miflash, but the error says it is blocked.

The device keeps restarting at the Poco logo. I looked at the buttons and nothing is stuck.
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] jwchips:
That's not the same problem as a bootloop ;) You can flash official firmware via fastboot with a locked bootloader.

I won't contribute further to this thread other than to recommend taking a closer look at what MiFlash is complaining about, and to try to be specific/detailed when asking for assistance with an issue.

Good luck!
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] user0u:
No, you cannot. Flashing anything from the bootloader mode requires the bootloader to be unlocked, obviously.

Coming to the problem, you might need to flash using EDL mode (unless some kind of hardware failure is causing the bootloop), but that requires either taking the phone to a service center or finding a third party who can do it remotely online.
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] MandysCandy:
Well i have kinda same problem but i have harder repairs because i have fully system destroyed. I hope you will find the solution and maybe tell us
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] CityKev:
To both the original poster and the latest one:

If you cannot find a way to fix your devices yourselves then contact @mvikrant97

He is an authorised seller on here and he can fix many devices remotely.

Xiaomi Auth Flash

Authorised from the site administration. Thanks to @V0latyle @Oswald Boelcke @willverduzco and all other admins. MESSAGE ME on XDA Forums Telegram Support Official MIUI & HyperOS Bootloader Unlock Guide Xiaomi Auth Flash Payments: PLEASE...

xdaforums.com
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] mvikrant97:
This seems to be a hardware probelm.
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] jwchips:
The 'lock' is actually a signature check.. Xiaomi's signature to be exact! Official firmware packages can be installed via fastboot/MiFlash on a locked bootloader (region etc must match, can't switch from CN/TW/EU)
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] user0u:
Nope.
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] jwchips:
Thanks for your helpful contribution, really useful info! It works for the rest of us :)
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] wakram001:
You can reflash official firmware with lock bootloader with mi assistant.

Just go to stock recovery and perform factory reset. Or flash firmware online with mi assistant.
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] zanst1234:
can you get to recovery mode? did you try factory reset there?
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] dANILo.sa:
conseguiu resolver caio? o meu poco f3 está do mesmo jeito, já tentei todas as maneiras para reinstalar a rom mas vai consigo.
[Xiaomi Poco F3 / Xiaomi Mi 11X / Redmi K40] Guilherme Silveira:
Talvez não seja o mesmo caso que o meu, eu conseguia até ir na tela de recuperação mas ele reiniciava, tava tipo em um loop de restart, resolvi clicando o botão de ligar várias vezes (clicar, não segurar) até aparecer a tela "MIUI"

/////////

Maybe it's not the same as mine, I could even get to the recovery screen but it would restart, it was like in a restart loop, I solved it by clicking the power button several times (click, don't hold) until the "MIUI" screen appeared.
[Xiaomi 14] senerex:
Frequently Asked Questions (FAQ):

1. Waiting time to unlock the bootloader

Q. If I receive the message: "unlocking can be done after 72h etc.". Is there a way to skip this waiting time?

A: Unfortunately you have to wait for that time to pass. There’s no way around it (that I know of).

2. Unlock procedure stops at 99%

Q: If my unlock procedure stops at 99%, what could be the problem?

A: Most probably you're using two different Xiaomi accounts. You have to use the same account that you have added into the device also in the unlock tool otherwise it will not work.

3. Recommended ad-blocker (for rooted devices)

Q: I want to block the advertisement in all apps, what app can you recommend?

A: If you decide to root your device, then you can install AdAway from here: https://adaway.org/. In order for AdAway to work properly please add in the Magisk App the Systemless Hosts (Magisk/Settings/Systemless Hosts).

4. Retaining the root after ROM update

Q: If I root my device as per point C or E of the AiO and I install a system update in my device, is the root still available?

A: Unfortunately root will be removed after the system update. So you have to repeat the procedure in point C or E (depending on what rom you have in your device).
[Xiaomi 14] dr4gony0shi:
A version of TWRP is available for Xiaomi 14, it has been compiled for the xiaomi.eu rom :

Recovery for Xiaomi devices - Browse /houji at SourceForge.net

List of relevant recovery in one place

sourceforge.net

You can then flash Magisk from it to root the device.The only caveat is that the data partition cannot be decrypted yet because the device has additional security measures and TWRP isn't updated to support those :

Twrp Recovery

thespacecat Possible problems: - Faulty or missing drivers - bad USB cable - wrong USB port (try USB 2.0 or USB-HUB) After connecting the device in fastboot mode to the PC, do you see this information in the "PC Device Manager"?

xiaomi.eu
[Xiaomi 14] dinosix9:
Thanks for the guide - I can confirm it works well as described... after 72h, it unlocked my bootloader and then I continued the same as in Xiaomi 13 guide (patching init_boot.img only and using Magisk)... I have root access now. Bought my Xiaomi in central Europe with image 1.0.14.0.UNCEUXM, no issues - except the usual banking apps problems after 😅
[Xiaomi 14] Sp8ky:
Is it even worth rooting anymore?

We have revanced now for YouTube, and you can use nextdns for adblock.

Only thing I'm missing is call recorder
[Xiaomi 14] dinosix9:
Well, i think when I buy a product, I should be able to use it any way I want as far as I am not endangering anyone.

The main benefits from my perspective are blocking in-app adds, taking screenshots where/when forbidden and using app mods... Those things are more important to me than not having a working McDonalds' app haha

Anyway, sorry, I would elaborate more but i don't think it's part of this thread :) I have provided some notes to senerex, so i assume he will finish the full guide in the near future
[Xiaomi 14] jekiDlemot:
So, if I bought the China version, this thing won't work and I'm stuck with notification issue.... Did I get the first paragraph right?
[Xiaomi 14] NOSS8:
Yep, you must use a third-party paying service.
[Xiaomi 14] jekiDlemot:
Let's say I did just that and the bootloader unlocked, would I be able to proceed and do the rest eu.rom, root, twrp and stuff...?

I asked the ncunluck guy and I don't know why it's 80 now ffs..
[Xiaomi 14] NOSS8:
You can do whatever you want as long as you don't re-lock the bootloader.

This guy is taking advantage of the demand to increase prices, there are cheaper ones doing research.
[Xiaomi 14] bamn:
Is there an easy way to keep full widevine support with root on this device?

This is needed to play Netflix in HD/HDR.
[Xiaomi 14] nmbte:
does it mean i can start on porting lineageos 21 on it?
[Xiaomi 14] dr4gony0shi:
I still have widevine L1 on xiaomi.eu with Magisk installed.
[Xiaomi 14] nmbte:
i have a possibly related question: is it possible to use gesture based navigation with a non-stock home app? Is there anyone who uses lineage os treble image? Any other lineageos/custom rom builds?

If i understand it correctly - the 30 day unlock wait limit is made so the device will not be unlocked during trial run. But the only reason i would keep my device past trial period is custom rom. I want to know if there will be any major issues ahead if i will start developing on this device. Anyone has any experiences? I do not like the hyperos usability but i love the hardware.
[Xiaomi 14] Sduby:
i am using treble build of pixelOS / crDroid. Fingerprint and auto brightness doesnt work, other things run fine.
[Xiaomi 14] nmbte:
Does the Google wallet work? Treble builds don't have everything you need as they are not really made for this hardware and are being sideloaded on top of the current distro. Also all unrooted Los have integrity issues that needs to be fixed with magisk modules.

Native Los is without your problems but suffers from integrity play services check and cts checks. So yeah.. kind of expected. Also how about the battery life?
[Xiaomi 14] user2332:
Hi!

I haven't tried it yet! I DON'T know if it works or not!

Has anyone here already loaded a kernel on the model?

I am interested in information.

I don't know how it works, I haven't tried it!

Only if you understand what needs to be done, try it at your own risk!

Link: https://github.com/tiann/KernelSU/releases/tag/v0.9.0

For example:

android14-6.1.25_2023-10-boot.img.gz

AnyKernel3-android14-6.1.25_2023-10 (kernelsu?)