[FIX] Show status bar item press (10/28/10) - Vibrant Android Development

One very annoying thing about the vibrant status bar (in ALL eclair ROMs) is the lack of visual feedback from selecting a notification item. Usually when you click a notification on stock, the item will turn orange. With the vibrant, this does not happen. The "pressed" state uses the same drawable as normal for notification icons. The same is true for the clear notifications button. I find this extremely annoying.
So, I went poking around in the framework-res.apk and found a typo in a status bar layout file. I fixed it so now it works!
EDIT: Oops! I posted the wrong file. It is actually "status_bar_latest_event.xml"
Sorry about that.
Here is the typo:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="66.0sp"
xmlns:android="http://schemas.android.com/apk/res/android">
<View android:background="@drawable/quick_panel_list_stroke_01" android:layout_width="fill_parent" android:layout_height="1.0sp" />
<com.android.server.status.LatestItemView android:id="@id/content" android:background=[COLOR="Red"]"@drawable/status_bar_item_background_normal"[/COLOR] android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="65.0sp" />
</LinearLayout>
That's the whole file. The "typo" is in red. "@drawable/status_bar_item_background_normal" points to a .9.png file which is why the drawable simply stayed the same ("normal") even when you clicked it.
What the file SHOULD say is this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="66.0sp"
xmlns:android="http://schemas.android.com/apk/res/android">
<View android:background="@drawable/quick_panel_list_stroke_01" android:layout_width="fill_parent" android:layout_height="1.0sp" />
<com.android.server.status.LatestItemView android:id="@id/content" android:background=[COLOR="Red"]"@drawable/status_bar_item_background"[/COLOR] android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="65.0sp" />
</LinearLayout>
"@drawable/status_bar_item_background" points to an xml file which is a selector that tells the drawable to switch according to the view's state (pressed, selected, normal)
I've looked at several frameworks and they all have the same typo in them. After I found this, I looked at a nexus one framework and that confirmed that this is indeed the way the file should read. Whether this was intentionally done by Samsung or not, I do not know. Although I'm assuming it was a mistake.
To use:
1. Download attachment "status_bar_latest_event.xml.zip" and remove ".zip" (don't unzip)
2. MAKE A BACKUP OF YOUR FRAMEWORK-RES.APK
3. Open framework-res.apk with 7-zip or winrar or whatever (DO NOT unzip it)
4. Copy status_bar_expanded.xml to /res/layout/ and overwrite.
5. Do this:
Code:
adb shell stop
adb push /path/to/framework-res.apk /system/framework/
adb reboot
Enjoy!

I just wanted to say 1up on this... I
'd love to have this figured out.

I've noticed this as well. I'm not sure why out isn't doing it either, but I know it definitely works correctly in froyo.

I think I found it. Testing now.
EDIT: See first post.

Awesome find, adding to the directory now!

matt_stang said:
One very annoying thing about the vibrant status bar (in ALL ROMs) is the lack of visual feedback from selecting a notification item. Usually when you click a notification on stock, the item will turn orange. With the vibrant, this does not happen. The "pressed" state uses the same drawable as normal for notification icons. The same is true for the clear notifications button. I find this extremely annoying.
So, I went poking around in the framework-res.apk and found a typo in a status bar layout file. I fixed it so now it works!
To use:
1. Download attachment "status_bar_expanded.xml.zip" and remove ".zip" (don't unzip)
2. MAKE A BACKUP OF YOUR FRAMEWORK-RES.APK
3. Open framework-res.apk with 7-zip or winrar or whatever (DO NOT unzip it)
4. Copy status_bar_expanded.xml to /res/layout/ and overwrite.
5. Do this:
Code:
adb shell stop
adb push /path/to/framework-res.apk /system/framework/
adb reboot
Enjoy!
Click to expand...
Click to collapse
Hi,
Thanks for figuring this out.
Any chance of posting the typo fix in the OP?
It would make it easier for those of us running our own customized frameworks.
Mostly I'm just lazy and don't want to drop your xml into a file, decompile, diff against stock, diff against my customizations, etc., etc.
Cheers, =)

Did you ever try my ROM? You can't really say that it is missing in ALL ROMS if you haven't tried them all.
It defiantly wasn't missing in my Axura, it was just blue instead of orange

s0niqu3 said:
Hi,
Thanks for figuring this out.
Any chance of posting the typo fix in the OP?
It would make it easier for those of us running our own customized frameworks.
Mostly I'm just lazy and don't want to drop your xml into a file, decompile, diff against stock, diff against my customizations, etc., etc.
Cheers, =)
Click to expand...
Click to collapse
Yeah I'll update the first post in a second. I'm not sure if it was a typo or not but it seems like Samsung would have fixed it in the latest releases and leaks.
Master™ said:
Did you ever try my ROM? You can't really say that it is missing in ALL ROMS if you haven't tried them all.
It defiantly wasn't missing in my Axura, it was just blue instead of orange
Click to expand...
Click to collapse
Sorry! It's only the Eclair ROMs. As mentioned earlier, Froyo ROMs already have this fixed.

Thanks a lot....nice observation to find AND fix the typo

Hey good work! Will be including this in an update.

Hi again,
Quick FYI, if you want the "clear-all" button to show the pressed state, decompile twframework-res.apk and edit /res/layout/status_bar_expanded.xml
change the red highlighted text in the following to:
@drawable/quickpanel_btn_default
Code:
<Button android:textSize="14.0sp" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:id="@id/clear_all_button" android:background="[COLOR="Red"]@drawable/quick_panel_btn_default_normal[/COLOR]" android:layout_width="75.0dip" android:layout_height="wrap_content" android:layout_marginRight="6.0dip" android:text="@string/status_bar_clear_all_button" />
Then save and recompile.
Cheers everyone, =)

s0niqu3 said:
Hi again,
Quick FYI, if you want the "clear-all" button to show the pressed state, decompile twframework-res.apk and edit /res/layout/status_bar_expanded.xml
change the red highlighted text in the following to:
@drawable/quickpanel_btn_default
Code:
<Button android:textSize="14.0sp" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:id="@id/clear_all_button" android:background="[COLOR="Red"]@drawable/quick_panel_btn_default_normal[/COLOR]" android:layout_width="75.0dip" android:layout_height="wrap_content" android:layout_marginRight="6.0dip" android:text="@string/status_bar_clear_all_button" />
Then save and recompile.
Cheers everyone, =)
Click to expand...
Click to collapse
Thanks! I looked for that but didn't think to check the twframework again because the other fix was in the regular framework. I noticed in the regular framework the button code was fine but it didn't occur to me it might be in tw.

s0niqu3 said:
Hi again,
Quick FYI, if you want the "clear-all" button to show the pressed state, decompile twframework-res.apk and edit /res/layout/status_bar_expanded.xml
change the red highlighted text in the following to:
@drawable/quickpanel_btn_default
Code:
<Button android:textSize="14.0sp" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:id="@id/clear_all_button" android:background="[COLOR="Red"]@drawable/quick_panel_btn_default_normal[/COLOR]" android:layout_width="75.0dip" android:layout_height="wrap_content" android:layout_marginRight="6.0dip" android:text="@string/status_bar_clear_all_button" />
Then save and recompile.
Cheers everyone, =)
Click to expand...
Click to collapse
------------------------------
I don't get why when I make changes to the twframework-res.apk file it always breaks the system with force closes.
phone - media - email all force close
I am using bionix 1.1
APK Manager 4.9
If I make any change to twframework-res.apk it ends in FCs.
When I tried to recreate from this tutorial its a no go.
I thought originally it might be a problem when recompiling, so I copied the modified files into the apk (I use winrar) but it still FCs.
The only way for me to have this work on my phone is to install it as it.
Any ideas?

Muffin-Factory said:
------------------------------
I don't get why when I make changes to the twframework-res.apk file it always breaks the system with force closes.
phone - media - email all force close
I am using bionix 1.1
APK Manager 4.9
If I make any change to twframework-res.apk it ends in FCs.
When I tried to recreate from this tutorial its a no go.
I thought originally it might be a problem when recompiling, so I copied the modified files into the apk (I use winrar) but it still FCs.
The only way for me to have this work on my phone is to install it as it.
Any ideas?
Click to expand...
Click to collapse
Hi,
Are your wiping your cache,
Dalvik-cache and fixing permissions before rebooting?
I'd say 95% of the time that solves fc issues for me when modifying system files.
Else I have no clue, I modify twframework-res all the time without issue.
Good luck though, cheers, =)

Help
s0niqu3 said:
Hi again,
Quick FYI, if you want the "clear-all" button to show the pressed state, decompile twframework-res.apk and edit /res/layout/status_bar_expanded.xml
change the red highlighted text in the following to:
@drawable/quickpanel_btn_default
Click to expand...
Click to collapse
Do you think you could post that xml file for us who are not so good at decompiling and using adb.

s0niqu3 said:
Hi,
Are your wiping your cache,
Dalvik-cache and fixing permissions before rebooting?
I'd say 95% of the time that solves fc issues for me when modifying system files.
Else I have no clue, I modify twframework-res all the time without issue.
Good luck though, cheers, =)
Click to expand...
Click to collapse
Ok, I don't quite understand how to edit twframework-res.apk.
If you would, please, a quick run down of options I should be selecting when decompiling and recompiling.
As of right now i have found out that my recompiling is not reencoding the xml files

Muffin-Factory said:
Ok, I don't quite understand how to edit twframework-res.apk.
If you would, please, a quick run down of options I should be selecting when decompiling and recompiling.
As of right now i have found out that my recompiling is not reencoding the xml files
Click to expand...
Click to collapse
Hi,
Do you use apk manager 4.9 to decompile?
If so, a straight decompile (option 9) is all I ever do for twframework-res.apk and it works fine. Now, when recompiling, if you start from something like bionix/hybrid/etc. base, its likely that they "cheated" when they replaced .9.png files for their theme, so you'll get errors when you recompile the framework.
So, here's my process if modding an already themed framework-res/twframework-res apk:
1) decompile apk
2) make my edits, try to recompile, if it errors, then:
3) Check the log, if its an error about a .9.png then:
4) decompile stock, non-themed apk from the rom version I use (JFD or JI6)
5) copy over the entire contents of the drawable-hdpi(-v4) folder to the apk I'm editing.
6) try to re-compile, 99% of the time, this works, since it seems most rom cooks like to cheat with their .9.png edits.
optional - 7) open the newly compiled apk and the original apk with 7zip and copy over the contents of the drawable-hspi(-v4) folder from the original/themed apk to my new compiled apk
8) zipalign apk
9) push apk to /system/framework
10) adb reboot recovery
11) reinstall packages to get into clockwork recovery
12) wipe cache, advanced wipe dalvik-cache and fix permissions
13) reboot
Hope this helps, cheers, =)

