[Q] Hacking SystemUI.apk on Timur rom / kernal - Android Q&A, Help & Troubleshooting

Hi There,
Bit of a newbie to this, but giving it a shot and getting reasonably far
I'm building a Nexus 7 car tablet install for my Rx8 sat nav housing.
Using USB rom / kerenal which is a semi dead project, I guess as the guy has the 2013 version and better things to do. It works well for the most part and i'm happy with it, but I want a couple of superficial tweaks
rootzwiki - topic/37755-timurs-kernel-usb-rom-most-popular-thread-on-rootzwiki/
Now this has a Landscape UI with a Navbar for soft buttons which works reasonably well. There are some media buttons which do volume (+ / -) and two dots. The first does play. The second FWD. Both work fine but are hardly inuative
A guy here has made a mod to SystemUI.apk
rootzwiki - topic/40701-closed-mod-kookies-mod-shop-system-bar-mods-bootanimations/page-2#entry1146225
Which I can install and works, but it breaks the clock in the navbar / status bar. However the nav buttons are there.
I've got APKstudio which is nice and fairly usefriendly. I can decompile SystemUI.apk no problems. Adding in framework-res.apk as a resource and I can rebuild it too. I've done this for both Timur's SystemUi.apk and Kookie_Monster's versions.
Having a read here
rootzwiki - topic/37755-timurs-kernel-usb-rom-most-popular-thread-on-rootzwiki/page-247#entry1144931
And SystemUI/res/layout/system_bar.xml is the file that is modified
Changing
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/menu" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_dot_large" android:contentDescription="@string/accessibility_vol_up" systemui:keyCode="85" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
To
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/menu" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_play" android:contentDescription="@string/accessibility_vol_up" systemui:keyCode="85" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
Adding in drawable/ic_sysbar_play from the drawable-sw600dp-hdpi folder of Kookie_Monster's to my decompiled Timur
Rebuilding works and I have a new apk......Using root file manager I can copy the file over my Nexus's apk which it then reboots.....And then i get stuck in a SystemUI has closed loop. Reboot and recover, restrore time!
I've been loosly following [youtube - watch?v=bMccWbMjBLs which does similar stuff.....However
Which mentions stuff about signatures and copy a manifest. I tried, but no joy so far.....I'm so close, yet seem to be missing something. Don't know if I need to put the APK back into Kookie_Monster's install zip, though that seems a bit overkill or if the signatures are out or quite what ???
Irritatingly the navbar seems some form of custom hack so any atempt on finding an app to customise hasn't worked so far
Any ideas,
Lee
p.s. excuse the lack of proper links. Anti-spam newbie measures *sigh*

Related

EPIC BLUE THEME PULLDOWN TOGGLES for Eclipse 2.1

Is there a way to change the order of the pulldown toggles in this theme? This is what I've done so far:
1)I've decompiled the SystemUI.apk file
2)Modified the status_bar_expanded.xml file to reorder the toggles the way that I wanted them.
3)Deleted the proper files that were modified
4)Recompiled & signed it.
5)Replaced the modified SystemUI.apk file back into the Epic Blue zip file
6)Installed in recovery (wiping cache & dalvik cache)
The pulldown toggles remain in their original order, but other modifications that I made took effect. Any help would be GREATLY appreciated!! I have done this before even with Epic Blue for 2.0.X with great results.
dkool1 said:
Is there a way to change the order of the pulldown toggles in this theme? This is what I've done so far:
1)I've decompiled the SystemUI.apk file
2)Modified the status_bar_expanded.xml file to reorder the toggles the way that I wanted them.
3)Deleted the proper files that were modified
4)Recompiled & signed it.
5)Replaced the modified SystemUI.apk file back into the Epic Blue zip file
6)Installed in recovery (wiping cache & dalvik cache)
The pulldown toggles remain in their original order, but other modifications that I made took effect. Any help would be GREATLY appreciated!! I have done this before even with Epic Blue for 2.0.X with great results.
Click to expand...
Click to collapse
Hmm. Are you using apkmanager to do this? I've had problems with it when having to delete files that were modified so I always do the option to not save additional files.(if that makes sense). Anyway I'm curious so I'm going to try it out for myself and let you know how it goes.
EDIT: Same thing happened here. I change the order in the xml but it stayed the same. There must be more to it since the scrolling toggles were added. If I figure it out I'll let you know.
---------- Post added at 09:51 PM ---------- Previous post was at 09:02 PM ----------
OK, here's what I found. The toggles in eclipse 2.1 are positioned using relative layout. Which means that each of the FrameWork Layout sections are pointing to the id that it is to the right of. So if we move the FrameWork Layout sections it won't matter. What is important is what the "android:layout_toRightOf" value is set to. For example if you look at the gps button you see that it is alway to the right of the blue tooth button.
Code:
android:layout_toRightOf="@id/bt_bttn"
Code:
<FrameLayout android:id="@id/gps_bttn" android:layout_width="fill_parent" android:layout_height="65.0dip" android:layout_weight="1.0" android:layout_toRightOf="@id/bt_bttn">
<ImageView android:layout_gravity="center_horizontal" android:id="@id/quickpanel_gps_btn_icon" android:layout_width="72.099976dip" android:layout_height="wrap_content" android:layout_marginTop="3.0dip" android:src="@drawable/quickpanel_icon_gps_off" />
<com.android.systemui.statusbar.quickpanel.GpsSettingButton android:textSize="11.0dip" android:textStyle="bold" android:textColor="#ffdfdfdf" android:gravity="center_horizontal" android:id="@id/quickpanel_gps_btn_text" android:paddingTop="35.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/quickpanel_gps_text" android:shadowDx="1.0" android:shadowDy="1.0" />
<ImageView android:layout_gravity="bottom|center" android:id="@id/quickpanel_gps_btn_status_icon" android:paddingLeft="2.2999878dip" android:paddingRight="2.2999878dip" android:layout_width="fill_parent" android:layout_height="5.299988dip" android:layout_marginBottom="4.0dip" android:src="@drawable/quickpanel_icon_off" android:scaleType="fitXY" />
</FrameLayout>
So changing the value of the layout_toRightO in each of the FrameLayout sections relative to the others is what you need to do to change the order of the toggles. I haven't tried it out yet but that should be what you're looking for. If you get to try it before I do let me know if it works.
Oh, Here's a tutorial that explains relative layout that I found http://developer.android.com/resources/tutorials/views/hello-relativelayout.html
Edit again: This method works. I just moved the flashlight right after the sound button.
You da Man!! Major Props to you!!
THANK YOU THANK YOU THANK YOU!!
Thanks. Glad to help.
Sent from my DROID X2 using Tapatalk
Has anyone had trouble with the flashlight toggle on the status bar sticking? It seems to stay for a little while and then goes back to the original status bar ....
I haven't, but I don't use the flashlight toggle enough to make a fair assessment. It hasn't stuck for me.

