Tried to Install TWRP, I think I deleted Android... - LG Optimus L90

I was following originally this guide by a user who posted steps that would basically allow me to move all of my apps from my internal storage to external SD card. The link to the thread I had posted about this can be found here: http://forum.xda-developers.com/lg-l90/general/internal-memory-storage-help-t3171582/post62245649
I managed to root my phone using the KingRoot method, right after, I installed Flashify, flashed the TeamWin Recovery Project, and right after, it automatically rebooted me. After that, I went to the reboot section, clicked on recovery, and than, it loaded me to an icon where the Android logo is opened from its belly with a red triangle with the ! mark inside the red triangle.
I am assuming that my Android OS was deleted, as I see I now have 3 GB of free internal storage space. I originally was running everything on stock. Is there any solution here? I did manage to install CM12.1, but I forgot to flash GAPPS, thus I had to manually download the Flashify and KingRoot APK's and ended up deleted CWM12.1 as it just seemed buggy.
At this point, I want to just go back to my normal Android, I am fine with using Stock, as long as I have free storage. Though, if using another ROM would be better (where battery life improvements and overall faster performances is always acceptable). I don't want to brick my phone, as it so far seems to be working.
I currently don't have any other backup phone on me, so I would love to solve these issues ASAP as I do need my phone to make calls and answer SMS Text Messages.
Thanks!

