[TOOL] Framework Flasher 1.1.4 (1/14/12) - Easily modify and flash framework-res.apk

Search This thread

blackhemi4x4

Senior Member
Mar 12, 2011
472
135
Covington, GA USA
help, step 2 echo off error

Ive tried a few times and cant compile this. I made one value change, but even if i make no changes, i get the same error. this is the stock 4.0.4 ICS nexus s framework.

here is the error, please help :)


java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/animator
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/drawable-sw600dp-hdpi
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/interpolator
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/layout-sw600dp
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/layout-w600dp
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/mipmap-hdpi
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/mipmap-ldpi
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/mipmap-mdpi
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/mipmap-xhdpi
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/values-h720dp
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/values-sw600dp
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/values-sw600dp-land
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/values-sw600dp-w1024dp
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/values-sw600dp-w1280dp
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/values-w360dp
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/values-w480dp
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/values-w500dp
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/values-w600dp
invalid resource directory name: C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res/values-w720dp
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\MATTHE~1\AppData\Local\Temp\APKTOOL6278790603619692638.tmp, -x, -S, C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res, -M, C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\MATTHE~1\AppData\Local\Temp\APKTOOL6278790603619692638.tmp, -x, -S, C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res, -M, C:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
 

timekeeper

Senior Member
Nov 29, 2006
405
49
Vancouver, BC
Thanks for your tool! I'm trying it on a framework-res from a CM9/ICS based rom and editing some xml lines in framework-res.apk\res\values\dimens.xml.

However, I get an error after it decompiles, and I am trying to recompile it, even after a not making any changes. It says echo off, and some error have occurred. Here is the framework-res:

http://dl.dropbox.com/u/2339461/framework-res.apk

and the logfile:

http://dl.dropbox.com/u/2339461/LogProcess.txt

Any ideas would be much appreciated.
 

chitose_ndy

Senior Member
Jan 30, 2011
1,756
193
30
Jakarta
wow!

thanks so much for sharing :D

im gonna try this on my sony xperia S.

if its working, i will made a thread for you on the xperia s forum :)
 

chitose_ndy

Senior Member
Jan 30, 2011
1,756
193
30
Jakarta
okay.. there's an error while recompiling..

here :

-r, --no-res
Do not decode resources.
-d, --debug
Decode in debug mode. Check project page for more info.
-f, --force
Force delete destination directory.
-t <tag>, --frame-tag <tag>
Try to use framework files tagged by <tag>.
--keep-broken-res
Use if there was an error and some resources were dropped, e.g.:
"Invalid config flags detected. Dropping resources", but you
want to decode them anyway, even with errors. You will have to
fix them manually before building.
b[uild] [OPTS] [<app_path>] [<out_file>]
Build an apk from already decoded application located in <app_path>.

It will automatically detect, whether files was changed and perform
needed steps only.

If you omit <app_path> then current directory will be used.
If you omit <out_file> then <app_path>/dist/<name_of_original.apk>
will be used.

OPTS:

-f, --force-all
Skip changes detection and build all files.
-d, --debug
Build in debug mode. Check project page for more info.

if|install-framework <framework.apk> [<tag>]
Install framework file to your system.

For additional info, see: http://code.google.com/p/android-apktool/

ECHO is off.
An error has occurred. Check the log for more info.
ECHO is off.

Press any key to continue . . .

it says that ECHO is off.
what is that actually?
 

s.yogamurthy

Senior Member
Apr 29, 2012
114
25
Finally! After days of struggling to figure out how to modify my ROM's framework-res.apk and create a working flashable update.zip to install the framework-res.apk changes, I have finally figured out how (big thanks to the guys here: http://xdaforums.com/showthread.php?p=20962080#post20962080) and have created an automated script to help others struggling with the same problem.

Framework Flasher 1.1.4
Feel free to download and experiment with it. This is my first gift to the XDA/Android Hacking community, and I plan on doing more. I just want to test the waters for now :) Feedback would be nice. Let me know if I've helped you in some way!

---------------------------

