Hi all:
I am new to xda-developers but a very experienced software designer.
In attempting to enable Google Voice calling on my new Nexus 7, I followed some threads here that
showed how to enable config_voice_capable in framework-res.apk via decompiling and rebuilding. It occurred to me that there
might be a more direct method for resource changes and I discovered, also
in here a post at http://forum.xda-developers.com/show...2302&nocache=1,
indicating the built-in overlay feature in android, for modifying resources at runtime.
I thought this looked promising and tried it out. I just wanted to confirm that it works well. I was unable to post in that
thread because I am new here, but I thought it would be worthwhile documenting what I did, for the benefit of
others.
I tested this method to enable 2 booleans in framework-res.apk but I believe it will work with any resources.
The booleans I enabled for testing were "config_voice_capable" and "config_enableLockScreenRotation".
All that is required on a rooted device is the following:
1. On your development machine (with aapt and other platform-tools installed).
switch to any directory of your choice for development purposes and
under it create a res/ directory for the resources you wish to change. Under this directory
I created a values directory in which I created a config.xml file that appears
as follows:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="config_voice_capable">true</bool>
<bool name="config_enableLockScreenRotation">true</bool>
</resources>
Notice that this file specifies only the 2 config values I wish changed. You can
add any other resources you want modified.
At the same level as the res/ directory create a manifest files AndroidManifest.xml
as follows:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.frameworkres.overlay">
</manifest>
2. Now using aapt build a package for the overlay as follows:
>aapt package -S res/ -M AndroidManifest.xml -f -v -F framework-res-overlay.apk
This will create the overlay package framework-res-overlay.apk, using resources in the res/
directory and the specified manifest file.
3. Now simply transfer the framework-res-overlay.apk to your device (I use a wifi ftp connection)
and save it on your sdcard (I use /sdcard/data).
Now on your Nexus or other device:
1. First check on your device for a directory /vendor/overlay.
2. If one is not present (it won't be by default) go into a terminal emulator on your device
and execute:
>su
>mount -o remount rw /system
>mkdir /vendor/overlay
3. Now copy the overlay package into that directory:
>cp /sdcard/data/framework-res-overlay.apk /vendor/overlay
That's it.
Simply power down your device then power up again and the new resources you specified
will replace the built-in defaults.
I hope that helps. And thanks to the original poster who discovered this feature.
It is in the source code tree, and is a much cleaner method for altering framework
resources at runtime than the procedure others have been using of decompiling, editing and
re-building, imo.
Good luck.
I am new to xda-developers but a very experienced software designer.
In attempting to enable Google Voice calling on my new Nexus 7, I followed some threads here that
showed how to enable config_voice_capable in framework-res.apk via decompiling and rebuilding. It occurred to me that there
might be a more direct method for resource changes and I discovered, also
in here a post at http://forum.xda-developers.com/show...2302&nocache=1,
indicating the built-in overlay feature in android, for modifying resources at runtime.
I thought this looked promising and tried it out. I just wanted to confirm that it works well. I was unable to post in that
thread because I am new here, but I thought it would be worthwhile documenting what I did, for the benefit of
others.
I tested this method to enable 2 booleans in framework-res.apk but I believe it will work with any resources.
The booleans I enabled for testing were "config_voice_capable" and "config_enableLockScreenRotation".
All that is required on a rooted device is the following:
1. On your development machine (with aapt and other platform-tools installed).
switch to any directory of your choice for development purposes and
under it create a res/ directory for the resources you wish to change. Under this directory
I created a values directory in which I created a config.xml file that appears
as follows:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="config_voice_capable">true</bool>
<bool name="config_enableLockScreenRotation">true</bool>
</resources>
Notice that this file specifies only the 2 config values I wish changed. You can
add any other resources you want modified.
At the same level as the res/ directory create a manifest files AndroidManifest.xml
as follows:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.frameworkres.overlay">
</manifest>
2. Now using aapt build a package for the overlay as follows:
>aapt package -S res/ -M AndroidManifest.xml -f -v -F framework-res-overlay.apk
This will create the overlay package framework-res-overlay.apk, using resources in the res/
directory and the specified manifest file.
3. Now simply transfer the framework-res-overlay.apk to your device (I use a wifi ftp connection)
and save it on your sdcard (I use /sdcard/data).
Now on your Nexus or other device:
1. First check on your device for a directory /vendor/overlay.
2. If one is not present (it won't be by default) go into a terminal emulator on your device
and execute:
>su
>mount -o remount rw /system
>mkdir /vendor/overlay
3. Now copy the overlay package into that directory:
>cp /sdcard/data/framework-res-overlay.apk /vendor/overlay
That's it.
Simply power down your device then power up again and the new resources you specified
will replace the built-in defaults.
I hope that helps. And thanks to the original poster who discovered this feature.
It is in the source code tree, and is a much cleaner method for altering framework
resources at runtime than the procedure others have been using of decompiling, editing and
re-building, imo.
Good luck.