[Samsung Epic 4G Touch] tdunham:
AOSP Lockscreen Toggle Mod

Ported this mod over from the SII.

Enable or disable the AOSP lockscreen from the Settings/Display menu.

Thanks go out to Mirko ddd for the info here: http://xdaforums.com/showthread.php?t=1689376

SETTINGS.APK

res/values/strings.xml

Add 2 new lines:

<string name="aosp_lock_title">AOSP Lockscreen</string>
<string name="aosp_lock_summary">Enable AOSP Lockscreen</string>

res/xml/display_settings.xml

Add 1 new line:

</PreferenceScreen>
[COLOR="Blue"]<CheckBoxPreference android:title="@string/aosp_lock_title" android:summary="@string/aosp_lock_summary" android:key="aosp_lock" />[/COLOR]
<CheckBoxPreference android:title="@string/clock" android:key="clock" android:summary="@string/clock_summary" />

Settings Classes.dex

com/android/settings/DisplaySettings.smali

FIND AROUND LINE 48:

.field private mWeatherSettings:Landroid/preference/PreferenceScreen;

BEFORE:

.field private mWeatherSettings:Landroid/preference/PreferenceScreen;

# direct methods

AFTER:

.field private mWeatherSettings:Landroid/preference/PreferenceScreen;

.field private mAospLock:Landroid/preference/Preference;

# direct methods

FIND AROUND LINE 953:

invoke-virtual {v0, v1}, Lcom/android/settings/DisplaySettings;->addPreferencesFromResource(I)V

BEFORE:

invoke-virtual {v0, v1}, Lcom/android/settings/DisplaySettings;->addPreferencesFromResource(I)V

.line 165
const-string v20, "clock"

AFTER:

invoke-virtual {v0, v1}, Lcom/android/settings/DisplaySettings;->addPreferencesFromResource(I)V

const-string v20, "aosp_lock"

move-object/from16 v0, p0

move-object/from16 v1, v20

invoke-virtual {v0, v1}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

move-result-object v20

check-cast v20, Landroid/preference/CheckBoxPreference;

move-object/from16 v0, v20

move-object/from16 v1, p0

iput-object v0, v1, Lcom/android/settings/DisplaySettings;->mAospLock:Landroid/preference/Preference;

.line 165
const-string v20, "clock"

FIND AROUND LINE 3156:

:cond_173

BEFORE:

:cond_173
iget-object v10, p0, Lcom/android/settings/DisplaySettings;->mBatteryPercentage:Landroid/preference/CheckBoxPreference;

AFTER:

:cond_173
iget-object v4, p0, Lcom/android/settings/DisplaySettings;->mAospLock:Landroid/preference/Preference;

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

move-result v4

if-eqz v4, :cond_83

const-string v3, "aosp_lock"

iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mAospLock:Landroid/preference/Preference;

check-cast v0, Landroid/preference/CheckBoxPreference;

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

move-result v2

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

move-result-object v4

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

goto :cond_44

:cond_83
iget-object v10, p0, Lcom/android/settings/DisplaySettings;->mBatteryPercentage:Landroid/preference/CheckBoxPreference;

Android.Policy.Jar

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

FIND AROUND LINE 3272:

.local v0, lockView:Landroid/view/View;
iget-boolean v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->CIRCLELOCK_MODE:Z

if-eqz v1, :cond_18

REPLACE WITH:

.local v0, lockView:Landroid/view/View;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;

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

move-result-object v1

const-string v2, "aosp_lock"

const/4 v3, 0x0

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

move-result v1

if-eqz v1, :cond_23

Pay attention to the last few. Most of them are simply changing the word 'LockScreen' to 'CircleLockScreen' and vice versa. No need to copy and paste over entire lines. ;)

FIND AROUND LINE 3290:

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

CHANGE TO:

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

FIND AROUND LINE 3303:

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

CHANGE TO:

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

FIND AROUND LINE 3314:

:cond_18

CHANGE TO:

:cond_23

FIND AROUND LINE 3315:

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

CHANGE TO:

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

FIND AROUND LINE 3328:

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

CHANGE TO:

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