How to custom LGHome.apk - G3 Q&A, Help & Troubleshooting

I just want to modify some strings in LGHome.apk
I use apk-multi-tool to decompile and recompile it, and it seems successfully
Then I extract resource.arsc from the unsignedLGHome.apk and add it the original LGHome.apk
After that, I copy the new LGHome.apk to /system/priv-app and set the permission,
then I reboot the phone, but the home app FC and I cannot access the home screen.
I have another try that I did not modify anything, just decompile and recompile it, and replace the resource.arsc
But it still failed.
I have use this approach to modify many apk, such as LGSettings.apk.
I do not know why it cannot be applied to LGHome.apk. Is there anything special for this apk?
Thank you very much.

bfdream said:
I just want to modify some strings in LGHome.apk
I use apk-multi-tool to decompile and recompile it, and it seems successfully
Then I extract resource.arsc from the unsignedLGHome.apk and add it the original LGHome.apk
After that, I copy the new LGHome.apk to /system/priv-app and set the permission,
then I reboot the phone, but the home app FC and I cannot access the home screen.
I have another try that I did not modify anything, just decompile and recompile it, and replace the resource.arsc
But it still failed.
I have use this approach to modify many apk, such as LGSettings.apk.
I do not know why it cannot be applied to LGHome.apk. Is there anything special for this apk?
Thank you very much.
Click to expand...
Click to collapse
What do the logs say about the reason for the FC?

Related

[Q] Do I have to theme using an update zip?

