MoDaCo is undergoing planned maintenance. Site functionality may be reduced - follow @modaco or @paulobrien on Twitter for updates.

  • Announcements

    • Reminder - MoDaCo position on illegal content

      ILLEGAL CONTENT I'd like to just reaffirm MoDaCo's position regarding piracy and illegal content in the light of some recent questions / postings. Posts will be censored by myself or my moderation team if the contain or link to: Illegal / pirated / cracked software or sites that host such software
      Nintendo emulators / ROMs or sites hosting them (in light of Nintendo's legal stance)


      CUSTOM ROMS

      You may discuss and post links to custom device ROMs on MoDaCo, provided the following rules are adhered to: ROMs must not be hosted directly in topic via the MoDaCo attachment system
      ROMs must not contain any illegal 3rd party software (this includes trial versions included without permission)
      ROMs must give full credit to the original author
      This decision has been taken in light of the huge amount of interest in this area of device customisation within the community, and member feedback! Please note that custom ROM discussion should be kept in specific device sub-areas, (e.g. Kaiser.MoDaCo.com for Kaiser based devices). ISSUES If you have any issues with this policy, please contact me directly via PM. P
    • Support MoDaCo by signing up to a MoDaCo Silver or Gold membership

      To sign up to an annual MoDaCo Silver subscription which will eliminate all ads from the site (as well as giving you access to the MoDaCo Online Kitchens for Android) for only £9.99 using PayPal, Credit or Debit Card, ensure you are logged in to the site, and then click the link below, which will take you directly to the subscription store! You can also sign up to an annual MoDaCo Gold subscription for £29.99, which adds the benefits listed below! PURCHASE A MODACO SUBSCRIPTION - FREE Titanium Backup Mobile for Android worth $5.99! - FREE 1 year PrivateInternetAccess.com worth $39.95! - FREE 1 year LastPass Premium worth $12! - FREE CalcConvert for Pocket PC from Binaryfish worth $17.95! - FREE Calendar Bar for Pocket PC from OmegaOne worth $9.99! - FREE CamerAware for Pocket PC and Smartphone from MoDaCo worth £19.99 / $30! - FREE Chronos for Pocket PC from ActiveKitten worth $14.95! - FREE CodeWallet Pro for Smartphone and Pocket PC from DeveloperOne worth up to $24.95! - FREE Concentrix for Pocket PC from eSoft Interactive worth $9.95! - FREE FlexMail for Pocket PC and Smartphone from WebIS worth up to $59.90! - FREE FTouchSL for Pocket PC from Vekoff s.r.o. worth 10 euro / $12.50! - FREE Jewel Challenge for Pocket PC from eSoft Interactive worth $9.95! - FREE John Cody's Alerts Pro for Smartphone from Omnisoft worth $14.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Dutch for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> French for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> German for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Italian for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Spanish for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Dutch for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> French for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> German for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Russian for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Turkish for Smartphone from Lingvosoft worth $49.95! - FREE Note2Self for Pocket PC and Smartphone from WebIS worth up to $19.90! - FREE Opera 8.60 for Pocket PC and Smartphone from Opera Software worth up to $48! - FREE Pocket Informant for Pocket PC and Smartphone from WebIS worth up to $59.90! - FREE Pocket Launcher for Pocket PC and Smartphone from Conduits worth $9.95! - FREE PTab for Pocket PC and Smartphone from z4soft worth up to $60! - FREE Resco Explorer for Pocket PC and Smartphone from Resco worth up to $49.90! - FREE Safemode for Pocket PC from monocube worth $12.95 - FREE SplashPhoto for Pocket PC and Smartphone from SplashData worth up to $59.90! - FREE Sprite Backup for Pocket PC and Smartphone from Sprite Software worth $29.95! - FREE Teksoft Glyphs UI for Pocket PC and Smartphone from Teksoft €9.95! - FREE Teksoft HeadsetRemote for Pocket PC and Smartphone from Teksoft €4.95! - FREE Traffic Jam for Pocket PC from eSoft Interactive worth $9.95! - FREE unlock (1 per year) from imei-check.co.uk - DISCOUNT of 10% at MoDaCo FairDeal - DISCOUNT of 10% at Semsons.com - FORUM - AD FREE SITE - FORUM - custom rank / title - FORUM - double competition entries - FORUM - double post attachment space - FORUM - no search flood control - FORUM - priority event registration - FORUM - triple PM space
    • Reminder: Selling items on the forum directly is not allowed

      Please note that selling items on the forum directly is not allowed by the forum rules. There is a forum for eBay auctions whereby you can list the items on eBay and link to them there. This is the ONLY forum for this type of activity. You may also advertise links to the eBay forum in your signature. Please note that selling directly in contravention of these rules will result in a warning / suspensions / ban.
Sign in to follow this  
Followers 0

How to replace framework-res.apk??

21 posts in this topic

Posted (edited) · Report post

There are 4 things really annoy me about Android on the ZTE Racer:

- low battery life warning box <= 15% I would prefer 8% before giving a damn. (/res/values/integers.xml)

- low memory warning that won't go away if your internal storage is < 30MB

- the default "beep" tone when you adjust your volume control - where is this sound file?? (appears to be software generated - http://www.netmite.c...olumePanel.java).

- the emergency call button that if touched enables call mode and calls emergency services.

This is particularly dangerous while in flight because it's so easy to trigger without realising it.

Now I have found the settings for changing the low battery life threshold they're stored inside framework-res.apk my only problem is how the hell do I replace this file without screwing up the Operating System??

I have ADB drivers installed as well as cwm however any tips on replacing files or restoring would be most appreciated.

btw: if anyone has details regarding the other 3 issues I would be interested to know

Richard S.

Edited by redhawkuk
0

Share this post


Link to post
Share on other sites

Posted · Report post

It is possible to open it through winrar...just right click > open with > choose winrar.

in it u will find a bunch of xmls in which i tried to find battery related stuff but failed.....

good job hunting :lol:

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

ok, their are numerous ways to edit the framework-res.apk and any other .apk file, if your simply replacing a like for like file ie "res/drawable-ldpi/ic_jog_dial_unlock" for example you can use 7-Zip to drag and drop replacement files, the modified file should ok to use.....if however you need to modify .xml`s (example res/values/arrays.xml) you need to decompile the .apk file (i use Apk Multi-Tool to decompile/recompile and Notepad ++ to edit .xml`s and smali`s to change certain values)........make backups of the original source rom or .apk your working on, always make backups of installed roms with CWM BEFORE you install a modified rom or push a modified .apk file via ADB.........

useful links http://forum.xda-dev...d.php?t=1136625 editing .apks for smali files

http://apkmultitool.com/ for editing. decompiling/recompiling and a bunch of other stuff

http://notepad-plus-plus.org/ notepad++ for editing .xml* and or smali files

*NOTE: when editing .xml`s only change values that are in BLACK

hope it helps and their is alot to learn, but basic editing is quite easy

BASIC cmd commands to use with ADB on a Windows based computer system:

you want to pull an .apk from a rom you currently have installed: example framework-res.apk

open cmd window and type:

adb pull  /system/framework/framework-res.apk
the pulled file will be located in the C:/Users/YOUR-USER-NAME/ to push a modified .apk file....example: location of modified file on your computer (push and pull same location) C:/Users/YOUR-USER-NAME/framework-res.apk
adb push framework-res.apk  /system/framework/framework-res.apk

NOTE .apk file names are case sensitive.......

for apps its basically the same command just different folder location on phone, instead its /system/apps/whatever.apk to push n pull files

Edited by Racerboy
1

Share this post


Link to post
Share on other sites

Posted · Report post

Here is a guide on how to use apktool to decompile/recompile apk's

apktool Guide

Be sure to backup old framework-res or entire rom before trying this so you can revert to old one if something goes wrong.

In my experience framework-res.apk is the most difficult file to succesfully modify and recompile. Since i am compiling CM7 myself from source sometimes best way is to make changes directly in source before compiling.

0

Share this post


Link to post
Share on other sites

Posted · Report post

@ClydeRadcliffe

are you compiling for Racer and will you be releasing it here?

0

Share this post


Link to post
Share on other sites

Posted · Report post

@ClydeRadcliffe

are you compiling for Racer and will you be releasing it here?

I don't own a Racer. I am lurking here because I am maintaining a friends Racer. Sorry if I am intruding here.

I am compiling CM7 roms for HD2. And so far I didn't had much luck with recompiling framework-res without errors so all changes I need I do in source before building a kang.

0

Share this post


Link to post
Share on other sites

Posted · Report post

Now I have found the settings for changing the low battery life threshold they're stored inside framework-res.apk my only problem is how the hell do I replace this file without screwing up the Operating System??

hey could you tell me in what xml is the setting for low battery alarm? sounds nice to change the value, too lazy to search on my own so if you know, it would be helpful :P

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

I don't own a Racer. I am lurking here because I am maintaining a friends Racer. Sorry if I am intruding here.

I am compiling CM7 roms for HD2. And so far I didn't had much luck with recompiling framework-res without errors so all changes I need I do in source before building a kang.

thats not a problem you are free to "Lurk" around whenever you like whether you have a Racer or not :) after all it is free and open info we share here on these forums.....................regards framework-res.apk have you tried editing using the above tools in 3rd post, they are quite handy for editing decompiling/re-compiling an existing .apk BUT as i see your compiling from source which is better......

Edited by Racerboy
0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

hey could you tell me in what xml is the setting for low battery alarm? sounds nice to change the value, too lazy to search on my own so if you know, it would be helpful :P

Just looked into racer's framework-res.apk and found next line in /res/values/integers.xml

<integer name="config_lowBatteryWarningLevel">15</integer>

I guess that would be the one.

Edited by ClydeRadcliffe
0

Share this post


Link to post
Share on other sites

Posted · Report post

thats not a problem you are free to "Lurk" around whenever you like whether you have a Racer or not :) after all it is free and open info we share here on these forums.....................regards framework-res.apk have you tried editing using the above tools in 3rd post, they are quite handy for editing decompiling/re-compiling an existing .apk BUT as i see your compiling from source which is better......