What does it do?
It extracts your framework-res.apk file and allows you to edit the files. After editing, the script will compile, sign the apk, create your update.zip with the correct structure for flashing, and then sign the .zip. Everything you need to modify and flash your framework-res.apk file.


How do I use it?
Download the .zip from the link below and extract it somewhere on your PC. Drag the framework-res.apk file that you want to modify and/or flash into the /place-framework-res-here/ directory. Double-click on RunMe.bat and off you go! Do the steps (1-5) in order and you shouldn't have any problems.


Who needs this?
A LOT of people according to how many google searches I did in the past 3-4 days.


Will it work for files other than framework-res.apk?
Currently, no. However it would be easy to implement that functionality if I saw that people would benefit from it.


I found a bug... what do I do?
Post it in this topic. I'll do what I can to make continual updates as long as I see people are benefiting from it. I'm sure there are bugs in it somewhere, so just let me know.


Where do I download this snazzy piece of software?
http://www.mediafire.com/?1nc14hkhs2yrqmt


The little disclaimer
If you download this tool, please say thanks! Not only does it motivate me to continue to improve this software, but it also let's me know how many users are using it! Thanks!
This script is mainly intended for use with editing script files (xml, etc.), and normal (non 9png) images. 9pngs have been successfully repacked using this tool! If you run into any problems, be sure to make it known!
Updates are on the way! This script is constantly being tweaked to allow for more functionality. Subscribe to this thread for the latest news and updates.

A very big thanks for this toll.
I was able to prepare update.zip using ur script but unable to flash.
Error0 : installation aborted.
Pl help me how to install this...
Just copying the apk made phone into bootlooop. Pl help to install

Sent from my Micromax A60 using XDA
 
Last edited:

masterex567

Senior Member
Mar 11, 2012
2,316
1,803
www.droidsters.com
Help.

Hey. I tried to use this to make some changes to framework-res.apk. It decompiles easily but the problem comes when recompiling.

It tells me Echo is off.

The log shows:
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
libpng error: Read Error
ERROR: Failure processing PNG image C:\framework\files-to-edit\framework-res.apk\res\drawable-mdpi\jog_tab_bar_left_end_confirm_gray.9.png
libpng error: Read Error

And there are hundreds of those errors.
And hundreds of these ones:
C:\framework\files-to-edit\framework-res.apk\res\values\public.xml:3258: error: Public symbol drawable/jog_ring_holo_ring_normal declared here is not defined.

And this one: Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Preyansh\AppData\Local\Temp\APKTOOL3425370845215149414.tmp, -x, -S, C:\framework\files-to-edit\framework-res.apk\res, -M, C:\framework\files-to-edit\framework-res.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Preyansh\AppData\Local\Temp\APKTOOL3425370845215149414.tmp, -x, -S, C:\framework\files-to-edit\framework-res.apk\res, -M, C:\framework\files-to-edit\framework-res.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more

The full log is attached.
 

Attachments

  • LogProcess.txt
    147.2 KB · Views: 10

crazyguns

Senior Member
Aug 24, 2011
292
91
Northampton
your thread was an absolute life saver dude!

noob here, about 2 weeks since my first android phone, sgs2 white. i thought i was a smarta$$ when i renamed framework-res.apk as .zip and extracted, edited and replaced using rootExplorer! the whole thing crashed and got stuck in infinite boot! thankfully i have a dual boot with cmiui, and flashed the old framework-res update.

then i googled like hell about framework and found your amazing thread! This is the simplest thing ever! Thanks for making it man.
I've now properly modded it with your flasher!

Wanted to get rid of the pattern lock pngs, so that it looks extra conspicuous! success! :D
 

AlexVendettA

Senior Member
Jul 15, 2012
75
14
Florence
i have my htc one x(europe) and i tried this application and decompilation works.. but compilation doesn't.. :confused:
p.s. sorry for my english i'm italian -.-''
p.p.s. the phone has android 4.0.3 and HTC sense 4.0 and it's rooted too
there is my log file
 

Attachments

  • LogProcess.txt
    25.5 KB · Views: 8
Last edited:
Dec 15, 2010
1
0
I'm running into the same errors the others have reported.