Dugorf said:
Do you think you could post that xml file for us who are not so good at decompiling and using adb.
Click to expand...
Click to collapse
Hi,
I don't really want to post my xml file for 2 reasons, (mostly for reason number 1 though.)
1) I made extra edits to it for my own personalized theme, and it might cause display issues for people using anything other than my own specific theme.
2) I'm kind of tired of people using somebody else's work and not giving credit. I see a lot of my battery icons used all over the place, and very rarely do people link back to the thread, or even say thanks in their OP.
I do this purely for fun (well, and to kill boredom time since I'm unemployed currently), but I also don't like people not giving credit to original content authors.
Anyway, sorry about that, cheers, =)

s0niqu3 said:
Hi,
I don't really want to post my xml file for 2 reasons, (mostly for reason number 1 though.)
1) I made extra edits to it for my own personalized theme, and it might cause display issues for people using anything other than my own specific theme.
2) I'm kind of tired of people using somebody else's work and not giving credit. I see a lot of my battery icons used all over the place, and very rarely do people link back to the thread, or even say thanks in their OP.
I do this purely for fun (well, and to kill boredom time since I'm unemployed currently), but I also don't like people not giving credit to original content authors.
Anyway, sorry about that, cheers, =)
Click to expand...
Click to collapse
That is totally understandable. Thank you for the detailed instructions. I am just getting into making my own themes (starting just for me). I have used your battery mod for awhile and love it. I'm looking forwards to learning how to make that kind of thing myself.
Thanks again.

Can you make a MM zip or flashable zip? I don't know exactly how to do this in Fusion 1.2 I don't want to mess anything up, last time I tried it was a fail. I kept getting FCs.

Related

[GUIDE] Creating Transparent Statusbars for CM7 based and most other ROM

Reading the next couple of paragraphs will help you to yourself create a Transparent Statusbar for CM7 based and also most other ROMs. I feel that despite some good programs available for doing this, for example the excellent patcher from ZduneX25, users face quite a bit of difficulty in creating their own transparent statusbars. So here is a detaild guide based on my experience. I have prepared status bars at least for 20 different ROMs using this process with zero fails. Hope it helps people out here.
Prerequisites:
Properly configured Apktool - http://code.google.com/p/android-apktool/
7-zip - http://www.7-zip.org/
Framework-res.apk and SystemUI.apk of the ROM for which you wish to create the statusbar
SystemUI.apk from an existing ROM or theme having transparent statusbar from which you want to copy the transparent images. I have attached the one I am using currently. Use it if you want.
Steps to create the statusbar:
Step 1 – Edit the SystemUI.apk to enable transparency
Open command prompt and go to the directory where you have installed Apktool
Install Framework-res.apk
Code:
apktool if Framework-res.apk
Decompile SystemUI.apk
Code:
apktool d /path/to/SystemUI.apk /path/to/decompiled_files
Now in the decompiled_files folder, open the following file ina a text editor
Code:
/path/to/decompiled_files/smali/com/android/systemui/statusbar/StatusBarService.smali
Search and Find the following string:
Code:
new-instance v0, Landroid/view/WindowManager$LayoutParams;
Three or four lines below this string you will find the following:
Code:
const/4 v5, 0x2
Replace it with
Code:
const/4 v5, -0x3
Now open the following file in a text editor
Code:
/path/to/decompiled_files/res/layout/status_bar.xml
You will find the following code at the end of the file
Code:
<com.android.systemui.statusbar.DateView android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="left|center" android:id="@id/date" android:background="@drawable/statusbar_background" android:paddingLeft="6.0px" android:paddingRight="6.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
Replace it with
Code:
<com.android.systemui.statusbar.DateView android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="center|center" android:id="@id/date" android:background="@drawable/statusbar_background2" android:paddingLeft="6.0px" android:paddingRight="6.0px" android:layout_width="fill_parent" android:layout_height="fill_parent" android:singleLine="true" />
Save and close the file
Browse to
Code:
/path/to/decompiled_files/drawable-mdpi or drawable-hdpi
Copy
Code:
statusbar_background.9.png
and paste it again as
Code:
statusbar_background2.9.png
in the same folder. You can also copy-paste and rename the file.
Recompile the SystemUI.apk
Code:
apktool b /path/to/decompiled_files
The new SystemUI.apk is saved to
Code:
/path/to/decompiled_files/dist/SystemUI.apk
Step 2 – Add the transparent images
Open the new SystemUI.apk in 7-zip and browse to the following locations depending on your device resolution
Code:
\res\drawable-mdpi\ or \res\drawable-hdpi\
Open the other SystemUI.apk (no. 4 in the prerequisites above) also in 7-zip and browse to the same folder,
Code:
\res\drawable-mdpi\ or \res\drawable-hdpi\
depending on your device resolution. Select the following files
statusbar_background.9.png
statusbar_background2.9.png
shade_bg.png (if you want a transparent pull down as well. Make sure the shade_bg.png is a transparent image.)
Drag and drop these files over to the other open 7-zip window containing your new SystemUI.apk. 7-zip will ask for confirmation, click OK.
Step 3 – Sign SystemUI.apk
You can use a number of signing tools to sign your files but in my experience it results in error many times, specially on Windows. The alternative way is use the signed files of the original apk.
Open the new SystemUI.apk in 7-zip
Open the original SystemUI.apk in 7-zip. This is the original SystemUI.apk from the ROM for which you want to create the statusbar, the one you decompiled.
Drag and drop the META-INF folder and AndroidManifest.xml file from the original to the new SystemUI.apk.
Close all files. That’s it. You just signed your APK with zero chances of any error.
Now push this final SystemUI.apk to /system/app on you phone and reboot.
Of course the risk is your own here. If something bad happens just push your original SystemUI.apk to the phone and you should be good.
Also in case you find any error here, please inform me and I will try to correct it.
Click the Thanks button if this writeup helped you.
wow !! gonna try it dude
can you make another guide on changing font colors,for example the font color in the settings menu screen?
dyetheskin said:
can you make another guide on changing font colors,for example the font color in the settings menu screen?
Click to expand...
Click to collapse
I will have a go at it next time.
Awesome thanx for explaining it so nicely
Sent from my GT-S5570 using xda premium
Very nice tutorial up there, but is there any solution for overlapping date when there are many notification icon on dropped down status bar?
@Cortiis
i tried but failed many times..so will u plzzz do it for me...here are the files..the 1st two are from the rom in which i want trans s.bar...3rd one(renamed) is from the rom which already has trans s.bar..
btw all the files here are not from my phone but from respective rom zips in my comp..
This worked for me but only on the lockscreen and when I have holo launcher running. Samsung home (touchwiz i presume) still has black status bar. search for solution to that with no success... anyone know what else needs to be modded for the transparent status bar in touchwiz? btw thanks to ccgh for pointing me to this thread
Will it work with 4.1?
(Cm10)
Sent from my Slim Jelly phone

[HOW TO] Centre clock and icon switch. Update: bottom power control widget!