[MOD][ACRO S][for STOCK rom - 6.1.A.2.45][12-09-16]

Hi guys ..
I'm not a developer so is beyond my knowledge to create custom roms and stuff, but using the little programming skills I have I can manage to play around with the APKs
After trying various XS mods I saw there are small incompatibilities in the framework so there are small annoying graphical and/or animation glitches. Giving that I decided to start modding the stock rom by myself.
This will be a work in progress and I'll update it as I'll advance in my modding skills.
DISCLAIMER: I'm not responsible if you brick your phone by applying these mods. Apply at your own risk.
Do not forget: first thing after putting CWM on your phone, do a full backup of the original system so you can come back to that status in case of emergencies.
Please be aware that these files are not working on ALL odexed 6.1.A.2.45 roms. I have no idea why.
My phone has the following Customization Version: 1266-3278_R3G
Maybe the framework is somehow different form other versions. Please check your cust. ver. before aplying:
- stock dialer and type *#*#service#*#* (*#*#7378423#*#*), Service Info, software information
Current status of my phone:
- Rom updated OTA to 6.1.A.2.45
- Bootloader unlocked with the sony procedure (using fastboot and the key generated online)
- CWM kernel installed: http://forum.xda-developers.com/showthread.php?t=1834129
- Root pushed to the device: http://forum.xda-developers.com/showpost.php?p=30320507&postcount=11
Next I took out the SystemUI.apk and I deodexed it (only this one, so it can be easily modded) and start messing around with it.
12-09-06 - a - CWM flashable: statusbar - 1% battery increments and CM battery style applied, as well as 2 icons changed in the pull-down menu (settings and delete-all notifications buttons): SystemUI_CMbat_120906.zip (attached)
The quick controls are from widgetsoid. I plan to replicate the 14 toggles mod but I will need some time.
{
"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"
}
12-09-06 - b - root stuff:: Delete at least part of the bloatware in the rom (I personally just moved the respective apks into a bkp folder):
http://img716.imageshack.us/img716/9964/screenshot2012090612342.png
12-09-09 - CWM flashable: statusbar - 1% battery MIUI style plus wifi, HD drawings (xhdpi): SystemUI_MIUIbat_wifi_120909.zip (attached)
12-09-11 - CWM flashable: statusbar - 1% battery MIUI style plus wifi, HD drawings (xhdpi), clock moved from status bar into the expanded notifications, next to the date, date rearranged, clock font increased.: SystemUI_MIUIbat_wifi_120909.zip (attached)[/b] - the toggles are from widgetsoid .. I will try to implement the quickpanel mod also.
Statusbar:
Expanded notifications:
12-09-16 - CWM flashable: statusbar - 1% battery MIUI style plus wifi, HD drawings (xhdpi), clock moved from status bar into the expanded notifications, next to the date, date rearranged, clock font increased, 8 toggles added to pulldown menu: SystemUI_toggles_120916.zip (attached)[/b]
Enjoy it!
I make no promises this will advance nor I will give OTA for anything ... it is just me trying to improve the experience I have with this phone.
Credits:
- XDA comunity for the info shared over the years.
- alteredlikeness - for the toggles sources and explanations.
You can use my files do to whatever you like! My real work was to understand some relations between the XMLs and SMALI files and also to create some pngs for the graphical aspect. I took the information for free so I'll return it in the same way.
Sept 9th - miui batt style and modded wifi statusbar icons.
Nice thank you so much :laugh: i will try it soon
Sept 11th - clock moved from statusbar into the pulldown notifications, next to the date. The clock font increased from 16dpi to 32dpi.
ro_explorer said:
Hi guys ..
I'm not a developer so is beyond my knowledge to create custom roms and stuff, but using the little programming skills I have I can manage to play around with the APKs
After trying various XS mods I saw there are small incompatibilities in the framework so there are small annoying graphical and/or animation glitches. Giving that I decided to start modding the stock rom by myself.
This will be a work in progress and I'll update it as I'll advance in my modding skills.
DISCLAIMER: I'm not responsible if you brick your phone by applying these mods. Apply at your own risk.
Do not forget: first thing after putting CWM on your phone, do a full backup of the original system so you can come back to that status in case of emergencies.
Current status of my phone:
- Rom updated OTA to 6.1.A.2.45
- Bootloader unlocked with the sony procedure (using fastboot and the key generated online)
- CWM kernel installed: http://forum.xda-developers.com/showthread.php?t=1834129
- Root pushed to the device: http://forum.xda-developers.com/showpost.php?p=30320507&postcount=11
Next I took out the SystemUI.apk and I deodexed it (only this one, so it can be easily modded) and start messing around with it.
12-09-06 - a - CWM flashable: statusbar - 1% battery increments and CM battery style applied, as well as 2 icons changed in the pull-down menu (settings and delete-all notifications buttons): SystemUI_CMbat_120906.zip (attached)
The quick controls are from widgetsoid. I plan to replicate the 14 toggles mod but I will need some time.
12-09-06 - b - root stuff:: Delete at least part of the bloatware in the rom (I personally just moved the respective apks into a bkp folder):
http://img716.imageshack.us/img716/9964/screenshot2012090612342.png
12-09-09 - CWM flashable: statusbar - 1% battery MIUI style plus wifi, HD drawings (xhdpi): SystemUI_MIUIbat_wifi_120909.zip (attached)
12-09-11 - CWM flashable: statusbar - 1% battery MIUI style plus wifi, HD drawings (xhdpi), clock moved from status bar into the expanded notifications, next to the date, date rearranged, clock font increased.: SystemUI_MIUIbat_wifi_120909.zip (attached)[/b] - the toggles are from widgetsoid .. I will try to implement the quickpanel mod also.
Statusbar:
Expanded notifications:
Enjoy it.
I make no promises this will advance nor I will give OTA for anything ... it is just me trying by need base to improve the experience I have with this phone.
Click to expand...
Click to collapse
How you removed clock from status bar?
October 16th 2012 - added 8 toggles to the drop-down notifications menu - OP updated.
ariciusonic said:
How you removed clock from status bar?
Click to expand...
Click to collapse
Use a deodexed SystemUI apk. Decompile it.
Edit: SystemUI/res/layout/status_bar.xml
Remove the line:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock"android:gravity="left|center" android:id="@id/clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
ro_explorer said:
October 16th 2012 - added 8 toggles to the drop-down notifications menu - OP updated.
Use a deodexed SystemUI apk. Decompile it.
Edit: SystemUI/res/layout/status_bar.xml
Remove the line:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock"android:gravity="left|center" android:id="@id/clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
Click to expand...
Click to collapse
Please help, I can't find the line.. Can you remove only clock from my systemUI.apk ? (it's from a xperia s)
:fingers-crossed:
ariciusonic said:
Please help, I can't find the line.. Can you remove only clock from my systemUI.apk ? (it's from a xperia s)
:fingers-crossed:
Click to expand...
Click to collapse
Check this one. If you see incompatibilities with your phone is because I used AcroS framework to decompile/compile your SystemUI.apk.
In that case please give me also your framework-res.apk and I'll redo the steps.
So now there is no clock at all, not in the statusbar and not in the drop-down notifications. I hope I understood correctly your request.
The zip is for CWM .
not working on my S, here is the framework..
https://www.box.com/s/0jpwg52tbw66uzvu3dxa
ariciusonic said:
not working on my S, here is the framework..
https://www.box.com/s/0jpwg52tbw66uzvu3dxa
Click to expand...
Click to collapse
Ok then .. this one is decompiled/compiled using your framework. It should work by default: XS_no_clock_2.zip
The above file is signed with a developer certificate.
If you want to keep the original signature, this is the same modded file as above, but with the original signature in it: XS_no_clock_2_original_signature.zip
Let me know if it worked.
ro_explorer said:
Hi guys ..
I'm not a developer so is beyond my knowledge to create custom roms and stuff, but using the little programming skills I have I can manage to play around with the APKs
After trying various XS mods I saw there are small incompatibilities in the framework so there are small annoying graphical and/or animation glitches. Giving that I decided to start modding the stock rom by myself.
This will be a work in progress and I'll update it as I'll advance in my modding skills.
DISCLAIMER: I'm not responsible if you brick your phone by applying these mods. Apply at your own risk.
Do not forget: first thing after putting CWM on your phone, do a full backup of the original system so you can come back to that status in case of emergencies.
Current status of my phone:
- Rom updated OTA to 6.1.A.2.45
- Bootloader unlocked with the sony procedure (using fastboot and the key generated online)
- CWM kernel installed: http://forum.xda-developers.com/showthread.php?t=1834129
- Root pushed to the device: http://forum.xda-developers.com/showpost.php?p=30320507&postcount=11
Next I took out the SystemUI.apk and I deodexed it (only this one, so it can be easily modded) and start messing around with it.
12-09-06 - a - CWM flashable: statusbar - 1% battery increments and CM battery style applied, as well as 2 icons changed in the pull-down menu (settings and delete-all notifications buttons): SystemUI_CMbat_120906.zip (attached)
The quick controls are from widgetsoid. I plan to replicate the 14 toggles mod but I will need some time.
12-09-06 - b - root stuff:: Delete at least part of the bloatware in the rom (I personally just moved the respective apks into a bkp folder):
http://img716.imageshack.us/img716/9964/screenshot2012090612342.png
12-09-09 - CWM flashable: statusbar - 1% battery MIUI style plus wifi, HD drawings (xhdpi): SystemUI_MIUIbat_wifi_120909.zip (attached)
12-09-11 - CWM flashable: statusbar - 1% battery MIUI style plus wifi, HD drawings (xhdpi), clock moved from status bar into the expanded notifications, next to the date, date rearranged, clock font increased.: SystemUI_MIUIbat_wifi_120909.zip (attached)[/b] - the toggles are from widgetsoid .. I will try to implement the quickpanel mod also.
Statusbar:
Expanded notifications:
12-09-16 - CWM flashable: statusbar - 1% battery MIUI style plus wifi, HD drawings (xhdpi), clock moved from status bar into the expanded notifications, next to the date, date rearranged, clock font increased, 8 toggles added to pulldown menu: SystemUI_toggles_120916.zip (attached)[/b]
Enjoy it!
I make no promises this will advance nor I will give OTA for anything ... it is just me trying to improve the experience I have with this phone.
Credits:
- XDA comunity for the info shared over the years.
- alteredlikeness - for the toggles sources and explanations.
You can use my files do to whatever you like! My real work was to understand some relations between the XMLs and SMALI files and also to create some pngs for the graphical aspect. I took the information for free so I'll return it in the same way.
Click to expand...
Click to collapse
I followed the instruction above but After flashed one of those file my phone became black screen and no Navibar!
Do you know what wrong with my phone?
My phone rooted and unlocked BL already.
You tried this on an Acro S with STOCK 6.1.A.2.45 ? It is very weird it did not worked.
Can you please give me your original SystemUI.apk and the odex file?
P.S.: I hope you had a backup to restore the phone ... otherwise, I can provide the original apk and odex.
ro_explorer said:
You tried this on an Acro S with STOCK 6.1.A.2.45 ? It is very weird it did not worked.
Can you please give me your original SystemUI.apk and the odex file?
P.S.: I hope you had a backup to restore the phone ... otherwise, I can provide the original apk and odex.
Click to expand...
Click to collapse
Yeah it's running stock A.2.45. No worry i did back up already.
Before i used to follow the other method by replace SystemUI.apk from another thread, but finally i got the same thing and even i replaced back the original SystemUI.apk still could not help until i restore phone system.
Ok here the original SystemUI.apk and odex file from my phone...
Thanks for your time
ro_explorer said:
October 16th 2012 - added 8 toggles to the drop-down notifications menu - OP updated.
Use a deodexed SystemUI apk. Decompile it.
Edit: SystemUI/res/layout/status_bar.xml
Remove the line:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock"android:gravity="left|center" android:id="@id/clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
Click to expand...
Click to collapse
Hi! Wich lines edit for the clock? I mean, centered clock
Sent from my LT26i using xda premium
alvizu said:
Hi! Wich lines edit for the clock? I mean, centered clock
Sent from my LT26i using xda premium
Click to expand...
Click to collapse
The same line you delete to remove the clock only that you have to play with the position of the line containing the clock definition and also woth the definition of the clock itself.
So, the line must be moved in the first LinearLayout field and the clock must have android:gravity="center"
That's all.
I'm not pasting here my own xml lines because apparently these might differ from one system to another.
higherman said:
Yeah it's running stock A.2.45. No worry i did back up already.
Before i used to follow the other method by replace SystemUI.apk from another thread, but finally i got the same thing and even i replaced back the original SystemUI.apk still could not help until i restore phone system.
Ok here the original SystemUI.apk and odex file from my phone...
Thanks for your time
Click to expand...
Click to collapse
So .. I took your files and compared the checksums with my files ... guess what? your files are identical to mine.
This lead only to one conclusion .. something is wrong either with the signature of my compiled file (but from my knowledge the signature of the system files do not count) or you have something weird over there.
The CWM package is supposed to automatically delete the original SystemUI.apk and SystemUI.odex files and then put instead the modded SystemUI.apk and set the rigt permissions.
Just to take all the precautions, here is the newest modded file with the original Sony signature.
If the above procedure (done manually) is still not giving results I frankly can not help you because I simply have no idea what's wrong.
ro_explorer said:
The same line you delete to remove the clock only that you have to play with the position of the line containing the clock definition and also woth the definition of the clock itself.
So, the line must be moved in the first LinearLayout field and the clock must have android:gravity="center"
That's all.
I'm not pasting here my own xml lines because apparently these might differ from one system to another.
Click to expand...
Click to collapse
I edit this, but no change, can you help me?
Sent from my LT26i using xda premium
Is this for Acro S ? In order to correctly decompile SystemUI.apk I need also the compatible framework-res.apk.
ro_explorer said:
Is this for Acro S ? In order to correctly decompile SystemUI.apk I need also the compatible framework-res.apk.
Click to expand...
Click to collapse
Xperia S
http://www.mediafire.com/?d207097bncq0ex0
If you have everything ready to edit and recompile, here is the line.
I was wrong before ... and I apologise for that.
You need to create an additional LinearLayout field especially for the clock:
So, the header of your status_bar.xml should look like:
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:background="@drawable/status_bar_expand_default" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/clock" android:layout_width="fill_parent" android:layout_height="fill_parent" android:singleLine="true" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
[...]
Explanation (I think we all are learning better by these trial&errors iterations ):
The XML file is basically presenting how the respective object is being built.
In this case, we are talking about the status bar.
Well, the LinearLayout fields are basically overlapped in the status bar and the objects inside each linear field has local orientation parameters.
By adding a new linear field on top of the others and by placing a clock entity centered, you will get what you want
Be warned: the clock will be overlapped with the notification icons which will be drawn from left to right ... so if many many notification icons will be drawn, these will go over the clock

[SCHOOL] How to start to become a dev [6 schools, last update 2013-01-24]

Schools
2012-12-19 - Post #5 Inspecting the content of an APK
2012-12-19 - Post #6 Understanding .9.PNG or 9-patch PNG
2012-12-19 - Post #7 Let's make our own .9.PNG
2012-12-19 - Post #8 Let's edit an APK
2012-01-13 - Post #12 Keep transparency of PNGs
2013-01-24 - Post #13 Easy but advanced apk-modding
Basic windows tools
The basic windows tools to look inside apk's and learn about it's structures, content and XML's are in this zip.
Mediafire: X10MP_essentials_v3.zip
In the zip you will find:
APK Easy Manager v1.0
APK Edit v0.2
APK Tool 1.5.2 SEMC
Gordons Gate USB driver
Screen Stream
SignApk
Notice: You will also need Java SE Runtime Environment. Download from here, and install first. (The one called JRE)
Gordons Gate USB driver
If you already has rooted your X10M/P you already got the USB driver, and you do not need to install the USB driver. The driver is also installed with SONY PC Companion.
APK Tool 1.5.2 SEMC
Next you need to install the framework files. In the zip is included CM7 and SEMC framework. (If you want to work on CM9 or CM10 you can get the framework-files in any of those ROMs)
Install both framework files in the folder. Open CMD and change dir to the folder with apktool and the framework files.
Then type:
apktool if framework-res.apk
apktool if SemcGenericUxpRes.apk​
APK Easy Manager v1.0
This tool will easily decompile most APK's, for easy access to resources and files, incl. XMLs
APK Edit v0.2
This tool will let you extract or inject files and edit existing XMLs.
Notice: Use the Apply button after you do a change to return to root folder. When injecting files, use copy and paste. If you just drag and drop the file wil be moved. Check AndroidManifest.xml after every APPLY, some strings might get changed or corrupted (typically there will be added a / in front of @, just remove the / and save and apply again).
(this is my generel APK-editing tool)
I use Notepad++ for editing XML/SMALI
Screen Stream
Just a very nice tool to make screen shots or video.
SignApk
Just in case you need to sign an APK.
What to do next
Well, just experiment and look inside APKs and get familiar with how they work and where different resources are placed and used by the APK. Slowly you will get more and more curious, read more and more about what ever gets your attention.
Schools and References - thread posts
Links to best posts in this thread
Post #5 Inspecting the content of an APK
Post #6 Understanding .9.PNG or 9-patch PNG
Post #7 Let's make our own .9.PNG
Post #8 Let's edit an APK
Post #12 Keep transparency of PNGs
Post #13 Easy but advanced apk-modding
References - outside forum
Best links to outside XDA forum
....
Reserved for a very usefull content
:cyclops:
Inspecting the content of an APK
The task of inspecting the content of an APK is fairly simple.
If you are only interesting in the graphics (PNGs) you can just rename the extension of an APK to ZIP. Now just extract the ZIP file and you got all the files from the APK. You will not be able to read the XML or SMALI files.
If you want access to everything use APK Easy Manager v1.0 from the essentials pack in post #1 above.
Just drag and drop the APK file into the APK Easy Manager v1.0, select Gingerbread in the dropdown and click Start Decompiling.
The decompiled APK will now be available in the projects folder.
{
"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"
}
Understanding .9.PNG or 9-patch PNG
Many attempts has been made to make this easy to understand and edit. Most of them ends up with strange sugestions and very complicated procedures.
Well, it's far from that complicated.
The goal of a .9.PNG is to make a graphical object, that's scaleable around a content, like a button with a text in it.
One good example is the buttons to cancel a call.
This button is made up of 5 different .9.PNG one for each state of the button, and are found in the Phone.apk (Phone.apk/res/drawable-mdpi)
btn_in_call_main_disable.9.png
btn_in_call_main_disable_focused.9.png
btn_in_call_main_normal.9.png
btn_in_call_main_pressed.9.png
btn_in_call_main_selected.9.png
They look like this (200% size shown in Pixlr.com/editor)
They all got the size 21x91. And obviously this is not the size of the buttons The actual button size is 64x64.
All around the PNGs is a 1 px border, with a simple information to the handling of the PNG object. The border must be only 100% transparent or 100% black. It's the black pixels that holds the information.
Top and left border tells what part of the PNG that is scalable/stretchable.
Right and buttom border tells what part of the PNG that can hold content, like text or other PNGs (above the buttons contains both text and graphics).
Very simple run down here: http://radleymarx.com/blog/simple-guide-to-9-patch/
Let's put that into words.
The "normal" butten state fades slightly from very dark at the buttom to less dark at the top and has round corners.
Top/left scalable/stretchable
For this button to look good, the corners sould not be stretched and the vertical transition should streach along most of the button. Left black border-line should be as long as possible for this.
For both horizontal and vertical, the corners should stay clear of being stretched.
Right/buttom content
Most of the button should hold content, so lines are here as long as possible but but still with a nice margin to the edges.
Let's make our own .9.PNG
First thing to be aware of is, that resizing a .9.PNG from another APK most likely will make the .9.PNG unusable because the imageeditor might change the total black of the border pixels and the total transparent might get some colour from pixels next to them.
Lets say that we want to make a Hobbit theme, and want the buttons above to look like something Hobbit, like a document.
So we want to change the document into the button, it would be something like this:
First I would just draw the black lines on the full image later we can do the cutting.
As you can see, I don't want stretch on the part where the corner of the document is missing (black line to the left).
Injecting this new button as it is now (no cutting at all) is fine. It does NOT have to be the size of the system-defaults. All 5 buttons just have to be same size.
This is how it looks with the same PNG for all 5 buttons. Not bad considering it took med 5 min to make
Note: The theme I used to test the Hobbit buttons is the Xperia S CM7 Theme. The caller number being close to the buttons is something that is on my list of fixing, and has nothing to do with the buttons.
Come oin newbie themers... let's build our self an XPERIA X10 Hobbit
Let's edit an APK
So I got this very simple app, that just open up a link. APK -> http://db.tt/WzA4QJhp
The APK has a Windows Live icon and just opens up http://mobile.live.com
We want to change the link to http://forum.xda-developers.com/forumdisplay.php?f=723 (this is the forum base for Sony Ericsson XPERIA X10 Mini), and give it a new nice icon.
Start APK Edit v0.2 (se post #1 for download etc) and open the APK-file (always edit in a copy).
App title and icon are changed from the front of the tool. Just write a new name and click the icon to change it. I made this cool icon.
Next we move to the content tab. This windows functions just like any other window, alowing moving og opening files directly.
The first file you see is AndroidManifest.xml
In this apk, it's not that interesting.....
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest android:versionCode="1" android:versionName="1.0" package="[COLOR="Red"]com.live.mobile[/COLOR]"
xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="@string/app_name" android:icon="@drawable/icon">
<activity android:label="@string/app_name" android:name=".WindowsLiveMobile">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="3" />
</manifest>
..... except for the red text. This is the apk signature, any other apk with the same signature will overwrite each other when installed. So if we want to make another link-APK and have both installed, this needs to be changed - AND ANY REFERENCE TO THIS, INCL PATH REFERENCES com/live/mobile must be changed too INCL the APK folders inside the SMALI folder. We will do this another day :laugh:
For now we will just find the part of the APK where the link is.
Deep inside smali/com/live/mobile are a bunch of smali-files. Our link-string is inside WindowsLiveMobile.smali.
Just open with text-editor (not Wordpad) find the link-string and edit the URL from "http://mobile.live.com" to "http://forum.xda-developers.com/forumdisplay.php?f=723"
Save the file and clik APPLY.
Copy to SD card and install.
This is the result APK http://www.mediafire.com/?v37jtayf7jsow82
Enjoy :good:
A very handy guide to .9.PNG's. Thanks!
Sent from my SK17i using xda premium
Great job!
thanks Emperor.dk for the information
Keep transparency of PNGs
When editing stock apps, everyone at one point will get problems with keeping the transparency of an stock PNG when opening it in an image editor programe on the PC.
Example: Here I have open plate.png from onoffwidgets.apk resources:
It should have been transparent, and editing from here won't do any good.
Solve this by first open it in Pixlr.com/editor and just save it again replacing the original on the PC.
When you open it again in your image editor in the PC, and the transparency works.
Now, enjoy modding and theming
Easy but advanced apk-modding
Cyanogen has made this cool app called CMWallpapers.apk.
You will find the app in a lot of custom ROMs all over XDA, some modded and some not.
In this school we will modify the package id to avoid colission with any preinstalled version and change the content of the app.
See previous schools for how to open an APK and edit content.
Today we are building an Xperia S wallpaper app-pack.
Changing icon and app name
Opening the apk in APK Edit first shows the app icons and name.
To change the icons simply click them and select the one you want from the popup filemanager. I found the original stock icon from WallpaperPicker.apk in the Xperia S stock ROM. It's fine to use the 48x48 for both LDPI and MDPI.
The app and label name is changed to "Xperia S wallpapers".
Notice: This is only the english name. In order to change the name for other languages, we need to change a lot of XML-files. This is done easily using the "replace in all open documents" function in Notepad++.
Navigate to res/ and simply drag and drop all the "value-??" folders into Notepad++, press CTRL+H and replace "CyanogenMod" with "Xperia S" in all open documents (There is one big button to do it in all with one click), and then press CTRL+SHIFT+S to save all documents.
After that click the Apply button in APK Edit.
Changing the package-id
The package id is defined in AndroidManifest.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest android:versionCode="10" android:versionName="2.3.7" [COLOR="Red"]package="com.cyanogenmod.CMWallpapers"[/COLOR]
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<application android:label="@string/app_name" android:icon="@drawable/cyanogenmod_icon">
<activity android:label="@string/app_label" android:icon="@drawable/cyanogenmod_icon" android:name="wallpaper" android:screenOrientation="nosensor" android:finishOnCloseSystemDialogs="true">
<intent-filter>
<action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:label="@string/no_wallpaper" android:name="NoWallpaper">
<intent-filter>
<action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Here we can change "com.cyanogenmod.CMWallpapers" to "com.xperias.wallpapers"
IMPORTANT: When you change the package-id you will have to change alle references in all SMALI-files, and all folder-paths inside the apk, or the app will not work.
Inside the APK exists a folder-path to the SMALI-files:
smali\com\cyanogenmod\CMWallpapers
We must rename the foldes "cyanogenmod" and "CMWallpapers" to match our package-id.
In APK Edit we just navigate to "smali\com\" and rename the folder "cyanogenmod" to "xperias", and then navigate into "xperias" and rename "CMWallpapers" to "wallpapers".
The new folder-path to the SMALI-files will now be:
smali\com\xperias\wallpapers
Next we will open all SMALI-files and change any references to match the new package-id. There are a lot, so again you might use the replace in all open documents function in Notepad++
Save all documents and click the Apply button in APK Edit.
Making wallpaper files
One wallpaperfile consists of two files, the wallpaper itself, and a thumbnail, in the format:
wallpaper.jpg
wallpaper_small.jpg
For this app to work properly, the LDPI resolution should be 427x320, and the thumbnail should be 107x80.
The MDPI resolution should be 640x480, and the thumbnail should be 107x80.
I have prepared all the wallpaperfiles from the stock Xperia S ROM, i had to resize and crop some parts off.
The wallpapers in the stock Xperia S ROM is found in "system\etc\customization\content\com\sonyericsson\wallpaperpicker\wallpapers"
The wallpaper-files has to be placed in "res\drawable-ldpi" and "res\drawable-mdpi"
Place wallpaperfiles inside the APK
First we open the "res\drawable-ldpi" folder, and delete the existing wallpaper files.
Notice: Don't delete the icon-file!
Then we copy the resized/cropped Xperia S wallpaperfiles into the folder and click Apply.
Next we do the same for "res\drawable-mdpi" folder.
Edit arrays.xml
Inside "res\values" folder we got an XML-file with references to all the wallpaper-files. This has to be edited to match our new wallpaper-files.
At the upper part of the XML we got file-reference, this must match the filename without the ".jpg", and at the lower part of the list we got wallpaper discription/name.
Be very carefull when editing XMLs in Windows. You will very easily break the text encode if you copy from 3rd party text-editor into Notepad++. It's better just to type in everything manualy.
Result
After install of the modded app, we get an Xperia S wallpaper choise when pressing the Menu-button and tapping wallpaper.
We also get an option to select no wallpaper. If we want to get rid of this, we need to edit AndroidManifest.xml and remove the red part:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest android:versionCode="10" android:versionName="2.3.7" package="com.xperias.wallpapers"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<application android:label="@string/app_name" android:icon="@drawable/cyanogenmod_icon">
<activity android:label="@string/app_label" android:icon="@drawable/cyanogenmod_icon" android:name="wallpaper" android:screenOrientation="nosensor" android:finishOnCloseSystemDialogs="true">
<intent-filter>
<action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
[COLOR="red"] <activity android:label="@string/no_wallpaper" android:name="NoWallpaper">
<intent-filter>
<action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
[/COLOR] </application>
</manifest>
And now, let me see some weekend mod-projects from all you newbies. I can't wait to se all your cool idears for app modding. I would realy like to see the Sony Ericsson Notes app with Google Tasks sync
Download the finished app here: http://www.mediafire.com/?i5tw3zpbcl86byg
New version here, cleaned up all MDPI, only 537 KB: http://www.mediafire.com/download.php?srhfp05qma86ctb
Awesome guide! I really want to learn something about the android world. Do you have some tools like these, but for linux?
mortadelax said:
Awesome guide! I really want to learn something about the android world. Do you have some tools like these, but for linux?
Click to expand...
Click to collapse
I'm very sure it's even more easy to do Android coding on a Linux system.... but i don't know how to install it, or use it, or play it.
awesome guide! Thanks a lot
Great! Thank a lot
Emperor.dk said:
I'm very sure it's even more easy to do Android coding on a Linux system.... but i don't know how to install it, or use it, or play it.
Click to expand...
Click to collapse
LOOOOL
Did you notice the line @ 4:55; "my phone doesn't take a week to boot"
That song is from a time way before smartphones .. :laugh:

[Q] [SlimBean 4.3] Add own Battery Icons to Settings

Hi,
I flashed the Sabermod version of SlimBean a few days ago. It is awesome, but there was one thing bothering me: None of the Icons you can choose (in Settings -> Interface -> Statusbar -> Battery Icon Style) pleased me. So I wanted to add other Icons to the menu. So I extracted the frameworks-res.apk, Settings.apk, SystemUI.apk and some more files and searched where this menu gets it's themes. The only thing I found after hours of investigating are the Icons you get, when you just select Icon in the Settings. I replaced those with my own and it worked, but I have two problems with this.
1. The default Icon does not support 1% steps (which the other selectable Icons do)
2. It doesn't complie with the idea behind this menu
Does anyone know how this menu works and where I can add my ressources? Or at least where the other options in the menu are stored? I searched the whole Rom by now. :crying:
Cheers,
Darky
PS: This was supposed to go in the developer thread for this Rom, but as a new user I could not post there :/ .
I'm not sure how to change it to *exactly* the icon you want (custom icons), I've never done it. What you can do is look in the themes and apps section, there's mods to flash a different battery icon. Should be plenty which are compatible.
Sent from a galaxy far, far away
I just found it in the source code:
github.com/SlimRoms/frameworks_base/blob/8c3428ebc393c112bef6ff3ab845ab61942de784/packages/SystemUI/src/com/android/systemui/statusbar/policy/CircleBattery.java
Unfortunately it's hardcoded. In the same package is a BatteryBarController.java which holds constants for each of the options. So without modifying and recompiling/flashing the whole Rom it is not possible as far as I understand it.
I will try one of these BatteryMods to get the 1% steps and modify SystemUI.
Edit: I just modified the SystemUI.apk myself to get the 1% steps. The files to modify are in /res/drawable: stat_sys_battery.xml and stat_sys_battery_charge.xml.
It is enough to just add steps from 0 to 100 in those files and add the images under res/drawable-hdpi.
The input can be produced easily with a pythonscript like this.
Code:
#!/usr/bin/env python3.3
def main():
for i in range(101):
#for stat_sys_battery.xml remove 'sys_battery_charge_anim'
print (' <item android:drawable="@drawable/stat_sys_battery_charge_anim',i,'" android:maxLevel="',i,'" />',sep='')
if __name__ == "__main__":
main()
Cheers,
Darky

(Tutorial) How to Mod Dark look on PA 4 Custom Rom

Hi, this is my first tutorial mod for droid razr, i will share how to change black gradient looks on Paranoid Android Rom become to solid black like on Slimkat rom with TRDS mode On xD . Some people maybe use xposed framework and module but i try to mod the framework because i dont use xposed . This mod also affect on other apps which use holo dark background like root explorer, safestrap, calculator etc.
For this Mod you will need
- PA rom ( i currently use PA 4 beta 7 for umts spyder)
- Apk tool/apk multitool/Ricky Kitchen tool etc
- Notepad ++
- Winrar/Winzip
- Patient and brain LOL
1. First you must know how to decompile and compile APK, i am using Ricky Rom Kitchen for doing this but you can another apps too like APK Multitool, APK tool etc
2. Now time to mod, first take your framework-res.apk from rom (its located on system/framework) and decompile it
3. Now open with notepad++ >> framework-res.apk/res/drawable/background_holo_dark.xml
4. You will see this
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<gradient android:startColor="#ff000000" android:endColor="#ff272d33"" android:angle="270.0" />
</shape>
5. Change android:endColor="#ff272d33"" with android:endColor="#ff000000" and save them
6. Compile it again but its not finish yet
7. Now on your apktool you will see unsignedframework-res.apk , open it with winzip and delete Meta-inf folder and androidmanifest xml and copy Meta-inf folder and androidmanifest.xml from original framework-res.apk
8. Rename unsignedframework-res.apk become framework-res.apk and copied back to your phone ( i recommend made a backup rom or just flashable zip framework-res.apk just in case if it failed and bootloop )
9. Now with Root Explorer copy your Framework-res.apk to the /system and set permission first RW-R-R and move it to framework folder, if its ask to overwrite answer yes
10. Reboot your phone and enjoy
this is how its look
credit :
- PA Rom for great work
- xda for great forum
- google for great machine lol
update with flashable zip, just instal it with your custom recovery
1. AOSPA Dark without crt animation >> https://www.dropbox.com/s/4v5wbap7da329be/aospa_dark.zip
2. AOSPA normal (back to original) >> https://www.dropbox.com/s/017fps0lzx0qcoe/aospa_normal.zip

Categories

Resources