[Q] Editing framework-res.apk - Galaxy Ace S5830i General

Hey can someone give me some quick tips on how to edit it?
I edited SystemUI.apk just fine but no matter what I do to framework-res, it won't let me replace the files (I'm only replacing pngs in drawable-mdpi folder)

What error are you getting? Also, install framework with apktool
POTATO!!!!

I think he's talking about drag and drop png file ) If it's true, the solution for him is learning how to decompile apk. Becoz most of png in systemUI is png, not too many 9.png files so it's easy to replace without decompiling

devilsking said:
I think he's talking about drag and drop png file ) If it's true, the solution for him is learning how to decompile apk. Becoz most of png in systemUI is png, not too many 9.png files so it's easy to replace without decompiling
Click to expand...
Click to collapse
Yup...
Decompile the framework-res.apk with Apktool and then replace the pngs..

I can't recompile because apktool always crashes when trying to recompile XML files. I'm using the AceCream framework apk instead of the stock rom one...
I'll try this on another PC to see if it's some weird software glitch

ZakooZ said:
I can't recompile because apktool always crashes when trying to recompile XML files. I'm using the AceCream framework apk instead of the stock rom one...
I'll try this on another PC to see if it's some weird software glitch
Click to expand...
Click to collapse
Try APK manager...much easier...

ZakooZ said:
I can't recompile because apktool always crashes when trying to recompile XML files. I'm using the AceCream framework apk instead of the stock rom one...
I'll try this on another PC to see if it's some weird software glitch
Click to expand...
Click to collapse
Tell me the definition of your "crashes"
it will show errors if u did smth wrong, even u use apkmanager )
For me apktool is more easier

devilsking said:
Tell me the definition of your "crashes"
it will show errors if u did smth wrong, even u use apkmanager )
For me apktool is more easier
Click to expand...
Click to collapse
Well, apktool dumps a stack trace where the error seems to occur in a public.xml file, apk manager says there is a error but the log shows nothing for me
https://www.dropbox.com/s/hbgqlo8pkfff10p/framework-res.apk
Can you test if you can modify this file without errors?

ZakooZ said:
Well, apktool dumps a stack trace where the error seems to occur in a public.xml file, apk manager says there is a error but the log shows nothing for me
https://www.dropbox.com/s/hbgqlo8pkfff10p/framework-res.apk
Can you test if you can modify this file without errors?
Click to expand...
Click to collapse
Oh...The infamous apktool bug...Use another version of apk tool and compile,will work
POTATO!!!!

Related

[Q] How to edit framework-res.apk?

