[Android General] Mohitash:
***Here is a guide for activating AOSP Lockscreen on Samsung ICS devices ***​

This guide is specially for GT-S7562. But should work for other Samsung ICS devices also. Values may differ.

Here, we will edit two files:

SecSettings.apk

android.policy.jar

Here we start---

First, we will activate Aosp lockscreen:

Decomiple android.policy.jar

Open smali/com/android/internal/policy/impl/LockPatternKeyguardView.smali

Search for

.method createLockScreen()Landroid/view/View;

Add blue lines

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

.prologue
.line 1460
[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_1f[/COLOR]

new-instance v0, Lcom/android/internal/policy/impl/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/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

.line 1466
.local v0, lockView:Landroid/view/View;
invoke-virtual {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V

.line 1467
return-object v0
.end method

Save and recompile android.policy.jar

Aosp Lockscreen is activated.

Now we will create on/off toggle in settings

Decompile SecSettings.apk

Open /smali/com/android/settings/LockscreenSettings.smali

Remove red line and add blue one

# instance fields
.field private isWeatherEnabled:Z

[COLOR="Blue"].field private mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]

.field private mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;

.field private mClock:Landroid/preference/CheckBoxPreference;

.field private mDualclock:Landroid/preference/SwitchPreferenceScreen;

.field private mHelpText:Landroid/preference/CheckBoxPreference;

.field private mInformationTicker:Landroid/preference/SwitchPreferenceScreen;

.field private mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

.field private mLockScreenShortcut:Landroid/preference/SwitchPreferenceScreen;

.field private mMotionDialog:Landroid/app/AlertDialog;

.field private mRippleEffect:Landroid/preference/CheckBoxPreference;

[COLOR="Red"].field private mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]

.field private mWeather:Landroid/preference/SwitchPreferenceScreen;

Search-

const-string v6, "unlock_text"

-In line 363

const-string v6, "unlock_text"

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

move-result v2

if-eqz v2, :cond_ed

move v2, v3

:goto_a2
invoke-virtual {v5, v2}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

.line 248
:cond_a5
[COLOR="Red"]iget-object v2, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]

[COLOR="blue"]iget-object v2, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]

if-eqz v2, :cond_bb

.line 249
[COLOR="Red"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]

[COLOR="Blue"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]

invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v2

[COLOR="Blue"]const-string v6, "aosp_lock"[/COLOR]

[COLOR="red"]const-string v6, "wake_up_lock_screen"[/COLOR]

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

move-result v2

Search-

const-string v5, "say_your_wakeup"

-In line 991

const-string v5, "say_your_wakeup"

invoke-virtual {p0, v5}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

move-result-object v5

check-cast v5, Landroid/preference/CheckBoxPreference;

[COLOR="blue"]iput-object v5, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]

[COLOR="Red"]iput-object v5, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]

.line 183
[COLOR="red"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]

[COLOR="blue"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]

invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getResources()Landroid/content/res/Resources;

move-result-object v8

const v9, 0x7f0d0b8f

Search-

.local v1, pm:Landroid/content/pm/PackageManager;

-In line 1081

.local v1, pm:Landroid/content/pm/PackageManager;
invoke-virtual {v1, v4, v7}, Landroid/content/pm/PackageManager;->queryIntentActivities(Landroid/content/Intent;I)Ljava/util/List;

move-result-object v0

.line 199
.local v0, list:Ljava/util/List;,"Ljava/util/List<Landroid/content/pm/ResolveInfo;>;"
invoke-interface {v0}, Ljava/util/List;->size()I

move-result v5

[COLOR="blue"]if-ge v5, v6, :cond_1aa[/COLOR]

[COLOR="red"]if-ge v5, v6, :cond_1b3[/COLOR]

.line 200
[COLOR="red"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]

[COLOR="blue"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;	[/COLOR]

[COLOR="red"]if-eqz v5, :cond_1aa[/COLOR]

[COLOR="blue"]if-eqz v5, :cond_1a1[/COLOR]

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

move-result-object v5

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

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

.line 202
[COLOR="red"]:cond_1aa
if-eqz v3, :cond_1b3[/COLOR]

[COLOR="blue"]:cond_1a1
if-eqz v3, :cond_1aa[/COLOR]

.line 203
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;

move-result-object v5

invoke-virtual {v5, v3}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z

.line 208
.end local v0 #list:Ljava/util/List;,"Ljava/util/List<Landroid/content/pm/ResolveInfo;>;"
.end local v1 #pm:Landroid/content/pm/PackageManager;
[COLOR="red"]:cond_1b3[/COLOR]
[COLOR="blue"]:cond_1aa[/COLOR]
return-void

.end local v3 #setWakeupCommand:Landroid/preference/PreferenceScreen;
.end local v4 #set_wakeup_commant_intent:Landroid/content/Intent;
[COLOR="red"]:cond_1b4[/COLOR]
[COLOR="blue"]:cond_1ab[/COLOR]
move v5, v7

Search-

wake_up_lock_screen

-In line 2382 (after editing all above lines)

.line 282
:cond_ad
[COLOR="red"]iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]

[COLOR="blue"]iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;	[/COLOR]

invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

move-result v4

if-eqz v4, :cond_1e

.line 283
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v4

[COLOR="red"] const-string v5, "wake_up_lock_screen"

iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]

[COLOR="blue"]const-string v5, "aosp_lock"

iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]

invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z

move-result v6

if-eqz v6, :cond_c8

:goto_c3
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

goto/16 :goto_1e

:cond_c8
move v2, v3

goto :goto_c3
.end method

Save it and now open res/xml/lockscreen_settings.xml

add edit-

[COLOR="red"]<CheckBoxPreference android:title="@string/samsung_unlock_option_say_your_wakeup_command_to_unlock_screen" android:key="say_your_wakeup" android:summary="@string/wakeup_in_lockscreen_summary" />[/COLOR]

[COLOR="Blue"]<CheckBoxPreference android:title="@string/aosp_title" android:key="say_your_wakeup" android:summary="@string/aosp_summary" />[/COLOR]

Save it.

Now open res/values/strings.xml and add these lines in the end.

<string name="aosp_title">AOSP Lockscreen</string>
<string name="aosp_summary">Official ICS lock screen</string>

Save it and recompile SecSettings.apk

Thats it. :)

These screenshots are from PMP™ Ultra ROM

Enjoy AOSP Lockscreen on your Samsung ICS Device :laugh::good: