[Defy General] espaciosalter20:
CENTER CLOCK MOD​

here are the modded files if you don't want to work this by yourself.

Ok guys, this is the way for make center clock on your cm10 build.

First of all, you need the apktool, zipalign and baksmali/smali tools that i'm going to provide you within this tutorial, notepad++ on your pc and root explorer on your phone.

Here is the step-by-step (on windows):

1. Extract apktool to a new folder.

2. Copy framework-res.apk and SystemUI.apk from your phone or from cm10 zip to your apktool folder.

3. Create a backup file of your original SystemUI.apk, name it whatever you want (preferably, backup.apk)

4. open cmd and go to your apktool folder.

5. Set up your framework:

java -jar apktool.jar if framework-res.apk

6. Now Decompile SystemUI.apk:

java -jar apktool.jar d SystemUI.apk

7. In explorer, open your apktool folder and look for this path: /SystemUI/res/layout/

8. Open with notepad++ status_bar.xml and copy the following code:

<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:id="@id/status_bar" android:background="@drawable/status_bar_background" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<ImageView android:id="@id/notification_lights_out" android:paddingLeft="6.0dip" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" />
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="2.0dip" android:paddingRight="2.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" />
</LinearLayout>
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
</LinearLayout>
<LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<include android:id="@id/signal_cluster_text" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_text_view" />
<TextView android:textAppearance="@style/TextAppearance.StatusBar.Battery" android:id="@id/battery_text" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="-3.0dip" android:singleLine="true" />
<ImageView android:id="@id/battery" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
</ImageSwitcher>
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>

9. Save your status_bar.xml

10. Recompile your file

java -jar apktool.jar b SystemUI New_SystemUI.apk

11. Once it is done building you need to open the backup apk you made at the beginning with Winzip, Winrar, 7zip or your prefered compress tool. Also open New_SystemUI.apk with Winzip, Winrar, 7zip or your prefered compress tool. From inside the New_SystemUI.apk drag resources.arsc and classes.dex to the root of backup.apk and it will replace resources.arsc that is in the apk. You are almost done. From inside New_SystemUI.apk drag the res folder into the backup apk.

12. Copy this modified backup file to Zipalign folder and run the ZipAlign executable. Then run the .bat file. You will find your zipaligned file on the "ZipAlignedApps" folder.

13. Copy the file to your phone.

14. Using Root Explorer, copy your new SystemUI.apk to /system/app, and set 644 permissions ((rw-r--r--) or (tick Read: owner, group, others / Write: owner)

15. Reboot your phone and Enjoy!!!

SMOOTHCROLL MOD​

Here is the step-by-step (on windows):

1. Extract the baksmali/smali tool to a new folder and put the framework.jar in same folder.

2. Run baksmali manager.bat.

3. Select framework.jar by pressing 4 -> 2 in main menu.

4. Press 1 to Baksmali the framework.jar.

5. Make it sure that new 'framework' folder is created and files inside it. (Don't close the baksmali manager window yet!)

6. Open the framework/android/widget/AbsListView.smali with notepad++.

7. Search for ".method private createScrollingCache"

(change red value to green value)

.prologue

const/4 v1, 0x1 0x0

8. Search for ".method private initAbsListView"

(change red value to green value)

.line 808

invoke-virtual {p0, v1v2}, Landroid/widget/AbsListView;->setScrollingCacheEnabled(Z)V

9. Search for ".method public setScrollingCacheEnabled (Z)"

(change red value to green value)

.registers 3

.parameter "enabled"disabled

10. Save the file and close notepad++

11. Come back to baksmali manager window.

12. Press 2 to smali

13. After smali, it will appear a "classes.dex" file on your baksmali/smali folder.

14. Open framework.jar with Winzip, Winrar, 7zip or your prefered compress tool

15. Drag and Drop the new classes.dex into framework.jar and replace the old one.

16. Put modified framework.jar to your phone's sdcard.

17. Copy that file to /system/framework and replace original one.

18. Give proper permissions (rw-r--r--) or (644) or (tick Read: owner, group, others / Write: owner)

19. Restart your phone and enjoy!!!