Jump to content

[SOLVED] Editing framework-res.apk


Guest 90180360

Recommended Posts

Guest 90180360

I'd like to change something in framework-res.apk. I've found apktool, which is able to decode and rebuild apk files. But unfortunately my ZTE Blade refuses to boot if I push the rebuilt framework-res.apk to /system/framework (even if I didn't change anything).

Sorry, I'm really new to this, can anyone tell me what I'm doing wrong?

Command line:

apktool d framework-res.apk

I: Loading resource table...

I: Decoding resources...

I: Copying assets and libs...
apktool b framework-res framework-res.apk

W: Could not find sources

I: Checking whether resources has changed...

I: Building resources...

aapt: warning: string 'default_count' has no default translation in c:\zteandroid\Japanese_Jellyfish_RLS9_apktool\system\framework\framework-res\res; found: fr

aapt: warning: string 'default_date' has no default translation in c:\zteandroid\Japanese_Jellyfish_RLS9_apktool\system\framework\framework-res\res; found: fr

aapt: warning: string 'default_temperature' has no default translation in c:\zteandroid\Japanese_Jellyfish_RLS9_apktool\system\framework\framework-res\res; found: fr

aapt: warning: string 'default_time' has no default translation in c:\zteandroid\Japanese_Jellyfish_RLS9_apktool\system\framework\framework-res\res; found: fr

aapt: warning: string 'default_weather' has no default translation in c:\zteandroid\Japanese_Jellyfish_RLS9_apktool\system\framework\framework-res\res; found: fr

aapt: warning: string 'default_week' has no default translation in c:\zteandroid\Japanese_Jellyfish_RLS9_apktool\system\framework\framework-res\res; found: fr

aapt: warning: string 'degree' has no default translation in c:\zteandroid\Japanese_Jellyfish_RLS9_apktool\system\framework\framework-res\res; found: fr

aapt: warning: string 'lock_tips' has no default translation in c:\zteandroid\Japanese_Jellyfish_RLS9_apktool\system\framework\framework-res\res; found: da el fr pt_PT ru sv

aapt: warning: string 'operator_info' has no default translation in c:\zteandroid\Japanese_Jellyfish_RLS9_apktool\system\framework\framework-res\res; found: fr

I: Building apk file...

Edited by 90180360
Link to comment
Share on other sites

I don't know that rom but if the framework is signed then you need to resign it with the same key used previously

Hopefully someone else will spot this and tell you if it needs signing

Link to comment
Share on other sites

Guest Frankish

Your framework-res.apk has compiled perfectly. Depending on how you are using the end result could cause boot loops. Pushing it to an existing flash would work fine.

If you are putting it in a rom zip to flash then it will most definitely need resigning. What rom is it for? You need modified signapk that can sign individual apk files, you need the key that your rom uses. FLB, Modaco Froyo and JJ all use the platform key.

EDIT: Looking at the errors (they are fine though) i guess at JJ or one of sebastians roms.

Edited by Frankish
Link to comment
Share on other sites

I've had varying success pushing either signed or unsigned, but if I put it in a flashable .zip signed or unsigned always works (except unsigned fails on restoring nandroid).

As Frankish said, the errors you're receiving are pretty normal when compiling and shouldn't cause any problems in framework-res functioning properly once placed on the ROM.

I didn't have much luck with signapk, due to noob errors, other signing tools screwing things up, and possibly not working right on 7x64.

edit: I used a different script for signing and tried to link it but reading the post I linked it wasn't the one I used at all! Once I find it or get home I'll link it again!

Edited by jt_mcg
Link to comment
Share on other sites

Guest Frankish
if I put it in a flashable .zip signed or unsigned always works (except unsigned fails on restoring nandroid).

Hmm are you sure about that? Never worked for me as recompiling breaks the signing as far as i know? None of my themes could be added to a rom zip before i started signing them at all.

Link to comment
Share on other sites

Hmm are you sure about that? Never worked for me as recompiling breaks the signing as far as i know? None of my themes could be added to a rom zip before i started signing them at all.

Not added to the rom (I haven't tried that), but just flashing the theme over yes. Because of the issues I had signing with 7x64 where I did most of the work, I installed the theme first and then took it over to sign on my 32 bit machine to sign after I was sure it worked.

edit: btw I had some luck with changing the hex in framework res and having it work in music, I was also able to recompile downloadprovider using apk manager 4.9 after messing around with the keep folder, but after only changing the colour of the text, it somehow got rid of the progress bar and started using some weird rotating img that I'd never seen before. It's all very strange, and I'm not sure without some more testing that it's going to be any easier if perfected.

Edited by jt_mcg
Link to comment
Share on other sites

Guest Frankish

:P

Ahh i get you now. Yeah they work fine if pushed to an existing setup. It's looking like we will have to stick to decompiling or hex editing both those files for themes for now!

Link to comment
Share on other sites

:P

Ahh i get you now. Yeah they work fine if pushed to an existing setup. It's looking like we will have to stick to decompiling or hex editing both those files for themes for now!

Yeah sorry, maybe I misunderstood too, but I thought that's what the op was trying first.

I think if I could get downloadprovider to recompile with apktool we'd be set, it's just apkmanager seems to be really buggy in what it keeps and discards. As with you, I couldn't get it to work with apktool even making no changes and before your guide I had dl'd apk manager so I gave it a whirl with that and it worked but this swirling img replaced the progress bar on downloads!!

I really wanted to test it with the ?primaryInverse or whatever variable rather than hardcoding white, but I didn't know how to do the variable in HxD!! It will work....eventually :D

Link to comment
Share on other sites

Guest 90180360

Thanks everybody for your help, it's appreciated!

Your framework-res.apk has compiled perfectly. Depending on how you are using the end result could cause boot loops. Pushing it to an existing flash would work fine.

Strange, because that's what I did.

adb remount

adb push framework-res.apk /system/framework/framework-res.apk

adb reboot

This causes a boot-loop, even if I didn't change anything.

If you are putting it in a rom zip to flash then it will most definitely need resigning.

Yeah, when adding it to the ROM, clockwork complains about signatures when I try to install. I'll look into this later.

What rom is it for?

JJ9

You need modified signapk that can sign individual apk files, you need the key that your rom uses. FLB, Modaco Froyo and JJ all use the platform key.

Thanks, will look into this. Not necessary when pushing it to an existing setup, right?

Edited by 90180360
Link to comment
Share on other sites

Thanks everybody for your help, it's appreciated!

Strange, because that's what I did.

adb remount

adb push framework-res.apk /system/framework/framework-res.apk

adb reboot

This causes a boot-loop, even if I didn't change anything.

Yeah, when adding it to the ROM, clockwork complains about signatures when I try to install. I'll look into this later.

JJ9

Thanks, will look into this. Not necessary when pushing it to an existing setup, right?

Not necessary, but it will fail when restoring a backup. What you could try now to see if it work's is taking a zip from frankish's themes and deleting services.jar and replacing the framework-res apk with the one you edited/recompiled.

Flash that over an existing JJ( setup and you should be able to see your edits.

Link to comment
Share on other sites

Guest 90180360
What you could try now to see if it work's is taking a zip from frankish's themes and deleting services.jar and replacing the framework-res apk with the one you edited/recompiled.

Flash that over an existing JJ( setup and you should be able to see your edits.

Ok, I took the blank update.zip and added the recompiled framework-res.apk.

I had to toggle signature verification in clockwork. Then it installed, but I'm back to boot-loop again...

One thing I noticed is that the framework-res.apk changes in size from 5'658'026 bytes to 3'612'522 bytes after recompiling...

Link to comment
Share on other sites

They can vary that much depending on what you're doing images wise, and the signature would add probably 600ish kb to that.

When you say back to boot loops, did it ever install properly? were you able to see your changes?

Link to comment
Share on other sites

No, never. Right now I don't even change anything, just de- and re-compile.

Is it the stock framework-res you're using or one that's previously modified?

Also Mods, this would probably be better suited to the themeing sub-forum if you could move it.

Link to comment
Share on other sites

Guest 90180360

Another thing I did is decompile the original and the recompiled framework-res.apk and then compare the folders with WinMerge.

Almost all files are identical, but there some files in res\drawable-hdpi, res\drawable-mdpi and res\xml which show differences, plus the file apktool.yml .

If it helps I can post the report.

Link to comment
Share on other sites

Guest 90180360
Is it the stock framework-res you're using or one that's previously modified?

I'm using the one that comes with JJ9. It's quite possible that kallt_kaffe has modified it, but I wouldn't know.

Link to comment
Share on other sites

Another thing I did is decompile the original and the recompiled framework-res.apk and then compare the folders with WinMerge.

Almost all files are identical, but there some files in res\drawable-hdpi, res\drawable-mdpi and res\xml which show differences, plus the file apktool.yml .

If it helps I can post the report.

To be honest, I'm pretty new to changing framework-res my self so I don't know how much more help I can be, Here's the signing script I used with the platform keys added to the .zip. You need to change the file names in the command, but maybe re-signing can help solve your problems.

Edit, which version of apktool are you using? 1.3.2 I think is buggy, there's a link to 1.3.1 in Frankish's guide that could also help

Edited by jt_mcg
Link to comment
Share on other sites

Guest 90180360
Edit, which version of apktool are you using? 1.3.2 I think is buggy, there's a link to 1.3.1 in Frankish's guide that could also help

Ok, this is a step forward! File-sizes are almost identical now!

Looks like 1.3.2 is giving others the same problem.

To be honest, I'm pretty new to changing framework-res my self so I don't know how much more help I can be, Here's the signing script I used with the platform keys added to the .zip. You need to change the file names in the command, but maybe re-signing can help solve your problems.

Thanks also for this!

Unfortunately, the problem is still not solved.

I've tried different update-zips (with the signed, unsigned and original framework-res.apk), and only the original doesn't result in a boot loop :P

Edit: When signing I just put framework-res.apk in the folder and run sign.bat, is there anything else I should do?

Edited by 90180360
Link to comment
Share on other sites

Ok, this is a step forward! File-sizes are almost identical now!

Looks like 1.3.2 is giving others the same problem.

Thanks also for this!

Unfortunately, the problem is still not solved.

I've tried different update-zips (with the signed, unsigned and original framework-res.apk), and only the original doesn't result in a boot loop :P

Edit: When signing I just put framework-res.apk in the folder and run sign.bat, is there anything else I should do?

Sorry, I forgot I didn't use the .bat!! I did it in the command line in auto-sign directory:

 java -jar signapk.jar platform.x509.pem platform.pk8 framework-res.apk signed-framework-res.apk

Then I moved the signed into the zip, and renamed it to just framework-res.apk.

I didn't look at the .bat because it was written for the testkeys and I had to add the platform keys to the folder.

Link to comment
Share on other sites

Guest 90180360
java -jar signapk.jar platform.x509.pem platform.pk8 framework-res.apk signed-framework-res.apk

YES :P :D :huh:

Now finally both pushing it with adb and using the update-zip work!

Link to comment
Share on other sites

Guest x.balli.x
Great news! Sorry about leaving that important bit out!

thanks this helped me too, i had to enable wake on menu button but it wasn't working becuase i was't signing with the platform keys.....

Link to comment
Share on other sites

thanks this helped me too, i had to enable wake on menu button but it wasn't working becuase i was't signing with the platform keys.....

Nice one, it drove me mental for about a day before I figured it out myself!

Link to comment
Share on other sites

  • 11 months later...
Guest shmizan

what a huge bump!!

guys I need your help. I'm trying to modify the framework-res.apk from the latest CyanogenMod KANG.

I use apktool to decompile, edit 3 lines in a xml file and recompile.

(I failed at creating a flashable zip so(clockworkmod errors)) then I try to push while in recovery - but it boots as if I didn't push it. so I push it when the rom's loaded and get bootloop after reboot.

I tried to sign with testkey keys and platform keys I found in the web, but again - bootloop.. what am I doing wrong?

Edited by shmizan
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.