About
A while ago Taine0 posted this thread. He's since vanished from XDA, and I have, at the request of several users, posted this here so that we have an active member in control of the first post. My goal is to write an in-depth guide into how to perform this modification, as well as a few other tidbits that could be of use. I also intend to maintain a list of links to other good guides, as written by other people. That is in the second post. I may well add a few, shorter, guides to some other popular tweaks to the third post if people want
Credits
Taine0 made this first, to the best of my knowledge. I can't stress enough how this thread is just to give coherent support.
ZduneX25: worked out how to stop new notifications from overlapping the clock, as well as re-order the status icons
Randomchars: worked out how to stop new notifications from overlapping the clock, as well as re-order the status icons
If there are others who I've forgotten about, please tell me! It's been a long time since I saw those posts
Contents
Post one:
-> Set up
-> Centring the clock
-> Switching the notification icons with the status icons
Post 2:
-> Other people's guides
Post 3:
-> Power control widget at the bottom of the notification shade (we need a short name for that mod )
-> Re-ordering the status icons
-> Removing power menu blur
A word of warning
If any of you quote this entire post, EVER, I will not help you. At all. I'll even go so far as to try and get a moderator to edit your post. This is a HUGE post, the last thing we need is multiple copies of this post littered throughout the thread. Quote only the bit you're struggling with.
The guide
This guide is written to be as cross compatible as possible. It's worth noting that my operating system of choice is Ubuntu, so thinks like apkmanager don't work too well for me.
Tools used
APKTool
A text editor. In my case it's gedit. On windows I suggest you use Notepad++. Mac users: the default text editor should work fine, but I've not tested it. I rarely, if ever, use macs.
An archiving tool. On Ubuntu the built in archive manager works perfectly. For windows users I'd suggest you get 7Zip, but winrar works too.
ADB. To set it up on Linux see here. If you're using windows see the next section for a quick guide. Mac users: for reasons mentioned above, you're on your own here. Sorry
ADB on windows
Download and extract this to a known location, such as C:\ADB. Now you need to add that to your PATH. See here for info on that. I believe you can also download the Android SDK and it has an automated installer for Windows now, but I'm not 100% sure on that.
Preparation
Set up ADB and APKTool. A guide for setting up APKTool can be found here
Now that you have ADB set up you can plug your phone into your computer, ensuring that you have "USB debugging enabled" (Settings --> Applications --> Development --> USB Debugging on 2.3 || Settings --> Developer options -->USB Debugging on 4.0)
Open up a terminal (CMD on Windows) by doing the following:
Linux: CTRL+ALT+T
Windows: Windows key+R, then type "CMD" (without quotes) and hit ENTER
Mac: No idea. If someone tells me I'll put it here
Now enter the following command to verify that your device is detected:
Code:
adb devices
The output should be something like this:
Code:
[email protected]:~$ adb devices
List of devices attached
3735698AA76400EC device
Yes, my name is Sam. Yes I named my PC Coruscant. Deal with it
Now, change directory to a useful working directory. For example:
Code:
cd ~/Android/Legend/StatusBarMod/Working/
On Windows you can just navigate to your chosen directory in Windows Explorer (the file manager) then hold SHIFT while right clicking, and choose "Open CMD here" (or something like that, I forget. Please confirm)
Next you need to pull SystemUI.apk and framework-res.apk from the device:
Code:
adb pull /system/app/SystemUI.apk
adb pull /system/framework/framework-res.apk
Output looks like this:
Code:
[email protected]:~/Android/Legend/StatusBarMod/Working$ adb pull /system/app/SystemUI.apk
3592 KB/s (1423910 bytes in 0.387s)
[email protected]:~/Android/Legend/StatusBarMod/Working$ adb pull /system/framework/framework-res.apk
4649 KB/s (9245621 bytes in 1.941s)
Now you need to set up APKTool to use your framework-res.apk:
Code:
apktool if framework-res.apk
Output:
Code:
[email protected]:~/Android/Legend/StatusBarMod/Working$ apktool if framework-res.apk
I: Framework installed to: /home/sam/apktool/framework/1.apk
Now you need to decompile SystemUI.apk:
Code:
apktool d SystemUI.apk
Output:
Code:
[email protected]:~/Android/Legend/StatusBarMod/Working$ apktool d SystemUI.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: /home/sam/apktool/framework/1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
It might also be an idea to decompile framework-res.apk if you want to change the order of the status icons (signal, wifi etc.):
Code:
apktool d framework-res.apk
Output:
Code:
[email protected]:~/Android/Legend/StatusBarMod/Working$ apktool d framework-res.apk
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
Open a file manager and navigate to you working directory. You'll see something like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Navigate to SystemUI/res/layout
If your ROM is CM, or CM based, you'll see this:
If your ROM is different, don't worry. The only file we're using here is status_bar.xml.
Open status_bar.xml in your text editor (gedit for me, notepad++ for most of you) and try to get familiar with the XML layout. I can't go into all the ins and outs here, but "<" starts a line, and ">" finishes a line. Regardless of whether your text editor wraps the text, that's how it works. A line is NOT finished until you see this: ">". If possible, set your text editor up to NOT wrap text around. You'll end up scrolling left and right a lot, but it's much easier to track what you're doing this way.
Centring the clock
Open a new tab in your text editor (yes, you can do that) and paste this into it:
Code:
<LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">
</LinearLayout>
That's the section that puts the clock in the centre of the status bar, but it currently doesn't hold the clock element in it. Go back to your status_bar.xml and look for a line that starts like this:
Code:
<com.android.systemui.statusbar.Clock
Remember, that clock line doesn't finish until you find the closing ">". Copy that entire line, then delete it (or just cut it, if you're feeling swish), then go back to your new tab and paste it into the middle of the code snippet above. It should look something like this:
Code:
<LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.Clock android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" [COLOR=Red]android:gravity="center"[/COLOR] android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
</LinearLayout>
See the bit that's highlighted in red? It's highlighted because I've changed "right" to "center". You need to do that too. Copy that whole block of code and paste it just below the line that ends like this:
Code:
xmlns:android="http://schemas.android.com/apk/res/android">
So that you end up with something like this:
Code:
<com.android.systemui.statusbar.CmStatusBarView android:background="@drawable/statusbar_background" android:focusable="true" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.Clock android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="center" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
</LinearLayout>
Now we need to fix a few things, like centring the date (to make it look nice) and making it so the date and new notifications don't overlap the clock.
To centre the date:
Find the line that starts like this:
Code:
<com.android.systemui.statusbar.DateView
and scroll across that line until you see this:
Code:
android:gravity="left|center"
Change that bit to this:
Code:
android:gravity="center"
Then scroll across a little more and change this:
Code:
android:layout_width="wrap_content"
to this:
Code:
android:layout_width="fill_parent"
.
That's the date centred!
To fix the notification overlap you need to add a little to this line:
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/ticker"
Scroll right to the end of that line and add this
Code:
android:background="@drawable/statusbar_background"
The whole line will look something like this:
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/statusbar_background">
Clock centred, no overlap!
Switching the icons around with the notification icons (optional)
It's worth noting that there will be a gap to the right of the notification icons. There's very little we can do that I'm afraid.
First you need to find the line that starts like this:
Code:
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons"
and move it to just above this:
Code:
<com.android.systemui.statusbar.IconMerger
Now scroll to the end of the line that starts like this
Code:
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons"
and change this:
Code:
android:layout_alignParentRight="true"
to this
Code:
android:layout_alignParentLeft="true"
Then on the line that starts like this:
Code:
<com.android.systemui.statusbar.IconMerger
change this
Code:
android:layout_alignParentLeft="true"
to this
Code:
android:layout_alignParentRight="true"
Now you can save and exit, because we're done there.
Recompiling SystemUI.apk
Go back to your terminal/cmd and enter the following command:
Code:
apktool b SystemUI
Output:
Code:
[email protected]:~/Android/Legend/StatusBarMod/Working$ apktool b SystemUI
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
Now go back to your file manager and go up a few levels, until you end up back in your working directory. Open, but don't extract, SystemUI.apk and navigate to res/layout. Put the window to one side and go back to your file manager, then navigate to SystemUI/build/apk/res/layout. You'll see those same XML files, only this time they're binary XML, because they've been compiled.
Simply drag status_bar.xml from the file manager to the archive manager, and it will be copied across. No need to sign or anything.
Go back to CMD, and issue the following command to get rw access on /system:
Code:
adb remount
Output:
Code:
[email protected]:~/Android/Legend/StatusBarMod/Working$ adb remount
remount succeeded
Then issue the following command to push your modified SystemUI.apk to your device:
Code:
adb push SystemUI.apk /system/app/SystemUI.apk
Output:
Code:
[email protected]:~/Android/Legend/StatusBarMod/Working$ adb push SystemUI.apk /system/app/SystemUI.apk
3943 KB/s (1423910 bytes in 0.352s)
Then reboot and enjoy:
Code:
adb reboot
Video
I'll make one that mirrors this guide more accurately over the coming weeks
Further reading
To be completed
Other guides
Nice short guide to centring the clock and making the status bar transparent by Fergie716: http://forum.xda-developers.com/showpost.php?p=19470547&postcount=1061 || If you want to use my trick to avoid signing SystemUI after a smali edit you need to copy the new classes.dex file to SystemUI too.
Fanstastic guide for all your theming needs: http://forum.xda-developers.com/showpost.php?p=9978779&postcount=62
Other tweaks
Things to write here (in no particular order)
Re-organise status icons in notification bar
Remove blur behind power menu
Enable tablet tweaks
Re-organise lockscreen
Power control widget at bottom
The way Taine0 did it is really messy, so I came up with a new way to move the power control widget. Instead of trying to force it to the bottom of the notification shade (this is done by editing status_bar_expanded.xml) realised I could attach it to the grab handle at the bottom, by editing status_bar_tracking.xml:
To apply the mod yourself decompile SystemUI the usual way, then paste this line:
Code:
<com.android.systemui.statusbar.powerwidget.PowerWidget android:id="@id/exp_power_stat" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/title_bar_portrait" />
To just above this line:
Code:
<ImageView android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable/status_bar_close_on" android:scaleType="fitXY" />
Now recompile and do the usual trick to avoid signing (copy the compile status_bar_tracking/xml into your old SystemUI.apk).
No further edits are required
Re-organising the status icons
So, these icons are things like signal strength, data connection type etc... If you have your status icons on the left you might find the order they're in mildly irritating. Fear not, my padwans! This section will enlighten you with regard to putting them in the order that you desire.
First things first, decompile framework-res if you haven't already:
Code:
apktool d framework-res.apk
Output:
Code:
[email protected]:~/Android/SGSII/Tweaks/StatusIconTut$ apktool d framework-res.apk I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
Then navigate to res/values in the newly created framework-res folder and open up "arrays.xml"
Now you'll want to scroll down until you find the following line
Code:
<string-array name="config_statusBarIcons">
All the lines that appear underneath that are the status bar icons (unsurprisingly) The section ends with
Code:
</string-array>
The order the appear in that list is the order (from left to right) that they appear in the status bar. So to reverse the order of the icons you need to go from this:
Code:
<item>ime</item>
<item>sync_failing</item>
<item>sync_active</item>
<item>gps</item>
<item>bluetooth</item>
<item>nfc</item>
<item>tty</item>
<item>speakerphone</item>
<item>mute</item>
<item>volume</item>
<item>headset</item>
<item>wifi</item>
<item>wimax</item>
<item>cdma_eri</item>
<item>data_connection</item>
<item>phone_evdo_signal</item>
<item>phone_signal</item>
<item>battery</item>
<item>alarm_clock</item>
<item>secure</item>
<item>clock</item>
To this:
Code:
<item>clock</item>
<item>secure</item>
<item>alarm_clock</item>
<item>battery</item>
<item>phone_signal</item>
<item>phone_evdo_signal</item>
<item>data_connection</item>
<item>cdma_eri</item>
<item>wimax</item>
<item>wifi</item>
<item>headset</item>
<item>volume</item>
<item>mute</item>
<item>speakerphone</item>
<item>tty</item>
<item>nfc</item>
<item>bluetooth</item>
<item>gps</item>
<item>sync_active</item>
<item>sync_failing</item>
<item>ime</item>
Pretty simple, eh? I'll leave you to choose the best order for those. Once you've done that you need to save your work, then recompile framework-res:
Code:
apktool b framework-res
Output:
Code:
[email protected]:~/Android/SGSII/Tweaks/StatusIconTut$ apktool b framework-res
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
Now, the usual trick to avoid signing the file again. Go back to the framework-res folder, navigate to build/apk. In there you'll see a file called "resources.arsc". Copy that into your original framework-res.apk (make a backup first!) then push it back using adb:
Notice that I have opened framework-res using my archiving tool, I've not extracted it
Code:
adb push framework-res.apk /system/framework/framework-res.apk
Reboot (and probably re-log into your Google account) and you're done. To avoid being singed out of all your accounts do all the pushing when your phone is in recovery.
Disable power menu blur
As we all know, Android has this nasty habit of putting a live blur behind the power menu, and rendering it with the CPU instead of the GPU. This leads to lags when opening that menu, as well as accessing the more advanced features put in by the CM team. So! To remove it we do the following:
Decompile framework-res.apk:
Code:
apktool d framework-res.apk
Output:
Code:
[email protected]:~/Android/Legend/StatusBarMod/CM-28-11-11$ apktool d framework-res.apk
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
Then navigate to res/values
Open up bools.xml and look (near the top) for this line:
Code:
<bool name="config_sf_slowBlur">false</bool>
You need to change the "false" to "true", like this:
Code:
<bool name="config_sf_slowBlur">true</bool>
Save and exit.
Go back to your command window, and recompile framework-res:
Code:
apktool b framework-res
Output:
Code:
[email protected]:~/Android/Legend/StatusBarMod/CM-28-11-11$ apktool b framework-resW: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
Now, to avoid signing issues we do the same trick as before, only this time it's the file "resources.arsc" we're copying across (build/apk/). Copy it across to the root of the original framework-res.apk:
Use adb to push it back:
Code:
adb push framework-res.apk /system/framework/framework-res.apk
then reboot
Code:
adb reboot
Done!
Requests
Any other popular theming mods? LEt me know, and I'll see if I can write a guide for it
Cool! Man I've been trying to make some understanding out of this mod for a while now. Thanks for the in-depth explanation of what all the changes do
this is really indepth mann,,thanks mucho now gotta go work this bad boy out.
Just shout if you need more help
Clicked "Thanks." Really appreciate the new write up man! Very nice job!
EDIT: I can't get my notifications to stop overlapping because whenever I try to add this line:
Code:
android:background="@drawable/statusbar_background"
I get an error when I compile. If I take that line out, it compiles fine. Any suggestions? Also, I've seen people have all the statusbar icons on the left except for battery. How do I get JUST my battery to the right hand side?
GrammarFreak-
Thank you so much for putting this guide together!! I have been reaching out to multiple people trying to get a few basic questions regarding theming answered. Though I can already do most of this with the rom I'm running, your guide answered several of my general questions that I can now apply to other mods I want to make.
Just to clarify though- system apps such as framework-res, mms, contacts, etc DO NOT need to be signed and therefore can me modified (replace pngs/edit xml's) without decompiling and then pushed or copied straight back into the rom, correct??? (When I say 'without decompiling', I know they have to be decompiled to make the edits. I'm talking about how you copied the modded xml back into the compiled apk overwriting the old...) I assume this works the same for png's and .9 png's.
Thanks again!! (Thanks button hit a few times!!)
VegasEvo4G said:
GrammarFreak-
Thank you so much for putting this guide together!! I have been reaching out to multiple people trying to get a few basic questions regarding theming answered. Though I can already do most of this with the rom I'm running, your guide answered several of my general questions that I can now apply to other mods I want to make.
Just to clarify though- system apps such as framework-res, mms, contacts, etc DO NOT need to be signed and therefore can me modified (replace pngs/edit xml's) without decompiling and then pushed or copied straight back into the rom, correct??? (When I say 'without decompiling', I know they have to be decompiled to make the edits. I'm talking about how you copied the modded xml back into the compiled apk overwriting the old...) I assume this works the same for png's and .9 png's.
Thanks again!! (Thanks button hit a few times!!)
Click to expand...
Click to collapse
As far as I'm aware, that should work. I can't test myself right now though.
Sent from my Legend using xda premium
Dude I'm not running CM but congratulations!
Really an amazing guide.
Hope n00bs won't flood this thread with *****y questions
Bravo!
Greetings
lippol94
lippol94 said:
Dude I'm not running CM but congratulations!
Really an amazing guide.
Hope n00bs won't flood this thread with *****y questions
Bravo!
Greetings
lippol94
Click to expand...
Click to collapse
Lol. The guide and techniques I go through should work for any 2.3 rom. In my limited testing it would appear that apktool doesn't work with ICS files. Confirmation would be appreciated.
Sent from my Legend using xda premium
TheGrammarFreak said:
Lol. The guide and techniques I go through should work for any 2.3 rom. In my limited testing it would appear that apktool doesn't work with ICS files. Confirmation would be appreciated.
Sent from my Legend using xda premium
Click to expand...
Click to collapse
I know but being on MIUI (if I wanted so) there's extended settings mod to do that with an easy UI
For what concerns ICS, I don't use it as it's too unstable atm
TheGrammarFreak said:
Lol. The guide and techniques I go through should work for any 2.3 rom. In my limited testing it would appear that apktool doesn't work with ICS files. Confirmation would be appreciated.
Sent from my Legend using xda premium
Click to expand...
Click to collapse
Apktool did not work on ICS for me. APKManager neither. And I just lost my statusbar
TheGrammarFreak said:
Lol. The guide and techniques I go through should work for any 2.3 rom.
Click to expand...
Click to collapse
I can't get my notifications to stop overlapping because whenever I try to add this line:
Code:
android:background="@drawable/statusbar_background"
I get an error when I compile. If I take that line out, it compiles fine. Any suggestions? Also, I've seen people have all the statusbar icons on the left except for battery. How do I get JUST my battery to the right hand side?
Thanks for the great (and very detailed) guide!
I would definitely like a guide on how to Disable the system blur (behind power menu)
spc_hicks09 said:
I can't get my notifications to stop overlapping because whenever I try to add this line:
Code:
android:background="@drawable/statusbar_background"
I get an error when I compile. If I take that line out, it compiles fine. Any suggestions? Also, I've seen people have all the statusbar icons on the left except for battery. How do I get JUST my battery to the right hand side?
Click to expand...
Click to collapse
I'd need to see the error and a copy of your XML to help there
Splitting the battery apart requires that you use CM. If you enable the battery percentage option in CMSetting the battery will go back over to the right hand side
creeve4 said:
Thanks for the great (and very detailed) guide!
I would definitely like a guide on how to Disable the system blur (behind power menu)
Click to expand...
Click to collapse
Cool, I'll have it done by next week ish. I'm currently 4 hours away from home visiting a friend
Epic write up mate.. cheers for your work on this and your execution and use of the English language is as eloquent as one has come to expect when noting you are the OP. Thank you.
Well done that man! B-)
Sent from my GT-P1000
nobleskill said:
Epic write up mate.. cheers for your work on this and your execution and use of the English language is as eloquent as one has come to expect when noting you are the OP. Thank you.
Well done that man! B-)
Sent from my GT-P1000
Click to expand...
Click to collapse
Ha ha, cheers man. I did have to edit the post about 15 times to get rid of some of the stupid mistakes though
This thread should help reduce the number of requests in the other thread
Sent by wiggling my big toe
TheGrammarFreak said:
Ha ha, cheers man. I did have to edit the post about 15 times to get rid of some of the stupid mistakes though
Click to expand...
Click to collapse
And its exactly that diligence and attention to detail that has fed the expectations of those familiar with your work. Heh yeah I know I can go on at times, perhaps even sometimes approaching the line where sincerity falls into satire, however my first post stands on the solid foundations of being more of fact than fancy so I also stand by it. This post also has my full and steadfast endorsement and support.
Lol. Ah miss these long winded off topic posts almost like I miss that skin cancer I had cut out of my shoulder just previous to my joining xda ... my work here is done for tonight. Fare thee well folks and adjure... until I next bore you silly with my mastery of twisting grammar and really old words into these fantastic distractions and artworks.. haha sleep now..
Later.
Sent from my GT-I9100

[MOD][HELP] Modding framework-res on CM 10.0 - removing emergency call & carrier info

[MOD][HELP] Modding framework-res on CM 10.0 - removing emergency call & carrier info
Hello everyone,
As per title, I'm trying to edit the xml in framework-res apk. Why? Because I'm turning my old Cappy into a music player, so I'm removing lots of stuff using Titanium Backup. I removed all phone-related functionality, therefore I don't need emergency call buttons, carrier info, and things like those .
I used apktool to unpack the framework.
Then I edited the relevant files(
Code:
res\layout\keyguard_screen_password_portrait
), setting 0.0dip in width and height to the buttons and the textview.
Then I recompiled, and installed the new framework from recovery with a custom zip file.
NB. I edited the password lockscreen because I need to use it for an app!
Installation and reboot work fine, but.. that damn button and carrier info won't go away.
There must be something wrong in what I do, ie maybe I'm editing the wrong xml, or something like that.
I've put the original and modded framework as attachments, so if anyone is willing to give a look into them and maybe help, there they are
lovefallen said:
Hello everyone,
As per title, I'm trying to edit the xml in framework-res apk. Why? Because I'm turning my old Cappy into a music player, so I'm removing lots of stuff using Titanium Backup. I removed all phone-related functionality, therefore I don't need emergency call buttons, carrier info, and things like those .
I used apktool to unpack the framework.
Then I edited the relevant files(
Code:
res\layout\keyguard_screen_password_portrait
), setting 0.0dip in width and height to the buttons and the textview.
Then I recompiled, and installed the new framework from recovery with a custom zip file.
NB. I edited the password lockscreen because I need to use it for an app!
Installation and reboot work fine, but.. that damn button and carrier info won't go away.
There must be something wrong in what I do, ie maybe I'm editing the wrong xml, or something like that.
I've put the original and modded framework as attachments, so if anyone is willing to give a look into them and maybe help, there they are
Click to expand...
Click to collapse
I know that this is like 1 year after the original post. I finally went into that file with the name you mentioned.... in my ice cream sandwich framework-res.apk .... then put in these lines... (the replacement)...
android:id="@id/emergencyCallButton" androidaddingRight="16.0dip" android:visibility="gone" android:layout_width="0.0dip" android:layout_height="0.0dip"
Then recompiled the apk. And then I injected (using 7zip) the compiled ''keyguard_screen_password_portrait.xml" file from the newly compiled apk into the original apk. All I needed to then do was to use Root Explorer app to pop the 'mostly-original' framework-res.apk back into /system/framework
Then just restart the phone, or just put the phone into sleep mode or blank-screen mode for a bit, then allow it to come back on....then the emergency button was gone. I now know that the correct file to edit is 'keyguard_screen_password_portrait.xml', which is the one you mentioned. Somebody on the net was mentioning 'keyguard_screen_unlock_portrait.xml', but focusing on 'keyguard_screen_unlock_portrait.xml' is a total waste of time for ICS. The file to edit for ICS is 'keyguard_screen_password_portrait.xml'.
kennyTSV said:
I know that this is like 1 year after the original post
Click to expand...
Click to collapse
Who cares, still relevant!! I'm going to try and do the same as you did, hope it will work Thanks a ton!!

[Advice/Reference/Guide] The Definitive APK Modding & Theming Thread... {06/07/13}

