LG Optimus G 4.1.2 How Do I Replace System/App Folder For A Backup Safely? - General Questions and Answers

how do I replace my actual system/app folder for a backup safely?
I want to make sure things won't go like this again, also sorry for the wall of text beforehand
My phone is the LG Optimus G AT&T and I'm using the stock 4.1.2 rom
I tried to install a status bar for a stock based ROM and a lock icon removal on my stock rom but it didn't work as expected. It messed up some things and the systemui kept notifying me that it stopped working every few seconds. The zip files I flashed supposedly installed a few files inside said folder but I'm not sure which files nor if it edited other files so I want to replace it completely to not have any problem. thing is, I'm not sure of how to proceed here, do I just wipe it with an explorer and then paste the back up there, or will that break my phone again? do I push the backup with adb command prompt after deleting the folder? Is there another option?
I'm not sure if this info is helpful at all but I thought you guys might need to take it into account, just in case
I'm also not sure of which category is the right one, since it's my first post in this forum, though I've been lurking around for quite a while
I tweaked the system apps a bit before screwing up, and deleted the AT&T bloatware that nobody uses, also replaced the stock launcher with nova as a system app. having only 1 launcher caused a huge mess after trying to fix things by replacing the contents the folder with a copy of the backed apps.
First I replaced all 4 files with the name "systemui.apk/odex" and "LGsystemui.apk/odex". then I tried to replace the whole folder by moving things and I accidentally checked the "apply this action for all files" option (or something along those lines) while overwriting them, which probably caused nova launcher to stop working and rebooted my phone automatically. then I spent 2 hours trying to figure out what was wrong with the phone because I couldn't do anything, just open the settings through the status bar and it turned out I had to reinstall nova launcher outside system by sending the apk to myself through email to not get in that mess again, and now I'm here, a little desperate to know what can I do to not screw my phone up.
Thank you

Related

Skinning question