The script fails during compiling the apk with " An error has occurred. Check the log for more info.", and it crashes. All the log says is "The system cannot find the file specified." I uploaded the framework-res and log files, hope this helps.

dl.dropbox.com/u/9665305/framework-res.apk

dl.dropbox.com/u/9665305/LogProcess.txt

dl.dropbox.com/u/9665305/LogSimple.txt
 

boywithabeard

Senior Member
Aug 16, 2011
234
58
Port Perry
WORKS!

I'm running into the same errors the others have reported.

The script fails during compiling the apk with " An error has occurred. Check the log for more info.", and it crashes. All the log says is "The system cannot find the file specified." I uploaded the framework-res and log files, hope this helps.

dl.dropbox.com/u/9665305/framework-res.apk

dl.dropbox.com/u/9665305/LogProcess.txt

dl.dropbox.com/u/9665305/LogSimple.txt

I was having the echo error as well, trying to recompile framework.res from SkyIcs 4.2. until I swapped the aapt file in the resources folder with the latest SDK aapt. Voila...recompile, sign, zip, flash, yay! Please thank me and the fine gentlemen who started this thread!
 
  • Like
Reactions: M4ST3R-V

Wintrmte

Senior Member
Jan 4, 2012
184
9
Was aapt the only thing you replaced? I put the latest aapt in and I still get that dang error.
 

brandestoch

New member
Jul 22, 2012
2
0
A new error.


---------------------------------------------------------------------
| Log - ter 24/07/2012 -- 0:13:08,26 |
---------------------------------------------------------------------
THE LOG BELOW IS FOR YOUR MOST RECENT PROCESS ONLY.


java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
F:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res\drawable-hdpi\decrease.PNG: error: File is case-insensitive equivalent to: F:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res\drawable-mdpi\decrease.png
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\APKTOOL1372494628566567112.tmp, -x, -S, F:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res, -M, F:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\APKTOOL1372494628566567112.tmp, -x, -S, F:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\res, -M, F:\FrameworkFlasher-1.1.4\files-to-edit\framework-res.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
 

crzfish

Member
Jan 2, 2012
35
4
Haiphong
tried, but it didn't work for me :(
here is the log
| Log - 25/07/2012 -- 20:11:39,37 | editor\LogSimple.txt
---------------------------------------------------------------------
THE LOG BELOW IS FOR YOUR MOST RECENT PROCESS ONLY.


java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
Java HotSpot(TM) Client VM (build 23.1-b03, mixed mode, sharing)
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
 

.x.x.x.Peria

Member
Feb 2, 2011
46
41
FIX

1.) Thank You for this tool, _finally_ I was able to edit that damn framework-res.apk :victory:

2.) I can't imagine how it works for others, but I needed to delete the space after "-o" option for compile (line 172):

7za x -o%~dp0temp-files %~dp0place-framework-res-here\framework-res.apk

3.) Flashed zip seems to works, however here it's log:

---------------------------------------------------------------------
| Log - 2012/07/26 -- 8:26:21.45 |
---------------------------------------------------------------------
THE LOG BELOW IS FOR YOUR MOST RECENT PROCESS ONLY.


java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) Client VM (build 22.1-b02, mixed mode, sharing)
W: Could not find sources
I: Checking whether resources has changed...
I: Building apk file...
The system cannot find the file specified.
Invalid switch - "resources.arsc".
The system cannot find the path specified.
 

lokeshsaini94

Senior Member
May 1, 2012
1,777
3,984
Behind you!!!
hey!!!
nice tool...
i have only one problem i can not compile apk back...
i even tried to just decompile and then compile without but it shows error even in that case....
 

Shaksterz

New member
Dec 5, 2010
2
0
Thanks for this tool!

I used this tool to help me enable ICS on screen buttons for the CM10 preview on the SGSII GT-i9100. I had the same problem that many other people with ICS ROMs were having, that the decompilation worked but then recompilation did not. Don't know why this worked, but once I moved the Framework Flasher folder to the root of my hard drive (C:\) the compilation and all the other steps worked. Also, I'm not sure if this did anything (it didn't do anything at first but it might contribute to why this worked), but I replaced the APKTool files with the ones in the zip file attached in this post, or alternatively found on the link below

http://xdaforums.com/showthread.php?t=1495002

Hope this works for you guys like it did for me :)
 