I havent tried to use those tools, I only used apktool which I think is also what is used in apk Multi tool.

Anyway on some occassions I managed to succesfully recompile framework-res file but most of the time I am getting an compile error or I get a apk file with I cant boot or have some other problems. Maybe

In my experience apk's like framework-res, Contacts.apk and Settings.apk are pain to recompile without errors.

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

I havent tried to use those tools, I only used apktool which I think is also what is used in apk Multi tool.

Anyway on some occassions I managed to succesfully recompile framework-res file but most of the time I am getting an compile error or I get a apk file with I cant boot or have some other problems. Maybe

In my experience apk's like framework-res, Contacts.apk and Settings.apk are pain to recompile without errors.

yes apktool is the command tool chain included in the apps above, its just intergrated into a nice UI for easy use for novice users of commands (like myself, although am learning) and afew other features, which is nice............at first when i started editing .apk files i did get errors in framework-res.apk but i put it down to the app package and not my good self :D ......seriously though they can be a pain in the backside........all depends on what your editing or adding

Edited by Racerboy
0

Share this post


Link to post
Share on other sites

Posted · Report post

Just looked into racer's framework-res.apk and found next line in /res/values/integers.xml

I guess that would be the one.

onice, thanks, gonna make it pop on every 5% (15-10-5) now lolol :D

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Okay so I have a really big problem my framework-res.apk won't rebuild using the apktool.

