Creating my own recovery.img? - myTouch 3G, Magic Android Development

So unless I have missunderstood something, the recovery.img is what state the phone returns to when you do a factory reset. I would very much like to change this state to have a few apps installed and pre-configured.
The best solution would be to create a recovery-image from say nandroid-backup. Is this possible? Or are there any awesome guides out there that teaches how to create your own recovery-images?
Cheers,
edit: I found alot of good information in these threads, but I really cant find information on how to customize my recovery-image to have certain apps installed, and such. Im guessing there is no automated way to transfor a nandroid-backup to a recovery image
http://forum.xda-developers.com/showthread.php?t=443994
http://forum.xda-developers.com/showthread.php?t=575144

recovery image is the barebones boot up and options that allow you to wipe, nandroid, and such. when powering up and pressing home at the same time, this is the recovery image. what you are talking about is either creating your own update, with preinstalled apps, or creating a clean nandroid backup with some apps installed. hope this clears up a bit.

byt3b0mb said:
recovery image is the barebones boot up and options that allow you to wipe, nandroid, and such. when powering up and pressing home at the same time, this is the recovery image. what you are talking about is either creating your own update, with preinstalled apps, or creating a clean nandroid backup with some apps installed. hope this clears up a bit.
Click to expand...
Click to collapse
I see, thanks for the info. So maybe I should not change the recovery-image. But I want to change the state the phone returns to when I do a factory reset. I think atleast the recovery-image is loaded during factory reset, because I have managed to make factory reset not work by making a faulty recovery image that hangs the phone, lol.
Maybe this is what I should do: An update.zip that inclodes a ROM that has pre-installed apps. Is this what the phone returns to at a factory reset?

sandis84 said:
Maybe this is what I should do: An update.zip that inclodes a ROM that has pre-installed apps. Is this what the phone returns to at a factory reset?
Click to expand...
Click to collapse
Correct

ronni.rasmussen said:
Correct
Click to expand...
Click to collapse
I have tried creating an update.zip, but I have ran into some problems as specified in this thread:
http://forum.xda-developers.com/showthread.php?p=5101633#post5101633
However, I am still unsure on how this update.zip would work. It feels as if I should edit the data.img-file, since it contains the information in the data-folder (i.e. the apps and their state). But I have found no editor or guide to do this. However, this might only change the state of the phone directly after installing the update-zip? If I install an update.zip with modified data.img, is this really what the device will return to after a factory reset?
I.e, exactly from where does the phone load the state it returns to after a factory reset?
Cheers,

are you wanting to have all gmail and other things with passwords already done or simply install barebones rom with your little bits you want
if its the latter option thats easy
make an update zip with your apks wifi apn settings inside and flash stright after installing rom before a reboot

or open up your desired rom and drop the files in the correct folders re-sign and thats it

sitimber said:
are you wanting to have all gmail and other things with passwords already done or simply install barebones rom with your little bits you want
if its the latter option thats easy
make an update zip with your apks wifi apn settings inside and flash stright after installing rom before a reboot
Click to expand...
Click to collapse
Im not sure I understand, but here is a clarification of what I want: What I want to do is specifically to change the "factory reset state". I am trying to do this to make a personalized very noob-friendly ROM, where they can just make a factory reset and still keep their essential apps and settings. It is meant for people that for example arent technical enought to make a restore from nandroid or such stuff.
edit: To create an update.zip with certain apps and settings, is there a complete guide for doing that? I have found many guides that covers parts of it, but I always run into problems.
edit2: Nvm, I have nog managed to create an update.zip. So I just add some apk-files to the data/app-folder in the boot-img in the update? Well, Im going to give it a try... I'll report back in a while =)

