Need some help setting up my SP - Xperia SP Q&A, Help & Troubleshooting

I have bought a new SP, and gave my last one to my wife, so I have a chance to start fresh.
I can't stand the bloating on the phone, and would like a light, fast lollipop ROM on it that still lets me use Sony's photo apps if possible. This one seems right for me (http://forum.xda-developers.com/xperia-sp/development/rom-cyanogenmod-12-1-sabermod-t3219230).
The problem I am experiencing is that when I go to various builds, I am having trouble understanding the instructions, and how to do what they are asking. I understand that I need to break the bootloader first, and then do something after that, and then install drivers, etc.. but I feel like a bit of an idiot because I just don't get it.
The instructions for one that I was thinking of putting on reads as follows :
* place the phone in fastboot mode, and flash the boot.img from the latest build: sudo fastboot flash boot boot.img
* enter Cyanogen Recovery
* flash the TWRP zip you downloaded via Cyanogen Recovery.
* shutdown and reboot into TWRP recovery.
* wipe/format /system /data /cache /dalvik.
* flash latest available build, and flash gapps.
* reboot and you're done.
Questions
- How do I flash the boot.img from the latest build? What is boot.img? What does "sudo fastboot flash boot boot.img " mean?
- How do I enter Cyanogen Recovery? What is it? Where do I get it?
- How do I flash the TWRP zip?
I could go on. I really need a step by step guide, or some systematic way to educate myself.
Can you suggest a ROM with a step by step guide, or one with a youtube video showing how it is done (walkthrough) or similar?

http://forum.xda-developers.com/showthread.php?t=2888579
Use this Guide to understand about Custom ROMs, Bootloaders, Flashing ROMs, Kernel and Recovery. Specific to Xperia SP.
Take your time to read, if didn't understand something, search for it on Google, you'll understand things
There are many more generic device Guides, but this Guide is Specifically for our Device.
Once you read the guide, then you'll understand the Instructions given in any ROM thread.
Sent from my Q1010i using Tapatalk

make backup of drm partition, unlock bootloader then start flashing roms

Related

[Q] (Simple) question about TWRP/2nd bootloader flashing

Having come close to hard bricking my device once already, I want to check some things before I attempt custom ROM installation.
I'm on 7.4.9, (rooted and with a factory cable to hand). The instructions for installing TWRP say to install "kfhd7-u-boot-prod-7.2.3" which I understand is the bootloader for OS 7.2.3 which is used because the later OS bootloaders were locked.
Now, if I flash that bootloader, and install TWRP, I can go on to flash a custom ROM. But if I just install TWRP for now, will the device still work with an 7.2.3 bootloader and the other images from 7.4.9 ? (or if I wish to continue with the stock ROM do I have to downgrade all images to 7.2.3?)
Also, are the checksums for the various stock images and files required to install TWRP around anywhere? Understandably, I'd like to verify them before starting.
thanks guys
cecr said:
Having come close to hard bricking my device once already, I want to check some things before I attempt custom ROM installation.
I'm on 7.4.9, (rooted and with a factory cable to hand). The instructions for installing TWRP say to install "kfhd7-u-boot-prod-7.2.3" which I understand is the bootloader for OS 7.2.3 which is used because the later OS bootloaders were locked.
Now, if I flash that bootloader, and install TWRP, I can go on to flash a custom ROM. But if I just install TWRP for now, will the device still work with an 7.2.3 bootloader and the other images from 7.4.9 ? (or if I wish to continue with the stock ROM do I have to downgrade all images to 7.2.3?)
Also, are the checksums for the various stock images and files required to install TWRP around anywhere? Understandably, I'd like to verify them before starting.
thanks guys
Click to expand...
Click to collapse
I would recommend you to keep a ROM and GApps zips on the sdcard,because we don't really know what evil Amazon has put into their latest update. So installing a second bootloader and TWRP might give you a bootloop. So keep a ROM so that you can flash it if you have a bootloop.
thanks for your reply but I'm still in the dark.
what I really need to know is if I flash a bootloader from a different OS version, without TWRP etc, ie a straight swap of bootloaders, will the device still work normally? I don't want to try anything until I know I will be able to get out of trouble and have a functioning device.
I appreciate your advice to put a ROM and GApps on the sdcard, but what ROM? Stock? Do you mean the bin file or 3 images?
Or do you mean CM11 or similar?
Installing CM11 is my goal, but having run into trouble the first time after installing TWRP I want to reduce risks as much as possible. My intention is to install TWRP first, then make a backup of the stock ROM so I can go back to that if needbe, then to install CM11 and give that a go. The only thing stopping me is that the first time I tried, after installing TWRP I couldn't boot up the stock ROM, and I don't know why it happened.
Would I be better off downgrading to 7.4.6/7.4.8 before doing anything else? I assume I'll lose all my apps and settings if I do that?
In any case, I'd like to verify the checksums of any file I download to be on the safe side, but haven't seen a comprehensive list of files/images and checksums. Where can I get that info?
cecr said:
thanks for your reply but I'm still in the dark.
what I really need to know is if I flash a bootloader from a different OS version, without TWRP etc, ie a straight swap of bootloaders, will the device still work normally? I don't want to try anything until I know I will be able to get out of trouble and have a functioning device.
I appreciate your advice to put a ROM and GApps on the sdcard, but what ROM? Stock? Do you mean the bin file or 3 images?
Or do you mean CM11 or similar?
Installing CM11 is my goal, but having run into trouble the first time after installing TWRP I want to reduce risks as much as possible. My intention is to install TWRP first, then make a backup of the stock ROM so I can go back to that if needbe, then to install CM11 and give that a go. The only thing stopping me is that the first time I tried, after installing TWRP I couldn't boot up the stock ROM, and I don't know why it happened.
Would I be better off downgrading to 7.4.6/7.4.8 before doing anything else? I assume I'll lose all my apps and settings if I do that?
In any case, I'd like to verify the checksums of any file I download to be on the safe side, but haven't seen a comprehensive list of files/images and checksums. Where can I get that info?
Click to expand...
Click to collapse
I meant the zip files,not the images or binaries. And a custom ROM is recommended.
As for your concern,I suggest you to make image backups of the system,boot and recovery partitions,not a nandroid backup via TWRP.
If you install a 2nd bootloader+TWRP on 7.4.9,there's a high chance that it'll bootloop. So there's no point in making a nandroid of a system that bootloops. But by flashing the backup images that I told you to make,you'll go completely stock,no risk.
And if you want to automate the process,use FireFlash by stanga72 or my Flasher. There's a good chance of them working since they both worked on 7.4.6 and 7.4.8

Bootable(only) TWRP development

Our phone needs a bootable only TWRP, this is a fact.
This is because of the a/b partitioning but, more, since of the "new" recovery-in-boot.IMG design which links kernel & recovery presence in an unwanted way...
And a bootable TWRP is the "official solution" developed by TWRP Team for Pixel 2/2 XL - the more similar device up to date - to overcome this issue in better way. I fully agree with their solution and I had thought of it even before of their official release...
A LOT of development has been done on this phone during only last month, better installable TWRP, better kernels, better installation methods developed for them, both for first install and for upgrade too, BUT the lack of a boot-only TWRP, something easily (& ever...) accessible with a simple fastboot boot twrpboot.img command is every day more evident...
For some reasons this has been achieved (even if still with limitations...) on Pixels (with available sources obviously...) but, to date, not for our device...
I would like this thread will become the reference thread to all which would want to contribute on this development, a place to report achieved results and faced issues so that others could try to help & overcome them...
We still have a restricted team of developers, but most of them are *great* on their work... I'm sure that only with a bit more teamed up work, this is a result we could achieve in weeks... probably before Christmas!
So, just to start, everyone which has tried to develop (or study...) this, could report what type of issues has faced to date...
I will still have twrp on my boot image. When I was testing kernels without twrp and I got a horrid kernel panic, stock recovery just wiped the device rebooted, wiped, repeat. When I had a bad kernel panic alpha testing on twrp, it would just boot to twrp in tact then I could flash the old kernel. If everything was too messed up, just reflash twrp. All kernels I have made besides the ones that gave those issues work perfect in twrp. Even the ones where bogoMIPS freq was used instead of our frequencies. (38.0 MHz). I like the idea of not having to hook my device up to a computer to boot into recovery.
Uzephi said:
I will still have twrp on my boot image. When I was testing kernels without twrp and I got a horrid kernel panic, stock recovery just wiped the device rebooted, wiped, repeat. When I had a bad kernel panic alpha testing on twrp, it would just boot to twrp in tact then I could flash the old kernel. If everything was too messed up, just reflash twrp. All kernels I have made besides the ones that gave those issues work perfect in twrp. Even the ones where bogoMIPS freq was used instead of our frequencies. (38.0 MHz). I like the idea of not having to hook my device up to a computer to boot into recovery.
Click to expand...
Click to collapse
Yes, I understand this, BUT there are a lot of other scenarios where having a bootable TWRP could save the day and/or at least make things simpler....
On the other hand, you are the first developer I know who is quite ever going without root!
(So you can't be taken as the "average user"... )
enetec said:
Yes, I understand this, BUT there are a lot of other scenarios where having a bootable TWRP could save the day and/or at least make things simpler....
On the other hand, you are the first developer I know who is quite ever going without root!
(So you can't be taken as the "average user"... )
Click to expand...
Click to collapse
I am confused...(I am I am long time enthusiast, pls forgive my naivety!)
I can reboot into twrp without issue using current method in this forum. Is "bootable twrp" referencing where / how twrp is implemented on this device? What are we missing as users and fans of all the great room devs out there by using our current method?
Ty for any insights in advance.
3's&7's said:
I am confused...(I am I am long time enthusiast, pls forgive my naivety!)
I can reboot into twrp without issue using current method in this forum. Is "bootable twrp" referencing where / how twrp is implemented on this device? What are we missing as users and fans of all the great room devs out there by using our current method?
Ty for any insights in advance.
Click to expand...
Click to collapse
The bootable refers to the command fastboot boot boot_a your-filename.img or fastboot boot boot_b your-filename.img . For the Moto Z2 Force, it has to be compiled differently than a boot image intended to be flashed as with the command fastboot flash boot_a your-filename.img , or fastboot flash boot_b your-filename.img . The reason it now has to be compiled differently is that our boot image is combined with recovery. If you try to fastboot boot a fastboot flash type, it would boot normally into Android OS--if all went OK. If you fastboot flash flashed a fastboot boot type, the device would boot into recovery instead of normal Android OS. Both fastboot boot and normal boot result in the kernel and ramdisk being written to RAM--to volatile memory; the difference is whether the data originally came from the device's non-volatile storage or external PC via USB-C cable.
Alternatively, there are two main forms of zip installers for a combined boot image, which are intended to be flashed inside TWRP or an apk like FlashFire (FlashFire does not play nice with already Magisk rooted Z2 Force, in my experience): a zip flash that flashes the entire boot.img (ramdisk + kernel), or a zip flash that only replaces half of the boot image (the ramdisk). For combined boot images, the ramdisk-only type that does not replace kernel is the more common of the two flash zip types on the site TWRP.me . In fact, I have never seen an official installer that also replaced boot image kernel on the official site.
As mentioned above, the fastboot boot type is not meant to be fastboot flash flashed; rather, it is primarily meant to be a platform utilized to flash the TWRP zip installer. You will see some devices on TWRP.me that have both fastboot boot type and zip flash type, and the aforementioned technique is why both are provided. Take a look at Pixel 2 XL (codenamed Taimen) on TWRP.me, and you'll see this method supported.
@jhofseth .... I could never explain it in a better way! :silly::good:
To come back IT... @jhofseth I know you have studied a lot this thing in these weeks, so I have a question for you...
If you take a boot.img containing a TWRP recovery like one we already have, and try a fastboot boot TWRP.IMG it should boot to its included kernel and then to system (if possible...), right?
This way we can test a new kernel without flashing it but it isn't our goal...
Well, when already flashed on phone we can choose between reboot to kernel/system or TWRP by adb commands or by extensions like Gravity Box...
Is it so hard/possible/thinkable to modify one of our boot.img so that it is in some way "forced" to boot to its TWRP in any case?
(and so even when loaded with a fastboot boot command...)
enetec said:
To come back IT... @jhofseth I know you have studied a lot this thing in these weeks, so I have a question for you...
If you take a boot.img containing a TWRP recovery like one we already have, and try a fastboot boot TWRP.IMG it should boot to its included kernel and then to system (if possible...), right?
This way we can test a new kernel without flashing it but it isn't our goal...
Well, when already flashed on phone we can choose between reboot to kernel/system or TWRP by adb commands or by extensions like Gravity Box...
Is it so hard/possible/thinkable to modify one of our boot.img so that it is in some way "forced" to boot to its TWRP in any case?
(and so even when loaded with a fastboot boot command...)
Click to expand...
Click to collapse
I would work on this if someone explains in detail why our current setup is an issue. I have ran into plenty of kernel issues when building bad kernels and twrp as recovery was better than stock recovery (as stated above). Please, I want this if there is a real reason for it. Our stock recovery just factory resets the device, so a recovery with other options is kinda nice.
Temp booting a kernel: use AIK and inject kernel into a boot image.
New TWRP update, just flash the boot image (which might have new boot image as well) and just reflash kernel. It is better than needing to hook the phone up to a PC every time you want to boot TWRP...
enetec said:
To come back IT... @jhofseth I know you have studied a lot this thing in these weeks, so I have a question for you...
If you take a boot.img containing a TWRP recovery like one we already have, and try a fastboot boot TWRP.IMG it should boot to its included kernel and then to system (if possible...), right?
This way we can test a new kernel without flashing it but it isn't our goal...
Well, when already flashed on phone we can choose between reboot to kernel/system or TWRP by adb commands or by extensions like Gravity Box...
Is it so hard/possible/thinkable to modify one of our boot.img so that it is in some way "forced" to boot to its TWRP in any case?
(and so even when loaded with a fastboot boot command...)
Click to expand...
Click to collapse
Yeah, that is one way to test, but sometimes that will fail even when the kernel works. For example, sometimes if you fastboot flash, sometimes you also have to flash latest Magisk again right away in TWRP, or it won't boot into Android OS. That would be impossible with fastboot boot (i.e., unless you patched boot image first with Magisk manager apk, or some other tool), because you would be unable to flash latest Magisk (or SuperSU 2.82 beta SR5). So, sometimes fastboot boot would fail to normally boot into Android OS--even though the kernel may be completely OK.
Uzephi said:
I would work on this if someone explains in detail why our current setup is an issue. I have ran into plenty of kernel issues when building bad kernels and twrp as recovery was better than stock recovery (as stated above). Please, I want this if there is a real reason for it. Our stock recovery just factory resets the device, so a recovery with other options is kinda nice.
Click to expand...
Click to collapse
There are plenty of scenarios where a bootable TWRP could be hassle saving / needed BUT you ask for a single one and I'll give you one... Or two! :laugh:
I want to be free to install the kernel I want with TWRP version I want.
Now this is not possible (if not with weird/tricking installations! ).
E.g.: let's imagine to want to install latest *stock* kernel with latest TWRP.
I have kernel, I have TWRP flashable zips ( @jhofseth made some which are fantastic...) BUT no (simple) way to merge them.
More: as you like to have tweaked kernel BUT without root, there is plenty of people who like to not have TWRP flashed on their systems BUT still being able to make backups and/or flash zips... (e.g. we have already seen some incompatibility between CF-Root and TWRP in past...) and/or remain free to take OTAs... & so on...
I could continue for hours, but these are already valid reasons IMHO...
Pixel 2 developers are not stupid... they have choosed this solution for valid reasons...
enetec said:
There are plenty of scenarios where a bootable TWRP could be hassle saving / needed BUT you ask for a single one and I'll give you one... Or two! :laugh:
I want to be free to install the kernel I want with TWRP version I want.
Now this is not possible (if not with weird/tricking installations! ).
E.g.: let's imagine to want to install latest *stock* kernel with latest TWRP.
I have kernel, I have TWRP flashable zips (@jhofseth made some which are fantastic...) BUT no (simple) way to merge them.
More: as you like to have tweaked kernel BUT without root, there is plenty of people who like to not have TWRP flashed on their systems BUT still being able to make backups and/or flash zips... (e.g. we have already seen some incompatibility between CF-Root and TWRP in past...) and/or remain free to take OTAs... & so on...
I could continue for hours, but these are already valid reasons IMHO...
Pixel 2 developers are not stupid... they have choosed this solution for valid reasons...
Click to expand...
Click to collapse
Answer (I have done this before I flashed TWRP and it worked wonders): root a boot image, go into system, adb shell, su, dd if=/dev/block/sde17(sdf17 for slot B) of=/sdcard/boot.img You now have a rooted bootable image, return to stock image. now you can use Flash Fire to make backups and flash stuff....
You can flash any kernel to TWRP. you want the stock kernel to flash? I can make a flashable zip with the stock kernel by Motorola if needed. It isn't hard tbh...
jhofseth said:
Yeah, that is one way to test, but sometimes that will fail even when the kernel works. For example, sometimes if you fastboot flash, sometimes you also have to flash latest Magisk again right away in TWRP, or it won't boot into Android OS. That would be impossible with fastboot boot, because you would be unable to flash latest Magisk (or SuperSU 2.82 beta SR5).
Click to expand...
Click to collapse
Why do you think a "booted" TWRP wouldn't be able to correctly flash zips?
I don't see reasons for this...
jhofseth said:
...
So, sometimes fastboot boot would fail to normally boot into Android OS--even though the kernel may be completely OK.
Click to expand...
Click to collapse
In fact I wrote "if possible"... BUT anyway this is of no interest. We *only* need to boot to TWRP, we are not interested in boot to an "unflashed kernel" if you understand what I mean...
We have only to force it to boot *ever* in TWRP. Kernel parts not used by TWRP (if some are needed on our phone, like some Mediatek devices need...) could be omitted at all (as done on bootable TWRP for Pixels2 if I don't go wrong...).
Uzephi said:
Answer (I have done this before I flashed TWRP and it worked wonders): root a boot image, go into system, adb shell, su, dd if=/dev/block/sde17(sdf17 for slot B) of=/sdcard/boot.img You now have a rooted bootable image, return to stock image. now you can use Flash Fire to make backups and flash stuff....
You can flash any kernel to TWRP. you want the stock kernel to flash? I can make a flashable zip with the stock kernel by Motorola if needed. It isn't hard tbh...
Click to expand...
Click to collapse
This are exactly the *weird/tricking* solutions I was talkin'about...
(Edit: let me add I don't like this a bit... Root how? Command could be mistyped & flashfire for backups is an orrible & unsafe solution... Just imagine do all this with valuable data in danger... )
All is possible. BUT these are NOT solutions for average user. And every single one requires a different solution/set of commands.
This is not for average user. I repeat it.
You & @johfseth are *NOT* average users... you are fu**ing good developers* and can't evaluate all scenarios with your (advanced) skills & capabilities...
enetec said:
All is possible. BUT these are NOT solutions for average user. And every single one requires a different solution/set of commands.
Click to expand...
Click to collapse
I have offered to give a bootable rooted image to other people in my kernel thread. The thing is, if ANYTHING is edited, OTA won't work, so bootable TWRP won't be feasible, unless you just backup your system and not edit anything.
If the average user can't follow a dd if/of command, would you want them to have to "fastboot boot (image)?" they might flash it, then their boot image needs to be flashed back or it won't boot. There are downsides for bootable TWRP as well. Because we don't know the decryption keys, you still have to wipe data. If you don't decrypt with the zip or SU, you can't update, etc. Decrypting modifies system which in turn makes you not able to get OTAs. It's a vicious cycle. The keys as per DeesTroy change with each boot image, so we would have to make a TWRP that has all keys, then comes to what devices do we support. Currently, the two who are actively developing and have worked on TWRP or assisted with it's boot kernel have only two devices, Sprint and T-Mobile. We wouldn't be able to debug any other model for it's decryption key.
To reiterate: to have working bootable TWRP with all the idiosyncracies you are asking for, we'd have to go through the java code like DeesTroy did and get it working. I am not fluent in java. I can make a bootable TWRP, but you'll have to be decrypted, because I know C and Python which is what kernels and most ROMs use. I don't know much about Java to find the decryption keys for each device.
Edit: for easy analogy: let's say computer languages are like human languages. I know two languages that are anglo-saxan in heritage, but you are asking me to read something latin based. I might know some things in it, but it's all greek to me still... XD
Edit 2: Looking at the TWRP for Pixel 2, the only reason they have a bootable image is to flash TWRP to both boots per their OP. It wasn't suggested to temp boot it for flashing purposes or backup purposes. It was implemented to have it in both boot partitions per the TWRP OP linked here
enetec said:
Why do you think a "booted" TWRP wouldn't be able to correctly flash zips?
I don't see reasons for this...
In fact I wrote "if possible"... BUT anyway this is of no interest. We *only* need to boot to TWRP, we are not interested in boot to an "unflashed kernel" if you understand what I mean...
We have only to force it to boot *ever* in TWRP. Kernel parts not used by TWRP (if some are needed on our phone, like some Mediatek devices need...) could be omitted at all (as done on bootable TWRP for Pixels2 if I don't go wrong...).
Click to expand...
Click to collapse
I understand, I was mainly referring to fastboot stuff, not within TWRP. Any within TWRP stuff was related to Magisk, not the inability of TWRP to flash once TWRP was loaded, but the importance of re-flashing Magisk and the consequences of not re-flashing Magisk. It was really just centered on the importance of re-flashing Magisk. Anything related to kernels stemmed from someone's question about testing kernels. Just minor stuff, but someone asked.
Uzephi said:
...
Edit 2: Looking at the TWRP for Pixel 2, the only reason they have a bootable image is to flash TWRP to both boots per their OP. It wasn't suggested to temp boot it for flashing purposes or backup purposes. It was implemented to have it in both boot partitions per the TWRP OP linked here
Click to expand...
Click to collapse
And this is *ALL* we need IMHO!!!
Is this doable in your (or others...) opinion?
EDIT: and anyway it probably will work fine to flash something and/or to fully backup a system *including* stock boot.img highfive & only excluding encrypted /data (the same encrypted /data our flashed TWRP is unable to manage too... so, what's the point on it? )
Anyway, we are really going OT here... this is not "Could a bootable TWRP be useful?" thread (it's *obvious* it is... ) this is a "What are the issues we have to face & fix to get a working bootable TWRP?" …
So my questions are basically two:
- is there a method to modify (read: force...) a boot.img with TWRP inside like ones we already have so that it boots to TWRP and not to system?
- can Pixels2/2XL bootable-only official TWRP (sources should be available...) be modified to make it work on our (similar...) device?
I would like to keep OTA (at least until there is a lineage os) and must encrypt my z2. Will the bootable TWRP decrypt the system password and allow backup? If I go with a modified boot.img with TWRP, then can I get OTA updates? or must I wait until someone modifies the OTA boot and publishes it? Can I keep one partition with the OTA and the other with a custom rom image?
kendallgreen said:
I would like to keep OTA (at least until there is a lineage os) and must encrypt my z2. Will the bootable TWRP decrypt the system password and allow backup? If I go with a modified boot.img with TWRP, then can I get OTA updates? or must I wait until someone modifies the OTA boot and publishes it? Can I keep one partition with the OTA and the other with a custom rom image?
Click to expand...
Click to collapse
To get OTA, both slots have to have an unmodified boot image, oem image and system. If anything got modified, OTA will fail
Just to link some very useful info(s) posted elsewhere...
https://forum.xda-developers.com/showpost.php?p=74665682&postcount=347
https://forum.xda-developers.com/showpost.php?p=74667790&postcount=350

How to reset firmware

so i've tried a few roms, and couldn't get gpay working. im going to try a few things mentioned in other threads, but before i start that. i want to properly/fully reset my phone to the stock, to hopefully make sure i don't mess anything up in the future.
my first issue was installing twrp, i tried to `fastboot flash` the recovery, but nothing worked until i followed these steps: https://www.getdroidtips.com/download-and-install-twrp-recovery-for-redmi-k20-pro-latest/
im worried about what might be in the misc.bin in that zip. cuz i couldn't reboot into twrp recovery until i flashed that. does anyone know what that is? i think i just want to flash/reset? everything on my phone back to miui, make sure i update to the latest firmware etc. but, tbh, i find navigating xda difficult and can't seem to find the official firmware anywhere, or steps on how to reset the phone...
thanks for any help
Um, i think ur in the wrong category
thejacer87 said:
my first issue was installing twrp, i tried to `fastboot flash` the recovery, but nothing worked until i followed these steps ...
im worried about what might be in the misc.bin in that zip. cuz i couldn't reboot into twrp recovery until i flashed that. does anyone know what that is?
Click to expand...
Click to collapse
The misc.bin file is basically just a script that tells the Device to directly boot into TWRP, because Xiaomi Devices / MIUI are configured to overwrite TWRP after a reboot. If you still feel uncomfortable having to flash the misc file, try "fastboot *BOOT* TWRP.img" instead of "fastboot *FLASH* TWRP.img".
If you wish to keep MIUI installed instead of an Custom ROM make sure to flash Magisk, as it patches the DM-Verity stuff that causes the Device to either get stuck in a Bootloop or replace TWRP with the Stock Recovery.
If you're planning to run an Custom ROM like LineageOS, AOSiP etc. you don't have to flash Magisk as long as your Device isn't encrypted. Rebooting from TWRP to System without flashing Magisk on an encrypted Device will encrypt your Data Partition and you'll have to format Data to be able to access the Internal Storage again. (Flashing Magisk in that case will prevent your Device from encrypting all your Data again after an ROM Flash.)
Fatal_Scythe said:
The misc.bin file is basically just a script that tells the Device to directly boot into TWRP, because Xiaomi Devices / MIUI are configured to overwrite TWRP after a reboot. If you still feel uncomfortable having to flash the misc file, try "fastboot *BOOT* TWRP.img" instead of "fastboot *FLASH* TWRP.img".
If you wish to keep MIUI installed instead of an Custom ROM make sure to flash Magisk, as it patches the DM-Verity stuff that causes the Device to either get stuck in a Bootloop or replace TWRP with the Stock Recovery.
If you're planning to run an Custom ROM like LineageOS, AOSiP etc. you don't have to flash Magisk as long as your Device isn't encrypted. Rebooting from TWRP to System without flashing Magisk on an encrypted Device will encrypt your Data Partition and you'll have to format Data to be able to access the Internal Storage again. (Flashing Magisk in that case will prevent your Device from encrypting all your Data again after an ROM Flash.)
Click to expand...
Click to collapse
k thanks for the info. what's the difference b/w the boot v flash for twrp?
is the misc.bin from that link i posted safe then? where did it come from? is there a thread here where files like that are posted/talked about?
i definitely plan to stick with either lineage or Pixel experience. i just want to get google pay going. so i think my next attempt will be to relflash magisk and look into that sql fix everyone mentions
thejacer87 said:
so i've tried a few roms, and couldn't get gpay working. im going to try a few things mentioned in other threads, but before i start that. i want to properly/fully reset my phone to the stock, to hopefully make sure i don't mess anything up in the future.
my first issue was installing twrp, i tried to `fastboot flash` the recovery, but nothing worked until i followed these steps: https://www.getdroidtips.com/download-and-install-twrp-recovery-for-redmi-k20-pro-latest/
im worried about what might be in the misc.bin in that zip. cuz i couldn't reboot into twrp recovery until i flashed that. does anyone know what that is? i think i just want to flash/reset? everything on my phone back to miui, make sure i update to the latest firmware etc. but, tbh, i find navigating xda difficult and can't seem to find the official firmware anywhere, or steps on how to reset the phone...
thanks for any help
Click to expand...
Click to collapse
If you're planning to go back to stock MIUI and locked bootloader, I highly recommend using Mi Flash and flashing the original fastboot MIUI ROM which can be found here https://www.xda-developers.com/download-miui-11-xiaomi-redmi-note-7-pro-poco-f1/amp/. All you gotta to do is extract the ROM file which is .tgz to any folder, and in Mi Flash select that folder click on "clean all and lock" in the bottom right corner, and click flash. This should theoretically make your device "out of the box".
Keep in mind that this method requires a PC with all ADB and fastboot drivers, they can be downloaded from here https://forum.xda-developers.com/showthread.php?t=2588979 .
thejacer87 said:
k thanks for the info. what's the difference b/w the boot v flash for twrp?
is the misc.bin from that link i posted safe then? where did it come from? is there a thread here where files like that are posted/talked about?
i definitely plan to stick with either lineage or Pixel experience. i just want to get google pay going. so i think my next attempt will be to relflash magisk and look into that sql fix everyone mentions
Click to expand...
Click to collapse
BOOT will just let the Device temporarily boot into the Recovery (without making changes to the Recovery Partition) FLASH will write the Recovery Image to the Recovery Partition so you can boot to it whenever you want / need to.
I don't know if there's any kind of threads where certain files are talked about sorry, but I could be wrong though.
I don't know much about G Pay, I was gonna try it too but my Bank doesn't support it. I've seen quite a few people reporting success in getting it to work / making payments with it in local stores with the mentioned SQL Fix so if you're lucky it'll work for you too
Fatal_Scythe said:
BOOT will just let the Device temporarily boot into the Recovery (without making changes to the Recovery Partition) FLASH will write the Recovery Image to the Recovery Partition so you can boot to it whenever you want / need to.
I don't know if there's any kind of threads where certain files are talked about sorry, but I could be wrong though.
I don't know much about G Pay, I was gonna try it too but my Bank doesn't support it. I've seen quite a few people reporting success in getting it to work / making payments with it in local stores with the mentioned SQL Fix so if you're lucky it'll work for you too
Click to expand...
Click to collapse
just got gpay to work with the sql fix. thanks for the help

Does anyone hava a guide to installing custom rom on MI 9 2020?

Hi,
I bought a new phone and thought I would get in to custom ROMs again. Mostly to get rid of bloatware. However, after following multiple guides I'm still no where closer to achieving my goals. The phone is a MI 9.
I found there's a lot of different steps depending on guide but most of the once I've tried does the following:
* Unlock bootloader, working
* Installing twrp via fastboot, working
* Deleting data in twrp, working
* Transfering a rom.zip file (depending on rom), working via usb cable
* Some guides recommends to install disable force Encryption via another zip file transferred from the computer, however, that seems to not be necessary, tried i few times
* Installing rom via twrp, seems to work
* In some guides you then need to remove cache, working
* Rebooting from twrp, working
After these steps I find myself in one of three different cases,
1. Phone is stuck in fastboot, have to reflash it with MIflash and global MIUI rom to get phone to work again
2. Phone in boot loop, logo shows up, phone waits for awhile, phone reboots, logo shows up
3. Phone boots up, logo is shown, phone reboots into twrp
I've also tried both XiaoMiTool and XiaoMiTool V2,
XiaoMiTool seems to write the global ROM to the phone whatever I choose (Have tried Xiaomi.eu and LineageOS 17)
XiaoMiTool V2, fails in second to last step, it wants to remove some cache before the installation in twrp is done.
Things I've not tried:
* Moving file to twrp with adb instead, should not make a difference
* Installing magisk
Now, I'm a bit afraid my phone will get hard bricked, have reinstalled the OS 20 times the last day to test different approaches and steps. Nothing seem to work. Does anyone have a proven method working in 2020?
Another way to go might be to just get rid of the commercials, run a different launcher to get app list and get rid of the bloatware. This is not really what I want but I can live with it.
As you can hear I'm about to just throw in the towel and give up. But I've heard a lot good about the xda forums so I thought it might be worth a try even though I do understand if no one has time or energy to help out a newbie.
Help please!
Edit: I do realize I've accidentally put this under Guides and not Q&A. I find no way of moving it nor deleting the thread so I guess some moderator will have to come help. Sorry for this.
Do you use latest TWRP for Mi9? TWRP from Mauronofrio works fine for me.
When you say "Deleting data in twrp", does this mean you did Format Data (confirm by typing "yes")? Or just wipe?
Poslano z mojega MI 9 z uporabo Tapatalk
mxxt01 is right. You have to format the data partition or else you will run into a bootloop.
I followed the guide here but I did not flash magisk since I don't need root.
Basically what I did was;
1. Unlock bootloader
2. Reboot to load the OS but skip the initial setup
3. Reboot to fastboot/bootloader
4. Flash TWRP (use the latest beta from Mauronofrio)
5. Immediatly press Vol Up + Power button to boot TWRP
6. Sideload the firmware to /tmp/
7. Format the data partition and type yes to continue
8. Factory reset
9. Flash firmware from within TWRP
10. Factory reset again (you can skip this if you don't want to)
11. Reboot
And that is how I did it.
mxxt01 said:
Do you use latest TWRP for Mi9? TWRP from Mauronofrio works fine for me.
When you say "Deleting data in twrp", does this mean you did Format Data (confirm by typing "yes")? Or just wipe?
Poslano z mojega MI 9 z uporabo Tapatalk
Click to expand...
Click to collapse
I have tried both Formatting data, this generally makes all folders have gibberish names and by going to advanced wipe, choosing data, some guides also wants you to delete Dalvik, Cache and System. I have tried both in the same go and one or the other. Does not seem to make a difference. But from the response below I get that it's formatting the data and typing yes that is the way to go(?)
TWRP version 3.3.1-0
sangbuana said:
mxxt01 is right. You have to format the data partition or else you will run into a bootloop.
I followed the guide here but I did not flash magisk since I don't need root.
Basically what I did was;
1. Unlock bootloader
2. Reboot to load the OS but skip the initial setup
3. Reboot to fastboot/bootloader
4. Flash TWRP (use the latest beta from Mauronofrio)
5. Immediatly press Vol Up + Power button to boot TWRP
6. Sideload the firmware to /tmp/
7. Format the data partition and type yes to continue
8. Factory reset
9. Flash firmware from within TWRP
10. Factory reset again (you can skip this if you don't want to)
11. Reboot
And that is how I did it.
Click to expand...
Click to collapse
Could you describe step 6 in more detail please?
This is what I get if I try sideloading my phone:
adb push xiaomi.eu_multi_MI9_V11.0.5.0.QFACNXM_v11-10.zip /tmp/
adb server is out of date. killing...
* daemon started successfully *
I guess it's important to not get the firmware in the SD-card folder since that will be wiped if I format the data, this might be where I fail.
Step 6 is to type adb push rom.zip /tmp/
I renamed the zip file to rom.zip so that I don't typo when typing.
Sent from my MI 9 using Tapatalk
In any case you should flash a current (11.0.6.0 or younger) fastboot ROM (.tgz extention). Recovery ROMs (.zip extention) don't reset the phone as deep as fastboot ROMs do.
After that you'd best flash vbmeta.img before TWRP, see #1 for more details.
Cheers
Toscha
From personal experience of using xiaomi.eu's ROM, I never did install vbmeta.img or dmverity, since that particular rom is based on the official beta Chinese MIUI ROMs, and the latest TWRP from Mauronofrio supports decryption. Not sure about other ROMs though.
Just to be safe, just download the stock fastboot ROM as a backup just in case anything goes wrong. Always remember to NOT lock your bootloader when flashing back to stock, in case your persist partition gets corrupted, you can flash it to recover.
ZevSwe said:
I have tried both Formatting data, this generally makes all folders have gibberish names and by going to advanced wipe, choosing data, some guides also wants you to delete Dalvik, Cache and System. I have tried both in the same go and one or the other. Does not seem to make a difference. But from the response below I get that it's formatting the data and typing yes that is the way to go(?)
TWRP version 3.3.1-0
Could you describe step 6 in more detail please?
This is what I get if I try sideloading my phone:
adb push xiaomi.eu_multi_MI9_V11.0.5.0.QFACNXM_v11-10.zip /tmp/
adb server is out of date. killing...
* daemon started successfully *
I guess it's important to not get the firmware in the SD-card folder since that will be wiped if I format the data, this might be where I fail.
Click to expand...
Click to collapse
Like written by toscha42 you should flash the latest fastboot stock rom (tgz) for your phone first, as after all the attempts you have made your phone is probably kind of ****ed up... Do not lock bootloader.
What I do and it works for me, starting from stock ROM.
1. Unlock bootloader (you already done that)
2. Flash in fastboot latest TWRP for your device (I use Mauronofrio)
3. After flashing disconnect the phone and push VOLUME UP + POWER to enter from fastboot directly to TWRP recovery
4. Format data with yes
5. Reboot to recovery
6. Flash xiaomi.eu custom rom for your device with USB OTG (usb otg is the easiest way I guess as you don't need to move the rom to internal storage)
7. Reboot to recovery
8. Wipe cache and dalvik cache
8. Reboot to system
And that's all.
Poslano z mojega MI 9 z uporabo Tapatalk
toscha42 said:
In any case you should flash a current (11.0.6.0 or younger) fastboot ROM (.tgz extention). Recovery ROMs (.zip extention) don't reset the phone as deep as fastboot ROMs do.
After that you'd best flash vbmeta.img before TWRP, see #1 for more details.
Cheers
Toscha
Click to expand...
Click to collapse
Can't seem to find any fastboot ROMS, neither of xiaomi.eu or LineageOs 17. Where can I find this? https://xiaomi.eu/community/threads/20-1-16.54300/
If I understood correctly vbmeta.img unlockes secure boot. Not sure why that is needed or what problems it might create. Did some googling but found nothing. What is this used for? If it's important, why is it not in any guides I found?
ZevSwe said:
Can't seem to find any fastboot ROMS, neither of xiaomi.eu or LineageOs 17. Where can I find this? https://xiaomi.eu/community/threads/20-1-16.54300/
If I understood correctly vbmeta.img unlockes secure boot. Not sure why that is needed or what problems it might create. Did some googling but found nothing. What is this used for? If it's important, why is it not in any guides I found?
Click to expand...
Click to collapse
Fastboot STOCK Xiaomi ROM.
To be flashed with MiFlash. Do not lock bootloader.
http://c.mi.com/oc/miuidownload/detail?device=1700361
Poslano z mojega MI 9 z uporabo Tapatalk
Fastoot ROMs are only available for official MIUI ROMs and has tgz as their filename extensions. They are flashable only using Mi Flash tools or equivalent. Custom ROMs has zip and they are flashable using recovery.
Correct me if I'm wrong, vbmeta.img is for verified boot. I was running on official MIUI ROM and I wanted to have TWRP recovery, but stock recovery would come back after every reboot. So I flashed a modified version of vbmeta.img available on the web, to disable verified boot, and TWRP would persist in the recovery partition. Have a read on Verified Boot here.
mxxt01 said:
Fastboot STOCK Xiaomi ROM.
To be flashed with MiFlash. Do not lock bootloader.
http://c.mi.com/oc/miuidownload/detail?device=1700361
Poslano z mojega MI 9 z uporabo Tapatalk
Click to expand...
Click to collapse
Hmm okay, but the phone is already working with the stock ROM, my whole idea is to switch to something else. What do you mean with do not lock bootloader?
sangbuana said:
Fastoot ROMs are only available for official MIUI ROMs and has tgz as their filename extensions. They are flashable only using Mi Flash tools or equivalent. Custom ROMs has zip and they are flashable using recovery.
Correct me if I'm wrong, vbmeta.img is for verified boot. I was running on official MIUI ROM and I wanted to have TWRP recovery, but stock recovery would come back after every reboot. So I flashed a modified version of vbmeta.img available on the web, to disable verified boot, and TWRP would persist in the recovery partition. Have a read on Verified Boot here.
Click to expand...
Click to collapse
Right, well I wish to switch to another ROM so installing MIUI Global ROm will not help.
I'm able to install TWRP without touching verfiedboot at all and get it to work even after reboot so that is not a problem. If that is what verifiedboot does I believe I can skip that?
ZevSwe said:
Hmm okay, but the phone is already working with the stock ROM, my whole idea is to switch to something else. What do you mean with do not lock bootloader?
Click to expand...
Click to collapse
than try once again by following my steps in post #8
You can skip flashing vbmeta and just follow mxxt01's steps.
Sent from my MI 9 using Tapatalk
sangbuana said:
You can skip flashing vbmeta and just follow mxxt01's steps.
Sent from my MI 9 using Tapatalk
Click to expand...
Click to collapse
That seems to have made the trick! Thanks so much!
I've been following this thread because I was having the same problems as ZevSwe, multiple attempts at installing roms with no success. I've been using phones/tablets with custom roms for years so I have some experience but not with this device.
I'll be trying the steps in post #8 later today but I have a question about twrp that's buggin me. I have been taking full twrp backups to a usb stick before installing and just reinstalling when the custom rom didn't work but the last few times the reinstall failed at about 98% complete and I've had to reinstall stock from scratch.
Any idea why a twrp backup would fail on reinstall? Is there something I could have inadvertantly done to cause this issue? Playing with roms is fun and easy when you've got a twrp backup to fall back on but a pain in the $#^ when it doesn't restore. Any thoughts would be appreciated before I give it another go.
thecdn said:
I've been following this thread because I was having the same problems as ZevSwe, multiple attempts at installing roms with no success. I've been using phones/tablets with custom roms for years so I have some experience but not with this device.
I'll be trying the steps in post #8 later today but I have a question about twrp that's buggin me. I have been taking full twrp backups to a usb stick before installing and just reinstalling when the custom rom didn't work but the last few times the reinstall failed at about 98% complete and I've had to reinstall stock from scratch.
Any idea why a twrp backup would fail on reinstall? Is there something I could have inadvertantly done to cause this issue? Playing with roms is fun and easy when you've got a twrp backup to fall back on but a pain in the $#^ when it doesn't restore. Any thoughts would be appreciated before I give it another go.
Click to expand...
Click to collapse
Since you noted that you have been doing a backup to a USB stick, it could be the USB stick is failing.
Honestly, all the installation guides for custom Roms i came across on XDA in the recent years are complete garbage. It fills like copy pasted from a guide that has been copypasted from a copypasted thread which has been copypasted and never worked.
For me, this guide works just fine. I just had to find the files for my Mi 9 instead of the k20 Pro. I would upload them for you but my upload speed is garbage.
https://www.youtube.com/watch?v=w_u_w6SrTDY&t=249s
I have flashed a lot of ROMs custom and official, fastboot and recovery. Never had any problems, the steps is here in thread.
Just remember 2 thing:
1. If you have ROM which using encryption, you must format data, because wipe will not remove encryption and you will see gibberish names
2. If you wipe system (which is mean less, because every ROM flash will do that, when you flash it, but many people insist in wiping it) then you must flash a ROM without reboot or you will stuck in fastboot and only option to repair is to flash official fastboot ROM (Non official fastboot ROMs, don't exist).

Pixel Experience installation guide

So today, I decided it was time to give the Pixel Experience ROM a try, because well.. it is one of the very few available for this phone for now (although some nice development arms to be going on for this phone).
Thing is, I couldn't succeed in any way at all. There is the Device page with its own instructions in the change logs:
https://download.pixelexperience.org/xqau52
FLASH OEM V9C AND NEWER OR YOUR DEVICE WON'T BOOT ********** IMPORTANT: README ********** ### Be sure to have the latest ODM, even when you get a OTA!!! ### To get this ROM and the OTA updater to work fine, you NEED TO follow a few steps: 1. Download Androxyde's FlashTool 2. Flash the latest STOCK firmware for your device, in order to get a bootloader bugfix for unlocked A/B 3. Before flashing this ROM through your favorite recovery environment, you *HAVE TO* flash the latest Sony Open Devices binaries for your device through fastboot. They cannot be distributed in this zip package because you have to accept their EULA. ** Make sure you flash the Sony ODM image to both slots: fastboot flash oem_a SW_binaries_for_Xperia_Android_(blahblah) fastboot flash oem_b SW_binaries_for_Xperia_Android_(blahblah) P.S.: If you get signature verification errors on TWRP, remember to disable package signature verification in the TWRP settings!!!
Click to expand...
Click to collapse
But then, there is also the generic installation guide here:
https://wiki.pixelexperience.org/devices/xqau52/install/
(I'm not going to quote this page because the install instructions is all there is on that page.)
Now the two instructions are quite contradictionary, and I couldn't figure out which one to follow, so I ended up following the part from the changelog that said to flash the Open Devices binaries to both slots (couldn't find the stock ROM but used Emma to clean flash it first), then flashed TWRP unofficial from the XDA device forums (tried both, stock and the other one) and was able to boot into TWRP. Since the device page kind of stopped there, I subsequently flashed the ROM as described on the installation page and got the device corrupt error upon booting the ROM, and the device stopped there. Couldn't get it to work.
Does anyone have any experience with tue installation of this ROM for this phone? I did prefer LOS but am quite eager to give this ROM a try, I just can't stand being unable to use navigation gestures in a normal way with a custom launcher (bad Sony!).
I have something similar but worse. The phone stopped working. It shows red light and it blinks by 30s interval. Can anyone help?

Categories

Resources