In framework-res.apk, what controls the color of the text for the status bar, such as notifications and the digitial clock? Are these controlled independently by seperate apks?
I'm considering diving in and attempting to skin my android but I want to know what I'm getting into.
I've tried replacing framework.apk that I built from source on a real device and emulator. Only bad things came of it. Had to reflash. Let me know if you have better luck.
I'm pretty sure it failed because a lot of the stuff in framework.apk is stubbed closed source stuff.
Koush,
Have you looked at this post by Living_Sword?
I suggest you enter the following commands using adb, because its faster and reliable than telnet or any other method. If you do not have adb setup, read here, if you do, then just enter adb shell in the console while the phone is connected.
In simple words, you have to re-sign the framework-res.apk with your own key. You should know that you will loose all your data while doing this mod. Here are the steps,
1. Re-sign and re-upload all the .apk files in /system/app with your own key or the test-keys. The command used for signing is included in the readme file alongwith the signing jar here.
2. Take a backup of /system/framework/framework-res.apk. Now, you would want to edit some stuff in framework-res.apk, for that the easiest method is to rename the apk file to .jar/.zip, put in your own files(with same name as original png) and rename it back to .apk. You have to re-sign this apk with the same key like you did in the first step.
3 . Upload the apk file to /system/framework. The phone will hang, and in few secs it will most likely go back to the android robot screen.
4. Take out the battery, then do a data reset by going into recovery mode and pressing ALT+L to see the log text and then ALT+W to wipe out /data. Obviously, you will loose all your apps and settings and will have to re-activate the phone.
5. After the wipe is complete, press HOME + BACK to reboot. The phone should reboot normally now.
I know its a pain to loose all the data and apps, but this is the easiest method until we figure out something more elegant, and its required to be done only once. Also, there is no need to keep the png file size same. And in future, you will be able to replace the framework-res.apk without any hassles.
Also, since each stock app's icon is in its own apk, once you re-sign every apk in /system/app, you can easily replace their icons with your own.
Source: http://www.modmygphone.com/forums/showthread.php?p=16871#post16871
Ok, so I have successfully replaced framework-res.apk with my own build which includes custom icons and things like that. However, I am running into two problems:
1: I keep running out of room in my system folder. Everytime I replace framework-res.apk I am losing space somehow, eventually I have to do the mod rc30 update all over again to get my memory back so I can push this file over, where is this space going? Whats eating it up? Oh, and it isn't the file size growing, this will happen if I pull a file and directly try to push it back onto the phone.
2: I still don't know how to change the default color of the text. I assume it is in one of these xml files but I'm not sure, and I haven't found it yet. Could it be in /res/color/?
If anyone could help me on these two issues I would be so appreciative.
This is what I've done so far, see the status bar and the icons?
Stericson
Stericson said:
Koush,
Have you looked at this post by Living_Sword?
I suggest you enter the following commands using adb, because its faster and reliable than telnet or any other method. If you do not have adb setup, read here, if you do, then just enter adb shell in the console while the phone is connected.
In simple words, you have to re-sign the framework-res.apk with your own key. You should know that you will loose all your data while doing this mod. Here are the steps,
1. Re-sign and re-upload all the .apk files in /system/app with your own key or the test-keys. The command used for signing is included in the readme file alongwith the signing jar here.
2. Take a backup of /system/framework/framework-res.apk. Now, you would want to edit some stuff in framework-res.apk, for that the easiest method is to rename the apk file to .jar/.zip, put in your own files(with same name as original png) and rename it back to .apk. You have to re-sign this apk with the same key like you did in the first step.
3 . Upload the apk file to /system/framework. The phone will hang, and in few secs it will most likely go back to the android robot screen.
4. Take out the battery, then do a data reset by going into recovery mode and pressing ALT+L to see the log text and then ALT+W to wipe out /data. Obviously, you will loose all your apps and settings and will have to re-activate the phone.
5. After the wipe is complete, press HOME + BACK to reboot. The phone should reboot normally now.
I know its a pain to loose all the data and apps, but this is the easiest method until we figure out something more elegant, and its required to be done only once. Also, there is no need to keep the png file size same. And in future, you will be able to replace the framework-res.apk without any hassles.
Also, since each stock app's icon is in its own apk, once you re-sign every apk in /system/app, you can easily replace their icons with your own.
Source: http://www.modmygphone.com/forums/showthread.php?p=16871#post16871
Click to expand...
Click to collapse
framework-res.apk is just the resources. framework.apk contains the actual code used by every application in the system. Attempting to replace THAT file the result of the android build process will fail.
I think we're talking about two different files.
Oh yep, definetly we are...I thought you were talking about that but I figured you would clarify if you were indeed. Thanks.
so you guys are making progress on some themes... GOOD ****..
jzajzz said:
so you guys are making progress on some themes... GOOD ****..
Click to expand...
Click to collapse
Agreed. Once this process is mastered, and some polished themes, or a tool to make your own (or something) comes out, our G1's will look even sweeter.
jzajzz said:
so you guys are making progress on some themes... GOOD ****..
Click to expand...
Click to collapse
Well, I was making progress, but now my phone is bricked. Don't know how it happened. Was doing the same thing I've done over 20 30 times, suddenly started giving me problems, reflashe JF update and voila! bricked phone. So now I'm getting a new one sent to me and hoping that it comes pre-rc30. Sucks too because I am pretty sure I found out where the text color is set. Thats why I'm trying to get this to work under the emulator, but I can't get it to work. The dang emulator won't reboot or shutdown. So I can't see the changed made.
It sounds like it's too late to help now. But how was the phone bricked? Did it go into an infinite reboot cycle? Stay on the G1 screen?
Also, I assume you hadn't loaded the dev bootloader? That could have easily saved your phone from brickage
JesusFreke said:
It sounds like it's too late to help now. But how was the phone bricked? Did it go into an infinite reboot cycle? Stay on the G1 screen?
Also, I assume you hadn't loaded the dev bootloader? That could have easily saved your phone from brickage
Click to expand...
Click to collapse
My phone does have the dev bootloader on it. However, now it just stays on the boot splash screen and I can't do the update because it says the /dev file is gone! Can I reflash all of that and save my phone?
Btw, I actually think the entire folder /system is gone, because I can't abd with root, and when I did it in the update screen my system folder wasn't showing. So, I have no idea how this happened.
Is it possible to push that entire folder back on there and then recover or something?
Yes, you can reflash the recovery partition using the fastboot protocol, which the dev bootloader supports. There isn't a windows binary for it yet, but if you have a linux or mac handy, turn on the phone into bootloader mode, then plug in the USB cable. "Serial0" should change to "FASTBOOT". now you can use the fastboot binary on your computer to flash anything on the phone. You might try re-flashing the recovery image that's in my modified update. If that doesn't work, maybe try flashing the radio too.
If you have the dev bootloader, I'm almost positive your phone can be saved. Give me at IM if you want to talk about it.
I *think* the fastboot binary is in the sdk for linux/mac. I could be wrong though. There are copies of both floating around though, just ask if you need one.
I managed to repack framework-res.apk and resign all other packages without wiping. The problem is with the signatures in /data/system/packages.xml - they no longer match after resigning. The solution is to simply delete all <sigs> sections (and the <certs> within), and the PackageManager will automatically regenerate them as they are launched. I just now successfully booted, so can't say this is thoroughly tested, but I'll report back here if any problems crop up.
donniesmit said:
I managed to repack framework-res.apk and resign all other packages without wiping. The problem is with the signatures in /data/system/packages.xml - they no longer match after resigning. The solution is to simply delete all <sigs> sections (and the <certs> within), and the PackageManager will automatically regenerate them as they are launched. I just now successfully booted, so can't say this is thoroughly tested, but I'll report back here if any problems crop up.
Click to expand...
Click to collapse
A good check after doing something like this is to take a look at the call log, and actually receieve a call (call yourself from your home phone, or whatever). Both of these like to error out when messing around with resigning.

HTC_IME mod

Link to apk file:
forum.xda-developers.com/showthread.php?t=624416
I'm running rooted stocked 2.1...5 with this mod installed. I tried to put it in the system/app folder because there is some room in there, since I removed some apps, but it did not like it. It just kept foreclosing it.
Any idea how to put it in there or even replace the original HTC_IME?
could have something to do with it being made for the nexus one
obsanity said:
Link to apk file:
forum.xda-developers.com/showthread.php?t=624416
I'm running rooted stocked 2.1...5 with this mod installed. I tried to put it in the system/app folder because there is some room in there, since I removed some apps, but it did not like it. It just kept foreclosing it.
Any idea how to put it in there or even replace the original HTC_IME?
Click to expand...
Click to collapse
i've made one from there, and installed it. I didn't push it to /system/app.
try doing that.
also make sure you are using the low res option.
obsanity said:
Link to apk file:
forum.xda-developers.com/showthread.php?t=624416
I'm running rooted stocked 2.1...5 with this mod installed. I tried to put it in the system/app folder because there is some room in there, since I removed some apps, but it did not like it. It just kept foreclosing it.
Any idea how to put it in there or even replace the original HTC_IME?
Click to expand...
Click to collapse
First make sure you downloaded the "lo" version, since Hero is low-res. And unpack the ZIP. It's not flashable, it's just zipped for convenience.
And then you can just install HTC_IME_lo.apk from your file manager by clicking it. There's no need to manually push it into /system/app. (It's registered differently from the default HTC_IME, so it can be installed like any normal application.) If you removed Clicker.apk while you were removing junk from /system/app, you'll need to reinstall that as well.
If you really want to replace the original HTC_IME, just rename HTC_IME_lo.apk to HTC_IME.apk and push it to /system/app. I think that's what you were trying to do before.
Hope this helps!
Oh, sorry I guess I forgot to mention that it is running fine in the user folder after installing it. It's just that I wanted to put in the system/app folder to save some space. I'll try renaming it and replacing with the stocked file. BTW, I'm typing on it now and its way better than the stocked because of how much customization you can do.
I finally tied this and it's a no go. Still get FC messages. However, all seems fine when I install it as an app. I think it's because the HTC_IME.odex file which is tied to the original. Even after rebooting it didn't work.
Anyone know how to get that odex file from the new HTC_IME I'm trying to install in the system/app folder?

LatinIME.apk/Keyboard installation help please

