[ONE Themes and Apps] ocd_amp:
[GUIDE][HowTo][Tools]Framework-Res.apk

Hello everyone.

Edit

:::This post is for people who are on CM11 based Roms which are not already patched. I put it in this thread because it is attracting the MOST attention. If you are the same ROM as Calkulin, he has fixed it and just Flash his framework, but if you are on another Cyanogenmod 11 based ROM, THIS is the post for you.

Due to this being a Major problem for MANY people, I was getting many requests asking me to fix Frameworks. I cannot do this as each Framework is ROM specific and there are many Roms as you know. So instead of ignoring everyone, I am taking my time out to write another more detailed post.

So to make it easy, I have put together all the Tools + more in this simple file along with Instructions. It is really about Common Sense. If there is something you do not understand, try your favorite search engine. This post is becoming full of junk posts which hide important posts that contain valuable information. So I am urging everyone to READ first. It is better to read for 2 hours and Fix your problem in 30 seconds than NOT Reading and trying to get someone else to fix it for 2 hours

NOTE: WHEN I Type in caps, It does not mean I am yelling. It means PAY ATTENTION.

1) YOU CAN ONLY USE YOUR OWN ROM'S FRAMEWORK

2) YES THIS WORKS

3) YOU HAVE TO UNDO THE CHANGES YOU MADE - Scripts, AppOps, etc etc. UNDO it. Its not Needed after this fix.

4) DON'T BUG YOUR ROM DEVS - THEY KNOW ABOUT THIS. EITHER THEY WILL FIX IT OR THEY WON'T. IF THEY DON'T, THEN YOU HAVE THIS GUIDE.

If you are UNWilling to read, or act, and expect everything to be fixed by someone else, buy an iPhone and call it a day.

Basic Computer Knowledge is Required. Such as.

1) Common Sense

2) How to open a Command Prompt.

3) How to Type.

DOWNLOAD APKTOOL : FIX YOUR OWN FRAMEWORK

IF YOU WOULD RATHER SKIP THE DOWNLOAD AND ONLY WANT THE INSTRUCTIONS, THEY ARE POSTED BELOW

Updated Text for Clarity

All tools are included. Except 7zip and Java. You need to download and install Java and 7zip or if you have them as portable programs, you need to point your windows environment variables to where you Java and 7zip are. Google that.

1) Place framework-res.apk into THIS (Where you have your apktool, etc) directory. Hold Shift, Right Click "Open Command Window Here"

2) Decompile Framework-res.apk

C:\{This directory where your apktool is}> java -jar apktool.jar d framework-res.apk

3) Modify Arrays.xml Look at the code on the first Page of this post please

4) Compile Framework-res (from Folder back to apk) - > Again, Shift Right Click > Open Command Prompt

C:\{This directory where your apktool is}> java -jar apktool.jar b framework-res

***It will start and it will say (W : Could not find sources) but thats ok let it continue. It may mention Translation errors. Ignore that. This is because there is no use of smali / backsmali (*These are needed in some cases to "install" a framework, with command "apktool if" but it is not needed here)

6) The NEW framework-res.apk will be in the dist folder located inside the framework-res folder in the same directory as your apktool.jar

7) Using 7zip, Open BOTH the newly created framework-res.apk from the DIST folder, and the original framework-res.apk.

FROM the Original Framework-res.apk, Select the META-INF and AndroidManifest.xml, and Drag and Drop them into the Newly created framework-res.apk which you also have opened inside of 7zip.

You should have 2 7zip windows open. 1 with the old framework-res.apk on the left, 1 with the new framework-res.apk on the right.

Note: Open the apk INSIDE of 7zip. Do NOT Extract the Apk. The APK is already compressed. However it contains SOME files that should NOT be further compressed.

You do not want resources.arsc file to be compressed because Android will not read it. If you look at Compressed and Uncompressed sizes for resources.arsc, they should be the same!

Close 7zip Program window.

8) Almost done. You need to ZIPALIGN this new apk - It is recommended. So Open another Command window within this directory again and type

C:\{This directory where your zipalign.exe is}>zipalign -f -v 4 framework-res.apk framework-res-za.apk

This will create a new Zipaligned framework-res-za.apk - > Rename this new zipaligned framework-res-za.apk back to framework-res.apk.

9) THE END - Make Flashable zip with provided Template by copying the NEW framework-res.apk into Flashable_Zip_Template_Directory /system/framework/ (This is where your new apk should be)

Use 7Zip to Zip it - Open 7zip, Drag and drop META-INF + system, Add to Archive, Zip it using Normal Compression.

Check it to see if your Zip has META-INF and System > Go in system and see if it has framework-res.apk.

How to get this Framework-res.apk into your ROM There are 3 ways. This is as noob friendly as I can type it out.

1) Flash the zip you made (Easiest Method, I don't see why you would bother with option 2 or 3 but I am putting it here for those who need to feel like Command Prompt busters.)

OR

2) Copy Framework-res.apk into your SD, Go in Recovery, Mount System, Copy the file into /system/framework, then fix permissions.

3) ADB

If you prefer ADB, You need to first make sure you have ADB access from either your Rom or your Recovery.

You can do this in your terminal by typing >

adb start-server

adb remount root -rw

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

adb shell

su

chmod 644 /system/framework/framework-res.apk

chown root.root /system/framework/framework-res.apk

Wipe your Dalvik Cache and Cache, then Reboot your device and you are done.

​

UPDATE : Further research indicates that Simply changing Framework-res.apk is not enough for ROMS that use their own theming such as Carbon ROM and AOKP, on certain Sony devices which I tested. Also, you cannot Flash such ROMS with the modified Framework-res baked into the ROM. In order to successfully modify the Framework - Here are the steps :

1) Remove any Theming from your ROM. - Turn off Dark Carbon, etc etc.

2) Before Decompiling, look for Frameworks.jar or Frameworks2.jar type files in /Framework and copy them to your PC.

3) Use Apktool command "if" to Install all the Framework files First before Decompiling.

4) Once installed, you can then Modify these Values, then Flash them to your ROM.

5) Always make sure to do a Backup in recovery first.

Other Solutions are to find an Updated ROM that does not suffer from these issues. If the Dev is not Merging their ROM with latest CM Upstream changes, IMO, that ROM is not worth having. Hope this helped those who are still affected by this.​