I'm trying to edit framework-res.apk so I can theme my rom. Are these the correct steps?
pull framework-res.apk from my phone
decompile the apk
make the changes
rebuild the apk
sign
zipalign
push apk back to device
I'm not too sure on this method as after I pushed back my modified apk, I get a load of force close errors
Any advice would be welcome
don't sign and don't zipalign and all are fine
I tried without sign and zipalign but the rom wouldnt boot. If I sign, I get force close errors
Does the rom need to be deoxed?
How is your process to decompile and recompile what tools do you use
vibez said:
I tried without sign and zipalign but the rom wouldnt boot. If I sign, I get force close errors
Does the rom need to be deoxed?
Click to expand...
Click to collapse
Sent from my GT-I9000 using XDA App
Is this an ODEXed ROM or a deOXEDed ROM? You can't mix and match. If you're not ODEXing any APKs after you've modified them then you need to make sure all APKs are deOXEDed.
setenza01 said:
How is your process to decompile and recompile what tools do you use
Sent from my GT-I9000 using XDA App
Click to expand...
Click to collapse
I use apk manager to decompile and rebuild
Benjamin Dobell said:
Is this an ODEXed ROM or a deOXEDed ROM? You can't mix and match. If you're not ODEXing any APKs after you've modified them then you need to make sure all APKs are deOXEDed.
Click to expand...
Click to collapse
It is a stock rom but there is no framework-res.odex does that mean it doesn't need deodexing even though there are odex files for every other apk in my system folder?
maybe this little monster is some help to you:
http://forum.xda-developers.com/showthread.php?p=7377678#post7377678
FadeFx said:
maybe this little monster is some help to you:
http://forum.xda-developers.com/showthread.php?p=7377678#post7377678
Click to expand...
Click to collapse
Nice app but this theme also needs .xml changes which this app doesnt support
ok, i put him a note in his thread about the xml changing issue, we will see what hes answer will be...
edit:
also this software could do the trick: http://android.modaco.com/content/t-mobile-pulse-pulse-modaco-com/302404/ande-android-design-editor/
I've been playing around a little more today and it seems the issue is that no tool can rebuild the xml files correctly, they seem to be compressed/encoded.
Has anyone been able to edit an xml file in framework-res.apk and have the phone read it properly?
vibez said:
I've been playing around a little more today and it seems the issue is that no tool can rebuild the xml files correctly, they seem to be compressed/encoded.
Has anyone been able to edit an xml file in framework-res.apk and have the phone read it properly?
Click to expand...
Click to collapse
Refer to my signature. Apk manager.
Edit : just read ur op.
Never sign the system apk's. Simply keep the original signatures intact and after recompiling them, re-include them.
So here are the rules u must follow :
If u've modified the manifest.xml, u must stop core, push the apk, start core or push the apk while in recovery.
If u've modified anything else, a simple push / reboot will do the trick.
Note, u cannot flash a modified system apk the first time (as in on a clean boot), u must flash the original rom, let it build the dex's and then flash ur modified apk.
Daneshm90 said:
Refer to my signature. Apk manager.
Edit : just read ur op.
Never sign the system apk's. Simply keep the original signatures intact and after recompiling them, re-include them.
Click to expand...
Click to collapse
Hi, I am already using apk manager but the xml files it creates do not seem to work.
To prove this, I have done a test. See the attached xml files,
original_stat_sys_battery.xml was extracted from the original framework-res.apk
I then used apk manager to decompile and then recompile the same apk without making any changes.
recompiled_stat_sys_battery.xml is this recompiled file
I then opened up both files and they look different to me
vibez said:
Hi, I am already using apk manager but the xml files it creates do not seem to work.
To prove this, I have done a test. See the attached xml files,
original_stat_sys_battery.xml was extracted from the original framework-res.apk
I then used apk manager to decompile and then recompile the same apk without making any changes.
recompiled_stat_sys_battery.xml is this recompiled file
I then opened up both files and they look different to me
Click to expand...
Click to collapse
That shouldn't concern u. Apktool's method of rebuilding the apk/arsc file is slightly different than how android originally builds an apk. What should concern u is if the apk simply works. Now when u decompile the apk, can u check the log to see if it reports of any missing resources, if it doesn't ur fine. So decompile the apk, make ur changes, recompile the apk, move the original meta-inf folder into ur new apk and push it to ur phone following the guidelines in my previous post. if it causes problems, post ur log and i'll take a look.
Ok this time I have added meta-inf to the new apk, pushed it to my phone and the phone hangs on boot.
Here is my log
--------------------------------------------------------------------------
|08/08/2010 -- 18:36:30.87|
--------------------------------------------------------------------------
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the path specified.
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
'adb' is not recognized as an internal or external command,
operable program or batch file.
Could Not Find C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged.apk
Could Not Find C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-signed.apk
Could Not Find C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-unsigned.apk
The system cannot find the file specified.
I: Loading resource table...
I: Decoding resources...
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'keyguard_password_attempts_count_pin_code' has no default translation in C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\other\..\out\res; found: fr ko
I: Building apk file...
Click to expand...
Click to collapse
Oh lol i meant the log of ur phone.
Use adb logcat
lol ok, at which point should I run logcat - after the hang or as soon as I switch the phone on?
vibez said:
lol ok, at which point should I run logcat - after the hang or as soon as I switch the phone on?
Click to expand...
Click to collapse
When u switch phone On.
Ok here you are
vibez said:
Ok here you are
Click to expand...
Click to collapse
Heres ur culprit
Code:
java.lang.SecurityException: META-INF/MANIFEST.MF has invalid digest for AndroidManifest.xml
Now seems u modified the androidmanifest.xml ? If u didn't then heres my recommendation, copy over the original androidmanifest.xml from the original apk.

framwork-res.apk modifying

Hi,
i'am searching for a guide how to manipulate correctly the framework-res.apk.
All ways i have tested fails.
I would modify some symbols in Notification bar (battery 1%) but all Time the my Phone run into bootloop or all Application Crashes after Startup.
I've tryed Apk Manager 4.9 / and Manualy with apktool.
Help plz .....
what i did :
1-extract apk (i use 7zip/WinRAR)
2-edit/replace image file(s)
3-repack with zero compression level ('store' level)
4-sign the apk
5-replace file using apk or create flashable recovery zip.
regards.
signing the framework-res.apk will not work.. will make the device go into bootloop
what you need is extract the framework-res.apk using apktool and edit the things you want and then compile it again using apktool .... now open the original framework-res.apk and replace the file resources.arsc with the edited compiled one..
this way you will retain the signature of the original framework-res.apk
PapaDocta said:
signing the framework-res.apk will not work.. will make the device go into bootloop
what you need is extract the framework-res.apk using apktool and edit the things you want and then compile it again using apktool .... now open the original framework-res.apk and replace the file resources.arsc with the edited compiled one..
this way you will retain the signature of the original framework-res.apk
Click to expand...
Click to collapse
But when i add some new Files and Edit some XML the Sign will be Corrupted ?
no it won't...
You need to do two copies.. the original file and the moded one...
1. make a backup of the original file
2. extract the original file using apktool
3. edit and modify anything you like
4. compile the edited file
5. rename the compiled file to framework-res.zip and take the modified resources.arsc
6. using winrar or 7zip open (to view not extract) the backed up framework-res.apk
7. place the moded resources.arsc into the backed up framework-res.apk
by doing this you retain the original signature of the backed up file and not breaking it..
Thx, will test it ;-)
kowalski99 said:
But when i add some new Files and Edit some XML the Sign will be Corrupted ?
Click to expand...
Click to collapse
Android system, signs system apk's on boot, you shouldnt sign them
Sent from my Desire HD using Tapatalk
My signed apk just work well.
AFAIK, we only cant re-sign htc's apk.
PapaDocta said:
signing the framework-res.apk will not work.. will make the device go into bootloop
what you need is extract the framework-res.apk using apktool and edit the things you want and then compile it again using apktool .... now open the original framework-res.apk and replace the file resources.arsc with the edited compiled one..
this way you will retain the signature of the original framework-res.apk
Click to expand...
Click to collapse
The right approach always depends, what you want to change. There is no need to decompile, if you only change a few standard png. If you change xml in values folder like color, styles or arrays, you can certainly not delete resources.arsc - resources have nothing to do with the signature anyway. So if you want to play safe, you should insert the original Meta-Inf (signature) and Android Manifest after compile. It is also recommended to zipalign the final apk in order to reduce RAM usage.
thanks he_stheone64 for the clarification.. i reached that conclusion based on my own research on the net and yeah i used to change the XML files to add language support and that the only way that worked with me..
And be sure to have a working and up-to-date sdk before trying to use apktool...
First, using a old sdk release i got a partially working result (few graphics bugs and strange reboots), then with a badly updated sdk on top off the old i got apktool making many errors. Finally, re-installing the last sdk from start i got apktool and my resulting apk working correctly.

[Q] Bootloop after editing a few XMLs?

