[Galaxy Note GT-N7000 Android Development] majdinj:
Continue moddings!!

Change default home screen wallpaper and default lock screen wallpaper

1. Decompile framework-res.apk using APK-Multi tool

2. Go to \res\drawable-xhdpi folder and change the following pics to what you want:

default_wallpaper (Home screen wallpaper)

keyguard_default_wallpaper (Lock screen wallpaper)

3. Make sure to rename your wallpaper to the exact name as the one that you will change

4. Compile framework-res.apk and push it to your phone.

Here are some pics taken from SGN2: download

Battery theming

First download my battery icon packs from here and use it as a resource (of course you can create your own!!).

1. Decompile SystemUI.apk with APK-Multi tool.

2. In Battery icon pack folder choose your desired battery theme and copy all png icons ONLY.

3. Go to \res\drawable-xhdpi folder and paste your icons there.

4. Now go back to Battery icon pack folder and in your desired battery theme folder, copy the two xml files (stat_sys_battery.xml and stat_sys_battery_charge.xml).

5. Go to \res\drawable folder and paste them there and accept changes.

6. Recompile and push it to your phone.

4 Lockscreen shortcuts enabling

1- Decompile SecSettings.apk and go to smali/com/android/settings/lockscreenshortcut/LockScreenShortcutSettings.smali

2- Open this file with notpad++ and change the following line:

# direct methods
.method static constructor <clinit>()V
.locals 2

.prologue
const/4 v1, 0x0

.line 79
[COLOR="Red"][B]const/4 v0, 0x4[/B][/COLOR]

sput v0, Lcom/android/settings/lockscreenshortcut/LockScreenShortcutSettings;->MAX_SHORTCUT_ICON:I

to:

# direct methods
.method static constructor <clinit>()V
.locals 2

.prologue
const/4 v1, 0x0

.line 79
[B][COLOR="Blue"]const/4 v0, 0x3[/COLOR][/B]

sput v0, Lcom/android/settings/lockscreenshortcut/LockScreenShortcutSettings;->MAX_SHORTCUT_ICON:I

3- Save changes

