Changing where OTA updates get stored on LG Spectrum and possibly other phones - Android Q&A, Help & Troubleshooting

Ok, this will be a bit of a technical thread, so bear with me. This is so people have an understanding of how to find and look at the update files that get put on a phone. If you are reading thru this, I will assume that you have a basic understanding of ADB and possibly of shell commands like ls and cd
When you go into settings -> About Phone - Software update, your phone does many checks to the file system. One of them is at a file /data/fota/ipth-muc.prop . Most people do not know this directory exists as when you are in ADB you can not do a list command on the /data directory without root. This file is re-created each time you boot your phone. If we do the following command, we can dowload the file to our computer:
ADB pull /data/fota/ipth-muc.prop
If we open the file, it will look a lot like this.
firmware.version=VS920ZV3
max.pkg.size=157286400
This file can also contain additional data. The string we want to add in there is where to download and place update packages. This can be defined as such:
pkg.location=
If this line does not exist, it will default to /cache/fota . Being as we can not cd into /cache or pull/push files there, this is a bad spot to put it. How ever, we can make directories and read/write to them under /data/local . Using this info we can do the following.
ADB shell
mkdir /data/local/temp
exit
From there, we can edit the original ipth-muc.prop file we pulled to look like this:
firmware.version=VS920ZV3
max.pkg.size=157286400
pkg.location=/data/local/temp
If you edit the file, use a true file editor. Notepad will not save it correctly, but Wordpad had no issues. From there we do the following
ADB push ipth-muc.prop /data/fota
Now when we do the update, it will place the downloaded files into our temp directory (note, you must do this after the phone is fully booted, but before you have the phone look for an update). Once the files are done downloading, click remind me later. Then we can go into ADB and pull the files.
ADB pull /data/local/temp
You will get two files. One will be the update "ipth_package.bin" and the manifest files "ipth_package.bin.dd" . The manifest file also contains the link to the original file name as link to it on the host server. The ipth_package.bin file is a simple zip file that can be opened with almost any archiving program.
The zip is signed by LG using their personal key, so modifying it and pushing it back to the phone is not currently possible. We can however see the contents of an update and see what is being change. I hope to use this in the near future to either break the LG key or find a way to find a glitch in a patch being done.

Related

[TOOL] Back up custom system files from recovery

This is a tool I made for myself for backing up some of the custom files... Mostly as a result of wanting to expedite the process of backing up some configuration files in /system (such as inadyn.conf or bashrc on synergy rom). It reads a text file to determine what files you want, saves them in a tar on your sdcard (necessary to tar them to keep permissions the same when transferring to fat). Then you flash the restore zip to put them back.
It's set to not backup if there already is a backup (to prevent overwriting your custom files by clicking the wrong zip). The backup.tar is deleted on successful restore.
To use, create a text file in /sdcard/custBackups called custom_files.txt, and put the full pathname of each desired file in there, seperated by a single space (no newlines). While in recovery, run the backup zip to save your custom files, and run the restore zip to restore them after flashing.
An easy way to add the files while using adb shell (with busybox installed) is to cd and ls around to find your file, then while working in the same directory run this command
echo " `realpath myfilename`" >> /sdcard/custBackups/custom_files.txt
(those are backticks, not single quotes, which may be on hackers keyboard but isn't on most android keyboards, that's why I suggested adb shell)
looks long but is pretty quick with bash completion. But only needs to be done once for each file, the text file stays in place.
Thanks to Cyanogen's team and ginger yoshi, as I got the idea from them and learned the updater script reading their files.
A dev can put this in their own updater script so it's all in one (which I do when exporting the svn for synergy). If you can't figure out how to add it reading my script, let me know. And if any devs do use, just shoot me some credit.
If this is used on any other phone, the assert command and mount command in updater script needs to be changed to suit... the rest should be pretty universal.
Is this something like Titanium Backup.apk but in zip format?
No I made this just for synergy for backing up the special configuration files for some of the special tools i'm that ROM, like inadyn and dropbear. Also any special themed files, my fonts..
Basically, catching any system files that titanium and other apps don't get.
Sent from my PG86100 using XDA App

Edited build.prop; phone now hangs during boot

