Remove All Ads from XDA
Honor View 10

[REQUEST] help me recompile

279 posts
Thanks Meter: 44
By TrojanHorses, Senior Member on 11th January 2014, 04:20 AM
Post Reply Email Thread
Warning: Wall of Text Incoming

I want to enable screen off animation in miui v4 rom(cm9 based) by vadim shved. but I get an error when I recompile my framework. I used this guide as reference

so... can someone do it for me?

I know that some of you guys will say "open settings then go to display settings and enable screen off animation" but I must say, SCREEN OFF ANIMATION IS NOT PRESENT IN ANY PART OF THE ROM'S SETTINGS.

Error Log:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.



C:\>cd android/apktool

C:\android\apktool>apktool if framework-res.apk
I: Framework installed to: C:\Users\Chito\apktool\framework\1.apk

C:\android\apktool>apktool d framework-res.apk framework1
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...

C:\android\apktool>apktool b framework-res-new.apk
Exception in thread "main" brut.androlib.AndrolibException:
toryException: framework-res-new.apk (The system
cannot find the file specified)
at brut.androlib.Androlib.readMetaFile( 142)
at brut.apktool.Main.cmdBuild(
at brut.apktool.Main.main(
Caused by: fra
mework-res-new.apk (The system cannot find the file specified)
at brut.androlib.res.util.ExtFile.getDirectory(ExtFil
at brut.androlib.Androlib.readMetaFile( 138)
... 4 more
Caused by: framework-res-new.apk (The system cann
ot find the file specified)
at Method)
at<init>(Unknown Source)
at<init>(Unknown Source)
at<init>(Unknown Source)
... 7 more



Step 1 : Get a copy of your framework-res.apk on your sd card. Do this by starting up root explorer on your phone, navigate to system - framework, scroll down and you should see framework-res.apk. Keep your finger pressed on it and you should see some options, select copy. Now press back twice and find the sdcard folder. Paste it anywhere you want (I made a folder for it so its easier to manage).

Step 2 : : Connect your phone up to your PC:

If you have sd card slots in your PC then unmount your sdcard from your phone by going to settings-SD card and Phone storage , take out your SD card and stick it in the SD card adapter that you should have gotten with your phone and stick that in the SD card slot in your PC

If you don't have an SD card slot then simply connect your phone to your PC via USB. When you connect it you should get a notification saying that the USB is connected, if you didn't you may need to install the drivers. On your phone drag down the notification bar and tap on "USB connected" and then tap "Connect storage to PC"

Step 3 : Now that your phone or SD card is connected you will need to navigate to where you put your framework-res.apk. cut it and paste it to a folder on your computer of your choice (somewhere easy to find). Now make a copy of it (yes that was not a typo we will need the original copy of framework-res if we fail, but we shouldnt fail). Anyway copy and paste it to the folder that you extracted "apktools". So for me that was "C:\Android\apktool" Yes i made a folder called android in C (easier to manage).

Step 4 : Now that we have a copy of framework-res.apk in the apktools folder we can modify it to enable the crt animation (at this point you can choose to disconnect your phone or SD card from your PC and connect it later or leave it in). Now we need to start up command prompt. This is where our years of command prompt navigating come into place . At this moment you should see "C:\Users\<Your Username>", you will need to navigate to where you extracted apktools, if you extracted it in "C:\" or somewhere else easy then this should be a walk in the park for you. If you extracted in "C:\" just type "cd C:\" then "cd apktool" and your there. For others, well....Go on to step 5 in a couple minutes

At the end of it you should see something like "C:\.......\apktool" (not the dots obviously)

Step 5 : now that you have framework-res.apk in the folder where you extracted apktools and you have command prompt open lets get started. First we will need to install framework to your system so we can compile correctly. To do this type "apktool if framework-res.apk" in command prompt. If you were successful you should see something like "I : Framework installed to C:\......."

Step 6: We will now need to decompile framework-res.apk. To do this type "apktool d framework-res.apk framework1". If it decompiled succesfully then there should be a folder called "framework1" where you extracted apktool.

Step 7 : Now we get to make that modification we need. Click on "framework1" --> "res" -- > "values". Find a file called "bools.xml" right click on it and click edit. Now we are looking for this line :
<bool name="config_animateScreenLights">true</bool>. Once you have found it change "<bool name="config_animateScreenLights">true</bool>" to "<bool name="config_animateScreenLights">false</bool>" now we save it (Do not click "save as" just click save)

Step 8 we will now need to recompile framework-res.apk. So open up the handy dandy command prompt and type "apktool b framework1 framework-res-new.apk". If all went well you should see a file called "framework-res-new.apk (Dont worry about all the writing in the command prompt window you saw, if you saw any). framework1 is the folder with our edited file
" NOTE: We are NOT using framework-res-new.apk as our new framework-res.apk IT WILL NOT WORK

Step 9 : This is where we are going to use 7zip. You have to open your original apk (the one we copy pasted into the apktool folder) with 7zip. right click on "framework-res.apk". Click "Open" and a window should show up check the box that says to open with a list of installed programs. You will need to browse to the folder you installed 7zip and click on "7zFM", then click "Ok". Now that we have our original "framework-res.apk" open in 7zip need to navigate to the "framework1" folder. Click on "Build -->apk" and there should be a file called "resources.arsc". Drag and drop this file in the 7zip window. You should get a confirmation box. Click "Ok" (There is already one in the 7zip window, the one we are dragging and dropping will replace it).

Step 10: Once we have replaced the "resources.arsc" file we can close the 7zip window. Now heres where the android SDK comes in handy. The rest of this tutorial will be split up into 2 parts; People with the android SDK and people without it

Attached Files
File Type: apk framework-res.apk - [Click for QR Code] (3.68 MB, 6 views)
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes