[Tutorial][Updated]3 Minit Battery for Oreo 8.0/PIE 9.0[Note FE/DS][12 May 2018] - Samsung Galaxy Note FE Guides, News, & Discussion

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

Related

[FIX] Show status bar item press (10/28/10)

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.

[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] Theme TouchWiz to be AOSP!

How To Theme TouchWiz Based ROM to look like AOSP!!​
Ok guys I decided to share my theming method with you guys. This is mainly intended for all developers and or ROM developers!
If you have TouchWiz based ROM (Some devices below) you can theme it to have an AOSP feel to it.
Devices:
Galaxy SII
Galaxy SIII
Galaxy Note
Galaxy Note II (Tested by Me )
Some others as well...
Whats Needed:​*APKTool DOWNLOAD HERE
*JAVA DOWNLAOD HERE
*7-ZIP DOWNLOAD HERE
*TouchWiz Base ROM
*SystemUI.apk (in system/app) **FROM TOUCHWIZ ROM**
*SystemUI.apk (in system/app) **FROM AOSP or CM10 ROM**
*Framework-res.apk and TWFramework-res.apk (in system/framework) **FROM TOUCHWIZ ROM**
*Zipalign tool
*Root Explorer App (Get from Google Play Store)
*Holo Launcher (Also get from Google Play Store)​
Lets Get Started:​Follow all of the steps below carefully and you should have an AOSP Themed TouchWiz ROM in no time ​
1. Download the Holo Launcher from the Google Play Store.
(When you run the launcher you will see that you will have an AOSP themed launcher and you will have AOSP system icons [messaging, phone, settings, ect..])
2. You need to install APKTool next. (If you already have this installed then skip this step)
*Download the APKtool files (link above)
*Put the files into your C drive. Make a folder in the root of your C drive called apktool.
*All of your files should go inside that folder (apktool)
*Go to CMD or Command Prompt and type in
Code:
cd C:\apktool
*That should redirect you to the apktool. If it worked then lets move on...
3. Get the framework-res.apk and TWFramework-res.apk (in system/framework) and place it in the apktool folder.
4. In the Command Prompt you will need to direct CMD to the APKtool folder. Then you must install the framework files by doing:
Code:
apktool if framework-res.apk
and
Code:
apktool if twframework-res.apk
Now your framework files are successfully installed. If you have an error in the CMD window then you must check your JAVA.
5. Now get your systemui.apk files from both AOSP (CM10) and TouchWiz ROM. Rename the AOSP systemui.apk to systemuiaosp.apk (so you dont get the touchwiz and aosp systemui's mixed up)
6. Make a backup of the TouchWiz systemui.apk in another folder called "Backup" ****YOU WILL NEED THIS LATER*****
7. Now you should have both systemuiaosp.apk and systemui.apk in the apktool folder. Now you must decompile both files by using these commands:
Code:
apktool d systemuiaosp.apk
and
Code:
aptkool d systemui.apk
You should have 2 more folders (systemuiaosp and systemui).
8. Here comes the actual theming of the systemui. Open both systemuiaosp and systemui folders side-by-side. And now you need to navigate to the drawable-xhdpi folder in both.
***FOLLOW THESE NEXT STEPS CAREFULLY OR YOU WILL HAVE AN ERROR***
9. Find the files you want to replace. They should all be PNG files. DO NOT JUST ADD PNG FILES FROM THE SYSTEMUIAOSP TO THE SYSTEMUI. YOU WILL GET ERRORS WHEN COMPILING THE FILE!! There are XML files (we will not edit in this tutorial) that use those PNG files with those extension names. So you can't just add files from one to another. For example:
If you have an icon you want to change but its only for that AOSP then it wont run on the TouchWiz. If you have a WiFi icon that has a name of AOSP_Wifi_1 and on the other systemui it says TOUCHWIZ_Wifi_1 you cant just delete the one that says TouchWIZ_WIFI_1 and replace it with the AOSP one. The XML files dont tell it to run the AOSP_WIFI_1. So you must ONLY REPLACE FILES WITH SAME EXTENSION NAME!!
10. You can go ahead and transfer files from the SystemuiAOSP to the systemui. Note what i said above!! If you have lets say 6 wifi icons for systemuiAOSP and 6 icons for systemui (touchwiz) you can rename the AOSP PNG files to match the TouchWiz ones so the XML files will know what to run.
I personally suggest only transferring Wifi Icons, Battery Icons, and Signal Icons. These are your most important ones to transfer! You can also transfer the Bluetooth and Airplane mode icons also.
11. After you have transfered the files over and you feel like you have done it correctly then you can go ahead and Compile the SystemUI folder by using this code:
Code:
apktool b systemui semidone.apk
12. If you did all the steps correctly above then apktool will build the apk file with no issues. If you have errors then you did not pay attention carefully. (You may want to try another CM10 ROM to get icons from).
13. Now here is where 7-Zip and your backup file comes into play. Open 7-Zip twice (2 windows). In the first window direct 7-zip to the semidone.apk file. And the second one to your backup file which should be SystemUI.apk (in the backup folder).
14. In the SystemUI.apk click on the RES folder and then find the Drawable-xhdpi folder. Delete the entire Drawable-xhdpi folder. Now in the other window (semidone.apk) go to RES and then transfer the entire Drawable-xhdpi folder into the SystemUI.apk window.
15. Now your SystemUI.apk in the Backup folder is your new modded one. But before you can use it you must zipalign it using any zipalign tools out there. I just use DSIxda's kitchen to do it since I make ROMs with it.
16. Now you can go ahead and transfer the SystemUI.apk onto your phone's SD card.
17. Download Root Explorer. Now go ahead and navigate to your SD card and click the SystemUI.apk file and then click copy or move. (whichever one you like).
18. Now navigate to your system/app folder and paste and overwrite the original one. (You will need to set root explorer to Read/Write). Now you can go ahead and reboot your device.
If you did everything correctly you should now have a themed launcher and a themed status bar with AOSP Icons!​
I don't ask for donations so if this tutorial helped you then please hit that Thanks button!​
MINE
Mine AGAIN
I was just looking for a thread like this... not sure if i have enough time and will to do it but i am very glad you post it!
thanks a lot!!!
ExcaliberX said:
I was just looking for a thread like this... not sure if i have enough time and will to do it but i am very glad you post it!
thanks a lot!!!
Click to expand...
Click to collapse
Your welcome. I hope it works for you!
So are there any screenshots showing exactly what changed? I'd like most of the UI to have an AOSP feel to it not just some parts. Does this theme all or just bits and pieces?
Shmi117 said:
So are there any screenshots showing exactly what changed? I'd like most of the UI to have an AOSP feel to it not just some parts. Does this theme all or just bits and pieces?
Click to expand...
Click to collapse
Well as said above it themes the launcher (holo) and the status bar icons are aosp.
thanks I was hoping to see where you find the blue background bars in the S2 in the settings menu SecSettings.apk or trframework or framework or systemUI I have looked everywhere and changed colors of .9pngs forever and it never phased them. obviously I never found the right one to change. would you happen to know and could you post here or pm me thanks. have a decent ROm that doesnt really need blue gray bars dominating the screen.

[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

[GUIDE][AOSP/MTK]Theming Guide For MT65XX Devices

Hello Guyzzz.....This Is My First Theming Guide Fro Mt65XX Devices
In This Guide I Will Tell You How To Do The Following Things:-
##Making Settings Holo Light##
##Changing The Switch##
##Changing The Spinners##
Requirements:-
##APKTOOL##
##NOTEPAD++##
##Knowledge About Decompiling And Recompiling##
##Time,Patience And Most Important Of All............A Working Brain--------- ##
OK......So Lets Get Started.......
For Making Settings Holo Light​
Decompile Settings.apk
Open Android Manifest.xml Using NotePad++
Search For This Line
Code:
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher_settings" android:label="@string/settings_label" android:supportsRtl="true" android:taskAffinity="" android:theme="@android:style/Theme.Holo" android:uiOptions="splitActionBarWhenNarrow">
Change
Code:
android:theme="@android:style/Theme.Holo"
TO
Code:
android:theme="@android:style/Theme.Holo.Light"
Save And Exit Android Manifest.xml
Recompile Your Settins
Sign It Manually
MOVING ONNNN.......
For Changing The Switch
Decompile framework-res.apk
Download Any Switch Resource From Below
Copy The Items From The "res/drawable" Folder Of The Downloaded Folder And Replace Those Files In framework-res "res/drawable" Folder
Now Goto drawable-hdpi{depending on ur device}And Delete All The Switch Pngs Present There{NORMALLY THE NAME STARTS WITH "switch_...9.png"}
Thats IT.....Now Recompile And Sign framework-res
AGAIN......MOVING ONNNN.......
For Changing The Spinners
Decompile framework-res.apk
Download Any Of The Spinner Resources From The Second Post
Extract The File And Open the Folder
Copy All The Contents from The Drawable Folder And Paste It In Your Folder{You Will be Asked To Replace The Files....Just Do It}
Now Open The Downloaded Resource Folder And Copy All The PNG'S In The FOlder And Paste It In "drawable-hdpi" Folder Of Your framework-res{Replace All The Files.....IF ASKED!!}
Thats IT.....Now Recompile And Sign The APK
ENJOY.....-HIT THANKS IF YOU LIKE MY WORK!!
Chetan Lodha said:
Hello Guyzzz.....This Is My First Theming Guide Fro Mt65XX Devices
In This Guide I Will Tell You How To Do The Following Things:-
##Making Settings Holo Light##
##Changing The Switch##
##Changing The Spinners##
Requirements:-
##APKTOOL##
##NOTEPAD++##
##Knowledge About Decompiling And Recompiling##
##Time,Patience And Most Important Of All............A Working Brain--------- ##
OK......So Lets Get Started.......
For Making Settings Holo Light​
Decompile Settings.apk
Open Android Manifest.xml Using NotePad++
Search For This Line
Code:
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher_settings" android:label="@string/settings_label" android:supportsRtl="true" android:taskAffinity="" android:theme="@android:style/Theme.Holo" android:uiOptions="splitActionBarWhenNarrow">
Change
Code:
android:theme="@android:style/Theme.Holo"
TO
Code:
android:theme="@android:style/Theme.Holo.Light"
Save And Exit Android Manifest.xml
Recompile Your Settins
Sign It Manually
MOVING ONNNN.......
For Changing The Switch
Decompile framework-res.apk
Download Any Switch Resource From Below
Copy The Items From The "res/drawable" Folder Of The Downloaded Folder And Replace Those Files In framework-res "res/drawable" Folder
Now Goto drawable-hdpi{depending on ur device}And Delete All The Switch Pngs Present There{NORMALLY THE NAME STARTS WITH "switch_...9.png"}
Thats IT.....Now Recompile And Sign framework-res
AGAIN......MOVING ONNNN.......
For Changing The Spinners
Decompile framework-res.apk
Download Any Of The Spinner Resources From The Second Post
Extract The File And Open the Folder
Copy All The Contents from The Drawable Folder And Paste It In Your Folder{You Will be Asked To Replace The Files....Just Do It}
Now Open The Downloaded Resource Folder And Copy All The PNG'S In The FOlder And Paste It In "drawable-hdpi" Folder Of Your framework-res{Replace All The Files.....IF ASKED!!}
Thats IT.....Now Recompile And Sign The APK
ENJOY.....-HIT THANKS IF YOU LIKE MY WORK!!
Click to expand...
Click to collapse
Good Job Bro I Think It Will Be Hard But It's Easy Good Job :laugh:
lol... this is all so NOT easy.
you missed few important parts in between your Simple Guide.
But Catchy Topic Header...
Add more Basic But important Steps
Dude.. you missed a lot of things in that tutorial ! i Hope in futute you will add more Things in that tutorial !
dare2know said:
lol... this is all so NOT easy.
you missed few important parts in between your Simple Guide.
But Catchy Topic Header...
Add more Basic But important Steps
Click to expand...
Click to collapse
SDShukla said:
Dude.. you missed a lot of things in that tutorial ! i Hope in futute you will add more Things in that tutorial !
Click to expand...
Click to collapse
I Dont Think bro...bcoz i followed these steps and everything worked!!
@chetan ,
it was jUST A POINTER nothing to make u feel bad,
Screenshots?
download from below!?!?!?
There is no resources to download in the 2nd post !!!

Categories

Resources