Well I've had my first issue with my shiny new handset! I rooted it this afternoon and decided to modify the build.prop to change the dalvik heap size as recommended by various people. However on rebooting, the phone's now hanging on the splash screen.
I can get into download and recovery ok - any ideas on how to fix this? Is build.prop editable in either of these modes?
If you have adb, boot in to CWM, adb pull /system/build.prop
Edit the file, please note that if you're on windows, DO NOT USE WORD or anything similar, it'll mess up your line endings (Newline Format), I suspect this is what happened in the first place.
In any case, if you need to edit the file in plain notepad, download "ToFroDos" and run todos on the file before editing,
then edit, then run fromdos on the file, then adb push it back on to the device.
Note on Re-uploading: you may need to execute adb remount rw in order to upload the file.
In any case, short form:
1. Boot to recovery
2. adb pull /system/build.prop
3. Edit locally (Making sure to keep the proper newline format (\n))
3.5 adb remount rw
4. adb push ./build.prop /system/build.prop
As said extract the original one from the rom and push it manually via adb push command
Sent from my GT-I9300 using Tapatalk 2
Oddly enough I used the build.prop editor app from the Play store. Seems that the issue was that it didn't put an 'm' at the end of the line specifying the size - so it read as '128'. Anyway, I've done what you suggested, and it worked - excellent stuff, thanks!
Next time, just use Jota Text Editor on your phone
I have use it many times to edit my build.prop file and never have issue
I tried adb pull /system/build.prop, but the build.prop file doesn't appear anywhere on my PC, so I can't edit it. My device appears in adb devices, and the command line responds with "718 KB/s (2943 bytes in 0.004s)" when I enter "adb pull /system/build.prop", but I can't find it
guitarplayer365 said:
I tried adb pull /system/build.prop, but the build.prop file doesn't appear anywhere on my PC, so I can't edit it. My device appears in adb devices, and the command line responds with "718 KB/s (2943 bytes in 0.004s)" when I enter "adb pull /system/build.prop", but I can't find it
Click to expand...
Click to collapse
Make sure you're not in a readonly directory on the host,
a default cmd in windows will start in the dir of %ComSpec% (Usually C:\windows\system32).
Abd will try to put files wherever you're located in you filesystem, unless you tell it otherwise. (adb pull {source} [destination])
Sent from my GT-I9300 using XDA
T0yK4T said:
If you have adb, boot in to CWM, adb pull /system/build.prop
Edit the file, please note that if you're on windows, DO NOT USE WORD or anything similar, it'll mess up your line endings (Newline Format), I suspect this is what happened in the first place.
In any case, if you need to edit the file in plain notepad, download "ToFroDos" and run todos on the file before editing,
then edit, then run fromdos on the file, then adb push it back on to the device.
Note on Re-uploading: you may need to execute adb remount rw in order to upload the file.
In any case, short form:
1. Boot to recovery
2. adb pull /system/build.prop
3. Edit locally (Making sure to keep the proper newline format (\n))
3.5 adb remount rw
4. adb push ./build.prop /system/build.prop
Click to expand...
Click to collapse
How do I do ADB pull/push if I can only get to the stock recovery screen? (The one with Mr. Android on his back with the ! above him)
BTW, I'm on a Note 3
Check the permissions!!!!!
The build.prop file should have 644 permissions.
Check if it fits, else change them using adb.
See other thread
http://forum.xda-developers.com/showthread.php?t=1927198

[Q] - exec '/system/bin/sh' failed: Permission denied (13) -