[Advice/Reference/Guide] The Definitive APK Modding & Theming Thread... {06/07/13}
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
XperienceD said:
This is why I love Virtuous Ten, as you can install multiple resources.
Click to expand...
Click to collapse
jacknb1ack said:
wow, i didnt know there is tools like that
Click to expand...
Click to collapse
After reading jacknb1ack's comment I felt compelled to re-write this whole thread to accommodate for the various PC Programs that you use to do all of your apk modding which can and do make things a hell of a lot quicker. I've wrote this as something I would have liked to have come across when I first joined because I know there is a lot to take in, and hearing you need to decompile, edit this or that xml, recompile, sign etc etc etc can be off putting for some especially if you struggle to get a program or apktool setup to begin with.
Knowing how to use command prompts will be beneficial in the long run so I've wrote a detailed guide below which covers it from start to finish along with how to Sign and Zipalign your apks, pulling them from the computer and so on. I've also covered some Theming basics with links to everything you're ever going to need, which will be extra handy if you're just getting started.
Minimum Requirements:
A Rooted Phone.
Java SE Runtime Environment
Java SE Development Kit
Any of the apk modifying methods below.
7-Zip or WinRar
Theming Requirements:
Notepad++
Photoshop, GIMP or any other image editing software.
Patience. :silly:
To avoid any java not found issues you need to set up the PATH for it in Environment Variables, you can find a short Guide on how to HERE. This is how mine looks...
Code:
[B]C:\Program Files (x86)\Java\jre6\bin;[/B]
I would advise that you also install the Android SDK but if you don't want to you can download this APK_Mod.zip that you can extract to a folder and place it anywhere you want on your Computer (I recommend C:\APK_Mod) and run any adb, apktool, zipalign or signing command prompts from it. You can find a more detailed guide for this method below.
But first off all here are some of the most common Programs that you can use to modify and theme your apks, and I'll start with one of the best...
Virtuous Ten Studio (VTS)
Virtuous Ten Studio (VTS) is the ultimate solution for the modification of android applications.
This program allows you to manage entire Android projects within an easy to use and familiar environment.
The intended group of users covers anyone from a themer over ROM devs up to the smali gods known for their awesome mods of existing apks.
The modifcation of smali code is one of the biggest features in VTS. You can easily decompile, edit and recompile any apk or jar file.
However, the application is not limited to smali files. You can edit almost any file found inside an apk or jar.
Virtuous Ten Studio is also the official successor to the highly important M10Tools released last year by the Virtuous Team.
You can easily edit any m10 file from Sense apps in order to resize or change them.
Additionally VTS brings support for un- and repacking of boot images (boot.img), a job that previously required a cygwin installation with the dsixda kitchen.
Since VTS' own implementation is a native windows solution, which means you don't need dsixda or cygwin anymore.
VTS has been designed to run on Windows, has been in development for nearly two years and has gone through many stages of testing.
Today VTS is a highly respected full blown Android IDE (Integrated Develoment Environment) suited for all your reverse engineering tasks.
Click to expand...
Click to collapse
- www.virtuous-ten-studio.com
AndroidSuite 2013
AndroidSuite 2013 what it does
Decodes and encodes Dex files
Decodes and encodes APK files (Previously bugged in APKManager)
Gives a console output
Flash boot.img (fastboot)
Flash update.zip (fastboot)
reboot/reboot fastboot mode
Sign unsigned apks
Click to expand...
Click to collapse
- (App) Androidsuite 2013 v117 (01/04/2013) Jelly Bean Support!
Tickle My Android 5.4
Tickle My Android, or TMA for short, is a command line tool for Windows that uses apktool to help you pull and decompile files from your Android phone or tablet.
But it can also:
change the battery icon,
change the WiFi icon,
change the signal icon,
change the emoticons,
change the notification toggles,
change the transparency of the statusbar (if the rom allows it),
add Ice-Cream Sandwich-style transitions
zipalign apk files,
sign new apk files,
sign recompiled apk files in the same way as the original,
deodex apk and jar files,
backup personal data and transfer to a brand new device,
resize and change boot animations,
change fonts,
add sounds from other devices,
create backup-generating flashable zip files
..and now comes in Portuguese and French!!
Click to expand...
Click to collapse
- [TOOL]Tickle My Android 5.4 - DE/RECOMPILE APPS, CHANGE ICONS...AND MORE!!!!
ApkManager V6.1
1. Based on ApkManager 4.9 by Daneshm90 (Big thanks to him)
2. Updated Apktool V1.5.2 by iBotPeaches & Brut.Alll
3. Updated Aapt v0.2
4. Default compression level set to “0?
5. 512Mo as default allowed heap size
6. 3 ready for use fake frameworks : “other\wanam1.apk”… (for Lidroid framework editing)
7. Add a “Decompile all files” feature (option 25)
Click to expand...
Click to collapse
- wanamlite.com
Command Prompt Editing​
Basically this is just manually doing what all of the programs above need to do in order to decompile, recompile, sign and zipalign apks so it's worth knowing how to modify apks this way for occasions when the above programs for whatever reason gives you issues.
Use Linux or a Mac?
See the following threads for more information on using apktool on other Operating Systems...
APK Manager for Mac OS X
[Linux][UTILITY][TOOL] APK Multi-Tool
[tutorial] decompiling,recompiling and signing in linux (27-01-2013)
How to install and use Apktool with Ubuntu
Getting APKs To Your PC​
You have two options here...
1. Use a file manager on your Phone to copy and paste files to your SD, then connect to your PC and use Windows Explorer to copy and paste to your desired location.
2. ADB. Open a command prompt window in the ADB folder (see below) and type/copy the following command...
Code:
adb pull /system/app/ Original_apps
...which will pull the whole app folder to your computer and create a new folder called Original_apps, which you can then simply copy apps to the main folder ready to be modified (keep the Original_apps folder as a backup). Then do the same for your framework folder...
Code:
adb pull /system/framework/ Original_framework
...want to pull your Phones whole system...
Code:
adb pull /system/ Xperia_Z_System
...you can rename "Xperia_Z_System" to whatever you want.
Further Information: [WINDOWS][TUT]ADB tutorial, setting up ADB, usefull commands, collecting debug info.
This is a zip of the apktool folder I currently use - APK_Mod.zip - which as said above also contains the ADB files needed to pull and push apps from your Phone, or you can check out the following links...
[Tool] ADB Fileexplorer
[TOOL][WINDOWS] Android Apktool
Installing Resources​
For apktool to work you need to install the resources needed by your apks for de and recompiling, and those resources are other apks, the first apk regardless of your Phones manufacturer is going to be your framework-res.apk. The second apk you need is dependent on the manufacturer so you need to check your framework folder for another apk such as twframework.apk or SemcGenericUXpres.apk, in some cases it might even be the SystemUI.apk but you would need to check if you have issues with the other two. Put those two apks in the APK_Mod folder to begin with then open a command prompt window. The easiest way for me is holding the shift key then right clicking the mouse and selecting Open command window here, but if you're not able to do that then click your Start button and search for Command Prompt, then open it. You then need to point it to the relevant folder, so type cd then copy and paste the location of the folder (cd C:\APK_Mod) and hit enter.
The install commands are...
Code:
[B]apktool if[/B] framework-res.apk
...and for the second...
Code:
[B]apktool if[/B] SemcGenericUXpres.apk
Decompiling​
The command for decompiling is...
Code:
[B]apktool d[/B] framework-res.apk
...and so on for each individual apk you want to modify. A new folder will be created that is named after the apk you are modding, then you can edit xmls, smali files and .9png images. You'll notice that there are a lot more folders when you decompile an apk, that's normal as those folders are from the resources.arsc and where you'll find the xml files you may need to edit to make the changes you want.
Recompiling​
When you've done editing it's time to recompile, using the command...
Code:
[B]apktool b[/B] -insert folder name-
...and if you've edited your files correctly then it should compile with no errors and create a folder named dist in the decompiled folder along with a new apk.
Signing​
Before using the new apk you will need to sign it, to do this you need to extract (open the apk and simply drag and drop them to the dist folder) from the original apk the resources.arsc (only if you haven't changed anything in the values folder, the AndroidManifest.xml and META-INF folder (if it exists), then copy them into the new apk. In WinRar it will give you the option to choose the compression method, and it's vital that you choose Store as the compression method because if you don't then you WILL BOOT LOOP after restarting your Phone!
NOTE: If you have edited anything in the values folder then extract the resources.arsc from the new apk and copy (drag and drop) it back in the same manner described above.
Alternatively you can use the following command...
Code:
[B]java -jar signapk.jar testkey.x509.pem testkey.pk8[/B] framework-res.apk.apk framework-resS.apk
...notice the extra "S", the output name has to differ from the input name otherwise it will give an error, if done right it will create a new apk called framework-resS.apk, just remember to rename it back to the original before using it on your Phone.
Zipaligning​
DISADVANTAGES OF UNALIGNED APKs
Quite understandably, situation would be reserved for unaligned application packages. Resource reading would be slow and memory usage would be on the higher end of the spectrum. It would also depend on how many unaligned applications are present. For example, if less number of applications with an unaligned home application, you’d see slower application launch times. This is the best case scenario. For a worst case scenario, having a number of unaligned applications will result in the system repeatedly starting and killing processes, struggling with lags and huge battery drain.
Click to expand...
Click to collapse
- SOURCE
The command for zipaligning is...
Code:
[B]zipalign -v 4[/B] framework-res.apk ZAframework-res.apk
...notice the "ZA", again that can be anything you want so long as it differs from the original name, I use ZA for an obvious reason, and again don't forget to rename it before using on your Phone.
Getting apks back to your Phone​
It's just a reversal of how you got them off your Phone to begin with, use a file explorer and put your apk on your SD Card, then move it to the Phones System folder and change it's permissions to rw-rw-r, then move and replace it with the original. Most apps should continue to work but if you change your framework-res or SystemUI you will most likely need to reboot. Or you can use adb to push and install them. Check the previous link for the commands.
If all the above has worked correctly you should now have your modified apk installed with the changes you've made displayed on your Phone.
Theming & Modifying​
This is where the fun begins, once you've got setup to decompile your apks then obviously you're going to want to mod them, so here's a few pointers to clear up what seems like a daunting process to new comers...
To start with you'll probably just want to start with replacing images, so if that's all you want to do for now then here's a quick tip, you DON'T need to decompile or sign your apks!, simply edit and rename your replacment images on you computer, preferably using the same or similar dimensions then drag and drop them back into the right folders in the apk, always using Store as the compression method, but PLEASE NOTE; .9 pngs can be replaced in the same way, but if you want to edit them in Photoshop for example then you need DO need to decompile them.
A few things to note...
Smali code is real Developer territory, it's Matrix code to me , thankfully there's usually a guide to follow so you can simply copy and paste code without having to fully understand how it works, so don't fret about this.
.9pngs are simply png images with a 1 pixel border. You can edit anything within that border but anything on or over will give errors when building. Unless you're creating an image from scratch then you can leave the border as it is, it's that simple! Sure there's a bit more to .9png editing but you can find a few links below that go into more detail about .9s and how they work.
xmls are relatively simple and edited with Notepad++, much simpler to understand than smali and again, there's usually a guide to be found for most mods you may want to make yourself, but if you're feeling brave you can experiment with it when you have a basic understanding of how it works.
Restoring modified files if you mess up is easier and quicker with a CWM.zip, especially if you're modifying any framework apks! Just because an apk might build with no errors doesn't mean it won't give you any when installed to the Phone.
.9png Editing​
I hope after reading this explanation you're left wondering what all the fuss is about, as it really is quite simple. I'll use the following two images, btn_default_pressed_holo.9 & status_bar_close_off.9 to illustrate the basic point of the borders...
Decompiled .9pngs:
Recompiled .9pngs:
Those borders control which part of the image is stretched, and we'll use Draw 9-patch which is for editing the borders of decompiled .9pngs and lets you see how the image, when stretched, will be displayed on the Phone. Notice that the borders are different sizes, well that's because I only want/need a certain part of the image to stretch to get the desired look on the Phone.
...in the image below the left side shows the stretched image and desired effect should look on the Phone and the right side shows how it would look if I had edited the borders incorrectly or used none at all...
You can get away by not using a border but you would need to edit your image to specific dimensions to accommodate for the stretching, for example it might look fine for a simple OK button but it might not look right if you used the same .9png for a screen press which stretches the whole length of the screen, so you're better off just using them to begin with, plus you'll more than likely get errors down the line while decompiling or recompiling your apk.
The use of the border is made even more clear when you add text to an image. For my status_bar_close_off.9 I've filled all four sides of the image (except for an empty pixel in all four corners as that is the max amount of border you can use) as I need it to stretch the image just how I've edited it...
...but if I used the same sized left side border as the btn_default_pressed_holo.9 then this is how it would look on the Phone...
...which is obviously not the look I'm trying to achieve, as the left side border is causing the image to stretch incorrectly.
So that's basically it, depending on the image you're editing you can usually leave the borders alone but if you create one from scratch then you might need to play about with them if your images doesn't look quite right when used on the Phone. Here's a few links that will assist you further, especially the batch editing...
How to edit .9.pngs
[TUTO] Create your 9.png !
[UTILITY][TOOL] 9patchPngSuite [Windows&Linux]
How to draw NinePatch images with Photoshop - .9.PNG
[TOOL][Multi-Platform][.9.png][ALL DPIs] Android Resizer Tool
[Tutorial][Commentary] How To Batch Edit .9PNG/PNG Images
Xposed Framework​
rovo89 said:
In this thread, I'm presenting a framework which gives you the possibility to modify your ROM - without modifying any APK (developers) or flashing (users)!
...
Advantages:
No need to modify any APKs. This means:
No need to decompile, change things in smali, compile, sign, ...
It will work for odexed and deodexed ROMs.
Your mod is not bound to a specific version of the ROM. Unless there is a major change in the methods called for a certain functionality, your mod will continue to work even when you upgrade your ROM. Hell, it will probably even work with different ROMs.
Multiple mods can be installed at the same time, even if they change the same package. So you can use these battery icons and those quick toggles. Even hooking the same method twice is possible. Of course, this only works properly if the mods are not trying to do incompatible things.
It does its magic at runtime. That means you can implement options to let the user decide if they prefer the bikeshed to be painted in red or blue. Or you can have some extra logic for certain ROMs without building different mod versions.
It can be disabled easily without having to reflash.
It's open source.
Click to expand...
Click to collapse
- [FRAMEWORK ONLY!] Xposed - ROM modding without modifying APKs
[Guide] Porting XTheme themes
[Guide] Xposed Framework/TabletUI (Noob-Friendly)
[INDEX][WiP] List of APPs & MODs that use XPOSED Module
[MOD][XPOSED][4.0+] XThemeEngine beta5 - Theme engine for any rooted phone
And that's pretty much it, the only way you're really going to learn is by reading then putting into practice what you've read and picking stuff up along the way, fortunately this far into the history of Android there are numerous guides for numerous mods and tools to help with a variety of tasks and the following links are going to be a big help...
U.I Modding
Text Color Guide
Tutorial :- Changing App Icons
[TUTORIAL]How to Theme Your MMS
[How-to] Edit the "About Phone" display
[GUIDE][REF]Changing System Text Settings
[TUTORIAL] How to add various framework/Settings mods
[TUTORIAL] Where to find the colors for making a theme
Some Extra Theming and Moving the Power Widget Down
[HOWTO] Integrating/Adding applications to the settings menu
[TUT][JB] HOW TO THEME SystemUI.apk for TOTALLY newbie!
[GUIDE][MOD][SYSTEMUI] How to add 0.0K/s meter on statusbar ICS/JB
[GUIDE] How to get Transparent App Drawer [Launcher2.apk or Trebuchet.apk]
[TUT] How To Center The Clock On The Statusbar..And Move Other Icons As Well!
[How-To]Removing Battery Percentage, Adding Toggles,Battery Circles to Statusbar
[GUIDE][Mods][All Devices]How to add/ Change Clocks to Analog/ Digital with Seconds
Various Tools...
[TOOL][BETA]Miui Theme Converter/Convert apk Themes!!!
[TOOL][JAVA]"The Rom Fumbler" aka "The Battery Icon Creator"[V29.0]
[TOOL]Boot Animation Factory-Create,Preview and Manage Boot Animations
Useful Links
findicons.com
colorschemer.com
[GUIDE] Tips for themers
Ultimate Online Theme Kitchen
[GUIDE] Want to learn how to theme?
General Questions about Themes GO HERE!!!!!
[Guide] How to port themes to T-Mobile Theme Chooser
[Collection] ICON SETS | Over *750* different Icon Packs
[DEV/GUIDE]Creating APKs for use with TMobile Theme engine
[GUIDE] T-mobile theme engine for the faint at heart (non-linux users)
[TEMPLATE] Icon Packs/Themes for Apex, Nova, Holo, ADW, and more!!
[INFO] Custom framework-res.apk resources.arsc using vendor overlays
If you feel something more should be added to this thread please feel free to suggest it.
Credits & Thanks:
@_calum_
@Diamondback
@ebs512
@Rizal Lovins
@Ticklefish
@wanam
@rovo89
And not forgetting @iBotPeaches and @Brut.all for making it possible with - [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files
ClockworkMod Recovery...
Flashable Clockwork Mod (CWM) zip​
ClockworkMod Recovery zips are used for flashing individual files to whole ROMS and can be a life saver if you push a badly edited apk to your Phone that results in a bootloop. There's also a few programs that can assist you with that too, but if all you're doing is replacing a few files all you really need is a template, then it's just a matter of creating the Phones folder setup in the zip which is simply creating folders: system\app - system\media\audio etc then dragging and dropping your files into it. A basic understanding of the updater script is essential, a ROM.zip will more than likely wipe your Phone whereas a Theme.zip may just replace files but it might delete some also.
See below for a CWM.zip Template but first some helpful links...
[Tool]easy flasher v4 (ur own update.zip)
[TUT] [for NOOB] editing updater-script for noobs!
[TUTORIAL] Making Flashable ZIPs, EDIFY Script, ZIP Signing & Key Creation
[Utility-Tool][DEVandThemers]CWMflashpack.zipCreatorV1{TheCollective}w/EdifyScripting
This is my Theme_CMW_Template.zip which is set up so you can add your own files to the framework and apps folders in the main system location, but you can easily add other folders to it if you want to add things like fonts, tones or anything else, just remember to add folders within folders if that's where the files you want to include are such as tones, media\audio\alarms for example.
If you navigate to META-INF\com\google\android you will find the updater-script which controls how the zip works and the text you see when you run it in CWM. As this zip is just for basically over writing files you don't need to edit anything except for a few lines...
...this is how I've edited it for my Ice Green ResMods theme...
...so just edit it using Notepad++ to your liking.
When adding files to your zip add them using Normal as the Compression Method...
...and that's pretty much it. Remember to remove the text files I've added otherwise they will be flashed to your folders too.
[How To] AOSP Lockscreen...
[MOD][4.2.2][Z] AOSP Lockscreen
1. Decompile your framework-res.apk.
2. Go to your layout folder and open keyguard_screen_tab_unlock.xml then find and change the following lines...
Code:
<com.android.internal.widget.DigitalClock android:layout_gravity="right" android:id="@id/time" android:layout_marginTop="@dimen/keyguard_lockscreen_status_line_clockfont_top_margin" android:layout_marginRight="@dimen/keyguard_lockscreen_status_line_font_right_margin" android:layout_marginBottom="12.0dip">
...to...
Code:
<com.android.internal.widget.DigitalClock android:id="@id/time" android:layout_gravity="center_horizontal" android:layout_marginTop="100.dip" android:layout_marginBottom="3.0dip">
...then change this...
Code:
<LinearLayout android:layout_gravity="right" android:orientation="horizontal" android:layout_marginRight="@dimen/keyguard_lockscreen_status_line_font_right_margin">
...to this...
Code:
<LinearLayout android:layout_gravity="center_horizontal" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="6.0dip">
...also change this...
Code:
<Button android:layout_gravity="right" android:id="@id/emergencyCallButton" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="4.0dip" android:layout_marginRight="16.0dip" android:text="@string/lockscreen_emergency_call" android:drawableLeft="@drawable/lockscreen_emergency_button" android:drawablePadding="4.0dip" style="?android:attr/buttonBarButtonStyle" />
...to this...
Code:
<Button android:layout_gravity="center_horizontal" android:id="@id/emergencyCallButton" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="4.0dip" android:text="@string/lockscreen_emergency_call" android:drawableLeft="@drawable/lockscreen_emergency_button" android:drawablePadding="4.0dip" style="?android:attr/buttonBarButtonStyle" />
...then change this...
Code:
<LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:weightSum="2.0" style="?android:attr/buttonBarStyle">
...to this...
Code:
<LinearLayout android:gravity="center" android:visibility="gone" android:orientation="horizontal" android:layout_width="fill_parent" android:weightSum="2.0" style="?android:attr/buttonBarStyle">
3. Recompile and sign your framework-res.apk
4. Go to system/app and either delete, rename or remove all permissions for UxpNxtLockScreen.apk.
5. Replace your framework-res.apk on your Phone with the new one, reboot, done....
To also remove the operator logo as I have change this line...
Code:
<TextView android:textAppearance="?textAppearanceMedium" android:textSize="@dimen/keyguard_lockscreen_status_line_font_size" android:textColor="?textColorSecondary" android:ellipsize="marquee" android:gravity="center_horizontal" android:id="@id/carrier" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="12.0dip" android:singleLine="true" android:layout_alignParentBottom="true" />
...to...
Code:
<TextView android:textAppearance="?textAppearanceMedium" [B][COLOR="Red"]android:visibility="gone"[/COLOR][/B] android:textSize="@dimen/keyguard_lockscreen_status_line_font_size" android:textColor="?textColorSecondary" android:ellipsize="marquee" android:gravity="center_horizontal" android:id="@id/carrier" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="12.0dip" android:singleLine="true" android:layout_alignParentBottom="true" />
Deodexing...
philos64 said:
The differences between Odex and Deodex Files...
In Android file system, applications come in packages with the extension .apk. These application packages, or APKs contain certain .odex files whose supposed function is to save space The odexed file structure works well as an optimization tool. Since these .odex files contain preliminary load information about each system app, the OS knows what to expect when it’s booting up, and consequently, loads all these apps faster.
On the other hand, it also makes hacking those applications difficult because a part of the coding has already been extracted to another location before execution.
For instance, on a non-rooted device you’ll find
system/app/Phone.apk ===> as well as ===> system/app/Phone.odex
Click to expand...
Click to collapse
- [GUIDE] - The differences between Odex and Deodex Files
[TOOL][WINDOWS]Universal Deodexer[ALL DEVICES!!]​
abcdjdj said:
Hi everyone,
Alokbina and I have created a tool which allows users to very easily deodex apks from a rom. This tool is very useful for Rom developers too. For now only windows is supported but we will try our best to make the same tool for linux too and make the tool as user friendly as possible. And, please don't forget to thank alokbina too.
Requirements:-
--->Java installed on your PC
--->system/framework folder from your rom
--->apks from that SAME ROM with the respective .odex file
--->Patience and a calm head (common sense included)
You can watch this video for setting up and using the tool -
- [FIXED][UPDATE - V3][TOOL][WINDOWS]Universal Deodexer[ALL DEVICES!!]
Click to expand...
Click to collapse
[GUIDE] How to DEODEX stock ODEXED ROM using dsixda's kitchen
Random Stuff...
edangel said:
Solution For 70 limit stock SMS Characters...
Well...for people who can't sent 160 sms characters on stock sms messaging app and they are limited to sent 70 characters here is the solution...
Simple...root needed!
with root explorer etc...
go to: /data/data/com.sonyericsson.conversations/shared_prefs
and open the file com.sonyericsson.conversations_preferences.xml.
find the line which says "semc_pref_key_character_conversion"value=false
and set it true..!
save the file and reboot your phone...and happy texting!
if i helped press thanks button!
:laugh:
Click to expand...
Click to collapse
XperienceD said:
cickii said:
can someone please tell me which xml is responsible for the blue / gray colors in the picture below.
Click to expand...
Click to collapse
Finally sussed it. It's LinearColorBar.smali found at Settings\smali\com\android\settings\applications, search for 0x99cc and -0xff6634 and change them for your own colours...
Click to expand...
Click to collapse
XperienceD said:
Hi all.
Just a short write up as a follow on from THIS thread as this is relatively quite simple.
So you want to change your notification background from the plain dark color to something a bit more your style...
...well all you need to do is decompile your SystemUI.apk and navigate to the values folder and open up your drawables.xml and you should see something like this...
Code:
<resources>
<item type="drawable" name="notification_number_text_color">#ffffffff</item>
<item type="drawable" name="notification_item_background_color">#ff111111</item>
<item type="drawable" name="notification_item_background_color_pressed">#ff257390</item>
<item type="drawable" name="ticker_background_color">#ff1d1d1d</item>
<item type="drawable" name="status_bar_background">#ff000000</item>
<item type="drawable" name="status_bar_recents_background_solid">#e5000000</item>
<item type="drawable" name="status_bar_recents_app_thumbnail_background">#88000000</item>
<item type="drawable" name="status_bar_notification_row_background_color">#ff090909</item>
<item type="drawable" name="notification_header_bg">#ff000000</item>
<item type="drawable" name="notification_tracking_bg">#e5000000</item>
<item type="drawable" name="recents_callout_line">#99ffffff</item>
<item type="drawable" name="notification_item_background_legacy_color">#ffaaaaaa</item>
</resources>
Simply change these two lines...
Code:
[B]<item type="drawable" name="notification_item_background_color">#ff111111</item>
<item type="drawable" name="notification_item_background_color_pressed">#ff257390</item>[/B]
to...
Code:
[B]<item type="drawable" name="notification_item_background_color">[COLOR="Red"]@drawable/status_bar_item_background_normal[/COLOR]</item>
<item type="drawable" name="notification_item_background_color_pressed">[COLOR="Red"]@drawable/status_bar_item_background_pressed[/COLOR]</item>[/B]
...then add two .9 png images of the same name, status_bar_item_background_normal and status_bar_item_background_pressed to your drawable-hdpi folder, recompile, zipalign, push to your Phone, done.
Quick Tip: If you can't create a .9 from scratch just edit the first two in drawable_hdpi which in my folder is alert_bar_background_normal.9 and alert_bar_background_pressed.9, just remember not edit over the .9 borders.
Click to expand...
Click to collapse
Hell man no posts from anyone??
Excellent excellent thread man.
dhirend_6d said:
Hell man no posts from anyone??
Click to expand...
Click to collapse
With 1500+ views hopefully it's because it's written that well People don't need to ask anything. :silly:
dhirend_6d said:
Excellent excellent thread man.
Click to expand...
Click to collapse
Thanks.
Thanks for this!
Sent from my SGH-I747 using xda premium
Can you make a tutorial
1. How to port magnify glass to ics devices/mdpi
2.how to port small app to ics devices/mdpi
3. How to add internet speedo meter In pull down menu not in status bar for ics
A million thanks if you make it ......
Sent from my ST21i2 using xda app-developers app

[Tutorial][Updated]3 Minit Battery for Oreo 8.0/PIE 9.0[Note FE/DS][12 May 2018]

Updated for PIE, 9.0
First of all, thanks to @dr.ketan for getting this to work for the Note 8 (Oreo). After seeing how he implemented the 3 Minit Battery in his ROM, I have implemented, for the Note FE/DS, what he did for the Note 8.
WARNING:
YOU DO THIS MODIFICATION AT YOUR OWN RISK. I NOR XDA-DEVELOPERS WILL NOT BE RESPONSIBLE FOR ANYTHING THAT HAPPENS AS A RESULT OF USING THESE MODIFICATIONS IN YOUR ROM. IF YOU HAVE NEVER MODIFIED AN APK FILE, I RECOMMEND LEARNING HOW TO DO IT BEFORE TRYING THIS MOD.
If you do not know how to decompile an apk, make changes to xml files and recompile an apk, I highly recommend you learn how-to-do-it before attempting this mod. Please refer to other threads on xda-developers regarding how to decompile/recompile apks.
The attached 3minit.zip file contains the following:
- apktool folder: in case you do not have the updated apktools
- sysinstall folder: where you put your modded SystemUI.apk and create an installable .zip file; also includes 3MinitBatterySettings.apk and MinitBatteryResources.apk
- res folder: drawable-xxxhdpi (fixed pip_dismiss_scrim.9.png file); layout folder (system_icons.xml - modded for 3minit battery) and status_bar.xml (if you want your clock centered)
- smali_classes2 folder: new folder (android) added to com folder - add complete android folder.
I HIGHLY recommend you make your own changes to the system_icons.xml file (and, if using the center clock mod, make changes to your status_bar.xml file)....Please do not just copy these 2 files into your ROM...they may be the same, but they may also be different...just make the changes to your files.
Steps to implement 3MinitBattery icons:
For OREO:
1 - MAKE A ROM BACKUP - Just in case - VERY IMPORTANT!
2 - Copy your deodexed SystemUI.apk to your work folder (with the apktool and baksmal.jar, smali.jar files)
3 - Decompile your SystemUI.apk (if you do not know how to do this, STOP - you should not be making this change)
4 - Copy pip_dismiss_scrim.9.png into res\drawable-xxxhdpi folder
5 - Copy the android folder into smali_classes2\com folder
6 - Edit the res\layout\system_icons.xml files - make the changes based on the file I provided - mods are near end of file - IMPORTANT: make sure you mod <LinearLayout info to android:layout_width="0.0dip" android:layout_height="0.0dip" - if you do not set to 0.0dip, both the stock and 3Minit batteries will be displayed.
7. When finished with mods, recompile SystemUI - do not forget to copy META_INF folder from original SystemUI.apk and the AndroidManifest.xml from the original SystemUI.apk into your new SystemUI.apk, otherwise your phone may bootloop or get stuck with a blank screen.
8. Put your modded SystemUI.apk in the system/SystemUI folder of the sysintall.zip file
9. Copy sysinstall.zip to your phone
10. Reboot into TWRP and install sysinstall.zip
11. You can use 3MinitbatterySettings to choose the battery style and other misc. properties.
For PIE:
1 - MAKE A ROM BACKUP - Just in case - VERY IMPORTANT!
2 - Copy your deodexed SystemUI.apk to your work folder (with the apktool) - use apktool 2.4.0 (attached)
3 - Decompile your SystemUI.apk (if you do not know how to do this, STOP - you should not be making this change)
4 - Copy pip_dismiss_scrim.9.png into res\drawable-xxxhdpi folder
5 - Copy the android folder into smali_classes2\com folder
6 - Edit the res\layout\system_icons.xml files - make the changes based on the file I provided - mods are near end of file - IMPORTANT: make sure you mod <LinearLayout info to android:layout_width="0.0dip" android:layout_height="0.0dip" - if you do not set to 0.0dip, both the stock and 3Minit batteries will be displayed.
7. When finished with mods, recompile SystemUI - do not forget to copy META_INF folder from original SystemUI.apk and the AndroidManifest.xml from the original SystemUI.apk into your new SystemUI.apk, otherwise your phone may bootloop or get stuck with a blank screen.
8. Put your modded SystemUI.apk in the system/SystemUI folder of the sysintall.zip file
8a. I have included my SystemUI.apk file - it is for XXU4CSC5 ROM - it includes double-tap to lock and removes entering password on reboot (just use fingerprint, if enabled)
9. Copy sysinstall.zip to your phone
10. Reboot into TWRP and install sysinstall.zip
11. You can use 3MinitbatterySettings to choose the battery style and other misc. properties.
3Minit.zip Link:
For OREO:
Google Drive: 3Minit.zip
Mega: 3Minit.zip
For PIE:
Google Drive: 3Minit.zip-PIE
Mega: 3Minit.zip-PIE
Reserved
Thank you for taking time to write up the guide!
Just one request - Since deodexed Oreo Roms are still not up yet, Much appreciated if you can share an updated guide to learn how to deodex a single APK in a rom as well.
Cheers!
JazonX said:
Thank you for taking time to write up the guide!
Just one request - Since deodexed Oreo Roms are still not up yet, Much appreciated if you can share an updated guide to learn how to deodex a single APK in a rom as well.
Cheers!
Click to expand...
Click to collapse
All you need is a deodexed SystemUI.apk and framework-res.apk.
I use Fulmics Deodexer: Fulmics Deodexer on XDA
I use dsixda's kitchen which I modified (with his permission, of course) to unpack the system.img folder.
Then I use Fulmic's Deodexer on the system folder.
From there, you can get the deodexed framework-res.apk and the SystemUI.apk.
The boot.img and the system.img are in .lz4 compressed format. You need to uncompress them using an lz4 uncompressor...see attached file... (lz4 -d file.img.lz4)
I tried on my S9+ Exynos but no luck, I lost status bar and navigation bar too!
Thanks
I am confused between tow lines.
1. <com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="fill_parent">
2.<LinearLayout android:gravity="start|center" androidrientation="horizontal" android:id="@id/system_icons_battery_container" android:layout_width="fill_parent" android:layout_height="fill_parent" />
Which one do I need to edit?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_vertical" android:id="@id/system_icons" android:layout_width="wrap_content" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.systemui.statusbar.policy.NetspeedView android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:layout_gravity="center" android:id="@id/networkSpeed" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:importantForAccessibility="no" android:layout_marginEnd="@dimen/battery_level_padding_start" />
<com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="center_vertical" androidrientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<include android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/signal_cluster_margin_start" layout="@layout/signal_cluster_view" />
<com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="fill_parent">
<LinearLayout android:gravity="start|center" androidrientation="horizontal" android:id="@id/system_icons_battery_container" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</com.android.systemui.BatteryMeterView>
</LinearLayout>
Click to expand...
Click to collapse
zoya4u said:
I am confused between tow lines.
1. <com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="fill_parent">
2.<LinearLayout android:gravity="start|center" androidrientation="horizontal" android:id="@id/system_icons_battery_container" android:layout_width="fill_parent" android:layout_height="fill_parent" />
Which one do I need to edit?
Click to expand...
Click to collapse
Attached is my system_icons.xml. You can compare yours with mine to see the correct changes.
gcrutchr said:
Attached is my system_icons.xml. You can compare yours with mine to see the correct changes.
Click to expand...
Click to collapse
Something going wrong. No status bar and navigation bar too!!
zoya4u said:
Something going wrong. No status bar and navigation bar too!!
Click to expand...
Click to collapse
How did you install SystemUI.apk on your phone?
Also, what did you do after you modded your SystemUI.apk and recompiled it?
gcrutchr said:
How did you install SystemUI.apk on your phone?
Also, what did you do after you modded your SystemUI.apk and recompiled it?
Click to expand...
Click to collapse
Recompiled the apk >installed 3mint battery setting.apk> copy MinitBatteryResources.apk to Pri-app > copy SystemUI to systemUI folder and reboot.
zoya4u said:
Recompiled the apk >installed 3mint battery setting.apk> copy MinitBatteryResources.apk to Pri-app > copy SystemUI to systemUI folder and reboot.
Click to expand...
Click to collapse
I added few more detailed steps to instructions. Please read.
The sysinstall.zip has a script to also set permissions correctly
Hi, I was wondering what you mean by including the original android manifest and meta-inf folder, Do I just take them out of the original apk and put them in the SystemUI/build folder?
Do I use the decompiled one that apktool provides (it makes manifest but not Meta-inf) at all?
I'm trying to mess around with a Doogee S60, got the framework files and sysui installed as stuff for apktool to use, specify it needs to use them at decompile
make my modifications, throw your fixed 9.png into the xxhdpi folder.... I think last time I used the manifest apktool makes, copied the META-INF to project/build and project/
And I'm still ending up with 'android is starting' for a minute or so, then my launcher's there, but without the status bar, nav bar and such.
After messing with it some the phone forces me to Factory Reset. :c
BerserkLeon said:
Hi, I was wondering what you mean by including the original android manifest and meta-inf folder, Do I just take them out of the original apk and put them in the SystemUI/build folder?
Do I use the decompiled one that apktool provides (it makes manifest but not Meta-inf) at all?
I'm trying to mess around with a Doogee S60, got the framework files and sysui installed as stuff for apktool to use, specify it needs to use them at decompile
make my modifications, throw your fixed 9.png into the xxhdpi folder.... I think last time I used the manifest apktool makes, copied the META-INF to project/build and project/
And I'm still ending up with 'android is starting' for a minute or so, then my launcher's there, but without the status bar, nav bar and such.
After messing with it some the phone forces me to Factory Reset. :c
Click to expand...
Click to collapse
Yes, replace the android manifest and add the META-INF folder. Easiest way: open original and compiled SystemUI.apks; drag 'n drop android manifest file and META-INF folder from original SystemUI.apk to compiled version.
lost the status bar and nav
gcrutchr said:
Yes, replace the android manifest and add the META-INF folder. Easiest way: open original and compiled SystemUI.apks; drag 'n drop android manifest file and META-INF folder from original SystemUI.apk to compiled version.
Click to expand...
Click to collapse
Hello
I used your instruction as this:
1- pull the SystemUI.apk and framefork-res.apk from the installed rom on my Samsung device that run android 8
2- decompiled the SystemUI.apk
3- I just replace the pip_dismiss_scrim.9.png from your 3minit.zip file (I do anything more)
4- recompile the SystemUI
5- replace the (Manifest.xml And META_INF folder) from 'original' folder to 'build/apk/' folder
6- do recompile the SystemUI again
7- copy the SystemUI.apk to the /system/priv-app/SystemUI/SystemUI.apk
8- change the permission of app
9- restart the phone
10- as the result I see no status bar and nav
>>> please help me for this ... where is wrong from my work steps (I just replace pip_dismiss_scrim.9.png file) ???? why the status bar and navber lost from os ??
---------- Post added at 02:24 PM ---------- Previous post was at 02:06 PM ----------
hossein_sys said:
Hello
I used your instruction as this:
1- pull the SystemUI.apk and framefork-res.apk from the installed rom on my Samsung device that run android 8
2- decompiled the SystemUI.apk
3- I just replace the pip_dismiss_scrim.9.png from your 3minit.zip file (I do anything more)
4- recompile the SystemUI
5- replace the (Manifest.xml And META_INF folder) from 'original' folder to 'build/apk/' folder
6- do recompile the SystemUI again
7- copy the SystemUI.apk to the /system/priv-app/SystemUI/SystemUI.apk
8- change the permission of app
9- restart the phone
10- as the result I see no status bar and nav
>>> please help me for this ... where is wrong from my work steps (I just replace pip_dismiss_scrim.9.png file) ???? why the status bar and navber lost from os ??
Click to expand...
Click to collapse
I just want to disable the status bar , but I lost the status bar and nav bar access(recent app , back , home button lost) .
my instruction step as I follow from this link():
- pull SystemUI.apk from your device: adb pull /system/priv-app/SystemUI/SystemUI.apk the path to SystemUI.apk may be different
- pull framework-res.apk from your device adb pull /system/framework/framework-res.apk the path to framework-res.apk may be different
- run apktool if framework-res.apk
- run apktool if SystemUI.apk
- run apktool d SystemUI.apk
- Open SystemUI\res\layout\status_bar.xml and add android:visibility="gone" to the top most xml element (for me it was com.android.systemui.statusbar.phone.PhoneStatusBarView)
- run apktool b SystemUI
- Go to SystemUI\original and copy AndroidManifest.xml and META-INF to SystemUI\build\apk\
- run apktool b SystemUI again
- Go to SystemUI\dist\ and override the device's original SystemUI.apk with the one at SystemUI\dist\SystemUI.apk with adb push SystemUI\dist\SystemUI.apk /system/priv-app/SystemUI/SystemUI.apk
- Restart device
hossein_sys said:
Hello
>>> please help me for this ... where is wrong from my work steps (I just replace pip_dismiss_scrim.9.png file) ???? why the status bar and navber lost from os ??
I just want to disable the status bar , but I lost the status bar and nav bar access(recent app , back , home button lost) .
my instruction step as I follow from this link():
Click to expand...
Click to collapse
Uh, what you are doing has nothing to do with the 3 Minit Battery Mod. Here is what I would suggest. Go to Google Play Store. Find a launcher or an app that allows you to hide the status bar. This is the easiest way - no programming.
I need this instruction for my specific work(remove permanently status bar)
gcrutchr said:
Uh, what you are doing has nothing to do with the 3 Minit Battery Mod. Here is what I would suggest. Go to Google Play Store. Find a launcher or an app that allows you to hide the status bar. This is the easiest way - no programming.
Click to expand...
Click to collapse
Many many thanks for your reply .
I need to remove status bar permanently from the android 8 .
As you say , my work dosnt have relationship with 3 mint battery but for removing the status bar in android 8 , i need follow your instruction... I say that follow your instruction but I dosnt change any thing expect replacing the nine path file.
So if you can help me to do this work I thank you .
I dosnt have problem in android 6 and previous android versions.
I just have problem on correct decompile and recompile of SystemUI.apk in android 8 , as your instruction I can decompile and recompile the file but after it the status bar and nav bar will be lost .
Please help me on this problem ... I need just this work .
Thanks
Updated for PIE, 9.0

Categories

Resources