What is your L90 variant?
You probably messed just the system and boot, CM12.1 and other custom roms currently runs with KitKat bootstack, and you may flashed them with Lollipop bootstack. Try to boot holding PWR + VOL DOWN, wait for LG logo show up, immediately release PWR button and hold again (don't release VOL DOWN). If you aboot is fine, you'll be shown a white screen asking if you wan't to reset your phone. If you still have your stock recovery, your phone will actually be reseted to stock, if you changed the recovery to TWRP or CWM, it will boot into them.
From the recovery you can create the right .zip to flash stock system and boot images retrieved from your kdz of your phone with LG Fimrware Extract. If you are able to flash them back, you won't need Kingroot, since your bootloader is unlocked, you can root your phone straight from the recovery with SuperSU flashable zip.
If none of the two options happen, you probably messed your aboot or recovery partition.

F. Gacrux said:
What is your L90 variant?
You probably messed just the system and boot, CM12.1 and other custom roms currently runs with KitKat bootstack, and you may flashed them with Lollipop bootstack. Try to boot holding PWR + VOL DOWN, wait for LG logo show up, immediately release PWR button and hold again (don't release VOL DOWN). If you aboot is fine, you'll be shown a white screen asking if you wan't to reset your phone. If you still have your stock recovery, your phone will actually be reseted to stock, if you changed the recovery to TWRP or CWM, it will boot into them.
From the recovery you can create the right .zip to flash stock system and boot images retrieved from your kdz of your phone with LG Fimrware Extract. If you are able to flash them back, you won't need Kingroot, since your bootloader is unlocked, you can root your phone straight from the recovery with SuperSU flashable zip.
If none of the two options happen, you probably messed your aboot or recovery partition.
Click to expand...
Click to collapse
I think I did mess with my stock recovery boot, and instead TWRP is set as my boot. When I pres the VOLUME down and Power button, I get prompted to a White screen that says "Erase all user data and restore default settings?", after I select "Yes", and "Yes" again, it shows "Factory Reset Performing". Than a quick animation of the Android logo with gears running behind it, after that it looks like it reboots, but right back to Team Win Recovery Project. From there, when I select Reboot, and recovery, it just shows the Android logo with the red triangle.
What are my options from here? I should mention, when I select the option "Reboot" in TWRP and go to "Recovery", it does say "No OS Installed!" , after swiping it than says "Install SuperSU? Your device does not appear to be rooted. Install SuperSU Now?".
Is there a proper way to also root the device, since it seems to be rooted, even though I swipe to install SuperSU?
EDIT: I also have a LG L90 D415.

If TWRP is booting, you are fine. TWRP is your new recovery, takes place of the stock LG recovery.
I don't know how many variants L90 have, you are D415RD or its a different model? If it's the same D415 you said, you can flash the D415RD zip with TWRP from this topic: http://forum.xda-developers.com/lg-...flashablestock-zip-kk-l-via-recovery-t3137255 (use Lollipop if you were at LL before, use KitKat if it was KK. You cannot downgrade to KK if you were on LL before, they are different bootstacks).
I suggest before flashing, wipe > adv wipe > dalvik/system/data/internal storage (your internal sd data will be wiped)/cache - do NOT format sdcard, it's your microSD with the necessary zip files to go back to stock. Go back and format data, type yes. Go back to home menu, reboot > recovery so your data get remounted and accessible again (ignore warnings saying there is no android installed and asking to install super user). Install > select the zip and wait. You can also flash SuperSU to get root (do after flashing the rom): https://download.chainfire.eu/696/SuperSU/UPDATE-SuperSU-v2.46.zip

F. Gacrux said:
If TWRP is booting, you are fine. TWRP is your new recovery, takes place of the stock LG recovery.
I don't know how many variants L90 have, you are D415RD or its a different model? If it's the same D415 you said, you can flash the D415RD zip with TWRP from this topic: http://forum.xda-developers.com/lg-...flashablestock-zip-kk-l-via-recovery-t3137255 (use Lollipop if you were at LL before, use KitKat if it was KK. You cannot downgrade to KK if you were on LL before, they are different bootstacks).
I suggest before flashing, wipe > adv wipe > dalvik/system/data/internal storage (your internal sd data will be wiped)/cache - do NOT format sdcard, it's your microSD with the necessary zip files to go back to stock. Go back and format data, type yes. Go back to home menu, reboot > recovery so your data get remounted and accessible again (ignore warnings saying there is no android installed and asking to install super user). Install > select the zip and wait. You can also flash SuperSU to get root: https://download.chainfire.eu/696/SuperSU/UPDATE-SuperSU-v2.46.zip
Click to expand...
Click to collapse
Ah okay, great, so I can easily fix this solution Just a question here - after performing this, when I go back to Stock, would it be recommended to just stick with it? I did some searching for fast Lollipop ROMs, and there are only a few out there from my search...
Also - Next time, is there a better way to do all of this? I was originally trying to install Xposed as a previous user had posted on these forums, that it allowed you to do a multitude of things additional to the whole Link2SD access.

Stick to the stock ROM.
TWRP is the best way of doing all of this, there nothing more easy than simply booting TWRP recovery and flash a zip file. Forget LG recovery and KDZ flash, TWRP is much better. TWRP allow to flash select partitions, thus preserving your unlocked bootloader and custom recovery.
If you are talking about all the partition format and reboot things I said, that actually is not really necessary, but since you tried to make some other changes other than simply flashing a new rom, I just wanted to make sure you were making a clean flash and first boot to avoid any obscure errors.
I don't know what is the current development status of Xposed in android LL and the recovery flasheable zip for our L90, but the last time I checked it wasn't stable and could lead to lots of FC to an unbootable system, so I just skiped any modification at this level.

F. Gacrux said:
Stick to the stock ROM.
TWRP is the best way of doing all of this, there nothing more easy than simply booting TWRP recovery and flash a zip file. Forget LG recovery and KDZ flash, TWRP is much better. TWRP allow to flash select partitions, thus preserving your unlocked bootloader and custom recovery.
If you are talking about all the partition format and reboot things I said, that actually is not really necessary, but since you tried to make some other changes other than simply flashing a new rom, I just wanted to make sure you were making a clean flash and first boot to avoid any obscure errors.
I don't know what is the current development status of Xposed in android LL and the recovery flasheable zip for our L90, but the last time I checked it wasn't stable and could lead to lots of FC to an unbootable system, so I just skiped any modification at this level.
Click to expand...
Click to collapse
YES! I was able to boot back into Stock ROM, but further more, I have root access via SuperSU! I was able to do the Link2SD method, and removed a bunch of the bloatware pre-installed on the ROM, it all works now! Thanks a lot for helping on all of this!
After spending literally my whole day trying to get my phone root acces, I think I will stick to Stock, everything works, and I don't want to kill another day trying to accomplish a miniscule achievment, since I already have Root access.
Now, one of my last questions: is there an appropriate way for me to boot into TWRP? Every time I reboot, I go straight to my ROM, not sure how to go back to TWRP (in the case I ever need to flash something again).
Otherwise, my phone works, and I was able to achieve my original goal of freeing up internal space.
Any cool tips or advice you recommend to possibly speed up or just enhance the Stock ROM now that I have root access?
Sent from my LG-D415 using XDA Free mobile app

I recommend to remove the software after flashing in TWRP, before doing the first boot, just mount /system and open ADB. If you do this after install, there is probably a lot of .dex files and app data remaining taking precious storage.
For example, if you update Youtube, Gmail and other pre-installed apps, after update they won't be removed, instead the new version will be renamed to something like com.google.youtube-2 and the previous version will remain in /system, you can notice this if you go to your app list in setting and try to uninstall, android will say that the version will be reverted to the stock one that shipped in the stock rom.
Here's a list of stuff and apps I removed before booting:
rm /system/usbautorun.iso
rm -r /system/app/Books
rm -r /system/app/ChromeWithBrowser
rm -r /system/app/Drive
rm -r /system/app/Gmail2
rm -r /system/app/GoogleTTS
rm -r /system/app/Hangouts
rm -r /system/app/LGSearchWidgetProvider
rm -r /system/app/Maps
rm -r /system/app/Music2
rm -r /system/app/Newsstand
rm -r /system/app/PlayGames
rm -r /system/app/PlusOne
rm -r /system/app/Street
rm -r /system/app/talkback
rm -r /system/app/Videos
rm -r /system/app/YouTube
rm -r /system/apps/bootup/LGBoxnet
rm -r /system/apps/bootup/LGFlashlightWidget
rm -r /system/apps/bootup/LGSmartWorld
rm -r /system/priv-app/LGBrowser
rm -r /system/priv-app/LGDictionary
rm -r /system/priv-app/LGEmail
rm -r /system/priv-app/LGFileManager
rm -r /system/priv-app/LGMemo
rm -r /system/priv-app/LGQTranslator
rm -r /system/priv-app/Velvet
rm -r /system/vendor/carrier/system/LGRemoteCall
rm -r /system/vendor/carrier/system/rspermlge
rm -r /system/vendor/overlay/com.android.browser
rm -r /system/vendor/overlay/com.lge.email
rm -r /system/vendor/overlay/com.lge.filemanager
rm -r /system/vendor/overlay/com.lge.lgworld
Of course, this is MY case, I removed applications that I thought not to be necessary to me. Apps such as Gmail, Youtube and etc I installed the most recent version from play store. Note that some apps cannot be removed or your cannot go past the setup wizard (the first screen after the first boot) e.g.: webview.
Don't try to install Xposed Framework, you will end with a lot of FC that will render the system unusable, I tried and didn't worked, but I had a TWRP backup and was just a matter of reverting everything.
Also, disable automatic system update. If you leave this checked in the settings and your phone updates, you will end in a soft brick.
To go to recovery you have 2 ways:
1 - Install Android Terminal Emulator, type su, then reboot recovery.
2 - Turn off your phone. Hold PWR + VOL DOWN, wait for LG logo show up, immediately release PWR button and hold again (don't release VOL DOWN). Don't worry, since you have TWRP recovery installed instead of LG recovery, your data won't be reseted, instead it will boot into TWRP.
I personally don't like the this second method because it's a good way to worn out your pwr and vol buttons, my previous phone was a LG Optimus 2x and the pwr/wake button became almost unusable after some time, I need to press very hard to work, use this second method only if you cannot boot into recovery from the OS.
To avoid always typing those command in Android Terminal Emulator, you can create a shortcut widget, just type reboot recovery in the argument, name the shortcut and it's done, everytime you tap the shortcut it will automatically open the terminal and reboot the phone. Don't forget to configure the app. to open always with su or the shortcut won't work (reboot command needs superuser access).

Xposed framework works in our L90 Lollipop, as long as you follow those steps I found @ reddit: https://www.reddit.com/r/LGL90/comments/3f8ycw/guide_how_to_install_xposed_framework_on_lollipop/
If you skip disabling the apps mentioned and clearing cache and dalvik, you will end in a infinite number of force closes and crashes, rendering the system unusable.
Of course, like always, do a system/boot/data backup with TWRP, if anything goes wrong, you'll be able to go back.
After the first boot a window will be shown saying that android system is updating some stuff, this will take a few minutes don't worry.
I installed LG Pie Support module to remove that annoying home google search ring when swiping from navigation buttons to screen.
Lollipop Memory Leak Fix module seems to have no effect tbh.

Related

How can I fix the Hero ROM's bootloop without wiping and fresh install?

I am frustrated that everytime an new release is out gotta reprogram my phone.
rm -rf /system/sd/*
search
sillyshyme said:
I am frustrated that everytime an new release is out gotta reprogram my phone.
Click to expand...
Click to collapse
Wiping your ext should not be an issue unless you're using Drizzy's "builds". If you're switching ROMs then you will have to wipe - get over it, but there should be "no wipe" updates when updating the a new version of the same ROM.
sillyshyme said:
I am frustrated that everytime an new release is out gotta reprogram my phone.
Click to expand...
Click to collapse
so i just noticed you had 27 posts, and im pretty sure all 27 have been about not wanting to wipe when switching roms, or complaining that you keep getting a boot loop. its just the dirty truth, if you wanna avoid a bootloop follow the info in the thread in my signature. if you dont wanna wipe, then dont switch, plain and simple.
SEARCH!!!!
palosjr said:
so i just noticed you had 27 posts, and im pretty sure all 27 have been about not wanting to wipe when switching roms, or complaining that you keep getting a boot loop. its just the dirty truth, if you wanna avoid a bootloop follow the info in the thread in my signature. if you dont wanna wipe, then dont switch, plain and simple.
SEARCH!!!!
Click to expand...
Click to collapse
Oh snap tellin it like it is..
I feel nice today, you're in luck, but this is the only post I'm writing to explain this procedure to you:
1. Reboot into recovery (Home + Power)
2. Backup NANDROID (or switchrom if you know how)
3. Enter into the console (alt+x)
4.
Code:
mount /system/sd
rm -rf /system/sd/app_s
rm -rf /system/sd/dalvik-cache
5.
Code:
ums_enable
6. Go into sdcard thru windows or whatever and then grab the data.img from the nandroid folder or switchrom folder depending on which one you used and place it in the same folder as fastboot (Go search if you don't know how)
7.
Code:
ums_disable
8.
Code:
recovery
9. Repair Filesystems (alt+f) (I think...)
10. Wipe data (alt+w)
11. Flash ROM of choice. (I've done this with practically every Hero flavor out there, should be no problem unless you cut corners in my directions some where... shame on you...)
12. Reboot phone when it finishes.
13. Wait for phone to get to setup page. Then, once there, reboot your phone again, but this time into bootloader (Camera + Power). You must wait for it to load the setup or this won't work.
14. Once fastboot is connected to the phone and can detect it (From connected PC):
Code:
fastboot flash userdata data.img
fastboot reboot
15. Wait for phone to boot up.... and bam, all wallpapers, lockscreen, program settings, mms, sms, contacts, etc. are already set up and your old settings + new ROM is ready to rock.

[Q] Q. Is it possible to unwittingly lose Custom Recovery? Please Help.

Firstly, my nexus one is Locked + Rooted with Stock FRF91.
OK, So I rooted with 1-click, installed a custom recovery (first Clockwork then Amon RA 1.8.0.0).
Did a full backup
Tried out a couple of Roms
Reverted to Stock from backup. All good!
Now 1 week later, I really want to try MiUI Rom so I power on phone with VOL-, select Recovery - all I see is the yellow exclamation in a white triangle with a green Android below. Isn't that normal / stock recovery???
Could the FRG83 OTA that I have not installed (it is still bugging me to do so ) have restored the stock recovery?
Did I clear something / do something wrong when performing the Stock backup or restore?
TIA for any advice.
The OTA update did install, and in the process replaced install-recovery.sh and recovery-from-boot.p, which meant that the stock recovery was automatically reinstalled by the OS on reboot.
Hi rusty, thanks for the reply. I have not installed the update, it is still asking to be installed. I even checked the build number in about phone - frf91.
Are you saying that with out my explicit permission the ota has modified my phone and restored the stock recovery - that certainly would explain it.
I misread your post, sorry about that.
However, restoring your backup is probably the cause, due to the same reasons above.
To simplify, you can lose your recovery in this fashion:
Start with stock ROM
Root
Install custom recovery without removing the .sh and .p files mentioned
Boot up phone
Now, if you install custom recovery using several automated methods, OR manually remove the files previously mentioned in thread, no problem. But if those files remain the stock ROM will automatically run them and restore the recovery image. Happens to a lot of people.
So likely that's what happened; restoring and using your stock ROM had those scripts in the image.
khaytsus said:
To simplify, you can lose your recovery in this fashion:
Start with stock ROM
Root
Install custom recovery without removing the .sh and .p files mentioned
Boot up phone
Now, if you install custom recovery using several automated methods, OR manually remove the files previously mentioned in thread, no problem. But if those files remain the stock ROM will automatically run them and restore the recovery image. Happens to a lot of people.
So likely that's what happened; restoring and using your stock ROM had those scripts in the image.
Click to expand...
Click to collapse
Thankyou both for your help. It makes a bit more sense now.
So in order to get back to a custom recovery, will I need to reinstall it or will removing these .sh and .p files do the trick?
Ps, what is the exact location of these and how would I delete them (i assume they are system/ protected)
Thanks, Steve.
You'll have to remove/rename the files and flash it again.
They are: /system/recovery-from-boot.p and /system/etc/install-recovery.sh
You could rename them:
Code:
mv /system/recovery-from-boot.p /system/recovery-from-boot.p.bak
mv /system/etc/install-recovery.sh /system/etc/install-recovery.sh.bak
or remove them altogether
Code:
rm /system/recovery-from-boot.p
rm /system/etc/install-recovery.sh
My advice would be to rename, just incase you feel like stock recovery again at some point.
Rusty! said:
You'll have to remove/rename the files and flash it again.
They are: /system/recovery-from-boot.p and /system/etc/install-recovery.sh
You could rename them:
Code:
mv /system/recovery-from-boot.p /system/recovery-from-boot.p.bak
mv /system/etc/install-recovery.sh /system/etc/install-recovery.sh.bak
Click to expand...
Click to collapse
Perfect. Understood.
I'll try to remember to update this thread with how I get on once i'm done but even if I dont, I think the info contained is pretty clear.
Thanks Rusty & khaytsus.
Also I'm pretty sure that if you use ROM Manager to flash custom recovery, it automatically zaps the files that would otherwise revert you to stock recovery.
Sent from my Nexus One using XDA App
I did use rom manager and I have since done clockworkmod through rom manager but when I go into recovery I get the stock one. that's why I did the manual process installing ra after clockwork the first time round.
Anyone else has that where rom manager seems to install the custom recovery but then when you go there its stock?

[Q] How to delete install-recovery.sh in milestone?

I found the following warning in a Rooting guide for Milestone:
If you applied an OTA update before, there is a script run at every system boot that checks and re-flashes the recovery when its checksum doesn't match. In such case, you have to avoid booting to android after the vulnerable recovery flash. Boot directly to recovery when RSD Lite restarts the phone (hold camera button) and from there remove the /system/etc/install-recovery.sh file.
rm -f /system/etc/install-recovery.sh
Could someone provide me detailed information on how to access the recovery and delete the install-recovery.sh file? Also does this reflashing occur on all Milestone which has received any OTA update?
Over 30 views, and still not a single reply. Come on guys, I know you are better than that...
uptheironsrafi said:
I found the following warning in a Rooting guide for Milestone:
If you applied an OTA update before, there is a script run at every system boot that checks and re-flashes the recovery when its checksum doesn't match. In such case, you have to avoid booting to android after the vulnerable recovery flash. Boot directly to recovery when RSD Lite restarts the phone (hold camera button) and from there remove the /system/etc/install-recovery.sh file.
rm -f /system/etc/install-recovery.sh
Could someone provide me detailed information on how to access the recovery and delete the install-recovery.sh file? Also does this reflashing occur on all Milestone which has received any OTA update?
Click to expand...
Click to collapse
First copy AOR to the root of sdcard.
Flash the VR. When the phone reboots and before it shows the M logo, press and hold the "x" key for a few seconds till the M logo is seen, then release. It should show you the triangle with exclamation mark. Press up volume button + camera button. It will show you recovery menu. Choose second option " apply sdcard update ".
After AOR menu is shown, choose console and type the command.
Done.
i first update my Milestone to the official 2.2.1.
Then copied the AOR 3.3 to sd card.
Then flash VR. then directly start to the recovery and flash the AOR.
After a while AOR starts and i type rm -f /system/etc/install-recovery.sh in the console and then "exit"
But i have to flash the AOR every time, because the stock recovery starts when i press camera button while startin (bootloade 90.74)
In the froyo menu, select Install Open Recovery at boot
After you select that, it will load AOR automatically if you hold the camera button (or X for 90.78 bootloader)
If you wipe caches, then you lose that so you would just Install OR at boot again
I flashed vulnerable recovery, flashed AOR and rooted my phone, and deleted the install-recovery.sh using the console command. I also selected the Install open recovery at root from the Froyo menu. However, my phone returns to the previous recovery menu every time i enter the recovery, and I have to flash AOR all over again.
Is there anyway to prevent this?
I'm having the exact same problem. Still looking for a solution. When I used root explorer to try and find install-recovery.sh BEFORE i started the whole process of trying to install VR, i couldn't find it (I previously used SuperOneClick to root after doing the official 2.2.1 update from Telus/Motorola). I suspect the file has been renamed and moved with this new 2.2.1 update.
This'll fix it but good http://forum.xda-developers.com/showthread.php?t=796679&page=26
zeppelinrox said:
This'll fix it but good http://forum.xda-developers.com/showthread.php?t=796679&page=26
Click to expand...
Click to collapse
Like someone said in that thread, I love you right now!

Thrill 4G Clockwork mod Instructions for New Rooters

If you are new to rooting your phone, there are simple ways to go about getting clockwork mod onto your LG thrill
You can root it easily with the 1 click root tool (I dont have the link on hand) after installing the LG Drivers from the LG Website.
Then, Download Rootexplorer, Rom manager (which i think is installed with 1 click root along with superuser)
First thing, download the recovery.img here after installing ADB guide is located here
After downloading recovery image, go to your pc's user folder C:\users\yourname and move it to there, that way there is no mistaking its location for adb
Now, on your phone you first need to go into root explorer, go to the /data folder, long click and go to permissions and select all available boxes and also make sure your device is in R/W mode not R/O mode.
Run CMD as administrator and do the following:
adb push recovery.img /data
then type:
SU
(this makes superuser active)
then:
dd if=/data/recovery.img of=/dev/block/mmcblk0p6 bs=4096
then after clockwork is flashed to finalize the settings type:
rm /data/recovery.img
reboot
Presto, Clockwork Mod is installed, remember you can access the clockwork menu via rom manager menu, or 3D+Volume Down +Power releasing the power button when the LG screen appears.
I will soon post onto this, how to update to gingerbread just making sure it works well on my own first. also, working on ICS as well.
Hope this helps anyone who has had trouble with it!
kobos311 said:
If you are new to rooting your phone, there are simple ways to go about getting clockwork mod onto your LG thrill
You can root it easily with the 1 click root tool (I dont have the link on hand) after installing the LG Drivers from the LG Website.
Then, Download Rootexplorer, Rom manager (which i think is installed with 1 click root along with superuser)
First thing, download the recovery.img here after installing ADB guide is located here
After downloading recovery image, go to your pc's user folder C:\users\yourname and move it to there, that way there is no mistaking its location for adb
Now, on your phone you first need to go into root explorer, go to the /data folder, long click and go to permissions and select all available boxes and also make sure your device is in R/W mode not R/O mode.
Run CMD as administrator and do the following:
adb push recovery.img /data
then type:
SU
(this makes superuser active)
then:
dd if=/data/recovery.img of=/dev/block/mmcblk0p6 bs=4096
then after clockwork is flashed to finalize the settings type:
rm /data/recovery.img
reboot
Presto, Clockwork Mod is installed, remember you can access the clockwork menu via rom manager menu, or 3D+Volume Down +Power releasing the power button when the LG screen appears.
I will soon post onto this, how to update to gingerbread just making sure it works well on my own first. also, working on ICS as well.
Hope this helps anyone who has had trouble with it!
Click to expand...
Click to collapse
All of this is already posted as is the instructions on how to update to gingerbread.
i have install CWM by as your guide. but when i use Rom Manager to Back up , message pop up that install CWM first to complete this action. i am new to these things.
Thanks

[GUIDE] Upgrade 4.5.15 rooted & encrypted -> 5.0.2 WITHOUT DATA/SETTINGS LOSS

as usual, if anything goes wrong, no responsibility etc
The official update tutorial for rooted users doesn't keep app data, only internal storage! This tutorial keeps EVERYTHING
This method allows updating from 4.5.15 (unlocked, encrypted, rooted) to 5.0.2 without any data (sys settings + app data + user data) loss
A FAQ section is present at the end of this post and will be regularly updated.
List of files to download while doing the following steps:
OOS 5.0.2 ROM
Codeworkx TWRP recovery
Latest Magisk
Terms and software used in this guide:
Fastboot / Bootloader = bootloader of the phone, it's a very low level mode of the phone that allows booting into recovery. Can be accessed by using the advanced reboot menu (enable in dev options) or by "adb reboot fastboot".
Recovery = a small operating system on the phone that allows you to do various operations even when the main OS (Android) is broken. This includes flashing ROMs, modifying stuff on the storage, etc. It's the Android swiss army knife. If you can get a phone to boot TWRP, then you can do almost anything.
Magisk = rooting software that uses a systemless method to keep SafetyNet working. Systemless = instead of modifying the system, every change is put in a separate image that is mounted "over" the system. When the system tries to access a file modified by Magisk, instead of reading it from the partition, it reads it from Magisk. It's recommended to use Magisk instead of SuperSU as of 2018.
ADB = tool that allows controlling the phone from your PC through USB. You can use it when you're in Android if USB debugging is enabled in the settings, or when you're in TWRP. Here, we mostly use it for transferring files directly (without MTP) and running commands (using "adb shell")
Note: For this guide you will be required to download and install Magisk. If you don't want your phone to be rooted, then at the end of this guide reboot into TWRP, wipe both caches and re-flash the OS. This will uninstall Magisk and any other root patch. Beware: it will reflash stock recovery, so if you ever want to re-root, you'll need to reboot to fastboot and flash TWRP manually.
Convention for commands that you will have to run:
a command line starting with "C:" means that it should be run on your PC
a command line starting with "~ #" means that it should be run on your phone (through adb shell) while in TWRP
a command line starting with "OnePlus5:/ $" means that it should be run on your phone (through adb shell) while in OxygenOS
Although the commands start with "C:", this is just for readability purposes. You should run everything from inside an empty directory with enough disk space and writing access.
Your phone will have to be plugged in to your PC from the beginning to the end. Also, make sure it has at least 80% battery before beginning, just in case.
I know, the tutorial is huge. This is simply due to the fact that if I just wrote "make a nandroid backup of this and that, flash, and restore the backup while doing this", then some people may encounter problems because not everyone knows how to do a nandroid backup, restore it, etc. Also, there are a lot of things that need to be done precisely that way and not another way, which explains why the tutorial is huge. Also, you may notice that there is a lot of commands to run throughout the tutorial, this is because that way, I'm sure that at the end, you will have done everything like I did it on my phone, so that if you have a problem it's much easier to figure out where it comes from.
Summary of what you need to do (this is only a SUMMARY to give you a preview of what the whole thing looks like, you shouldn't follow it except if you're really an expert since a lot of things need to be done precisely, instead you should follow the easier complete steps below):
Make a Nandroid backup of /data
Backup files on internal storage
Wipe everything (internal storage + /data + system + caches), and then format data (important!)
Push and flash the OOS zip
Wipe caches and reboot (to Oreo!)
When it reboots, make sure everything (features, like Wi-Fi and fingerprint sensor) works. Don't "save anything" though, everything you do will be erased when we'll restore your backup. This is just a "test drive" for Oreo.
Reboot to TWRP, wipe Data and restore the /data backup
Run the three commands to fix Wi-Fi and fingerprints
Reboot (to System) and check everything works (don't do anything, don't change any setting, just make sure it works)
Reboot to TWRP, rename the "Android" folder to "Android_oreo" on sdcard, delete everything else on sdcard and restore your internal files
Rename the freshly restored Android (nougat) folder to "Android_nougat" and rename "Android_oreo" to "Android".
Flash Magisk, wipe dalvik+cache and reboot to System
When in Android, everything should work except some apps won't have their data. This is normal. Open a terminal (either on your phone using Termux or from your PC using adb shell), elevate using su and rename "Android" to "Android_oreo" and "Android_nougat" to "Android" (this is so that it correctly restores permissions)
If everything works fine, delete the "Android_oreo" folder
First, if you have Xposed Framework (systemless or not) installed, uninstall it. Next, if needed, uninstall any Magisk module that is "Nougat-only" to prevent any problems afterwards.
Boot the phone to bootloader/fastboot (either using advanced reboot, or by using volume down button when you start your phone) and boot to the TWRP recovery by doing
Code:
C:\> fastboot boot twrp-3.2.1-0-oreo-8.1-codeworkx-cheeseburger.img
from your PC.
Next, in TWRP, make a backup of /data (using the Backup button). Then, still while in TWRP, run the following commands:
Code:
C:\> adb shell
~ # cd /sdcard
/sdcard # tar cvf twrp.tar TWRP
/sdcard # md5sum twrp.tar
<< md5 checksum of twrp.tar >>
/sdcard # exit
C:\> adb pull -p /sdcard/twrp.tar
When the above command has finished, make sure that the checksum of the received twrp.tar file matches the one previously displayed.
If it doesn't match, delete the file and run adb pull again. Don't continue following this guide until you have received a 1:1 (checksum-wise) backup of /data.
Code:
C:\> adb shell
<< WARNING: dangerous command! double check the following line is correct before pressing enter! >>
~ # rm -rf /sdcard/TWRP
~ # rm /sdcard/twrp.tar
That was for /data. Now, the backup for the internal storage:
Code:
~ # cd /sdcard
/sdcard # du -csh
<< you should see here the total size of sdcard, that'll give you an idea of how long it'll take >>
/sdcard # tar cvf sd.tar element1 element2 element... elementN
<< in the command above, replace "element1..N" by a space-separated list of what you want to have in the backup.
Keep in mind that your list HAS to contain the element "Android" (case is important). It contains the app data.
Let's say for example you want to keep only the photos you have taken (and nothing, nothing else that was on internal storage).
The photos are in the folder DCIM, so the command will look like this:
tar cvf sd.tar Android DCIM
(because you want DCIM, and Android has to be in the list, no matter where)
>>
/sdcard # md5sum sd.tar
<< md5 checksum of sd.tar >>
/sdcard # exit
C:\> adb pull -p /sdcard/sd.tar
When the above command has finished, make sure that the checksum of the received sd.tar file matches the one previously displayed.
If it doesn't match, delete the file and run adb pull again.
Keep in mind that anything you don't put in that list will not be backed up and will be lost!
Now, you have a backup for all the important stuff so we can start doing the real sh*t.
Now, the important step:
Go back to the TWRP home screen, press "Wipe", "Advanced Wipe" and there check "Dalvik / ART Cache", "Cache", "System", "Data" and "Internal Storage". Confirm using the slider at the bottom of the screen. Press the home button, then "Reboot" and "FastBoot". Now, type the same fastboot command as in the previous step to boot the recovery image. You'll enter the recovery as before.
Now, on your PC, in the terminal, type
Code:
adb push -p OnePlus5Oxygen_23_OTA_029_all_1801292040_d71af3d.zip /sideload
(note: here, we are not using "adb sideload", we are really using "adb push"). In TWRP, click Install, in the file manager go to /sideload and select the OOS zip file. Confirm by sliding. If you get an error, go back to home, click Mount and ensure System is not checked. Then try installing again. If it still does not work, reboot to fastboot, type command again, get to the recovery and install again.
When the zip-file is installed, go home, click "Wipe", "Advanced Wipe" and check both caches and confirm. Then, go home, click "Wipe" and then "Format Data". Then, go home, click "Reboot" and then "System". Your phone will now reboot to Oreo. It will take a long time, but do not turn off the phone. Let it run. On my phone, it took on average 2 minutes for that boot.
You'll be greeted by the "first boot" page. It'll ask you if you want to restore a backup or start anew, choose start anew. Connect to your Wi-Fi network and Google account. Follow all the instructions until you get to the home screen. There, make sure everything works (especially Wi-Fi and fingerprint sensor). Don't save your fingerprints yet, they will be erased afterwards. If everything works, you can continue following these instructions. If not, post a comment down there.
Now that you're at the home screen, go in the settings, About Android and click the build number 8 times to enable Developer Options. Go in there and enable advanced reboot. Then, reboot your phone into fastboot/bootloader using the power button. Type the exact same command as before to start TWRP. Once that you are in TWRP, run the following commands:
Code:
C:\> adb push -p twrp.tar /sdcard/
C:\> adb shell
~ # cd /sdcard
/sdcard # tar xvf twrp.tar
/sdcard # cp /data/misc/wifi/WifiConfigStore.xml /sdcard/
In TWRP, click "Wipe", "Advanced Wipe" and check only the "Data" partition. Confirm. Press home, then "Restore" and choose the backup in the list. Confirm to restore. Back to the terminal, we need to run the following commands otherwise Wi-Fi and fingerprints won't work:
Code:
/sdcard # cp WifiConfigStore.xml /data/misc/wifi/
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
<< WARNING: dangerous command! double check the following line is correct before pressing enter! >>
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
Note: the command above are ran from your PC in an adb shell while the phone is still in TWRP.
Reboot the phone to system and ensure Wi-Fi and fingerprints are still working. Right now you should already see your old home screen and all your apps, but the internal storage isn't there yet. Reboot in fastboot, run the command to get in TWRP.
Once TWRP has booted, run the following commands:
Code:
C:\> adb push -p sd.tar /sdcard/
C:\> adb shell
~ # cd /sdcard
<< WARNING: dangerous command! double check the following line is correct before pressing enter! >>
/sdcard # rm -rf Alarms Albums DCIM Download Movies Music Notifications Pictures Podcasts Ringtones
/sdcard # ls
<< now, look at the list of files that were printed, and rm anything left that is not called "Android" or "sd.tar"
<< WARNING: dangerous command! double check everything is correct before pressing enter! >>
if when you do rm <the thing> it tells you it's a directory, then do: rm -rf <thething>
if there's a folder called SomeFolder, do "rm -rf SomeFolder"
next, run this:
/sdcard # ls
Android sd.tar <-- expected output
/sdcard # mv Android Android_oreo
/sdcard # tar xvf sd.tar
/sdcard # mv Android Android_nougat
/sdcard # mv Android_oreo Android
If you don't have Magisk somewhere on your sd card, download it and upload it using MTP or adb. Then flash it using the Install button. Clear dalvik/cache and reboot to system.
When the phone has booted (again, it might take time), make sure USB debugging is enabled and run the following commands:
Code:
C:\> adb shell
OnePlus5:/ $ su
<< here, you might see a Magisk screen asking for superuser access. Allow. >>
OnePlus5:/ $ cd /sdcard
OnePlus5:/sdcard $ mv Android Android_oreo && mv Android_nougat Android
Now, try some apps and make sure all the data is there (especially games and Netflix/Hulu/etc). If everything is there, and the phone works properly, go back in the terminal and type:
Code:
OnePlus5:/sdcard $ rm -rf Android_oreo
Optionally, start the TWRP app and flash it, it can always be useful. You can also reboot to fastboot to do that.
Now reboot your phone (normal reboot) one last time.
There, working OOS 5.0.2 / Android 8.0.0 phone with no data loss.
Frequently Asked Questions
How long does the whole thing take?
Highly depends on the amount of data you have on your phone. Since it the USB port only supports USB 2.0, it may take 4 or 5 hours in total.
Will doing this void my warranty?
No.
Will I be able to install future OTA updates using the regular download-reboot-flash-twrp procedure?
Yep. Just use the regular method as you would have on Nougat.
Will I lose my data?
If you follow all the instructions, no. Even if you don't follow them, as soon as you have made a backup of /data and internal storage, then no matter how bad you screw up you could always get a working phone back.
I followed the instructions and now my phone doesn't work
Boot in TWRP, wipe everything, reflash.
questions will be added there in the future
Having WiFi and fingerprint issues
You sure it is a good idea to just delete those files? I would have guessed that I need to replace these (nougat version from backup) with the oreo version to have it working just like before the restore.
Code:
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
I'm having the issues with wifi and fingerprints. Neither one is working. I'll try to figure out how to fix this.
@zdimension Thanks for this guide, I don't have time to test it yet, but I have a question
pdluke said:
Code:
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
Click to expand...
Click to collapse
At this point in the procedure, adb shell is still using root (before flashing magisk) ? How is that possible ? Does the adb /sideload preserve root ?
olivier380 said:
@zdimension Thanks for this guide, I don't have time to test it yet, but I have a question
At this point in the procedure, adb shell is still using root (before flashing magisk) ? How is that possible ? Does the adb /sideload preserve root ?
Click to expand...
Click to collapse
These commands should be run while the phone is in TWRP. Also note that adb /sideload is not used here, only adb push.
pdluke said:
You sure it is a good idea to just delete those files? I would have guessed that I need to replace these (nougat version from backup) with the oreo version to have it working just like before the restore.
Code:
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
I'm having the issues with wifi and fingerprints. Neither one is working. I'll try to figure out how to fix this.
Click to expand...
Click to collapse
If you delete them, they will be generated automatically at the next system boot. But you could also make a backup of those three files before wiping /data, store that somewhere, restore Nougat /data and then restore your backup of those three files. The result would be the same.
Note: actually, not exactly. Erasing the first file won't change anything since it's not used anymore in Oreo, but the two other files contain the fingerprint configuration (list of saved fingerprints). So,
Either you remove the files and you have to save your fingerprints again at next boot
Either you restore them from an Oreo backup and you'll get the fingerprints you had saved during the "first boot" procedure when you rebooted the phone right after flashing the OS
But the result is mostly the same: everything works. Deleting the files ensures you get something clean. If you restore from an Oreo backup I can't guarantee the result (as it may interfere with other files from the Nougat backup).
10 bucks to make a script to do this all for me haha.
@zdimension Thanks for the clarification Another thing you might add to the files to download would be Magisk (optionally). In this kind of guide, I've always find it useful to download everything first.
olivier380 said:
@zdimension Thanks for the clarification Another thing you might add to the files to download would be Magisk (optionally). In this kind of guide, I've always find it useful to download everything first.
Click to expand...
Click to collapse
Oops, forgot to add it
I added the link, and also instructions for how to un-root afterwards for those who would want it.
To improve the guide, here are some ideas :
- You should highlight that rm -rf is a very dangerous command, and that it needs to be checked twice (especially the targeted folder)
- It could be useful to use the du -csh command to check the size of a folder (to estimate the backup time for example).
- As a safety measure, one could md5sum the tar file before and after using adb pull
What do you think ?
olivier380 said:
To improve the guide, here are some ideas :
- You should highlight that rm -rf is a very dangerous command, and that it needs to be checked twice (especially the targeted folder)
- It could be useful to use the du -csh command to check the size of a folder (to estimate the backup time for example).
- As a safety measure, one could md5sum the tar file before and after using adb pull
What do you think ?
Click to expand...
Click to collapse
Thanks for the ideas! I updated the post (and I added a changelog at the bottom for future reference).
Followed guide for successful upgrade from 4.5.15 encrypted, unlocked bootloader w/ Magisk root.
One note, after the first complete wipe and flash of the full ROM, it was getting stuck on first boot and never completed. Discovered that I needed to not just wipe the Data partition but Format it in TWRP, to clear out the old encryption I think. Magisk wouldn't install either until I did this.
@debork thanks for the positive feedback (all the merit goes to @zdimension of course)
@zdimension there are many people in the other thread https://forum.xda-developers.com/oneplus-5/how-to/official-oxygenos-4-5-2-7-1-1-ota-t3627003 that tried (unsucessfully) to upgrade from 4.5.15 to 5.0.1, maybe a link to this topic could be useful for them (if it's not too late).
Regarding the
Go back to the TWRP home screen, press "Wipe", "Advanced Wipe" and there check "Dalvik / ART Cache", "Cache", "System", "Data" and "Internal Storage".
Click to expand...
Click to collapse
I think it should be highlighted in red, since it is the actual "clean flash" (AFAIU, correct me if I'm wrong).
if we only have the BL unlocked non root and stock recovery can we only ota without any loss of data ?
debork said:
Followed guide for successful upgrade from 4.5.15 encrypted, unlocked bootloader w/ Magisk root.
One note, after the first complete wipe and flash of the full ROM, it was getting stuck on first boot and never completed. Discovered that I needed to not just wipe the Data partition but Format it in TWRP, to clear out the old encryption I think. Magisk wouldn't install either until I did this.
Click to expand...
Click to collapse
Thanks for feedback, I will add that to the guide (although it worked with just Wipe for me )
zdimension said:
Thanks for feedback, I will add that to the guide (although it worked with just Wipe for me )
Click to expand...
Click to collapse
Have you rooted the 4.5.15 with Magisk or SuperSU (which is not compatible with Oreo anymore) ?
olivier380 said:
Have you rooted the 4.5.15 with Magisk or SuperSU (which is not compatible with Oreo anymore) ?
Click to expand...
Click to collapse
I stopped using SuperSU when it was sold to that shady company. Also, Magisk is better imo.
quick05 said:
if we only have the BL unlocked non root and stock recovery can we only ota without any loss of data ?
Click to expand...
Click to collapse
Official OnePlus support said that nothing is guaranteed if your bootloader is unlocked. But since you're on stock recovery + non rooted, you could always try. But backup everything first. Some people here on XDA have reported that it doesn't work, though.
Just followed your guide with no problems. Thank you very much!! I can confirm also that you need to format data after the wipe otherwise it gets stuck in a bootloop!
Thanks so much for this. I was able to successfully follow the guide and get upgraded to 5.0.1 without losing any data. In fact, I even messed up one step by failing to include the Android directory in the sdcard.tar backup (perhaps that should be more explicit), but it doesn't seem to have affected everything; all of my apps seem to have retained their data.
A few notes:
1. The file size of twrp.tar was ~14GB but when executing the pull command, it recognized it as only ~1.3 GB. As a result, the pull was not complete until it reached over 1000%. All the more reason to do the md5 check.
2. As others stated, I needed to format the data partition, not just wipe it.
3. I might recommend also including a "summary" version somewhere on what this guide does. Scrolling through the guide the first time, it seemed pretty daunting, but really all that you're doing is: backing up data partition and internal storage; wiping device; flashing Oreo ROM; tweaking a few files; and restoring backed up data and internal storage.
Thank you again so much! Glad to finally be on Oreo.
elight3 said:
Thanks so much for this. I was able to successfully follow the guide and get upgraded to 5.0.1 without losing any data. In fact, I even messed up one step by failing to include the Android directory in the sdcard.tar backup (perhaps that should be more explicit), but it doesn't seem to have affected everything; all of my apps seem to have retained their data.
A few notes:
1. The file size of twrp.tar was ~14GB but when executing the pull command, it recognized it as only ~1.3 GB. As a result, the pull was not complete until it reached over 1000%. All the more reason to do the md5 check.
2. As others stated, I needed to format the data partition, not just wipe it.
3. I might recommend also including a "summary" version somewhere on what this guide does. Scrolling through the guide the first time, it seemed pretty daunting, but really all that you're doing is: backing up data partition and internal storage; wiping device; flashing Oreo ROM; tweaking a few files; and restoring backed up data and internal storage.
Thank you again so much! Glad to finally be on Oreo.
Click to expand...
Click to collapse
Thanks for the feedback! I'll add a summary to the guide.

Categories

Resources