For anyone who wants to mess around with their framework-res.apk, I wrote this little bat program to automate the task of downloading, decompiling, recompiling and uploading.
A common issue I found with apktool is that all the files get compressed, where certain file types are stored with no compression in the original apk. So, to address that and make sure the new apk is properly signed, this utility builds the new apk, extracts all the files and puts them back into the original apk, properly compressed, leaving the signing intact.
To the best of my knowledge, all the tools included in this are freely redistributable (adb, aapt, 7 zip, etc.).
To use this, you'll need the Java JDK installed (it's needed to run apktool specifically, not my little bat program). You can find the JDK here.
You'll also need the Samsung drivers for the phone installed, but I'm going to assume if you're here, you already have them.
Finally, if you're going to use this, you should have a general idea of how to edit the resources in the apk, or at least the willingness to learn. This just automates the tasks of getting and processing the file, it doesn't edit anything itself. This doesn't do anything invasive, and it pulls a backup of your current framework.apk the first time it's run, so you can always restore, but as always, you're proceeding at your own risk.
I've tested it on Windows 7, but it *should* work fine on any version of Windows since it's just a simple DOS bat program. Also, it works specifically with the Fascinate framework-res.apk file. It may or may not work with frameworks from other phones.
Anyway, here it is... FrameworkUtility Hope someone finds it useful...
- 11-23-2010, 11:40 AM #2
- 11-27-2010, 06:08 PM #3
- 11-27-2010, 06:10 PM #4
Question: Do you have any idea why 3G would display instead of H when connected to HSDPA? The png files are present, but it seems like there is some programming or logic saying display the 3G png when connected to HSDPA. H does not display for upload, download, or for just connected. 3G always displays.
I've noticed a few things in my poking around:
1- When encountering modified images that, for whatever reason, aren't what it expects, it'll sometimes fall back to another image. When replacing my battery icon, there were times that it'd revert to the stock image even if my updated XML pointed to my new image.
2- There seems to be some unused images in framework-res. It may be that while the HSDPA images are there, they're simply not called or the conditions for them being called are never met, such as...
3- In modding my battery, I discovered a definite bug somewhere in the battery stats being reported by whatever part of the OS reports them. When discharging, the battery percent is reported in 1% increments. But when charging, the battery is always reported as somewhere around 20%. Even the stock XML in framework-res is set to display 6 to 8 different animated sequences depending on the battery level (<10%, 15%, 20% 25% 35% and so on), but when I look at what's actually displayed when charging, it's always the 20% sequence. Perhaps the connection images are the along the same line - the XML may be set up to display 3D and HSPDA images, but the OS always reports a 3G connection.
Just some ideas...
- 11-28-2010, 08:25 AM #6
The ROM is a captivate rom based off of a vibrant rom (jk2) and has always displayed only 3g. the images are there but not being called to display perhaps.
another issue is the battery charging displays, it doesnt display the rotating (animation) while charging, again i think the problem may be in the xml, but which one. I will poke around later. thanks in advance.
edit: what are you using to edit xml?
Not sure about the connection type/status ones. It sounds like the OS could simply be reporting a data connection and throwing up the 3G icon - not differentiating between connection types.
- 11-28-2010, 10:36 AM #8
error. what is causing it?
error. what is causing it?
* Framework Utility Script 1.0 *
New framework will be uploaded to your phone
Make sure phone is connected and rebooted into
Press any key to continue...
failed to copy 'new_framework-res.apk' to 'system/framework/framework-res.apk':
Press any key to return to main menu.
Try opening a command prompt, navigating to the utility folder and then to \tools folder (where adb is located) and typing adb shell. That should connect to your phone. Then type su and see if you get a message on your phone to allow superuser permissions. Click the allow button and make sure it remembers the choice. Should work after that.
- 11-28-2010, 11:25 AM #10
su and adb shell:
'su\' is not recognized as an internal or external command,
operable program or batch file.
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB devic
returns an error if more than one USB device is
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
-s <serial number> - directs command to the USB device or emulator w
the given serial number. Overrides ANDROID_SERI
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number
Using this ocmmand with no additional arguments
will disconnect from all connected TCP/IP devic
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and i
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
('-s' means install on SD card instead of inter
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specifie
adb remount - remounts the /system partition on the device re
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
- If it is "system" or "data", only the corresponding partition
ADB_TRACE - Print debug information. A comma separated list
of the following values
1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes prior
ity over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these de
bug tags are printed.
ADB can't connect to your phone without USB debugging enabled. If it was turned off, turn it on and try again. If you still get the permissions error, command prompt to the tools folder, then type:
"adb shell" without the quotes. This should connect to your phone and you should get a # prompt. If you get all the text you were getting before, it's still not connecting to your phone.
If you get the # prompt, then type "su" (no quotes) and check your phone for the SuperUser permissions verification thing.
- 11-28-2010, 12:59 PM #12
- 11-28-2010, 02:10 PM #14
- 11-28-2010, 02:13 PM #15
failed to copy 'new_framework-res.apk to 'system/framework/framework-res.apk': Read-only file system
Was able to push via adb push framework-res.apk /system/framework (after renaming the file and putting in /android/tools folder
Mods didnt work though
will keep trying.
- 11-28-2010, 02:48 PM #16
It's likely an issue between Fascinate and Captivate. The Fascinate framework-res.apk has no v4 folders inside, so that's probably it. When my lil utility rebuilds the apk, it manually adds the files from each of the folders in the new apk to the old one using 7z. Since the fascinate doesn't have any v4 folders, the bat program ignores them.
Let me play with this a little tonight, I'll see if I can add the signing to the new apk as opposed to adding all the files to the old, signed apk. That way it'd probably be more compatible with other frameworks, but even then, I have no way of knowing exactly what's in a framework from another system.
- 07-06-2012, 08:37 AM #18