Does anyone know how to use linux to push an original sh file or even just the whole bin folder?
I am unable to use the shell command in adb because I really messed that up by replacing my bin folder with another phones bin folder (same phone make and model - Samsung Proclaim).
(whoops, as you can tell I don't understand much about the system files and therefore I shouldn't be messing with them but my phone was stuck in a bootloop and I got google happy and desparate)
But I've read a few things about possibly using linux to get in there and put the originals back. I have been using linux for a short while but I lack the skills necessary to do this.
Does anyone know if this is something that I can learn to do in a few days or is this something that only years of experience can accomplish?
I'm willing to search and read whatever is necessary I just need a push in the right direction.
Download Stock ROM
Open and decompress zip file (or whatever)
not just adb push the sh executable but all /system folder
remount /system
Code:
adb remount
Code:
adb push ./STOCK_DECOMP/system /system
if you get errors on copying app, just copy each internal folder one by one
at least i got internal shell on a Kindle doing this way (just copying an original sh didn't resolve my problem), but all environment was a little messy.
good luck.

Interesting issue, possibly permissions error?

I've messed with some of my files on my phone through ES File manager, and I kept getting errors with a specific folder, I then realized that, it's only happening with the folder I created while pushing a file through adb. ESFM has root permissions enabled, but I could not find where to view the permissions for a folder, only files. I also managed to change the stuff in the folder while in recovery. Do I need to set the permissions for the folder through adb right after i create it, or is it a bug somewhere with the ROM/device, or just a random error? If someone could provide an explanation it would be nice.
Viper 1.2.0
s-off
ML417 said:
I've messed with some of my files on my phone through ES File manager, and I kept getting errors with a specific folder, I then realized that, it's only happening with the folder I created while pushing a file through adb. ESFM has root permissions enabled, but I could not find where to view the permissions for a folder, only files. I also managed to change the stuff in the folder while in recovery. Do I need to set the permissions for the folder through adb right after i create it, or is it a bug somewhere with the ROM/device, or just a random error? If someone could provide an explanation it would be nice.
Viper 1.2.0
s-off
Click to expand...
Click to collapse
See if you can duplicate the error while pulling a logcat. That will help out in solving your problem.
if you dont wanna do that just adb remount and chmod the folder either through adb or adb shell access then restart phone
It's specific to only the folder i created through adb. I'm wondering if anyone else experienced it, or if it is only on my phone
what type of folder and either way you should be able to just adb shell then su then chmod /path to folder
t1gartist said:
what type of folder and either way you should be able to just adb shell then su then chmod /path to folder
Click to expand...
Click to collapse
I created the folder on the /sdcard while pushing a file from my computer. The folder was still accessable, I just wasn't able to copy anything into it/edit it. What permissions would be given to a folder like that if i didn't specify them?
you should have been able to read and write by default all of mine are... erm.... delete the folder and create it via root browser or what ever explorer you have and you should be able to long press and access permissions

[Q] Please help- simple mistake... bricked phone

Hi all-
I have unknowingly renamed the framework-res.apk file to framework-res.bak, following the suggestion of a website (who had said to copy the file over, not rename it). I had no idea that would make the phone instantly useless, and render everything inoperative
I was rooted. All I need to do is copy the backup back over, but how?
I am able to get into CMM-based Recovery v5.0.2.7 and can mount the system directory and see it on my PC, but for some reason the framework directory is invisible. There is talk on the web about getting to a prompt and typing:
adb push framework-res.apk /system/framework/framework-res.apk
But how in the world do you get to a prompt? I don't see it on any menu, anywhere and the adb command is unrecognized on my OS.
Hoping I'm not ruined...... thanks for any advice.
Samsung Captivate Glide Android 2.3, Ubuntu
To get ADB, you first have to install the Android SDK.
http://developer.android.com/sdk/index.html
Then, you have to put ADB in the PATH variable.
http://www.redmondpie.com/how-to-set-up-android-adb-and-fastboot-on-windows-tutorial/
After that, you can just type adb in the command prompt and it should work.
Hi,
I downloaded the SDK tools and got the adb command, but when I mount the phone with recovery I still don't see any framework directory.
I got to DOS and navigated to the directory where my copied framework-res.apk file was, and ran:
c:\adb\adb push framework-res.apk L:\framework\framework-res.apk
it replied with:
1319 kb/s (7979827 bytes in 5.905s)
However, then I rebooted the phone and it won't get past the SAMSUNG screen at all, it just sits there forever.
- why can't I see the framework directory, even though I have mounted it through CWM based recovery?
- can I see it using the ADB tools?
- has just copying the copied file back over, destroyed the cell phone? I can't possibly see how.
Thanks for any help
OK I found out the problem.
you need to use forward slashes and put the whole pathname in:
C:\adb\adb push framework-res.apk /system/framework/framework-res.apk
Thats assuming you have the adb command in the c:\adb directory.
It seems the phone is working again.
WHEW! Man that file is dangerous. be warned.

Categories

Resources