Well, I have managed to create and install an update.zip, but the result is not showing up! I create my update, place it on the sdcard, start in recovery mode and run the update. Then i restart.
When I restart first i see the "phone out of box"-image for about half a second, then splashscreen. Then "phone out of box"-image for half a second again, and then it returns to the splash screen and boots normally.
When it has booted I check if my changes has applied. What i have done is I have tried to create several directories in the file system by adding three lines in the init.rc:
Code:
mkdir /sdcard 0000 system system
mkdir /system
[b]mkdir /test1[/b]
mkdir /data 0771 system system
mkdir /cache 0770 system cache
[b]mkdir /test2 0770 system cache[/b]
mkdir /sqlite_stmt_journals 01777 root root
[b]mkdir /test3 01777 root root[/b]
mount tmpfs tmpfs /sqlite_stmt_journals size=4m
But none of these directories has been created. Even worse, the lines I added are gone from init.rc! It seems as if the update was never applied. What could be wrong? Any help would be VERY appriciated, since I feel very very stuck at the moment.

Related

Build Your Own alt+w Wipe...(edit: if you don't use apps2sd...)

First Note: These apps will become uninstallable! (much like any other stock rom apk) and must be deleted using the console, somehow.. anybody care to shed some light on how?
Hopefully someone can add more to this or use this info to build a much more thorough how-to, but for now here's what I've got...
Instead of building your own update.zip you can modify your alt+w wipe data to reinstall the downloaded/backed-up apks of your choice. This can also be used to install 3rd party apks without having access to any other installer, for instance if you wipe then find yourself without any access to the internet/market or a computer.
To do this you must first have the apps on the sd. I used astro to backup apps which puts the apks in /sdcard/backups/apps
I'm doing this on IonR2, your system apps may be elsewhere, mine are located in /system/app, you'll need to know where they are for this to work.
Power off your phone and do this (enter the bold stuff only, replace my directories with yours):
home+power (enter recovery)
alt+x (to go to console)
hit enter (cause the prompt says so..)
/ # mount sdcard
/ # mount system
/ # cd sdcard/backups/apps (or cd to where ever your backed up apks are)
/sdcard/backups/apps # ls *appname* (this may be useful for finding the exact *.apk name)
/sdcard/backups/apps # install -cp org.appName.com.apk /system/app (remember to capitalize where necessary)
at this point it should hang for a second then return to the "/sdcard/backups/apps #" prompt, if so the apk has successfully been added.
/sdcard/backups/apps # reboot (or install more apks if you like)
home+power then alt+w to test if you so desire. now your backed up apk should reinstall itself if you ever have to do an alt+w wipe again..(weather the apk is on the sd card or not)
I know, not very thorough but wth, I figured someone might find this as useful as I did(or be able to expand on it a bit, data, app settings etc). Also cool if you happen to have no net connection, no pc access and a wiped phone with no real useful/fun apps...
u only have to do this once, and it'll flash the new roms WITH these apps installed? how do we 'clear' these apps if we don't want to have them installed when we wipe?
Is it possible to install all the apps in your backup directory at once, with some sort of batch command?
These apps will become uninstallable! (much like any other stock rom apk) and must be deleted using the console, somehow.. anybody care to shed some light on how?
@ Lieu10ant, yeah, you only have to do once/updated rom, this modifies the base install. the newely added apks will be installed every time you alt+w (wipe). If you apply an update.zip this process will need to be redone(I'm pretty sure, haven't tried).
@ lukekirstein, I'm sure there's a way but I'm not sure how. Really hoping someone more knowledgable jumps in here with a bit more info :/
I've added a file manager(with backed up apps installer) and wifi tether because I always need/use em and never really planned on uninstalling em..
Im pretty sure you would have to use "rm" and individually remove all apps you dont want.
instead of backing up your apps, just run apps to sd and never reinstall any apps again
Breakthecycle2 said:
Im pretty sure you would have to use "rm" and individually remove all apps you dont want.
Click to expand...
Click to collapse
you would mount the system again from the recovery console and 'rm' each app you don't want. You would want to be careful not to batch delete stuff.
sonikamd said:
These apps will become uninstallable! (much like any other stock rom apk) and must be deleted using the console, somehow.. anybody care to shed some light on how?
@ lukekirstein, I'm sure there's a way but I'm not sure how. Really hoping someone more knowledgable jumps in here with a bit more info :/
Click to expand...
Click to collapse
Wouldn't it be a nice thing to make them uninstallable? That would, in theory, make them a lot more stable like the stock apps and can only be updated, not modified. You can probably delete them through console in recovery or even through ADB if you wanted to. It'd definitely be impossible to do it through some basic installer or the package uninstaller while the phone is running normally. The same process as a stock app.
I know you can't do it while the phone is running (bummer :/) but I was hoping it's possible when the phone is off.
@ Breakthecycle2, cool, I figured rm through console after mounting but haven't tried so wasn't 100% on that one.
@ Sirus20x6, I prefer this method to apps2sd, mainly because everything's stored in the phone's internal memory. Although I know most folks now seem to be using an apps2sd of some sort.
@ lukekirstein, yeah. That's why I do it this way, but some may want them uninstallable so I figured I better make a point to inform those folks
Wouldn't this decrease your internal memory since these apps are being saved to the phone so you can later wipe?
jusplainmike, I would assume so. Something to keep in mind.
Would a nand be better?
sonikamd said:
I'm doing this on IonR2, your system apps may be elsewhere, mine are located in /system/app, you'll need to know where they are for this to work.
Click to expand...
Click to collapse
(10c)
perhaps, depends on what you want I suppose. I wipe clean every so often just to get a fresh start, speed things back up etc. Sometimes while installing themes I wipe multiple times and also just want a clean slate.
This is definitely not the way to go for a complete backup-restore. Just seems a good way to reinstall a few missing by stock apps after a wipe.
lol soulife i know, i know
I believe apps2sd is the best bet for keeping apps after a wipe or fresh install.
retort
sonikamd said:
lol soulife i know, i know
Click to expand...
Click to collapse
The only reason is because you push a market app to internal memory it read only. If there's an update you have to open terminal or adb and rm and push the update back. Plus if you flash a new update it will wipe them out. With a2sd however you can update them no hastle, and even if you flash a new build, with a2sd the reinstall themself. Much more convient as long as you smart with your partitioning.
I think you guys may be doing this the hard way. If you are wiping and moving to a compatible ROM, just leave the sd card as it is and the new ROM should be able to find and install the apps as long as it has apps2sd built in.
If you are moving to an incompatible ROM you will have to remove old sd app directory first.
rm -r /system/sd/app
then you should be able to just copy over your entire apk backup directory to your sdcard as follows.
cp- a /sdcard/yourdirectoryname /system/sd/app
and if you are installing a ROM that has app2sd built in, it should find all the apps and install them.
If the ROM you use does not have apps to sd, then you will be able to use Lucid script to move apps from phone to sd card app directory (with already copied apps) and link directory
Tru, I just don't use apps2sd. My sd is constantly getting mangled for one reason or another..
uh, by doing this you're filling up your /system folder which actually needs memory to improve. and you can uninstall them by
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
rm/system/app/nameof.apk
on another note wouldnt wiping while having info in the system ; wipe?
anyways

[Q] Problems with Nandroid advanced restore

I actually have two questions here.
I'm trying to do an advance restore of the data from a previous backup using CWM. recovery 5.0.2.7 and having some problems.
In recovery, when I click on 'advanced restore' I am told there are no files. I then choose the regular 'restore' option and it shows the files to choose from.
I can then go back one screen and select 'advanced restore' again and it will now display the list of backups. When I select a backup and try to restore the data, I get a MD5 mismatch error. This happens when I try to do an advanced restore with any of my backups, not just a certain one. Also, I can do a normal restore without any problems.
I tried this:
http://www.geekdevs.com/2011/10/solved-md5-mismatch-error-on-clockworkmod/
Then this:
http://forum.xda-developers.com/showthread.php?t=1606047
I've read several threads but most of them seem to be solved after trying one of the above methods. I also haven't seen any that describe the backup list not displaying at first.
Secondly, I found this problem because I'm running Pyr'o'Ice ICS Desensed 1.1.3 and stupidly tried to tether with wifi and my phone got stuck in a reboot loop. I want to restore the userdata via Nandroid recovery, but will that also restore the tether setting that causes that bug?
My main issue is with the Nandroid recovery, but I thought someone reading this might also know the answer to that question also.
Any help is greatly appreciated.
Edit: (didn't read whole post)
1. Open your sdcard on pc (usb mounted)
2. ensure there is a folder in clockworkmod/backup (ex: 2011-08-10.02.40.28)
if your sure the nandroid isn't corrupted and you want to restore it anyway, you can modify the md5sum.
1. go get a md5sum checker
2.With your phone mounted on your pc...go into the clockworkmod/backups/(yourbackups folder)
3. md5 sum all the images in there (write it down somewhere)
4. open the nandroid.md5 with a text editor
5. replace the md5s with the ones you wrote down
6. Try restoring it again
This doesn't appear to do anything
xmc wildchild22 said:
Edit: (didn't read whole post)
1. Open your sdcard on pc (usb mounted)
2. ensure there is a folder in clockworkmod/backup (ex: 2011-08-10.02.40.28)
if your sure the nandroid isn't corrupted and you want to restore it anyway, you can modify the md5sum.
1. go get a md5sum checker
2.With your phone mounted on your pc...go into the clockworkmod/backups/(yourbackups folder)
3. md5 sum all the images in there (write it down somewhere)
4. open the nandroid.md5 with a text editor
5. replace the md5s with the ones you wrote down
6. Try restoring it again
Click to expand...
Click to collapse
I'm having exactly the same problem as the OP, and I'm not sure how this will help as all md5sum does is give the md5s listed in the nandroid.md5 file. Using this method, all one is doing is putting the exact same md5s over what is there in the nandroid.md5 file.
I really need a method to make the Nandroid Advance Restore work in order to get back my data after updating to 1.63.531.2.
Any other suggestions? --
--
KingCheetah
y do u guys need to advanced restore...just restore
xmc wildchild22 said:
y do u guys need to advanced restore...just restore
Click to expand...
Click to collapse
Heh, well, in my case, I'm trying not to have to restore my phone from scratch after updating to 1.63.531.2, as well as keep the update. A straight restore will just take me back to DS Mod 1.55.531.3. Advanced Restore would allow restoration of data without overwriting the boot.img, system, etc.
So, no further methods to try to address this error?
--
KingCheetah
then take the system.img from the 1.63 update and put in replace of the nandroids one....then redo the md5 checksum for the system.img like i had showed before
xmc wildchild22 said:
Edit: (didn't read whole post)
1. Open your sdcard on pc (usb mounted)
2. ensure there is a folder in clockworkmod/backup (ex: 2011-08-10.02.40.28)
if your sure the nandroid isn't corrupted and you want to restore it anyway, you can modify the md5sum.
1. go get a md5sum checker
2.With your phone mounted on your pc...go into the clockworkmod/backups/(yourbackups folder)
3. md5 sum all the images in there (write it down somewhere)
4. open the nandroid.md5 with a text editor
5. replace the md5s with the ones you wrote down
6. Try restoring it again
Click to expand...
Click to collapse
The md5s are already the same.
That also doesn't address the issue why I am told that there are no files found when I try the advanced restore option without first going to the regular restore and backing out.
Investigation ongoing, but an idea to help
paperskye said:
The md5s are already the same.
That also doesn't address the issue why I am told that there are no files found when I try the advanced restore option without first going to the regular restore and backing out.
Click to expand...
Click to collapse
This may have something to do with the way in which CWM 5.0.2.7 saves the majority of data to tar files instead of img files. This behavior of CWM is part of the discussion in this thread: http://forum.xda-developers.com/showthread.php?t=1624516
Yogi2010 made the suggestion of using the Modaco 4.0.0.9 recovery for backups that can be successfully used with Advanced Restore. I believe Modaco's AR works because it saves all data to img files.
I'm going to attempt an update to 1.63 using Modaco for backup and then AR of data afterward. If successful, we know that Modaco is the key for utilizing AR due to the file type it uses for data storage.
Why CWM 5.0.2.7 behaves as it does regarding AR remains an open question.
I'll report back to this thread with results after my update attempt --
--
KingCheetah
Modaco functional with Advanced Restore
I used the Modaco 4.0.0.9 recovery for my backup prior to updating to 1.63, then followed with an Advanced Restore of data afterward, which successfully restored my phone environment. So AR is functional with Modaco, but not CWM 5.0.2.7. I don't know for certain if the fact that CWM uses tar files has something to do with its inability to execute AR, but it certainly seems like this is a contributing factor.
I'm going to Google this and see if I can come up with any further info on CWM that might explain its behavior.
So far, it's Modaco FTW. Itz on my fone, reestoring my data --
--
KingCheetah
Did you use this to get Modaco? I noticed it says you must have s-off but in your thread you said you have s-on.
http://forum.xda-developers.com/showthread.php?t=1179125
My problem is that with the data I want to restore, my phone gets stuck in a boot loop. I am thinking that I might be able to install Modaco, restore the data where I can't start up my phone and then do a Modaco backup while still in recovery. Then restore a functioning backup (so my phone boots up) and finally do an advanced restore where I only restore the data I need from the bootloop backup.
paperskye said:
Did you use this to get Modaco? I noticed it says you must have s-off but in your thread you said you have s-on.
http://forum.xda-developers.com/showthread.php?t=1179125
Click to expand...
Click to collapse
That's the original thread Paul (Modaco's creator) posted. I downloaded my copy via Blue's invaluable Developers Reference: http://forum.xda-developers.com/showpost.php?p=17384145&postcount=7. Scroll down to the Recovery section, and under Clockworkmod 4.0.0.9 Recovery there's a download link; but it's the same file.
As to being s-off, I think that's how things used to be. Obviously, all you need now is the bootloader to be unlocked so you can fastboot flash the recovery img file. Otherwise, I couldn't have been doing all the monkeying I've been doing recently.
paperskye said:
My problem is that with the data I want to restore, my phone gets stuck in a boot loop. I am thinking that I might be able to install Modaco, restore the data where I can't start up my phone and then do a Modaco backup while still in recovery. Then restore a functioning backup (so my phone boots up) and finally do an advanced restore where I only restore the data I need from the bootloop backup.
Click to expand...
Click to collapse
My experience is limited, but from your description, I'm not sure if the Advanced Restore option will be the smoking gun for your problem. The way I understand it, ClockworkMod recovery--of which Modaco is an unofficial flavor--takes the equivalent of a disk image of your phone while the OS is inactive (like many disk imaging programs for the PC). If you've got some ratty data causing the boot looping, that data is going to be stored along with everything else in the snapshot during backup. It will also be restored using regular restore or Advanced. So, I'm not certain how using a different recovery module will accomplish your goal of stopping the boot loop. Also, remember that any backups made with CWM 5.0.2.7 will be incompatible with Modaco recovery since it uses only img files.
This definitely needs to go to someone more experienced in troubleshooting Android, I think. Maybe you could edit the title of this thread to reflect the boot looping problem. This will hopefully get someone like Blue involved to help out. Sorry not to have a definitive answer for this. I suppose you could flash Modaco (same as you flashed CWM 5.0.2.7) and see if it does what you're hoping it will do. Best advice I can give.
Apologies for not having a concrete solution, and best of luck --
--
KingCheetah
Same problem, with ANY restore
I'm running cwm 5.0.2.7 and can't restore any previous backups. When I run restore it restores a few things, but then it just stops and cwm recovery seems to abruptly reset. After that I get stuck on the splash screen after rebooting.I verified the md5s in the backup folder, also. All match.
I DID change the backup filename so I could find it easily in my backup folder, but it was doing the same thing even before I changed it.
Anyone else have the same issue?
Also, is there a way to restore the images through adb/fastboot, even though they were created by cwm recovery?
A small suggestion
IBtokin said:
I'm running cwm 5.0.2.7 and can't restore any previous backups. When I run restore it restores a few things, but then it just stops and cwm recovery seems to abruptly reset. After that I get stuck on the splash screen after rebooting.I verified the md5s in the backup folder, also. All match.
I DID change the backup filename so I could find it easily in my backup folder, but it was doing the same thing even before I changed it.
Click to expand...
Click to collapse
Check your backup filenames and make sure they don't have any spaces. If that isn't an issue, you might try reflashing CWM and see if that resolves its difficulties. CWM shouldn't be behaving as you describe if it has been installed properly. Only other thing I can think of is looking into any item installed on your phone that could possible not play nice with CWM. I don't know of any myself, but it's a possibility.
IBtokin said:
Also, is there a way to restore the images through adb/fastboot, even though they were created by cwm recovery?
Click to expand...
Click to collapse
Not that I know of; hopefully someone with more CWM knowledge will chime in on this thread.
Purrs --
--
KingCheetah
Hmm...I'll have to check to see if the old fastboot method can still be used.
---------------------------------------------------------------------------
Nope. Nandroid used to save the files in .img format instead of the current one. This means no fastboot restore.
Sent from Spaceball One.

[XT1032] CM 12 - Flashing TWRP v2.8.6.0 has caused bootloop

Hello,
XT1032 CM 12 latest nightly (I think)
I flashed TWRP v2.8.6.0 using their manager app. I entered recovery mode and everything seemed to work fine. I made a NANDroid backup then rebooted. Unfortunately the device was then stuck at the bootlogo and kept looping. I can still access recovery and fastboot but for some reason adb doesn't see the device, nor can my device's data be access under Windows 7. I don't recall if I had USB debugging on or not. I would like to try to backup a few files to my computer (the backup for instance) but I am unable to since I can't use adb as the device is not recognized. MTP through TWRP doesn't seem to work either. I do have the Universal drive pack installed already on Windows.
Any help would be greatly appreciated. Thanks for your time.
To start with, let's make sure the files you want still exist.
1. Boot into TWRP recovery
2. Go to "Mount" and check that your "Data" partition is selected
3. Go back and then go to "Advanced" and then to "File Manager"
4. Navigate around (maybe /sdcard/ ? Depends what you're looking for) and find the files you need
If you can't find your file, you'll need some more help. Let's say you do see your file. Do you have a USB-OTG cable? You could plug a USB drive into your phone and mount that. Then you could copy your file to that drive. If you don't have the cable you do have some other options, but let us know how far you get.
EDIT: I know I haven't addressed the problem of the bootloop at all. Many of those solutions involve wiping so we need to make sure you've backed up all the files you need first.
First of all thanks for the help. :good:
I've been trying to find a solution and in fact flashing CWM worked. I was able to adb pull all the files and make a backup.
I backed up the content of the sdcard. I tried restoring the CWM nandroid with data only so it did reinstall the apps but unfortunately all their data and settings are gone. Making a full restore just goes back to bricking. So I have the nandroid and the data manually backed up to a computer but no idea how to restore it.
I've tried pushing the nandroid back to /mnt/shell/emulated/clockworkmod/backup after an unsuccessful restore but now it doesn't even work. (protocol failure, the push command fails)
honestly at this point I think the best solution is just to make a clean install. In fact it would be a good idea to just reset the whole phone and start with a clean slate with CM13 including wiping system files and maybe manually restore some key files and configuration (I've got all the .com files of relevant apps)
Do you know how to do that? :laugh:
frustratedwhiteman said:
First of all thanks for the help. :good:
I've been trying to find a solution and in fact flashing CWM worked. I was able to adb pull all the files and make a backup.
I backed up the content of the sdcard. I tried restoring the CWM nandroid with data only so it did reinstall the apps but unfortunately all their data and settings are gone. Making a full restore just goes back to bricking. So I have the nandroid and the data manually backed up to a computer but no idea how to restore it.
I've tried pushing the nandroid back to /mnt/shell/emulated/clockworkmod/backup after an unsuccessful restore but now it doesn't even work. (protocol failure, the push command fails)
honestly at this point I think the best solution is just to make a clean install. In fact it would be a good idea to just reset the whole phone and start with a clean slate with CM13 including wiping system files and maybe manually restore some key files and configuration (I've got all the .com files of relevant apps)
Do you know how to do that? :laugh:
Click to expand...
Click to collapse
I'm not really a Nandroid expert, but I can take a few shots in the dark. When you did your backup you got a TAR file for System and one for Data, etc., right? Then you convert those to IMGs? If you upgraded and then restored the system backup I can see why that would result in a boot loop. Restoring the data image shouldn't cause such problems though. Is this what you've tried so far? You're right, though. The safest method is to manually restore the data of just the apps where you need that data, and do it one at a time. This would allow you to pinpoint what is causing the issue. Of course, I may have no idea what I'm talking about. I've never actually needed to restore a Nandroid backup! Hopefully someone with more experience there will chime in.
I thought to hell with it I went and solved the issue by installing CM13
Thanks for taking the time to help and see you next time

LG Sunset (LG33L) deleted wrong app question

I know this is probably a shot in the dark, but the phone was rooted with kingroot and working great, I decided to be an idiot and factory reset. I must've deleted a system app that made the phone function properly. The lock screen doesn't work. The recent apps button does nothing either. Also, when I restart the phone it starts the whole factory reset process over. Does anyone have any idea what LG app may govern these things? The phone works besides this, but that is pretty major stuff. I know it's a cheap phone but I thought it was worth asking.
CaptainPatterson said:
I know this is probably a shot in the dark, but the phone was rooted with kingroot and working great, I decided to be an idiot and factory reset. I must've deleted a system app that made the phone function properly. The lock screen doesn't work. The recent apps button does nothing either. Also, when I restart the phone it starts the whole factory reset process over. Does anyone have any idea what LG app may govern these things? The phone works besides this, but that is pretty major stuff. I know it's a cheap phone but I thought it was worth asking.
Click to expand...
Click to collapse
If you can find a copy of your stock firmware, you can:
1) extract the system apps from the firmware(they'll be in the /system/app and /system/priv-app folder, extract the ones that you don't currently have on the device), then push those apps to the corresponding folder on the device using adb push or by using an app that has a root browser.
2) extract the /system/app folder and the /system/priv-app folder, then use adb push to push them back to /system on the device.
3) extract the entire system.img from the firmware then use adb shell and a dd command to dd the system.img on the device to replace the corrupted system with a complete system.
Or you can get copies of what you don't have from another member here with the same device and firmware then use those to replace the deleted apps
After getting them back to where they go, boot to recovery and wipe cache but don't factory reset.
It's always best to disable or hibernate system apps first to determine whether they are needed, if disabling/hibernating them cause issues then you know they can't be deleted, in this case, re-enable/unhibernate the app. If disabling/hibernating an app doesn't cause an issue, then it's safe to remove/uninstall that app. Do this process one app at a time and you'll figure out what you have to keep and what can be gotten rid of. And remember, after removing or adding system apps, you have to boot to recovery and wipe cache partition (and/or dalvik/ART cache if you have custom recovery). Failing to do the wipe will definitely cause issues.
@CaptainPatterson, I added more info.
I DO NOT PROVIDE HELP IN PM, KEEP IT IN THE THREADS WHERE EVERYONE CAN SHARE

Backup methods, .win versus .img, when to use each type?

When I used payload dumper on the OTA for this device I ended up with 34 .img files. When I used TWRP to backup all the partitions from the OxygenOS I end up with 12 .win files. When I used dd commands to get copies of boot_a & boot_b and persist, I end up with .img files. When I used dd commands to get EFS backup I ended up with modemst1.bin and modemst2.bin.
I have all these back ups now but I'm not sure which type of file to use and when.
I have TWRP and Lineage on my 8T and they're working great. But I'd like to now restore OxygenOS, install the latest OTA, re-install TWRP, then install a newer version of Lineage. There's a good chance I'll slip up and have to recover my phone at some point and I'd like to know first if I'm better off trying to get TWRP booted and then restoring all the .win backups, or if I should just flash all the .img files from the payload dumper.
Can anyone offer some tips or explain the difference?
Look in TWRP thread. It mentions what partitions to backup (and restore) when changing ROMs.
Look in TWRP thread. It mentions what partitions to backup (and restore) when changing ROMs.
Click to expand...
Click to collapse
I've read through that thread and made a lot of notes, but I guess I'm just wondering at this point, since we have a fully-functional TWRP is it the case that as long as I have the .win files from the TWRP backup of boot, dtbo, super and data partitions that should be all I need?
Persist.img & Modemst1/2.bin & boot_a/b.img can be discarded? Or would you keep these on hand for other reasons?
FakeGemstone said:
I've read through that thread and made a lot of notes, but I guess I'm just wondering at this point, since we have a fully-functional TWRP is it the case that as long as I have the .win files from the TWRP backup of boot, dtbo, super and data partitions that should be all I need?
Persist.img & Modemst1/2.bin & boot_a/b.img can be discarded? Or would you keep these on hand for other reasons?
Click to expand...
Click to collapse
Persist and modem images presumably contain IMEI information, so better keep them somewhere safe. Boot_a/b.img can be discarded.
It's starting to make sense. Thank you for your explanation.
My phone had Lineage and TWRP installed and was running great, but I wanted to try out the backup and restore option of TWRP. So I backed up /data then used TWRP to restore the OxygenOS to the version I was using right before I installed Lineage. I restored OxygenOS to both slots and also I formatted /data.
After doing an minimal setup on OxygenOS, taking a quick look around to see if everything looked okay and rebooting to system a couple of times, I used TWRP to install LineageOS again. That seemed to work fine. I did minimal setup, took a look around, rebooted a couple of times, so far; so good.
I then followed the instructions from theincognito on Steps for backing up and restoring data in TWRP to restore the data partition:
It seemed to work fine, except I was never presented with a blank screen (a clue?) and the phone just booted to system normally. My apps and settings appeared to be restored BUT the 3-button system navigation icons (home/back/switchapps) were missing. So whenever I navigated away from the home screen there was no way to get back except to reboot the phone. It didn't matter if I switched to 2-button navigation or gesture navigation, none of it worked. So I guess the navigation options are all apps and those apps malfunctioned when /data was restored. Also, I could not enable Advanced Restart for the Power Menu. That's probably a system app, too. I didn't have a password on the phone at any time, or a SIM card installed. I know the TL;DR instructions in post #3 say that you should just reboot to system again if you have this problem, but doing so didn't fix the problem for me. I must have made a mistake at some point.
I ended up wiping the phone, doing a clean install of Lineage and setting up the apps and preferences the old-fashioned way.
I'd like to try this again to see if I can get it to work. Does anyone have suggestions of what went wrong?
Should I have tried restoring /data a second time before giving up and wiping the phone?
Does the fact I didn't get the expected blank screen after restoring /data have any significance?
Did the problem more likely originate with the backup process or the restore process?
Oh boy, it just dawned on me... Should I have also restored the backup of Boot/dtbo/Super? I assumed those wouldn't change if you were restoring to the exact same version of Lineage so I didn't bother with it.
I stumbled across a trick to get the restored data backup working again. I went to Settings --> Apps & Notifications --> App Info. Then I selected the option "Show System" from the list at the top with the 3 vertical dots. From the list of apps I selected 3-button navigation and then selected "force stop". After that, I rebooted and all the settings that were missing before were magically back in place, and both the Status Bar and the Navigation Bar were functioning and configured just the way I had them when I did the backup. I don't know anything about how system apps work so I can't explain why this helped, but I tested it twice with fresh installations of LineageOS and it worked exactly the same both times.
I should add that between this post and the one above from February 1st, I have re-installed Oxygen OS many times using old and new OTA zips, and installed Lineage OS several times, first on one slot then the other. And each time I've restored various back ups of LineageOS system files and LineageOS data files following the instructions, but always the result was a partial restoration of user configurations and missing status and navigation bars. I wonder that I'm the only person who found that booting twice after a data restore didn't bring back those menus. But hopefully if it happens to someone else they'll find this post and know what to do.

Categories

Resources