I couldn't find an appropriate thread to place this under, but this looked like the most logical.
I recently rooted my phone and installed a custom rom on it. The Smoked Glass v6.0.1. I find the default apps very annoying and found a way to make them disapear. I changed the .apk file in the/system/app section to .bak.
Well in this rom the Voice Search app is also connected with the Android keyboard. If I remove the Voice Search I also remove the virtual keyboard. The app is called VoiceSearchWithKeyboard.apk.
So I changed it to .bak and tried to install the android stock keyboard called LatinIME.apk. I also found the libjni_latinime.so. I pushed these to my phone using the SDK tool. One to the /system/lib and the other to /system/app. When I booted my phone up I didn't get the keyboard. So I also pushed the LatinIME.odex over to the /system/app file and it still didn't work. The phone ended up not being able to boot up, so I had to go into flash recovery and back up the phone.
So I am just wondering what am I doing wrong? I know this may not make sense as to why I just don't deal with the extra icon. But I don't know, I just want it perfect I quess.
Any help would be greatly appreciated. Thanks.

[Tutorial] Status bar transparency

I've been seeing way too many requests for this with just about every mod possible. Considering the simplicity of this mod, the easiest way to please everyone, is for all of you to know how to accomplish this mod yourself.
BTW, this is for the status bar itself, not pulldown bar or notification background.
What you need:
- Paint.NET software (or any other image editing software that you are already comfortable with, this one seems to be the easiest for setting transparency though.)
- Your framework-res.apk AFTER you have all of your other mods applied to your phone. Otherwise you will have to apply this mod again every time you add or change mods (most likely).
- 7zip
So, you should have your framework-res.apk on your computer and 7zip installed to open the apk. Open up the framework, navigate to /res/drawable-hdpi folder. In that folder, find the file statusbar_background.png. You can either pull that file out to your computer to edit it or open it straight from 7zip (which is the best way to ensure there is no issues when pushing framework back to the phone) but you must have your editing software set as the default to open .png files.
Now once you have that file open in Paint.NET, you will see the image of the status bar as you currently have it. Up on the top toolbar, you should see the option "Layers". Click that then select "Layer properties" at the bottom of the drop-down. At the bottom of the window that pops up, you should see "Opacity" and the number set at 255 with the neighboring slider all the way to the right. I suggest using the slider because as you move it you will see the transparency applied to the bar image, allowing you to slide it around to the desired transparency.
Once you have finished setting your transparency, click the little disk image at the top left to save your changes, close the program out and you should then see a box pop up in 7zip (if you made changes without unpacking the file from 7zip first) asking if you would like to apply changes to file you edited. Say yes, then close 7zip, which may or may not state that changes have been made to the apk and if you'd like to update it, which you would say yes to if it does. If you unpacked the file from 7zip, simply drag and drop the file back into its correct spot, confirm you want to replace the file, then close it up. After all of this is done, just put framework-res.apk back into the framework folder on your phone whatever way you like, turn your phone on and you have a transparent status bar.
As a side note, you can play with Paint.net to see all of the modifications you can make to your status bar like changing colors, texture, and a few other things. One piece of advice is to have a backup framework-res.apk in case you make a mistake or something.
excuse my extreme noobness, but what is the best way to transfer the apk back and forth from the phone to computer? yes I am new to this and yes I am a retard and yes I probably shouldnt even try this..
JoeyBones1 said:
excuse my extreme noobness, but what is the best way to transfer the apk back and forth from the phone to computer? yes I am new to this and yes I am a retard and yes I probably shouldnt even try this..
Click to expand...
Click to collapse
Easiest way would be to get root explorer so you can navigate to the /system/framework folder and copy the apk from there to your sdcard, where you can just copy it to your computer. the other option would be plugging your phone into your computer, phone should be on, open up command prompt then navigate to your sdk/tools folder (get it if you dont already have it), then type "adb pull /system/framework/framework-res.apk c:\" without the quotes. the file will be in the root of your C directory. To get it back on your phone when finished, for root explorer just reverse the steps, but when moving the apk back to its proper folder, just hit the "Mount R/W" button at the top right of root explorer, copy the file back in and reboot. For alternate method, boot into recovery, mount /system partition, then in prompt after navigating to sdk tools folder type "adb push c:\insertdirectoryto\framework-res.apk /system/framework/" without quotes, then boot up and youre done.
tried this...boot looped...had to restore backup...thanks for the info though...might try again soon
BillytheKid82 said:
tried this...boot looped...had to restore backup...thanks for the info though...might try again soon
Click to expand...
Click to collapse
Did you try editing the file without extracting it or did you extract it and reinsert it?
Or you could edit the .png and use metamorph to push it into the framework-res.apk without moving or unzipping anything. And you could just keep the metamorph theme with that one .png on your sdcard to re-apply it whenever you flash a new rom, without altering any other theme elements you've already applied.
What do I edit to change the pull down notifications?
Sent from my Incredible using XDA App
thx a ton got it
transparent, transferring back to phone now..we will see
edit ..boot loops too..
i used root explorer ..extracted framework-res.apk to my sd card ,,then on my computer i opened paint.net and edited the statusbar_background.png file and then
zipped back up the framework-res and renamed to apk then copied back to my framework folder and it the forced closed and went into boot lopes...
i know im close to getting this right ..what step am i skrewing up?
i edited the file w/out extracting it...using root explorer i copied the framework res to my sdcard...plugged my phone in to comp, opened the framework res w/ 7zip, edited w/ gimp, saved all changes...unmounted phone, used root explorer and copied the new edited framework, then navigated to the original framework res and pasted the new one there to overwrite the original...then it force closed so i tried to paste it again, then the phone rebooted and boot looped? not sure if i did something wrong
Gahh Its Lee said:
What do I edit to change the pull down notifications?
Sent from my Incredible using XDA App
Click to expand...
Click to collapse
That file is a .9.png file. editing these is ridiculously difficult and ill-advised.
chrisloveskaos said:
thx a ton got it
transparent, transferring back to phone now..we will see
edit ..boot loops too..
i used root explorer ..extracted framework-res.apk to my sd card ,,then on my computer i opened paint.net and edited the statusbar_background.png file and then
zipped back up the framework-res and renamed to apk then copied back to my framework folder and it the forced closed and went into boot lopes...
i know im close to getting this right ..what step am i skrewing up?
Click to expand...
Click to collapse
BillytheKid82 said:
i edited the file w/out extracting it...using root explorer i copied the framework res to my sdcard...plugged my phone in to comp, opened the framework res w/ 7zip, edited w/ gimp, saved all changes...unmounted phone, used root explorer and copied the new edited framework, then navigated to the original framework res and pasted the new one there to overwrite the original...then it force closed so i tried to paste it again, then the phone rebooted and boot looped? not sure if i did something wrong
Click to expand...
Click to collapse
I JUST remembered that I think you need to be running a deodexed rom to allow modifications. I've always used deodexed roms and forgot that it might be a requirement for things like this. Do either of you know if what youre running is deodexed or not?
mixedlemon said:
Or you could edit the .png and use metamorph to push it into the framework-res.apk without moving or unzipping anything. And you could just keep the metamorph theme with that one .png on your sdcard to re-apply it whenever you flash a new rom, without altering any other theme elements you've already applied.
Click to expand...
Click to collapse
metamorph is definitely more useful. I just have never created anything to run with it so I don't know the process of doing so.
im running skyraider vanilla, i tried to look on the thread to see if it is deodexed and i couldn't find if it is or not...may not be...thanks for your help
mb02 said:
I JUST remembered that I think you need to be running a deodexed rom to allow modifications. I've always used deodexed roms and forgot that it might be a requirement for things like this. Do either of you know if what youre running is deodexed or not?
Click to expand...
Click to collapse
running new skyraider 3.3 and im sure it is
Yea it seems they are both deodexed, and btw I didn't know skyraider 3.3 was so awesome I'm tempted to switch over to it. But yea, I'm not sure why your phones aren't allowing the modifications to the framework. I might as well load SR 3.3 and see for myself what's up. I'll get on that later tonight when I have time and let you guys know if i figure anything out.
Use this with metamorph. It will work on any rom (tested on skyraider 3.3) except those that still use the "drawable-hdpi-v4" folder in the framework-res.apk. If your rom uses that folder, simply rename the folder it puts on your sdcard in /sdcard/AndroidThemes/HalfTransparentBar/
If you'd rather have a different transparency just replace the .png in the folder with yours.
In fact, if you want to edit ANY graphic on your rom, just put the .png in the /sdcard/AndroidThemes/xxxxxx/framework-res/res/drawable-hdpi/ folder with the same file name as the one you want to replace. And of course, do a nandroid backup just in case.
EDIT: As Berzerker7 pointed out, this file probably wont make anything transparent unless you have a modified services.jar. oops.
mixedlemon said:
Use this with metamorph. It will work on any rom (tested on skyraider 3.3) except those that still use the "drawable-hdpi-v4" folder in the framework-res.apk. If your rom uses that folder, simply rename the folder it puts on your sdcard in /sdcard/AndroidThemes/HalfTransparentBar/
If you'd rather have a different transparency just replace the .png in the folder with yours.
In fact, if you want to edit ANY graphic on your rom, just put the .png in the /sdcard/AndroidThemes/xxxxxx/framework-res/res/drawable-hdpi/ folder with the same file name as the one you want to replace.
edit: and of course, do a nandroid backup just in case.
Click to expand...
Click to collapse
Well then that simplifies a lot of things lol. Thanks for putting that up for us, makes everything even easier.
Simply swapping a file won't work. It's the same reason simply swapping a transparent image for the notification pull-down doesn't work. Opacity is controlled on another level by services.jar. You need to modify the values there, as well as swapping out for a transparent image.
Btw, this didn't work for me on SkyRaider 3.3. (Metamorph or swapping the file).
It makes the background black but not transparent on virtuous 3.0.1
mixedlemon said:
Use this with metamorph. It will work on any rom (tested on skyraider 3.3) except those that still use the "drawable-hdpi-v4" folder in the framework-res.apk. If your rom uses that folder, simply rename the folder it puts on your sdcard in /sdcard/AndroidThemes/HalfTransparentBar/
If you'd rather have a different transparency just replace the .png in the folder with yours.
In fact, if you want to edit ANY graphic on your rom, just put the .png in the /sdcard/AndroidThemes/xxxxxx/framework-res/res/drawable-hdpi/ folder with the same file name as the one you want to replace.
edit: and of course, do a nandroid backup just in case.
Click to expand...
Click to collapse
Berzerker7 said:
Simply swapping a file won't work. It's the same reason simply swapping a transparent image for the notification pull-down doesn't work. Opacity is controlled on another level by services.jar. You need to modify the values there, as well as swapping out for a transparent image.
Btw, this didn't work for me on SkyRaider 3.3. (Metamorph or swapping the file).
Click to expand...
Click to collapse
Ah, I must have already installed a theme that modified it, then.
WOOOT!
SO can't wait to try this!
Wow... epic fail on my part... edited the image, repackaged, compared to original, file sizes/compression were similar enough, so I copied it onto my SD card and went in to Root Explorer... Mistake number 1)forgot to do a nandroid OR a titanium, Mistake number 2)Renamed the framework-res.apk to framework-res.bak BEFORE I copied the new file to the /system/framework. As soon as I did that, everything went haywire so I did a battery pull and went to do it the ADB way from recovery. Thought I did that right, so I rebooted into a bootloop... Finally gave up so I decided to do mistake number 3)full nandroid restore of a backup that was admittedly a few days old (See mistake 1 lol) after which I had rearranged a few things and added more apps etc... Now on to the important stuff...
MAKE SURE YOU DO STEP 1 BEFORE ATTEMPTING ANY OF THIS AND IF YOU RUN INTO PROBLEMS, DO STEP 2 SO YOU DON'T MAKE THE SAME MISTAKE I DID!
Step 1)For the love of all that's holy, do a Nandroid and Titanium backup first!
Step 2)In Clockwork Mod Recovery, do NOT do a full restore, instead go to advanced restore and simply restore the system (the part that you were messing around with to do this mod lol I realized this gem just as I clicked "Yes" in CWM, I still have the palm print on my forehead... haha​
Hopefully you folks will have better luck than I did, but if not, hopefully I can save you some of the headache I went thru...

[Q] Messed up framework, how can i fixed it?

I've been trying to change to gingerbread theme for mini pro, did something wrong though and not all elements were functioning properly so I tried to restore the original framework, copied the original, previously copied framework.res and pasted it into /system/framework folder. The phone turned off and all i got now is sony ericsson loading text when trying to turn it on again. I'm completely new with android so please help. How can i put it into recovery mode to install firmware from the beginning or make it work any other way?

Categories

Resources