Attachments

  • APKTool.zip
    2.7 MB · Views: 176

Top Liked Posts

  • There are no posts matching your filters.
  • 317
    Finally! After days of struggling to figure out how to modify my ROM's framework-res.apk and create a working flashable update.zip to install the framework-res.apk changes, I have finally figured out how (big thanks to the guys here: http://xdaforums.com/showthread.php?p=20962080#post20962080) and have created an automated script to help others struggling with the same problem.

    Framework Flasher 1.1.4
    Feel free to download and experiment with it. This is my first gift to the XDA/Android Hacking community, and I plan on doing more. I just want to test the waters for now :) Feedback would be nice. Let me know if I've helped you in some way!

    ---------------------------

    What does it do?
    It extracts your framework-res.apk file and allows you to edit the files. After editing, the script will compile, sign the apk, create your update.zip with the correct structure for flashing, and then sign the .zip. Everything you need to modify and flash your framework-res.apk file.


    How do I use it?
    Download the .zip from the link below and extract it somewhere on your PC. Drag the framework-res.apk file that you want to modify and/or flash into the /place-framework-res-here/ directory. Double-click on RunMe.bat and off you go! Do the steps (1-5) in order and you shouldn't have any problems.


    Who needs this?
    A LOT of people according to how many google searches I did in the past 3-4 days.


    Will it work for files other than framework-res.apk?
    Currently, no. However it would be easy to implement that functionality if I saw that people would benefit from it.


    I found a bug... what do I do?
    Post it in this topic. I'll do what I can to make continual updates as long as I see people are benefiting from it. I'm sure there are bugs in it somewhere, so just let me know.


    Where do I download this snazzy piece of software?
    http://www.mediafire.com/?1nc14hkhs2yrqmt


    The little disclaimer
    If you download this tool, please say thanks! Not only does it motivate me to continue to improve this software, but it also let's me know how many users are using it! Thanks!
    This script is mainly intended for use with editing script files (xml, etc.), and normal (non 9png) images. 9pngs have been successfully repacked using this tool! If you run into any problems, be sure to make it known!
    This tools was created to work with the Droid X2. If you are experiencing problems using it, first ensure that you are in fact using a Droid X2.
    8
    Change Log
    1.1.4 (1/14/12)
    - Corrected the Log error. You can now see error logs!
    - Corrected an error processing problem where Framework Flasher would instantly close without warning

    1.1 (1/7/12)
    - Made compatibility tweaks
    - Removed unnecessary overhead

    1.0 (1/6/12)
    - Initial Release


    When reporting errors, please ensure that there are no spaces in your file path, and include what ROM and version you are running.
    5
    Updated to 1.1.4a

    Hey there!

    I've just updated & packed Framework Flasher as per fralken guidelines. Pushed to version 1.1.4a

    Enjoy! :highfive:
    3
    Corrected and updated the tool to v 1.1.4b

    Corrected errors in RunMe.bat and updated the tool with latest apktool v2.0.1 and faapt v2 by Chainfire.
    Cheers!!:highfive:
    Tool works fine now!:):)
    3
    Hello :)

    This is an awesome little tool you got here. I haven't tried it yet but I'll likely give it a shot eventually.

    You should add functionality for SystemUI.apk, that's the other "real big" file people like to edit. Just a suggestion based on what I know about theming :)

    Very nice!

    Thanks. I will definitely look into adding this. I'll update the OP with any changes or updates.

    So r u telling me this will modify everything including the. 9 png images..also can u get into the xml files as well or images only...i use apk manager and with the. 9 pngs u cannot touch the 9 patches or change the image without using draw 9 patch to ensure the apk will recompile

    Sent from my DROID X2 using xda premium

    Not tested 9pngs with this, it's mainly intended for scripting (xml files, etc. along with normal non 9png images). I've updated the OP to include a little disclaimer stating this fact. Thanks for pointing that out.