To make sure it wasn't related to my modded files I tested it against an untouched copy but still won't build.

I'm getting a lot of "declared here is not defined." in \res\values\plubic.xml

apktool is version 1.4.2 (and yes I have tried --forced-all as well)

Any idea what I'm doing wrong??

Richard S.

Edited by redhawkuk
0

Share this post


Link to post
Share on other sites

Posted · Report post

thats odd.. using apktool 1.4.1 and no problems at all.. try downgrading to .1 and recompile with that

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

I've solved it the ROM I was editing (Ricky Wyatt's v2 Android 2.1) had the default wallpaper saved in JPG format with a PNG extension.

I guess the apktool does strict checking of file formats but why it was throwing loads of strange errors is another mystery.

The only thing I can't work out is how did Ricky Wyatt manage to pack this file in the first place?? :blink:

Richard S.

Edited by redhawkuk
0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

I decided to play around with the original framework-res.apk 2.1 from the Three UK stock ROM but there's something weird about the unpack / rebuild process.

Original APK size 6.18MB

Unpacked to folder total size: 5.73MB

Repacked APK size: 3.72MB

Somehow I've gone from 6.18MB ot 5.73MB, what happened to the rest of the data I thought APKs were compressed?? (original apk appears to be uncompressed with unicode text).

I repacked, resigned and replaced the framework-res.apk file but on rebooting my phone it didn't get past the little green man.