Noob to theme'ing.
Do I have to make an update zip to theme or can I modify the framework apk and just push that to /system/app?
You can just modify and push framework-res.apk to system/framework/
Sent from my ADR6300 using XDA App
Oddity said:
You can just modify and push framework-res.apk to system/framework/
Click to expand...
Click to collapse
system/framework/
sorry i've been at this computer too long lol
My replacement keeps giving me boot loops.
All I changed was: I duplicated the green lockslider and its components and renamed them to replace the other gray locksliders.
then I compressed the framework-res to a zip (using built in mac zip compression, mac user so i can't use winrar) and change zip to apk. adb push to system/framework/
any ideas what is going wrong?
cupcakera said:
My replacement keeps giving me boot loops.
All I changed was: I duplicated the green lockslider and its components and renamed them to replace the other gray locksliders.
then I compressed the framework-res to a zip (using built in mac zip compression, mac user so i can't use winrar) and change zip to apk. adb push to system/framework/
any ideas what is going wrong?
Click to expand...
Click to collapse
Have you tried installing it via a update.zip?
cupcakera said:
My replacement keeps giving me boot loops.
All I changed was: I duplicated the green lockslider and its components and renamed them to replace the other gray locksliders.
then I compressed the framework-res to a zip (using built in mac zip compression, mac user so i can't use winrar) and change zip to apk. adb push to system/framework/
any ideas what is going wrong?
Click to expand...
Click to collapse
Well this gets to be a bit confusing. I will say what i know hopefully others can help out too.
APKs are just zip containers that are signed, that means there is no compression. In your zip program look for a setting under compression labeled store. You would then have to sign that bad boy in order for your phone to work. You can not use the testsign certificate.
With that being said here is a guide...
Modifying?
PNG's -> open the apk up in the zip program, navigate to the res/whatever_folder_had_the_original and drop your files in.
9.PNGs and XML more complicated. You will have to decompile the apk [apktool] then modify them [look for articles on that, i cant get too indepth here]. Compile the apk. Drag the now compiled xml and 9.pngs to the respective folder open in your zip program.
Really the object is not to mess up the signing that comes with the apk. opening up the apk in a zip program, allows you to view, and replace files with not destroying the signature.
This method will not work with all applications. I have still not figured why some programs work with being signed with a testcert and others are not. I have a hunch that all userspace programs can be test signed and all system files need their own [htc?] key.
Also to note is that for some reason the phone when looking at framework-res, services.jar and others does not seem to mind the differences in CRC of the files stored in it, with what is in the manifest. I still can figure out the phones reasoning to allow this to happen on some but not all apps.
I hope this was not very confusing. I am working on video toturials of this same subject. Stay tuned!
That really helps a lot. Thanks.
I'll try that out tonight. Any recommendations for zip programs with a store feature for mac?
cupcakera said:
That really helps a lot. Thanks.
I'll try that out tonight. Any recommendations for zip programs with a store feature for mac?
Click to expand...
Click to collapse
I use BetterZip on my mac..........open the apk with Betterzip, then extract the res folder to your desktop (or wherever you want). Edit the .png files you want.......steer clear ( unless you know how) of editing the 9.png files. Delete the original res folder from the framework folder and insert the res folder you just edited. Then save the framework-res.apk and push back to where it belongs.
I like 7zip better, but this works okay, since there is no 7zip for a mac.
Betterzip worked perfectly! Thanks again.

[Q] Binary XML edits....

Hi there,
I am trying to learn all this theming and have started with the basics, the notification bar icons in framework-res.apk.
I can pull it from the phone, I can decompile it but I am having a challenge putting it all back together as I changed the number of images in a specific animation and then edited the XML file regarding that, but I think there must be other references to the files as now there are less files and the error log is saying it can't find the ones I removed (both the png's and the references in the one xml file) when trying to recompile.
Is there a master XML listing all the files expected or something.
many thanks in advance
David P
Let me guess you are using apktool?
What you need to do is take a clean version of the apk you want to edit. For arguments sake let's say you are editing framework-res.apk.
Decompile using apktool and make your edits to .xml files ONLY. Once done recompile using,
apktool b -f [foldername] framework-res.apk
Now this recompiled apk will probably not work. However the xml files will be properly recompiled. So now you extract the edited .xml files, add them to a clean unedited framework-res.apk (not a de and re copmpiled one) without extracting the .apk. Just add and replace the files using WinRar or whatever.
Also add your edited images to necessary folder in the clean .apk too. So the end result is a clean framework-res.apk that you have updated with your edited .xml files and edited images. This apk should function just fine!!
Sorry if this is a big mess but it makes sense to me and it works for me.
Thanks for the suggestion. I am not quite sure what I am using, I have tried ThemePro for windows and APKManager, both of which are just scripted batch files so I would need to check what they use to extract or decompile with.
So Basically, I decompile, edit the xml (while textual) then recompile so the XML's are binary again. Then pull the BINARY XML#'s from the APK and use those with all the appropriate files and folders which I then create a new clean APK from by zipping it and renaming to .apk, correct?
David P
ephumuris said:
Let me guess you are using apktool?
What you need to do is take a clean version of the apk you want to edit. For arguments sake let's say you are editing framework-res.apk.
Decompile using apktool and make your edits to .xml files ONLY. Once done recompile using,
apktool b -f [foldername] framework-res.apk
Now this recompiled apk will probably not work. However the xml files will be properly recompiled. So now you extract the edited .xml files, add them to a clean unedited framework-res.apk (not a de and re copmpiled one) without extracting the .apk. Just add and replace the files using WinRar or whatever.
Also add your edited images to necessary folder in the clean .apk too. So the end result is a clean framework-res.apk that you have updated with your edited .xml files and edited images. This apk should function just fine!!
Sorry if this is a big mess but it makes sense to me and it works for me.
Click to expand...
Click to collapse
A lot of thanks!!! I'm looking for an explanation like this, all that I try give me an unusable framework-res.apk and now I know why.
ephumuris said:
Now this recompiled apk will probably not work.
Click to expand...
Click to collapse
Apktool creates "clean" apks as you name them. There is almost no difference between application built from sources or using apktool. And almost no logical difference between original apk and rebuilt one (for most apps, of course apktool doesn't support some of them).
If you are talking about system apps, then your problems are most probably related to incorrect way of installing resulting apk, not to it's structure. You can't reinstall system app easily and one of workarounds is to copy AndroidManifest.xml and META-INF from original file and push it to a device. Actually you did this using your method and I think this is the reason, why you think there is something wrong with apks built by apktool.

[Q] Force Close after re-compiling framework-res.apk

Hi,
I'm trying to make some changes to framework-res.apk.
I user APK Manager 4.9 to decompile the file, then made one trivial change to a XML file (changed one auto brightness related value).
I then compiled back to APK without signing and pushed to the phone in recovery mode the deleted Dalvik cache just to be on the safe side.
No matter how I play with it I always get FC from all the system apps immediately after the phone completes the boot process.
Some more information:
1. My original APK had directories like /res/drawable-hdpi-v4 while after decomplie they become res/drawable-hdpi (without the "v4")
2. After I recompile the "v4" directories are not created back and the generated APK contains the directories without the v4
3. If I use the "Reduce errors" feature of the APK manager complie option then I end up with APK that contains both the directories with v4 and those without.
4. I tried with the "reduce errors" option and without it (in which case I manually copied the signature directory into the APK) but got same FC.
5. It seems that once the FCs begin to happen they don't stop until a full nandroid restore. Even if I put the original framework.res.apk file I still get FCs after rebooting.
6. I'm using Revolution HD 2.0.11 ROM
7. The APK file I'm trying to modify was generated by the UOT kitchen.
Any idea what am I doing wrong?
No one knows?
erank said:
No one knows?
Click to expand...
Click to collapse
You dont need to decompile the framework to edit the files, heres the best way, take the the original framework-res.apk, and copy it to your pc, use 7zip to extract the .apk and extract any files you want to edit from the extracted framework, now go back to your original framework-res.apk and right click on it, find 7zip in the contex menu and click open, the contents of the apk will appear in a new window, now just drag and drop your edied files in the right directorys, once done, close 7zip, push the framework back to /system/framework/, wipe the dalvik cache and your done
AndroHero said:
You dont need to decompile the framework to edit the files, heres the best way, take the the original framework-res.apk, and copy it to your pc, use 7zip to extract the .apk and extract any files you want to edit from the extracted framework, now go back to your original framework-res.apk and right click on it, find 7zip in the contex menu and click open, the contents of the apk will appear in a new window, now just drag and drop your edied files in the right directorys, once done, close 7zip, push the framework back to /system/framework/, wipe the dalvik cache and your done
Click to expand...
Click to collapse
The files I want to edit are XML files which are compiled to reasources.arsc, as far as I know 7zip can't extract those, it has to be decompiled.
erank said:
The files I want to edit are XML files which are compiled to reasources.arsc, as far as I know 7zip can't extract those, it has to be decompiled.
Click to expand...
Click to collapse
Too true, the only other thing you could try is to sign the .apk before pushing it....
Sent from my Desire HD using Tapatalk
AndroHero said:
Too true, the only other thing you could try is to sign the .apk before pushing it....
Click to expand...
Click to collapse
Thanks AndroHero.
Everywhere I was looking they always say not to sign system APKs, but just to be sure I also tried signing it and not signing but copying the original META-INF directory - always got the same result - FC in all systems apps after boot.

[Q] right way for battery z2 with animation

how to chane battery to battery z2 with animation
plz plz help me
There are two ways you can go about this
1. You can just get the z2 systemui.apk and replace it with yours inb /system/app while setting its permissions to rw-r--r--
Download link: http://forum.xda-developers.com/showthread.php?t=2705713
2. OR you can go about this the more advanced way. Follow this only if ypu have any experience in compiling and decompiling apks. The advantage for this method is that you get to keep your own systemui and just change the battery. First go to the link above and download the systemui.apk. Decompile it. Now also copy your own systemui.apk to the internal sd card. Decompile that also. Copy the battery images from the new systemui to the old on from the /res/drawable-hdpi folder. Recompile your old systemui. Move it into /system. Change its permissions to rw-r--r--. move it to /system/app while overwriting the one that already exists there. Reboot your phone.
paper13579 said:
There are two ways you can go about this
1. You can just get the z2 systemui.apk and replace it with yours inb /system/app while setting its permissions to rw-r--r--
Download link: http://forum.xda-developers.com/showthread.php?t=2705713
2. OR you can go about this the more advanced way. Follow this only if ypu have any experience in compiling and decompiling apks. The advantage for this method is that you get to keep your own systemui and just change the battery. First go to the link above and download the systemui.apk. Decompile it. Now also copy your own systemui.apk to the internal sd card. Decompile that also. Copy the battery images from the new systemui to the old on from the /res/drawable-hdpi folder. Recompile your old systemui. Move it into /system. Change its permissions to rw-r--r--. move it to /system/app while overwriting the one that already exists there. Reboot your phone.
Click to expand...
Click to collapse
thanks but don't work
after reboot systemUI don't show
mohamad khubayb said:
thanks but don't work
after reboot systemUI don't show
Click to expand...
Click to collapse
Are you deodexed?
I don't think you are. If you are not, just replace the systemui.apk again and also delete the systemui.odex. Make sure you delete that odex file. Then reboot.

Corrupted AsusSettings.apk after recompile with Advanced ApkTool

Hi,
Before, I used to able to decompile and recompile AsusSettings and framework-res.apk without any problem, I even added my modifications to it. But then, on another day, I recompiled some other Settings and framwork-res and they corrupted and didn't work anymore (I decompile then recompile immediately, and didn't add any modification to it). Root Explorer (after recompiling) still works fine. I tried to install an other version of java, use different versions of Windows, but it didn't help me. I'm sure that I installed framework before I decompiling the apk, and I chmod 644 after copy the apk to it place, and my rom is deodexed.
What is the solution? Thanks in advance.
Edit: All the "recompile" steps i mentioned above is "Recompile, sign and zipalign"
Sorry for my English and expression.

Categories

Resources