So after decompiling framework-res.apk and editing statusbar.xml, statusbarextended.xml, and statusbarlatesteventcontent.xml I get stuck in a bootloop right after installing the ROM fresh from stock and a MC. So what could be the problem? Why would changing the text color of the statusbar cause a bootloop?
ih4ckback said:
So after decompiling framework-res.apk and editing statusbar.xml, statusbarextended.xml, and statusbarlatesteventcontent.xml I get stuck in a bootloop right after installing the ROM fresh from stock and a MC. So what could be the problem? Why would changing the text color of the statusbar cause a bootloop?
Click to expand...
Click to collapse
How did you decompile/recompile? When you recompiled, did you use the same filestructure?
Ex: /framework-res/res/drawable-hdpi instead of /res/drawable-hdpi
Did you keep the same lines and just edit the color codes? You need to give more info to let us know what you did. Any tiny mistake in editing framework-res.apk will result in a bootloop, so your case isn't diagnosable unless you tell us what you did.
.Candy said:
How did you decompile/recompile? When you recompiled, did you use the same filestructure?
Ex: /framework-res/res/drawable-hdpi instead of /res/drawable-hdpi
Did you keep the same lines and just edit the color codes? You need to give more info to let us know what you did. Any tiny mistake in editing framework-res.apk will result in a bootloop, so your case isn't diagnosable unless you tell us what you did.
Click to expand...
Click to collapse
I used apkmanager, decompiled, edited color codes only, recompiled, installed, bootloop and yes the filestructure is the same.
ih4ckback said:
I used apkmanager, decompiled, edited color codes only, recompiled, installed, bootloop and yes the filestructure is the same.
Click to expand...
Click to collapse
How did you install it. Using APK Manager? If so, that's probably the issue. I don't trust certain APK Manager options. To be safe, in the future you should only use it for decompiling, recompiling, and signing if necessary, never for re-install the APK.
Anyway, did you attempt to sign the file? framework-res.apk doesn't need to be signed, and if you do sign it, I believe it will create a boot-loop.
Also, when you recompiled it, did you go through the step that creates the "keep" folder where you delete the files that you edited? If not, then that's probably the issue. If you don't do that step, then your edited file will only contain the files that you edited. At least that's what I understand from my experience.
I copied the apk to my /system/framework folder within my custom rom and flashed the zip. I did sign the file. I'll retry without signing it and yes I did the keep step.
ih4ckback said:
I copied the apk to my /system/framework folder within my custom rom and flashed the zip. I did sign the file. I'll retry without signing it and yes I did the keep step.
Click to expand...
Click to collapse
dont sign system apks
Pirateghost said:
dont sign system apks
Click to expand...
Click to collapse
thats a good tip lol thanks I'll remember that next time I do any modding.

[Q]Bootloop after recompiling FW 140 framework-res.apk ( how reslove ? )

Hi everyone. I have experienced about bootloop after recompiled framework-res.apk that based from Latest firmware 9.1.A.1.140. I'm trying to decompile framework-res, then I used apktool and Install both frameworks ( framework-res.apk and semcgenericuxpres.apk ) then, I decompiled. After that, I EDITED SOME XMLS LIKE STRING.XML. AFTER THAT I RECOMPILED AND GOT SUCCESS. THEN I TOOK resources.arsc from modded FW and I copied into original framework-res.apk ( compression normal ). Then I copied into SD card. I wiped cache and dalvik then Install it. After I installed, I got BOOTLOOP
PLEASE ANY SOLUTION !!
We can't edit framework-res at the moment.
http://forum.xda-developers.com/showthread.php?t=2105685
Only way is binary editing, and that's complicated.
NuriJ said:
We can't edit framework-res at the moment.
http://forum.xda-developers.com/showthread.php?t=2105685
Only way is binary editing, and that's complicated.
Click to expand...
Click to collapse
MMM.. is that another way ?

Need help with apktool

Hello I am trying to work on a mod for rom I am working on. But the warnings I am getting happen even with untouched files.
I am editing the Secsettings.apk.
I am able to decompile it just fine with apktool 2.0.0 but compiling is another story. I install framework-res.apk and even installed twframework-res.apk. but this is what I get with unedited secsettings. I get same results when I do my edits.
I am doing
apktool b SecSettings
It is putting files in the build file
Is this ok?
jasonj711 said:
Hello I am trying to work on a mod for rom I am working on. But the warnings I am getting happen even with untouched files.
I am editing the Secsettings.apk.
I am able to decompile it just fine with apktool 2.0.0 but compiling is another story. I install framework-res.apk and even installed twframework-res.apk. but this is what I get with unedited secsettings. I get same results when I do my edits.
I am doing
apktool b SecSettings
It is putting files in the build file
Is this ok?
Click to expand...
Click to collapse
Those are only warnings. Looks like it built apk from the last line.
Here's a great tool that does all the hard work for you
http://forum.xda-developers.com/showthread.php?t=2639400

Categories

Resources