Obviously I'm missing something important but what is it??

Richard S.

Edited by redhawkuk
0

Share this post


Link to post
Share on other sites

Posted · Report post

I repacked, resigned and replaced the framework-res.apk file but on rebooting my phone it didn't get past the little green man.

i think thats just your problem, framework-res.apk is a system file, you should not resign it, keep the original signature and it should work.. for compression, its probably different compression method used in 7z that apk tool uses :P

also, /res/drawable/default_wallpaper.jpg < not sure why that is a problem, its supposed to be .jpg

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Compression does seem to be the issue here I used Winzip32 no compression to repack the APK and then resign it.

Now it boots all the way to the welcome / unlock screen however when I do unlock all I get are FCs. :mellow:

I realise that this is a system file which shouldn't be mucked about with but Ricky has done it I don't see why I cannot do the same.

Any ideas how to prevent apktool compressing the data in the APK build or do I need another tool?

Richard S.

Edited by redhawkuk
0

Share this post


Link to post
Share on other sites

Posted · Report post

Compression does seem to be the issue here I used Winzip32 no compression to repack the APK and then resign it.

Now it boots all the way to the welcome / unlock screen however when I do unlock all I get are FCs. :mellow:

I realise that this is a system file which should be mucked about with but Ricky has done it I don't see why I cannot do the same.

Any ideas how to prevent apktool compressing the data in the APK build or do I need another tool?

Richard S.

try using 7-zip and without resigning of system files, i never had issues when i edit and repack apk files

0

Share this post


Link to post
Share on other sites

Posted · Report post

I've extracted and rebuilt many APKs in the past without problems but for some reason framework-res.apk seems to be something of a special case.

All I ever wanted was to change the low battery warning threshold and remove the stupid emergency button crap from the locked screen.

I suspect Android probably has some kind of anti-tampering mechanism because only the slightest insignificant change would causes all applications to FC.

For example I replaced the startup screen images using Winzip not apktool this time which kind of worked except everything FC when I unlocked the phone.

Anyway I'm about to throw in the towel soon unless someone knows of a solution (yes I have tried cleaning dalvik-cache). :mellow:

Richard S.

0

Share this post


Link to post
Share on other sites

Posted · Report post

Success at last :blink: it turns out I needed to run zipalign - http://developer.android.com/guide/developing/tools/zipalign.html

I also used the same CERT files from the original framework-res not sure if it would accept it as being re-signed.

Now I'm off to try and install JIT on Android 2.1 before I change this ROM. :lol:

Richard S.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2015. MoDaCo uses IntelliTxt technology.