4- (The following step is provided by tkari4; thanks man) For some region this feature is disabled like Germany :( ; So navigate to smali/com/android/settings folder and open LockscreenMenuSettings.smali and search for "ro.csc.country_code" and change the following (red to blue):

if-nez v4, :cond_5

const-string v4, "[B][COLOR="Red"]Germany[/COLOR][/B]"

const-string v7, "ro.csc.country_code"

invoke-static {v7}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;

to:

if-nez v4, :cond_5

const-string v4, "[B][COLOR="Blue"]none[/COLOR][/B]"

const-string v7, "ro.csc.country_code"

invoke-static {v7}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;

3- Save file and recompile and push to your phone.

Results example:

Toggle to choose AOSP lock screen

We need to do our changes to two files; android.policy.jar and SecSettings.apk

A. android.policy.jar:

1.	Decompile (backsmali) android.policy.jar

2.	Go to classout\com\android\internal\policy\impl and open LockPatternKeyguardView.smali

3.	Search for ".method createLockScreen()Landroid/view/View;" and the following lines (the blue ones):

.method createLockScreen()Landroid/view/View;
.registers 7

.prologue
.line 1351
[B][COLOR="Blue"]iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;

invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v0

const-string v1, "aosp_lock"

const/4 v2, 0x0

invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v0

if-nez v0, :cond_majdi[/COLOR][/B]

new-instance v0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;

iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;

iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;

iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;

iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;

invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/sec/CircleLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V

[B][COLOR="Blue"]goto :goto_yes[/COLOR][/B]

.line 1357
[B][COLOR="Blue"]:cond_majdi
new-instance v0, Lcom/android/internal/policy/impl/LockScreen;

iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;

iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;

iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;

iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;

invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V[/COLOR][/B]

.local v0, lockView:Landroid/view/View;
[B][COLOR="Blue"]:goto_yes[/COLOR][/B]
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V

.line 1358
return-object v0
.end method

4.	Save changes and compile (smali) your classout folder

B. SecSettings.apk:

1.	Decompile SecSettings.apk by APK-Multi-tool

2.	Go to /smali/com/android/settings/ folder and open LockscreenSettings.smali

3.	As Mirko_ddd did we will use an unused code with the form of (checkbox preference). Here it is "mSayCommand"

4.	Since this unused code is actually hidden, so we need to un-hide it first. Search for the following lines and delete them (the red lines only):

if-ge v9, v10, :cond_15

iget-object v9, p0, Lcom/android/settings/LockScreenSettings;-> mSayCommand:Landroid/preference/CheckBoxPreference;

if-eqz v9, :cond_11

[B][COLOR="Red"]invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;

move-result-object v9

iget-object v10, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;

invoke-virtual {v9, v10}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z[/COLOR][/B]

:cond_11
if-eqz v7, :cond_12

5.	Now search and replace all "mSayCommand" with "mAospLock" also search and replace all "wake_up_lock_screen" with "aosp_lock"

6.	Search for "say_your_wakeup" and replace it with "majdi_aosp_lock"

7.	Save changes and exit.

8.	Go to res\values folder and open strings.xml file and add the following strings at the end before </resource>:

<string name="aosp_lock_screen">AOSP Lockscreen</string>
<string name="aosp_lock_screen_description">Original Jelly Bean Lockscreen</string>

9.	Go to res\xml folder and open lockscreen_settings.xml file and add the following line at the end before </PreferenceScreen> (actually you can put it in a place that you want this mod to be shown in lock screen option menu later on):

<CheckBoxPreference android:title="@string/aosp_lock_screen" android:key="majdi_aosp_lock" android:summary="@string/aosp_lock_screen_description" />

10.	Save all changes and recompile. Push the modified files to your phone.

Results example:

Fixing home button lag

1.	Backsmali android.policy.jar

2.	G to classout\com\android\internal\policy\impl folder and open PhoneWindowManager.smali

3.	Search for ".method public interceptKeyBeforeDispatching" then search for "#statusbar:Lcom/android/internal/statusbar/IStatusBarService;" and go down for the line that has the following iput-boolean … with mHomePressed:Z field and add the following line bellow it (the blue one):

.line 3364
.end local v38 #statusbar:Lcom/android/internal/statusbar/IStatusBarService;
:cond_38c
:goto_38c
const/16 v46, 0x0

move/from16 v0, v46

move-object/from16 v1, p0

[B][COLOR="Red"]iput-boolean[/COLOR][/B] v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->[B][COLOR="Red"]mHomePressed:Z[/COLOR][/B]

[B][COLOR="Blue"]invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->goHome()Z[/COLOR][/B]

4. save changes and recompile (smali) the classout folder.

Permanent disabling of SMS, MMS & Email log history to be logged in call logs

1. Backsmali SecMms.apk.

2. Go to classout\com\android\mms\transaction folder and open MessagingNotification.smali file.

3. Now what you need to do is to search for any line that contains the following command "Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;", there might be 3 or 4 lines, and delete them all.

Example (delete the whole red line):

invoke-static {v6}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

move-result-object v6

[COLOR="Red"]invoke-virtual {v5, v6, v7}, [B]Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;[/B][/COLOR]

.line 1348
add-int/lit8 p2, p2, 0x1

4. save changes and recompile (smali) the classout folder.

Disabling scrolling cache across OS

1. Backsmali framework2.jar.

2. Navigate to classout\android\widget folder and open AbsListView.smali

3. Search for ".method private createScrollingCache()V" and change:

const/4 v1, 0x[B][COLOR="Red"]1[/COLOR][/B]

to:

const/4 v1, 0x[B][COLOR="Blue"]0[/COLOR][/B]

4. Search for ".method public setScrollingCacheEnabled(Z)V" and change:

.parameter "[B][COLOR="Red"]enabled[/COLOR][/B]"

to:

.parameter "[B][COLOR="Blue"]disabled[/COLOR][/B]"

5. Save changes and recompile (smali) your file and push to your phone.

Center clock in status bar

1. Decompile SystemUI.apk by Apk-Multi tool

2. Navigate to /res/layout/ folder and open tw_status_bar.xml

3. Delete all these lines:

<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="0.0dip" android:paddingRight="2.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:id="@id/left_icons" android:paddingLeft="4.0dip" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<TextView android:textSize="15.0dip" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
<ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
<ImageView android:id="@id/doNotDisturbIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tw_dnd" android:alpha="0.7" android:scaleX="0.85" android:scaleY="0.85" />
<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:orientation="horizontal" android:id="@id/right_icons" android:paddingRight="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<LinearLayout android:gravity="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/tw_signal_cluster_view" />
<TextView android:textSize="12.0dip" android:textColor="#ffa6a6a6" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" />
<ImageView android:gravity="center" android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<com.android.systemui.statusbar.policy.Clock android:textSize="@dimen/status_bar_clock_text_size" android:textColor="#ff959595" android:ellipsize="none" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />
</LinearLayout>

and substitute with the following:

<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="1.0dip" android:paddingRight="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:id="@id/left_icons" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<TextView android:textSize="15.0dip" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
<ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
<ImageView android:id="@id/doNotDisturbIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tw_dnd" android:alpha="0.7" android:scaleX="0.85" android:scaleY="0.85" />
<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:textSize="@dimen/status_bar_clock_text_size" android:textColor="#[B][COLOR="Red"]ffffffff[/COLOR][/B]" 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/right_icons" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentRight="true">
<LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<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/tw_signal_cluster_view" />
<TextView android:textSize="12.0dip" android:textColor="#ffa6a6a6" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" />
<ImageView android:gravity="center" android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

4. Save changes, recompile and push to your phone

Results: