[GUIDE][HOW TO] Quick PIN Unlock And Scramble Pad For Lollipop - Galaxy S 5 Android Development (Snapdragon)

This is a how to add quick pin unlock and scramble pad to lollipop. It has been tested and working on s5, s6, note 3 and possibly note 4.
This is a guide for people to add it themselves, not for people to upload their files and expect it done for them. It does require the ability to decompile and compile apks and is done with making a toggle for it in custom settings which can be found in this great thread here so it can be toggled on or off depending on what people want to use.
For this mod we will be modifying SystemUI from system/priv-app. It requires 3 files to be modified and 2 to be added which are attached to this post.
Download and extract the attached zip and place the two smali files into
Code:
com/android/keyguard/
in the same folder com/android/keyguard/ look for these 3 files which we will need to modify for this.
KeyguardPINView.smali
PasswordTextView.smali
NumPadKey.smali
Lets start with NumPadKey.smali
look for this method which should be near the top
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
and look for the following section of code in that method
Code:
iget-object v5, p0, Lcom/android/keyguard/NumPadKey;->mContext:Landroid/content/Context;
sget v6, Lcom/android/keyguard/R$drawable;->lock_ripple_drawable:I
invoke-virtual {v5, v6}, Landroid/content/Context;->getDrawable(I)Landroid/graphics/drawable/Drawable;
above the iget we will add this line
Code:
invoke-direct {p0}, Lcom/android/keyguard/NumPadKey;->updateText()V
so it should look something like this
Code:
invoke-direct {p0}, Lcom/android/keyguard/NumPadKey;->updateText()V
iget-object v5, p0, Lcom/android/keyguard/NumPadKey;->mContext:Landroid/content/Context;
sget v6, Lcom/android/keyguard/R$drawable;->lock_ripple_drawable:I
invoke-virtual {v5, v6}, Landroid/content/Context;->getDrawable(I)Landroid/graphics/drawable/Drawable;
Now look for the following line
Code:
# virtual methods
and add this whole method above it
Code:
.method private updateText()V
.locals 4
.prologue
.line 122
iget v2, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I
if-ltz v2, :cond_1
.line 123
iget-object v2, p0, Lcom/android/keyguard/NumPadKey;->mDigitText:Landroid/widget/TextView;
iget v3, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I
invoke-static {v3}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 124
sget-object v2, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;
if-nez v2, :cond_0
.line 125
invoke-virtual {p0}, Lcom/android/keyguard/NumPadKey;->getResources()Landroid/content/res/Resources;
move-result-object v2
sget v3, Lcom/android/keyguard/R$array;->lockscreen_num_pad_klondike:I
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getStringArray(I)[Ljava/lang/String;
move-result-object v2
sput-object v2, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;
.line 127
:cond_0
sget-object v2, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;
if-eqz v2, :cond_1
sget-object v2, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;
array-length v2, v2
iget v3, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I
if-le v2, v3, :cond_1
.line 128
sget-object v2, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;
iget v3, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I
aget-object v0, v2, v3
.line 129
.local v0, "klondike":Ljava/lang/String;
invoke-virtual {v0}, Ljava/lang/String;->length()I
move-result v1
.line 130
.local v1, "len":I
if-lez v1, :cond_2
.line 131
iget-object v2, p0, Lcom/android/keyguard/NumPadKey;->mKlondikeText:Landroid/widget/TextView;
invoke-virtual {v2, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 137
.end local v0 # "klondike":Ljava/lang/String;
.end local v1 # "len":I
:cond_1
:goto_0
return-void
.line 133
.restart local v0 # "klondike":Ljava/lang/String;
.restart local v1 # "len":I
:cond_2
iget-object v2, p0, Lcom/android/keyguard/NumPadKey;->mKlondikeText:Landroid/widget/TextView;
const/4 v3, 0x4
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setVisibility(I)V
goto :goto_0
.end method
Now anywhere under the virtual method line add the following whole method. It can be right at the end of the smali if want, thats where I usually add it
Code:
.method public setDigit(I)V
.locals 0
.param p1, "digit" # I
.prologue
.line 117
iput p1, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I
.line 118
invoke-direct {p0}, Lcom/android/keyguard/NumPadKey;->updateText()V
.line 119
return-void
.end method
That it for that smali and move onto the next
so now we will modify PasswordTextView.smali.
at the start of this file you will see
Code:
# annotations
To this annotation
Code:
.annotation system Ldalvik/annotation/MemberClasses;
we will add the following
Code:
Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
so it will look like this for example. Note some devices may have more values there, do not remove and values just ass the quick unlock listener value
Code:
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/keyguard/PasswordTextView$CharState;,
Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
}
.end annotation
now also up the top look for
Code:
# instance fields
and add the following field below that
Code:
.field protected mQuickUnlockListener:Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
now find the following method
Code:
.method public append(C)V
and in it look for the following section of code
Code:
:cond_1
invoke-direct {p0}, Lcom/android/keyguard/PasswordTextView;->userActivity()V
.line 296
const-wide/16 v4, 0x0
invoke-direct {p0, v4, v5}, Lcom/android/keyguard/PasswordTextView;->showAndHideHint(J)V
and add this below it
Code:
iget-object v4, p0, Lcom/android/keyguard/PasswordTextView;->mQuickUnlockListener:Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
if-eqz v4, :cond_next
.line 215
iget-object v4, p0, Lcom/android/keyguard/PasswordTextView;->mQuickUnlockListener:Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
iget-object v5, p0, Lcom/android/keyguard/PasswordTextView;->mText:Ljava/lang/String;
invoke-interface {v4, v5}, Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;->onValidateQuickUnlock(Ljava/lang/String;)V
:cond_next
return-void
so it looks like this for example
Code:
:cond_1
invoke-direct {p0}, Lcom/android/keyguard/PasswordTextView;->userActivity()V
const-wide/16 v4, 0x0
invoke-direct {p0, v4, v5}, Lcom/android/keyguard/PasswordTextView;->showAndHideHint(J)V
iget-object v4, p0, Lcom/android/keyguard/PasswordTextView;->mQuickUnlockListener:Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
if-eqz v4, :cond_next
iget-object v4, p0, Lcom/android/keyguard/PasswordTextView;->mQuickUnlockListener:Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
iget-object v5, p0, Lcom/android/keyguard/PasswordTextView;->mText:Ljava/lang/String;
invoke-interface {v4, v5}, Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;->onValidateQuickUnlock(Ljava/lang/String;)V
:cond_next
return-void
goto :goto_0
.end local v0 # "charState":Lcom/android/keyguard/PasswordTextView$CharState;
:cond_2
iget-object v4, p0, Lcom/android/keyguard/PasswordTextView;->mTextChars:Ljava/util/ArrayList;
add-int/lit8 v5, v1, -0x1
invoke-virtual {v4, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
then at the end of the smali add this whole method
Code:
.method public setQuickUnlockListener(Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;)V
.locals 0
.param p1, "listener" # Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
.prologue
.line 101
iput-object p1, p0, Lcom/android/keyguard/PasswordTextView;->mQuickUnlockListener:Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
.line 102
return-void
.end method
Now we move on to the final smali KeyguardPINView.smali
look for this at the top
Code:
# static fields
and add the following field
Code:
.field private static sNumbers:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List",
"<",
"Ljava/lang/Integer;",
">;"
}
.end annotation
.end field
also under this line
Code:
# instance fields
you may need to add the following line if it is not present already. It already exists on s5 and note 3 but needs to be added for s6. So if it is not there then add it
Code:
.field private mDivider:Landroid/view/View;
now look for
Code:
# direct methods
which should be not far from the above added lines and add the following constructor method
Code:
.method static constructor <clinit>()V
.locals 7
.prologue
const/4 v6, 0x4
const/4 v5, 0x3
const/4 v4, 0x2
const/4 v2, 0x1
const/4 v3, 0x0
.line 48
const/16 v0, 0xa
new-array v0, v0, [Ljava/lang/Integer;
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
aput-object v1, v0, v3
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
aput-object v1, v0, v2
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
aput-object v1, v0, v4
invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
aput-object v1, v0, v5
const/4 v1, 0x5
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
aput-object v1, v0, v6
const/4 v1, 0x5
const/4 v2, 0x6
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v0, v1
const/4 v1, 0x6
const/4 v2, 0x7
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v0, v1
const/4 v1, 0x7
const/16 v2, 0x8
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v0, v1
const/16 v1, 0x8
const/16 v2, 0x9
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v0, v1
const/16 v1, 0x9
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v0, v1
invoke-static {v0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
move-result-object v0
sput-object v0, Lcom/android/keyguard/KeyguardPINView;->sNumbers:Ljava/util/List;
return-void
.end method
look for this access
Code:
.method static synthetic access$000(Lcom/android/keyguard/KeyguardPINView;Z)V
and add the following two methods below that method
Code:
.method static synthetic access$100(Lcom/android/keyguard/KeyguardPINView;Ljava/lang/String;)V
.locals 0
.param p0, "x0" # Lcom/android/keyguard/KeyguardPINView;
.param p1, "x1" # Ljava/lang/String;
.prologue
.line 37
invoke-direct {p0, p1}, Lcom/android/keyguard/KeyguardPINView;->validateQuickUnlock(Ljava/lang/String;)V
return-void
.end method
Code:
.method private validateQuickUnlock(Ljava/lang/String;)V
.locals 3
.param p1, "password" # Ljava/lang/String;
.prologue
const/4 v2, 0x1
.line 198
if-eqz p1, :cond_0
.line 199
invoke-virtual {p1}, Ljava/lang/String;->length()I
move-result v0
const/4 v1, 0x3
if-le v0, v1, :cond_0
iget-object v0, p0, Lcom/android/keyguard/KeyguardPINView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
invoke-virtual {v0, p1}, Lcom/android/internal/widget/LockPatternUtils;->checkPassword(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_0
.line 201
iget-object v0, p0, Lcom/android/keyguard/KeyguardPINView;->mCallback:Lcom/android/keyguard/KeyguardSecurityCallback;
invoke-interface {v0, v2}, Lcom/android/keyguard/KeyguardSecurityCallback;->reportUnlockAttempt(Z)V
.line 202
iget-object v0, p0, Lcom/android/keyguard/KeyguardPINView;->mCallback:Lcom/android/keyguard/KeyguardSecurityCallback;
invoke-interface {v0, v2}, Lcom/android/keyguard/KeyguardSecurityCallback;->dismiss(Z)V
.line 203
invoke-virtual {p0, v2}, Lcom/android/keyguard/KeyguardPINView;->resetPasswordText(Z)V
.line 206
:cond_0
return-void
.end method
now look for this method
Code:
.method protected onFinishInflate()V
and replace the whole method with this one
Code:
.method protected onFinishInflate()V
.locals 12
.prologue
const/4 v9, 0x1
const/4 v10, 0x0
.line 77
invoke-super {p0}, Lcom/android/keyguard/KeyguardPinBasedInputView;->onFinishInflate()V
.line 78
sget v8, Lcom/android/keyguard/R$id;->keyguard_bouncer_frame:I
invoke-virtual {p0, v8}, Lcom/android/keyguard/KeyguardPINView;->findViewById(I)Landroid/view/View;
move-result-object v8
check-cast v8, Landroid/view/ViewGroup;
iput-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mKeyguardBouncerFrame:Landroid/view/ViewGroup;
.line 79
sget v8, Lcom/android/keyguard/R$id;->row0:I
invoke-virtual {p0, v8}, Lcom/android/keyguard/KeyguardPINView;->findViewById(I)Landroid/view/View;
move-result-object v8
check-cast v8, Landroid/view/ViewGroup;
iput-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mRow0:Landroid/view/ViewGroup;
.line 80
sget v8, Lcom/android/keyguard/R$id;->row1:I
invoke-virtual {p0, v8}, Lcom/android/keyguard/KeyguardPINView;->findViewById(I)Landroid/view/View;
move-result-object v8
check-cast v8, Landroid/view/ViewGroup;
iput-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mRow1:Landroid/view/ViewGroup;
.line 81
sget v8, Lcom/android/keyguard/R$id;->row2:I
invoke-virtual {p0, v8}, Lcom/android/keyguard/KeyguardPINView;->findViewById(I)Landroid/view/View;
move-result-object v8
check-cast v8, Landroid/view/ViewGroup;
iput-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mRow2:Landroid/view/ViewGroup;
.line 82
sget v8, Lcom/android/keyguard/R$id;->row3:I
invoke-virtual {p0, v8}, Lcom/android/keyguard/KeyguardPINView;->findViewById(I)Landroid/view/View;
move-result-object v8
check-cast v8, Landroid/view/ViewGroup;
iput-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mRow3:Landroid/view/ViewGroup;
.line 83
sget v8, Lcom/android/keyguard/R$id;->divider:I
invoke-virtual {p0, v8}, Lcom/android/keyguard/KeyguardPINView;->findViewById(I)Landroid/view/View;
move-result-object v8
iput-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mDivider:Landroid/view/View;
.line 85
invoke-virtual {p0}, Lcom/android/keyguard/KeyguardPINView;->getContext()Landroid/content/Context;
move-result-object v8
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v8
const-string v11, "lockscreen_quick_unlock_control"
invoke-static {v8, v11, v10}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v8
if-ne v8, v9, :cond_1
move v4, v9
.line 88
.local v4, "quickUnlock":Z
:goto_0
invoke-virtual {p0}, Lcom/android/keyguard/KeyguardPINView;->getContext()Landroid/content/Context;
move-result-object v8
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v8
const-string v11, "lockscreen_scramble_pin_layout"
invoke-static {v8, v11, v10}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v8
if-ne v8, v9, :cond_2
move v5, v9
.line 91
.local v5, "scramblePin":Z
:goto_1
if-eqz v5, :cond_5
.line 92
sget-object v8, Lcom/android/keyguard/KeyguardPINView;->sNumbers:Ljava/util/List;
invoke-static {v8}, Ljava/util/Collections;->shuffle(Ljava/util/List;)V
.line 94
sget v8, Lcom/android/keyguard/R$id;->keyguard_bouncer_frame:I
invoke-virtual {p0, v8}, Lcom/android/keyguard/KeyguardPINView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/LinearLayout;
.line 95
.local v0, "bouncer":Landroid/widget/LinearLayout;
new-instance v7, Ljava/util/ArrayList;
invoke-direct {v7}, Ljava/util/ArrayList;-><init>()V
.line 96
.local v7, "views":Ljava/util/List;, "Ljava/util/List<Lcom/android/keyguard/NumPadKey;>;"
const/4 v1, 0x0
.local v1, "i":I
:goto_2
invoke-virtual {v0}, Landroid/widget/LinearLayout;->getChildCount()I
move-result v8
if-ge v1, v8, :cond_4
.line 97
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;
move-result-object v8
instance-of v8, v8, Landroid/widget/LinearLayout;
if-eqz v8, :cond_3
.line 98
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;
move-result-object v3
check-cast v3, Landroid/widget/LinearLayout;
.line 99
.local v3, "nestedLayout":Landroid/widget/LinearLayout;
const/4 v2, 0x0
.local v2, "j":I
:goto_3
invoke-virtual {v3}, Landroid/widget/LinearLayout;->getChildCount()I
move-result v8
if-ge v2, v8, :cond_3
.line 100
invoke-virtual {v3, v2}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;
move-result-object v6
.line 101
.local v6, "view":Landroid/view/View;
invoke-virtual {v6}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v8
const-class v9, Lcom/android/keyguard/NumPadKey;
if-ne v8, v9, :cond_0
.line 102
check-cast v6, Lcom/android/keyguard/NumPadKey;
.end local v6 # "view":Landroid/view/View;
invoke-interface {v7, v6}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 99
:cond_0
add-int/lit8 v2, v2, 0x1
goto :goto_3
.end local v0 # "bouncer":Landroid/widget/LinearLayout;
.end local v1 # "i":I
.end local v2 # "j":I
.end local v3 # "nestedLayout":Landroid/widget/LinearLayout;
.end local v4 # "quickUnlock":Z
.end local v5 # "scramblePin":Z
.end local v7 # "views":Ljava/util/List;, "Ljava/util/List<Lcom/android/keyguard/NumPadKey;>;"
:cond_1
move v4, v10
.line 85
goto :goto_0
.restart local v4 # "quickUnlock":Z
:cond_2
move v5, v10
.line 88
goto :goto_1
.line 96
.restart local v0 # "bouncer":Landroid/widget/LinearLayout;
.restart local v1 # "i":I
.restart local v5 # "scramblePin":Z
.restart local v7 # "views":Ljava/util/List;, "Ljava/util/List<Lcom/android/keyguard/NumPadKey;>;"
:cond_3
add-int/lit8 v1, v1, 0x1
goto :goto_2
.line 109
:cond_4
const/4 v1, 0x0
:goto_4
sget-object v8, Lcom/android/keyguard/KeyguardPINView;->sNumbers:Ljava/util/List;
invoke-interface {v8}, Ljava/util/List;->size()I
move-result v8
if-ge v1, v8, :cond_5
.line 110
invoke-interface {v7, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v6
check-cast v6, Lcom/android/keyguard/NumPadKey;
.line 111
.local v6, "view":Lcom/android/keyguard/NumPadKey;
sget-object v8, Lcom/android/keyguard/KeyguardPINView;->sNumbers:Ljava/util/List;
invoke-interface {v8, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v8
check-cast v8, Ljava/lang/Integer;
invoke-virtual {v8}, Ljava/lang/Integer;->intValue()I
move-result v8
invoke-virtual {v6, v8}, Lcom/android/keyguard/NumPadKey;->setDigit(I)V
.line 109
add-int/lit8 v1, v1, 0x1
goto :goto_4
.line 115
.end local v0 # "bouncer":Landroid/widget/LinearLayout;
.end local v1 # "i":I
.end local v6 # "view":Lcom/android/keyguard/NumPadKey;
.end local v7 # "views":Ljava/util/List;, "Ljava/util/List<Lcom/android/keyguard/NumPadKey;>;"
:cond_5
if-eqz v4, :cond_6
.line 116
iget-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mPasswordEntry:Lcom/android/keyguard/PasswordTextView;
new-instance v9, Lcom/android/keyguard/KeyguardPINView$2;
invoke-direct {v9, p0}, Lcom/android/keyguard/KeyguardPINView$2;-><init>(Lcom/android/keyguard/KeyguardPINView;)V
invoke-virtual {v8, v9}, Lcom/android/keyguard/PasswordTextView;->setQuickUnlockListener(Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;)V
.line 124
:goto_5
return-void
.line 122
:cond_6
iget-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mPasswordEntry:Lcom/android/keyguard/PasswordTextView;
const/4 v9, 0x0
invoke-virtual {v8, v9}, Lcom/android/keyguard/PasswordTextView;->setQuickUnlockListener(Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;)V
goto :goto_5
.end method
Thats all we need to do for the modifications all that is left now is add the following keys to custom settings to toggle them on and off
Code:
<CheckBoxPreference android:title="Quick Unlock" android:key="lockscreen_quick_unlock_control" android:summaryOn="Enabled" android:summaryOff="Disabled" />
<CheckBoxPreference android:title="Pin Pad Scramble" android:key="lockscreen_scramble_pin_layout" android:summaryOn="Enabled" android:summaryOff="Disabled" />
Thats it.
If you use this in your rom please give credits.
An example of what scramble pad is, is attached to this post

Thanks for sharing this with us bro. Nice work

Works great.
Thank you again for the guide!

Create a diff instead please... The guide above isn't applicable on BOD3. Lots of the code above don't have any matches and have some slight reiterations.

thank you for the awsome guide but I have this problem.
Code:
..\3-Out\SystemUI.apk\smali\com\android\keyguard\PasswordTextView.smali[10,2] no viable alternative at input 'Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;'

nambavuong said:
thank you for the awsome guide but I have this problem.
Code:
..\3-Out\SystemUI.apk\smali\com\android\keyguard\PasswordTextView.smali[10,2] no viable alternative at input 'Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;'
Click to expand...
Click to collapse
try to add the comma after the last memberclasses
from this
Code:
Lcom/android/keyguard/PasswordTextView$CharState;
to this
Code:
Lcom/android/keyguard/PasswordTextView$CharState;,
then add
Code:
Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
so the final code is
Code:
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/keyguard/PasswordTextView$1;,
Lcom/android/keyguard/PasswordTextView$CharState;[COLOR="Red"],
Lcom/android/keyguard/PasswordTextView$QuickUnlockListener; [/COLOR]
}
.end annotation

txr33 said:
This is a how to add quick pin unlock and scramble pad to lollipop. It has been tested and working on s5, s6, note 3 and possibly note 4.
This is a guide for people to add it themselves, not for people to upload their files and expect it done for them. It does require the ability to decompile and compile apks and is done with making a toggle for it in custom settings which can be found in this great thread here so it can be toggled on or off depending on what people want to use.
For this mod we will be modifying SystemUI from system/priv-app. It requires 3 files to be modified and 2 to be added which are attached to this post.
Download and extract the attached zip and place the two smali files into
Code:
com/android/keyguard/
in the same folder com/android/keyguard/ look for these 3 files which we will need to modify for this.
KeyguardPINView.smali
PasswordTextView.smali
NumPadKey.smali
Lets start with NumPadKey.smali
look for this method which should be near the top
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
and look for the following section of code in that method
Code:
iget-object v5, p0, Lcom/android/keyguard/NumPadKey;->mContext:Landroid/content/Context;
sget v6, Lcom/android/keyguard/R$drawable;->lock_ripple_drawable:I
invoke-virtual {v5, v6}, Landroid/content/Context;->getDrawable(I)Landroid/graphics/drawable/Drawable;
above the iget we will add this line
Code:
invoke-direct {p0}, Lcom/android/keyguard/NumPadKey;->updateText()V
so it should look something like this
Code:
invoke-direct {p0}, Lcom/android/keyguard/NumPadKey;->updateText()V
iget-object v5, p0, Lcom/android/keyguard/NumPadKey;->mContext:Landroid/content/Context;
sget v6, Lcom/android/keyguard/R$drawable;->lock_ripple_drawable:I
invoke-virtual {v5, v6}, Landroid/content/Context;->getDrawable(I)Landroid/graphics/drawable/Drawable;
Now look for the following line
Code:
# virtual methods
and add this whole method above it
Code:
.method private updateText()V
.locals 4
.prologue
.line 122
iget v2, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I
if-ltz v2, :cond_1
.line 123
iget-object v2, p0, Lcom/android/keyguard/NumPadKey;->mDigitText:Landroid/widget/TextView;
iget v3, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I
invoke-static {v3}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 124
sget-object v2, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;
if-nez v2, :cond_0
.line 125
invoke-virtual {p0}, Lcom/android/keyguard/NumPadKey;->getResources()Landroid/content/res/Resources;
move-result-object v2
sget v3, Lcom/android/keyguard/R$array;->lockscreen_num_pad_klondike:I
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getStringArray(I)[Ljava/lang/String;
move-result-object v2
sput-object v2, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;
.line 127
:cond_0
sget-object v2, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;
if-eqz v2, :cond_1
sget-object v2, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;
array-length v2, v2
iget v3, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I
if-le v2, v3, :cond_1
.line 128
sget-object v2, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;
iget v3, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I
aget-object v0, v2, v3
.line 129
.local v0, "klondike":Ljava/lang/String;
invoke-virtual {v0}, Ljava/lang/String;->length()I
move-result v1
.line 130
.local v1, "len":I
if-lez v1, :cond_2
.line 131
iget-object v2, p0, Lcom/android/keyguard/NumPadKey;->mKlondikeText:Landroid/widget/TextView;
invoke-virtual {v2, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 137
.end local v0 # "klondike":Ljava/lang/String;
.end local v1 # "len":I
:cond_1
:goto_0
return-void
.line 133
.restart local v0 # "klondike":Ljava/lang/String;
.restart local v1 # "len":I
:cond_2
iget-object v2, p0, Lcom/android/keyguard/NumPadKey;->mKlondikeText:Landroid/widget/TextView;
const/4 v3, 0x4
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setVisibility(I)V
goto :goto_0
.end method
Now anywhere under the virtual method line add the following whole method. It can be right at the end of the smali if want, thats where I usually add it
Code:
.method public setDigit(I)V
.locals 0
.param p1, "digit" # I
.prologue
.line 117
iput p1, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I
.line 118
invoke-direct {p0}, Lcom/android/keyguard/NumPadKey;->updateText()V
.line 119
return-void
.end method
That it for that smali and move onto the next
so now we will modify PasswordTextView.smali.
at the start of this file you will see
Code:
# annotations
To this annotation
Code:
.annotation system Ldalvik/annotation/MemberClasses;
we will add the following
Code:
Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
so it will look like this for example. Note some devices may have more values there, do not remove and values just ass the quick unlock listener value
Code:
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/keyguard/PasswordTextView$CharState;,
Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
}
.end annotation
now also up the top look for
Code:
# instance fields
and add the following field below that
Code:
.field protected mQuickUnlockListener:Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
now find the following method
Code:
.method public append(C)V
and in it look for the following section of code
Code:
:cond_1
invoke-direct {p0}, Lcom/android/keyguard/PasswordTextView;->userActivity()V
.line 296
const-wide/16 v4, 0x0
invoke-direct {p0, v4, v5}, Lcom/android/keyguard/PasswordTextView;->showAndHideHint(J)V
and add this below it
Code:
iget-object v4, p0, Lcom/android/keyguard/PasswordTextView;->mQuickUnlockListener:Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
if-eqz v4, :cond_next
.line 215
iget-object v4, p0, Lcom/android/keyguard/PasswordTextView;->mQuickUnlockListener:Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
iget-object v5, p0, Lcom/android/keyguard/PasswordTextView;->mText:Ljava/lang/String;
invoke-interface {v4, v5}, Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;->onValidateQuickUnlock(Ljava/lang/String;)V
:cond_next
return-void
so it looks like this for example
Code:
:cond_1
invoke-direct {p0}, Lcom/android/keyguard/PasswordTextView;->userActivity()V
const-wide/16 v4, 0x0
invoke-direct {p0, v4, v5}, Lcom/android/keyguard/PasswordTextView;->showAndHideHint(J)V
iget-object v4, p0, Lcom/android/keyguard/PasswordTextView;->mQuickUnlockListener:Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
if-eqz v4, :cond_next
iget-object v4, p0, Lcom/android/keyguard/PasswordTextView;->mQuickUnlockListener:Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
iget-object v5, p0, Lcom/android/keyguard/PasswordTextView;->mText:Ljava/lang/String;
invoke-interface {v4, v5}, Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;->onValidateQuickUnlock(Ljava/lang/String;)V
:cond_next
return-void
goto :goto_0
.end local v0 # "charState":Lcom/android/keyguard/PasswordTextView$CharState;
:cond_2
iget-object v4, p0, Lcom/android/keyguard/PasswordTextView;->mTextChars:Ljava/util/ArrayList;
add-int/lit8 v5, v1, -0x1
invoke-virtual {v4, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
then at the end of the smali add this whole method
Code:
.method public setQuickUnlockListener(Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;)V
.locals 0
.param p1, "listener" # Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
.prologue
.line 101
iput-object p1, p0, Lcom/android/keyguard/PasswordTextView;->mQuickUnlockListener:Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;
.line 102
return-void
.end method
Now we move on to the final smali KeyguardPINView.smali
look for this at the top
Code:
# static fields
and add the following field
Code:
.field private static sNumbers:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List",
"<",
"Ljava/lang/Integer;",
">;"
}
.end annotation
.end field
also under this line
Code:
# instance fields
you may need to add the following line if it is not present already. It already exists on s5 and note 3 but needs to be added for s6. So if it is not there then add it
Code:
.field private mDivider:Landroid/view/View;
now look for
Code:
# direct methods
which should be not far from the above added lines and add the following constructor method
Code:
.method static constructor <clinit>()V
.locals 7
.prologue
const/4 v6, 0x4
const/4 v5, 0x3
const/4 v4, 0x2
const/4 v2, 0x1
const/4 v3, 0x0
.line 48
const/16 v0, 0xa
new-array v0, v0, [Ljava/lang/Integer;
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
aput-object v1, v0, v3
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
aput-object v1, v0, v2
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
aput-object v1, v0, v4
invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
aput-object v1, v0, v5
const/4 v1, 0x5
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
aput-object v1, v0, v6
const/4 v1, 0x5
const/4 v2, 0x6
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v0, v1
const/4 v1, 0x6
const/4 v2, 0x7
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v0, v1
const/4 v1, 0x7
const/16 v2, 0x8
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v0, v1
const/16 v1, 0x8
const/16 v2, 0x9
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v0, v1
const/16 v1, 0x9
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v0, v1
invoke-static {v0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
move-result-object v0
sput-object v0, Lcom/android/keyguard/KeyguardPINView;->sNumbers:Ljava/util/List;
return-void
.end method
look for this access
Code:
.method static synthetic access$000(Lcom/android/keyguard/KeyguardPINView;Z)V
and add the following two methods below that method
Code:
.method static synthetic access$100(Lcom/android/keyguard/KeyguardPINView;Ljava/lang/String;)V
.locals 0
.param p0, "x0" # Lcom/android/keyguard/KeyguardPINView;
.param p1, "x1" # Ljava/lang/String;
.prologue
.line 37
invoke-direct {p0, p1}, Lcom/android/keyguard/KeyguardPINView;->validateQuickUnlock(Ljava/lang/String;)V
return-void
.end method
Code:
.method private validateQuickUnlock(Ljava/lang/String;)V
.locals 3
.param p1, "password" # Ljava/lang/String;
.prologue
const/4 v2, 0x1
.line 198
if-eqz p1, :cond_0
.line 199
invoke-virtual {p1}, Ljava/lang/String;->length()I
move-result v0
const/4 v1, 0x3
if-le v0, v1, :cond_0
iget-object v0, p0, Lcom/android/keyguard/KeyguardPINView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
invoke-virtual {v0, p1}, Lcom/android/internal/widget/LockPatternUtils;->checkPassword(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_0
.line 201
iget-object v0, p0, Lcom/android/keyguard/KeyguardPINView;->mCallback:Lcom/android/keyguard/KeyguardSecurityCallback;
invoke-interface {v0, v2}, Lcom/android/keyguard/KeyguardSecurityCallback;->reportUnlockAttempt(Z)V
.line 202
iget-object v0, p0, Lcom/android/keyguard/KeyguardPINView;->mCallback:Lcom/android/keyguard/KeyguardSecurityCallback;
invoke-interface {v0, v2}, Lcom/android/keyguard/KeyguardSecurityCallback;->dismiss(Z)V
.line 203
invoke-virtual {p0, v2}, Lcom/android/keyguard/KeyguardPINView;->resetPasswordText(Z)V
.line 206
:cond_0
return-void
.end method
now look for this method
Code:
.method protected onFinishInflate()V
and replace the whole method with this one
Code:
.method protected onFinishInflate()V
.locals 12
.prologue
const/4 v9, 0x1
const/4 v10, 0x0
.line 77
invoke-super {p0}, Lcom/android/keyguard/KeyguardPinBasedInputView;->onFinishInflate()V
.line 78
sget v8, Lcom/android/keyguard/R$id;->keyguard_bouncer_frame:I
invoke-virtual {p0, v8}, Lcom/android/keyguard/KeyguardPINView;->findViewById(I)Landroid/view/View;
move-result-object v8
check-cast v8, Landroid/view/ViewGroup;
iput-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mKeyguardBouncerFrame:Landroid/view/ViewGroup;
.line 79
sget v8, Lcom/android/keyguard/R$id;->row0:I
invoke-virtual {p0, v8}, Lcom/android/keyguard/KeyguardPINView;->findViewById(I)Landroid/view/View;
move-result-object v8
check-cast v8, Landroid/view/ViewGroup;
iput-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mRow0:Landroid/view/ViewGroup;
.line 80
sget v8, Lcom/android/keyguard/R$id;->row1:I
invoke-virtual {p0, v8}, Lcom/android/keyguard/KeyguardPINView;->findViewById(I)Landroid/view/View;
move-result-object v8
check-cast v8, Landroid/view/ViewGroup;
iput-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mRow1:Landroid/view/ViewGroup;
.line 81
sget v8, Lcom/android/keyguard/R$id;->row2:I
invoke-virtual {p0, v8}, Lcom/android/keyguard/KeyguardPINView;->findViewById(I)Landroid/view/View;
move-result-object v8
check-cast v8, Landroid/view/ViewGroup;
iput-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mRow2:Landroid/view/ViewGroup;
.line 82
sget v8, Lcom/android/keyguard/R$id;->row3:I
invoke-virtual {p0, v8}, Lcom/android/keyguard/KeyguardPINView;->findViewById(I)Landroid/view/View;
move-result-object v8
check-cast v8, Landroid/view/ViewGroup;
iput-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mRow3:Landroid/view/ViewGroup;
.line 83
sget v8, Lcom/android/keyguard/R$id;->divider:I
invoke-virtual {p0, v8}, Lcom/android/keyguard/KeyguardPINView;->findViewById(I)Landroid/view/View;
move-result-object v8
iput-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mDivider:Landroid/view/View;
.line 85
invoke-virtual {p0}, Lcom/android/keyguard/KeyguardPINView;->getContext()Landroid/content/Context;
move-result-object v8
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v8
const-string v11, "lockscreen_quick_unlock_control"
invoke-static {v8, v11, v10}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v8
if-ne v8, v9, :cond_1
move v4, v9
.line 88
.local v4, "quickUnlock":Z
:goto_0
invoke-virtual {p0}, Lcom/android/keyguard/KeyguardPINView;->getContext()Landroid/content/Context;
move-result-object v8
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v8
const-string v11, "lockscreen_scramble_pin_layout"
invoke-static {v8, v11, v10}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v8
if-ne v8, v9, :cond_2
move v5, v9
.line 91
.local v5, "scramblePin":Z
:goto_1
if-eqz v5, :cond_5
.line 92
sget-object v8, Lcom/android/keyguard/KeyguardPINView;->sNumbers:Ljava/util/List;
invoke-static {v8}, Ljava/util/Collections;->shuffle(Ljava/util/List;)V
.line 94
sget v8, Lcom/android/keyguard/R$id;->keyguard_bouncer_frame:I
invoke-virtual {p0, v8}, Lcom/android/keyguard/KeyguardPINView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/LinearLayout;
.line 95
.local v0, "bouncer":Landroid/widget/LinearLayout;
new-instance v7, Ljava/util/ArrayList;
invoke-direct {v7}, Ljava/util/ArrayList;-><init>()V
.line 96
.local v7, "views":Ljava/util/List;, "Ljava/util/List<Lcom/android/keyguard/NumPadKey;>;"
const/4 v1, 0x0
.local v1, "i":I
:goto_2
invoke-virtual {v0}, Landroid/widget/LinearLayout;->getChildCount()I
move-result v8
if-ge v1, v8, :cond_4
.line 97
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;
move-result-object v8
instance-of v8, v8, Landroid/widget/LinearLayout;
if-eqz v8, :cond_3
.line 98
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;
move-result-object v3
check-cast v3, Landroid/widget/LinearLayout;
.line 99
.local v3, "nestedLayout":Landroid/widget/LinearLayout;
const/4 v2, 0x0
.local v2, "j":I
:goto_3
invoke-virtual {v3}, Landroid/widget/LinearLayout;->getChildCount()I
move-result v8
if-ge v2, v8, :cond_3
.line 100
invoke-virtual {v3, v2}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;
move-result-object v6
.line 101
.local v6, "view":Landroid/view/View;
invoke-virtual {v6}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v8
const-class v9, Lcom/android/keyguard/NumPadKey;
if-ne v8, v9, :cond_0
.line 102
check-cast v6, Lcom/android/keyguard/NumPadKey;
.end local v6 # "view":Landroid/view/View;
invoke-interface {v7, v6}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 99
:cond_0
add-int/lit8 v2, v2, 0x1
goto :goto_3
.end local v0 # "bouncer":Landroid/widget/LinearLayout;
.end local v1 # "i":I
.end local v2 # "j":I
.end local v3 # "nestedLayout":Landroid/widget/LinearLayout;
.end local v4 # "quickUnlock":Z
.end local v5 # "scramblePin":Z
.end local v7 # "views":Ljava/util/List;, "Ljava/util/List<Lcom/android/keyguard/NumPadKey;>;"
:cond_1
move v4, v10
.line 85
goto :goto_0
.restart local v4 # "quickUnlock":Z
:cond_2
move v5, v10
.line 88
goto :goto_1
.line 96
.restart local v0 # "bouncer":Landroid/widget/LinearLayout;
.restart local v1 # "i":I
.restart local v5 # "scramblePin":Z
.restart local v7 # "views":Ljava/util/List;, "Ljava/util/List<Lcom/android/keyguard/NumPadKey;>;"
:cond_3
add-int/lit8 v1, v1, 0x1
goto :goto_2
.line 109
:cond_4
const/4 v1, 0x0
:goto_4
sget-object v8, Lcom/android/keyguard/KeyguardPINView;->sNumbers:Ljava/util/List;
invoke-interface {v8}, Ljava/util/List;->size()I
move-result v8
if-ge v1, v8, :cond_5
.line 110
invoke-interface {v7, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v6
check-cast v6, Lcom/android/keyguard/NumPadKey;
.line 111
.local v6, "view":Lcom/android/keyguard/NumPadKey;
sget-object v8, Lcom/android/keyguard/KeyguardPINView;->sNumbers:Ljava/util/List;
invoke-interface {v8, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v8
check-cast v8, Ljava/lang/Integer;
invoke-virtual {v8}, Ljava/lang/Integer;->intValue()I
move-result v8
invoke-virtual {v6, v8}, Lcom/android/keyguard/NumPadKey;->setDigit(I)V
.line 109
add-int/lit8 v1, v1, 0x1
goto :goto_4
.line 115
.end local v0 # "bouncer":Landroid/widget/LinearLayout;
.end local v1 # "i":I
.end local v6 # "view":Lcom/android/keyguard/NumPadKey;
.end local v7 # "views":Ljava/util/List;, "Ljava/util/List<Lcom/android/keyguard/NumPadKey;>;"
:cond_5
if-eqz v4, :cond_6
.line 116
iget-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mPasswordEntry:Lcom/android/keyguard/PasswordTextView;
new-instance v9, Lcom/android/keyguard/KeyguardPINView$2;
invoke-direct {v9, p0}, Lcom/android/keyguard/KeyguardPINView$2;-><init>(Lcom/android/keyguard/KeyguardPINView;)V
invoke-virtual {v8, v9}, Lcom/android/keyguard/PasswordTextView;->setQuickUnlockListener(Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;)V
.line 124
:goto_5
return-void
.line 122
:cond_6
iget-object v8, p0, Lcom/android/keyguard/KeyguardPINView;->mPasswordEntry:Lcom/android/keyguard/PasswordTextView;
const/4 v9, 0x0
invoke-virtual {v8, v9}, Lcom/android/keyguard/PasswordTextView;->setQuickUnlockListener(Lcom/android/keyguard/PasswordTextView$QuickUnlockListener;)V
goto :goto_5
.end method
Thats all we need to do for the modifications all that is left now is add the following keys to custom settings to toggle them on and off
Code:
<CheckBoxPreference android:title="Quick Unlock" android:key="lockscreen_quick_unlock_control" android:summaryOn="Enabled" android:summaryOff="Disabled" />
<CheckBoxPreference android:title="Pin Pad Scramble" android:key="lockscreen_scramble_pin_layout" android:summaryOn="Enabled" android:summaryOff="Disabled" />
Thats it.
If you use this in your rom please give credits.
An example of what scramble pad is, is attached to this post
Click to expand...
Click to collapse
Will this xposed with work on Samsung Infuser?
Riyal said:
Create a diff instead please... The guide above isn't applicable on BOD3. Lots of the code above don't have any matches and have some slight reiterations.
Click to expand...
Click to collapse
Nope
Cowboy from Hell on a twisted trail.
Koffed From my Big Ass Outlaw Phone.

Bubbajoe40356 said:
Will this xposed with work on Samsung Infuser?
Nope
Cowboy from Hell on a twisted trail.
Koffed From my Big Ass Outlaw Phone.
Click to expand...
Click to collapse
1. Dont quote O.P
2. Gravity also supported.
3. Pls dont talk xposed in this guide. Thank you!
Sent from my SM-G9250

nambavuong said:
1. Dont quote O.P
2. Gravity also supported.
3. Pls dont talk xposed in this guide. Thank you!
Sent from my SM-G9250
Click to expand...
Click to collapse
1 . It's a team thing. You worry about you and I'll take care of Bubba.
2. Who cares.
3. See #1 and have a lovely day. When you get your police badge ... come pull me over.
Cowboy from Hell on a twisted trail.
Koffed From my Big Ass Outlaw Phone.

Thanks for sharing, working great on N3.

I have not tried it yet but from the pictures i can see that if a key with number and letters is in the first position it loses the letters
it's normal?

remuntada78 said:
I have not tried it yet but from the pictures i can see that if a key with number and letters is in the first position it loses the letters
it's normal?
Click to expand...
Click to collapse
Are you talking about "Scramble Pad", that can be enabled/disabled. I guess it for higher security level.

kmokhtar79 said:
Are you talking about "Scramble Pad", that can be enabled/disabled. I guess it for higher security level.
Click to expand...
Click to collapse
Yes talking about it, ok
Inviato dal mio SM-G900F utilizzando Tapatalk

@Bubbajoe40356
Seriously, you just quoted the entire first post only to type one line underneath. This added a lot of unnecessary scrolling and it is very annoying.

corncobman said:
@Bubbajoe40356
Seriously, you just quoted the entire first post only to type one line underneath. This added a lot of unnecessary scrolling and it is very annoying.
Click to expand...
Click to collapse
I dont find it annoying but complaining about it is unnecessary

txr33 said:
Thats all we need to do for the modifications all that is left now is add the following keys to custom settings to toggle them on and off
Code:
<CheckBoxPreference android:title="Quick Unlock" android:key="lockscreen_quick_unlock_control" android:summaryOn="Enabled" android:summaryOff="Disabled" />
<CheckBoxPreference android:title="Pin Pad Scramble" android:key="lockscreen_scramble_pin_layout" android:summaryOn="Enabled" android:summaryOff="Disabled" />
Click to expand...
Click to collapse
Who help me add this segment to where ?

huaminhquan93 said:
Who help me add this segment to where ?
Click to expand...
Click to collapse
add to xml/pref of your custom setting.apk

nambavuong said:
add to xml/pref of your custom setting.apk
Click to expand...
Click to collapse
xml/pref name ?

you need to have a custom settings app to enable/disable this mod, you can find the custom settings apk in the op of the link posted in this op. once you have the custom settings apk you need to decompile it and go to res/xml/preferences.xml and thats where those 2 lines will be added

JoHnNYBlaZE716 said:
you need to have a custom settings app to enable/disable this mod, you can find the custom settings apk in the op of the link posted in this op. once you have the custom settings apk you need to decompile it and go to res/xml/preferences.xml and thats where those 2 lines will be added
Click to expand...
Click to collapse
no link for custom setting apk in the OP

Related

[GUIDES COLLECT] Update 24/7/2012

1.MMS mod
2.Add 2G/3G toggle
3.CRT Animation toggle
4.Improve Sweep to Remove Notification
5.Long Press Volume Button to skip Song
6.Hack FM Radio
7.Make Option for Date style on Status Bar
8.Mod TouchWiz 3
Touchwiz 3 modded for example​
Add MMS skin chooser
Need: stock Mms.apk + APKMulti tools + Notepad plus
Step:
1-decompile Mms.apk
2-go to ../res/xml/
open mms_config.xml
change the number to what ever you want.
2.1 Change limit contact to send
Code:
<int name="recipientLimit">10</int>
2.2 CHange limit of converting to MMS
Code:
<int name="smsToMmsTextThreshold">4</int>
3.Enable skin chooser
go to ../res/xml/
open preferences.xml
add this after the 3rd line
Code:
<ListPreference android:entries="@array/pref_entries_message_skin" android:title="@string/pref_title_message_skin" android:key="pref_key_message_skin" android:defaultValue="Default" android:dialogTitle="@string/pref_dialog_title_message_skin" android:entryValues="@array/pref_entry_values_message_skin" />
go to ../smali/com/android/mms/ui/
Open MessagingPreferenceActivity.smali
Find this
Code:
.method public static getMessageSkin(Landroid/content/Context;)I
.registers 2
.parameter "context"
.prologue
.line 631
const/4 v0, 0x0
return v0
.end method
change to this
Code:
.method public static getMessageSkin(Landroid/content/Context;)I
.locals 6
.parameter "context"
.prologue
.line 631
const/4 v4, 0x0
const-string v5, "Default"
.line 578
invoke-static {p0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object v0
.line 579
.local v0, pref:Landroid/content/SharedPreferences;
const-string v2, "pref_key_message_skin"
const-string v3, "Default"
invoke-interface {v0, v2, v5}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
.line 580
.local v1, skinType:Ljava/lang/String;
const-string v2, "Default"
invoke-virtual {v5, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_0
move v2, v4
.line 591
:goto_0
return v2
.line 582
:cond_0
const-string v2, "Edge"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_1
.line 583
const/4 v2, 0x1
goto :goto_0
.line 584
:cond_1
const-string v2, "Gloss"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_2
.line 585
const/4 v2, 0x2
goto :goto_0
.line 586
:cond_2
const-string v2, "Sticker note"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_3
.line 587
const/4 v2, 0x3
goto :goto_0
.line 588
:cond_3
const-string v2, "Memo"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_4
.line 589
const/4 v2, 0x4
goto :goto_0
:cond_4
move v2, v4
.line 591
goto :goto_0
.end method
Recompile your Mms.apk
Here Mms.apk( base on DXKT3 but all stock deodexed rom can use) i made with limit sending contact is 500, convert to MMS at 500 of course with skin enable.
End tut. Thank you for watching boring show
Add 2G/3G toggle to lidroid toggle bar
First go here and mod your Phone.apk
http://forum.xda-developers.com/showthread.php?t=1731187
At 2. Register the Receiver at runtime through Phone Application smali file
there are 2 options
1- for resigned rom
2- for stock
If your rom is resigned just open Androidmanifest.xml and add
Code:
<receiver android:name="NetworkModeReceiver">
<intent-filter>
<action android:name="com.android.phone.CHANGE_NETWORK_MODE" />
<action android:name="com.android.phone.NEW_NETWORK_MODE" />
</intent-filter>
</receiver>
If not just continue the guide above.
Dont recompile it. You can do some other modification.
Open /res/values/bools.xml and modify what you need.
Code:
<resources>
<bool name="ignore_sim_network_locked_events">false</bool>
<bool name="ignore_perso_locked_events">false</bool>
<bool name="sim_network_unlock_allow_dismiss">true</bool>
<bool name="icc_perso_unlock_allow_dismiss">true</bool>
<bool name="allow_incoming_call_touch_ui">true</bool>
<bool name="allow_in_call_touch_ui">true</bool>
The funniest thing
[COLOR="Red"]<bool name="world_phone">true</bool>[/COLOR]
<bool name="config_enable_dialer_key_vibration">true</bool>
<bool name="tty_enabled">true</bool>
<bool name="hac_enabled">true</bool>
<bool name="dtmf_type_enabled">true</bool>
<bool name="auto_retry_enabled">false</bool>
<bool name="allow_local_dtmf_tones">true</bool>
<bool name="allow_back_key_to_reject_incoming_call">true</bool>
<bool name="config_show_onscreen_dial_button">true</bool>
<bool name="send_mic_mute_to_AudioManager">true</bool>
<bool name="has_in_call_noise_suppression">true</bool>
<bool name="allow_menu_proximity_sensor">true</bool>
</resources>
Recompile Phone.apk
Prepare resource for Network Mode toggle. Decomile lidroid-res.pak
Add 3 images to lidroid-res( for 2G only,3G only and 2G&3G)
Depend on your image size you can put it in drawable-hdpi,mdpi,ldpi...
90x90 put in hdpi, 60x60 put in mdpi, 45x45 put in ldpi
Recompile lidroid-res.apk
Decompile lidroid-res.apk and take ID of 3 image above from public.xml
Next step for rom has 15 toggle bar
Decompile SystemUI.apk
Download quickpanel.rar
Extract to SystemUI.apk/smali/com/lidroid/systemui/quickpanel/
Open NetworkModebutton.smali, change all my resource ID to your
0x30b003f : Text display under toggle. If you use original lidroid-res. It doesnt change
0x3020102 : 2G&3G image ID
0x3020101 : 2G image ID
0x3020103 : 3G image ID
Recompile SystemUI.apk
Download modified QuickpanelSettings.apk support 16 toggle
Copy back to your phone an restart
How to test if toggle work
Open dialer pad
input
Code:
*#*#4636#*#*
Choose Phone Information
scroll to the end you will see a dropdown box display current network
press back button
now change network toggle
Again comeback to PhoneInformation and see if network change
Refine wilfredcool007 CRT animation Guide
Original thread
http://forum.xda-developers.com/showthread.php?t=1533255
Decompile services.jar
No need to change anything in PowerManagerService.smali
open PowerManagerService$BrightnessState
Search
Code:
invoke-static {v0, v1}, Lcom/android/server/PowerManagerService;->access$4700(Lcom/android/server/PowerManagerService;I)I
lookdown several line, after
Code:
.end method
add
Code:
.method private getScreenAnimationMode(Landroid/content/Context;)I
.registers 7
.parameter "context"
.prologue
const v0, 0x0
const v3, 0x1
const v4, 0x10
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "config_beam_screen_on"
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, :cond_22
const v0, 0x1
:goto_18
const-string v2, "config_beam_screen_off"
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, :cond_21
add-int/2addr v0, v4
:cond_21
return v0
:cond_22
const v0, 0x0
goto :goto_18
.end method
Find
Code:
.method public run()V
After
Code:
.prologue
const/4 v8, 0x0
add
Code:
.line 2078
iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
invoke-static {v4}, Lcom/android/server/PowerManagerService;->[COLOR="Blue"]access$3400[/COLOR](Lcom/android/server/PowerManagerService;)Landroid/content/Context;
move-result-object v4
invoke-direct {p0, v4}, Lcom/android/server/PowerManagerService$BrightnessState;->getScreenAnimationMode(Landroid/content/Context;)I
move-result v4
if-nez v4, [COLOR="blue"]:cond_2f[/COLOR]
Go to the end of this method
Above
Code:
goto :goto_4e
.end method
add
Code:
iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
invoke-static {v6}, Lcom/android/server/PowerManagerService;->[COLOR="blue"]access$3400[/COLOR](Lcom/android/server/PowerManagerService;)Landroid/content/Context;
move-result-object v6
invoke-direct {p0, v6}, Lcom/android/server/PowerManagerService$BrightnessState;->getScreenAnimationMode(Landroid/content/Context;)I
move-result v6
Recompile services.jar
Enable CRT animation from framework-res.apk
Make Check box to control CRT effect in Settings.apk
Decompile Settings.apk
Open Settings.apk/res/xml/display_settings.xml
under
Code:
<PreferenceScreen android:title="@string/g_sensor_title" android:key="g_sensor" android:summary="@string/g_sensor_summary">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.GSensorSettings" />
</PreferenceScreen>
add
Code:
<PreferenceCategory android:title="CRT Animation Control">
<CheckBoxPreference android:title="Use CRT Effect when turn on screen" android:key="config_beam_screen_on" android:defaultValue="true" android:summaryOn="Enabled" android:summaryOff="Disabled" />
<CheckBoxPreference android:title="Use CRT Effect when turn off screen" android:key="config_beam_screen_off" android:defaultValue="true" android:summaryOn="Enabled" android:summaryOff="Disabled" />
</PreferenceCategory>
Recompile Settings.apk
Maybe need change build.prob to get CRT work
open /system/build.prob
Comment(#) or del line
Code:
debug.sf.hw=1
Improve Sweep to Remove
Original thread
http://forum.xda-developers.com/showthread.php?t=1691397
1. If your rom has Sweep to Remove
Decompile SystemUI.apk
Open /smali/com/android/systemui/statusbar/ExpandedView.smali
add under # instance fields
Code:
.field mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
add this method to the end
Code:
.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
.locals 1
.parameter "event"
.prologue
.line 51
iget-object v0, p0, Lcom/android/systemui/statusbar/ExpandedView;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
invoke-virtual {v0, p1}, Lcom/android/systemui/statusbar/ItemTouchDispatcher;->needsInterceptTouch(Landroid/view/MotionEvent;)Z
move-result v0
if-eqz v0, :cond_0
.line 52
const/4 v0, 0x1
.line 54
:goto_0
return v0
:cond_0
invoke-super {p0, p1}, Landroid/widget/LinearLayout;->onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
goto :goto_0
.end method
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.locals 2
.parameter "event"
.prologue
.line 59
iget-object v1, p0, Lcom/android/systemui/statusbar/ExpandedView;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
invoke-virtual {v1, p1}, Lcom/android/systemui/statusbar/ItemTouchDispatcher;->handleTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
.line 61
.local v0, handled:Z
invoke-super {p0, p1}, Landroid/widget/LinearLayout;->onTouchEvent(Landroid/view/MotionEvent;)Z
move-result v1
if-eqz v1, :cond_0
.line 62
const/4 v0, 0x1
.line 65
:cond_0
return v0
.end method
Save
Delete LatestItemContainer$1.smali and LatestItemContainer.smali
Download statusbar.rar and extract to /smali/com/android/systemui/statusbar/
Edit StatusBarService.smali
Add under # instance fields
Code:
.field mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
In .method private makeStatusBarView
above
Code:
const v8, 0x1050005
invoke-virtual {v5, v8}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
add
Code:
new-instance v6, Lcom/android/systemui/statusbar/ItemTouchDispatcher;
invoke-direct {v6, p0}, Lcom/android/systemui/statusbar/ItemTouchDispatcher;-><init>(Landroid/content/Context;)V
iput-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
above
Code:
const v8, 0x7f030004
invoke-static {p1, v8, v10}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
add
Code:
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
iput-object v6, v2, Lcom/android/systemui/statusbar/ExpandedView;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
Replace method makeNotificationView ( from begin to end)
with modified
Code:
.method makeNotificationView(Lcom/android/internal/statusbar/StatusBarNotification;Landroid/view/ViewGroup;)[Landroid/view/View;
.locals 19
.parameter "notification"
.parameter "parent"
.prologue
const/4 v4, 0x0
const/4 v5, 0x0
.line 574
move-object/from16 v0, p1
iget-object v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->notification:Landroid/app/Notification;
move-object/from16 v16, v0
.line 575
.local v16, n:Landroid/app/Notification;
move-object/from16 v0, v16
iget-object v0, v0, Landroid/app/Notification;->contentView:Landroid/widget/RemoteViews;
move-object/from16 v17, v0
.line 576
.local v17, remoteViews:Landroid/widget/RemoteViews;
if-nez v17, :cond_0
.line 577
.line 611
:goto_0
return-object v4
.line 581
:cond_0
const-string v4, "layout_inflater"
move-object/from16 v0, p0
move-object v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/StatusBarService;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v15
check-cast v15, Landroid/view/LayoutInflater;
.line 582
.local v15, inflater:Landroid/view/LayoutInflater;
const v4, 0x7f030008
move-object v0, v15
move v1, v4
move-object/from16 v2, p2
move v3, v5
invoke-virtual {v0, v1, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
move-result-object v18
check-cast v18, Lcom/android/systemui/statusbar/LatestItemContainer;
.local v18, row:Lcom/android/systemui/statusbar/LatestItemContainer;
move-object/from16 v0, v16
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x2
if-nez v4, :cond_1
move-object/from16 v0, v16
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x20
if-nez v4, :cond_1
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/StatusBarService;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
move-object v4, v0
new-instance v5, Lcom/android/systemui/statusbar/StatusBarService$7;
move-object v0, v5
move-object/from16 v1, p0
move-object/from16 v2, p1
invoke-direct {v0, v1, v2}, Lcom/android/systemui/statusbar/StatusBarService$7;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Lcom/android/internal/statusbar/StatusBarNotification;)V
move-object/from16 v0, v18
move-object v1, v4
move-object v2, v5
invoke-virtual {v0, v1, v2}, Lcom/android/systemui/statusbar/LatestItemContainer;->setOnSwipeCallback(Lcom/android/systemui/statusbar/ItemTouchDispatcher;Ljava/lang/Runnable;)V
:cond_1
const v4, 0x7f090024
move-object/from16 v0, v18
move v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->findViewById(I)Landroid/view/View;
move-result-object v10
check-cast v10, Landroid/view/ViewGroup;
.line 586
.local v10, content:Landroid/view/ViewGroup;
const/high16 v4, 0x6
invoke-virtual {v10, v4}, Landroid/view/ViewGroup;->setDescendantFocusability(I)V
.line 587
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/StatusBarService;->mFocusChangeListener:Landroid/view/View$OnFocusChangeListener;
move-object v4, v0
invoke-virtual {v10, v4}, Landroid/view/ViewGroup;->setOnFocusChangeListener(Landroid/view/View$OnFocusChangeListener;)V
.line 588
move-object/from16 v0, v16
iget-object v0, v0, Landroid/app/Notification;->contentIntent:Landroid/app/PendingIntent;
move-object v6, v0
.line 589
.local v6, contentIntent:Landroid/app/PendingIntent;
if-eqz v6, :cond_2
.line 590
new-instance v4, Lcom/android/systemui/statusbar/StatusBarService$Launcher;
move-object/from16 v0, p1
iget-object v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->pkg:Ljava/lang/String;
move-object v7, v0
move-object/from16 v0, p1
iget-object v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->tag:Ljava/lang/String;
move-object v8, v0
move-object/from16 v0, p1
iget v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->id:I
move v9, v0
move-object/from16 v5, p0
invoke-direct/range {v4 .. v9}, Lcom/android/systemui/statusbar/StatusBarService$Launcher;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Landroid/app/PendingIntent;Ljava/lang/String;Ljava/lang/String;I)V
invoke-virtual {v10, v4}, Landroid/view/ViewGroup;->setOnClickListener(Landroid/view/View$OnClickListener;)V
.line 594
:cond_2
const/4 v13, 0x0
.line 595
.local v13, expanded:Landroid/view/View;
const/4 v12, 0x0
.line 597
.local v12, exception:Ljava/lang/Exception;
:try_start_0
move-object/from16 v0, v17
move-object/from16 v1, p0
move-object v2, v10
invoke-virtual {v0, v1, v2}, Landroid/widget/RemoteViews;->apply(Landroid/content/Context;Landroid/view/ViewGroup;)Landroid/view/View;
:try_end_0
.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v13
.line 602
:goto_1
if-nez v13, :cond_3
.line 603
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
move-object/from16 v0, p1
iget-object v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->pkg:Ljava/lang/String;
move-object v5, v0
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
const-string v5, "/0x"
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
move-object/from16 v0, p1
iget v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->id:I
move v5, v0
invoke-static {v5}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
move-result-object v5
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v14
.line 604
.local v14, ident:Ljava/lang/String;
const-string v4, "StatusBarService"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "couldn\'t inflate view for notification "
.end local v6 #contentIntent:Landroid/app/PendingIntent;
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5, v14}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v4, v5, v12}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
.line 605
const/4 v4, 0x0
goto/16 :goto_0
.line 599
.end local v14 #ident:Ljava/lang/String;
.restart local v6 #contentIntent:Landroid/app/PendingIntent;
:catch_0
move-exception v11
.line 600
.local v11, e:Ljava/lang/RuntimeException;
move-object v12, v11
goto :goto_1
.line 607
.end local v11 #e:Ljava/lang/RuntimeException;
:cond_3
invoke-virtual {v10, v13}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V
.line 608
const/4 v4, 0x1
move-object/from16 v0, v18
move v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->setDrawingCacheEnabled(Z)V
.line 611
const/4 v4, 0x3
new-array v4, v4, [Landroid/view/View;
const/4 v5, 0x0
aput-object v18, v4, v5
const/4 v5, 0x1
aput-object v10, v4, v5
const/4 v5, 0x2
aput-object v13, v4, v5
goto/16 :goto_0
.end method
Recompile systemUI.apk
2. If your rom dont have Sweep to Remove
Go here first
http://forum.xda-developers.com/showthread.php?t=1483193 then comeback to this guide
Long press Volume to skip song
original thread
http://forum.xda-developers.com/showthread.php?t=1257260
Decompile android.policy.jar
go to /com/android/internal/policy/impl/
make 2 new text document, rename it to
Code:
PhoneWindowManager$12.smali
PhoneWindowManager$13.smali
Open PhoneWindowManager$12.smali
paste this
Code:
.class Lcom/android/internal/policy/impl/PhoneWindowManager$12;
.super Ljava/lang/Object;
.source "PhoneWindowManager.java"
# interfaces
.implements Ljava/lang/Runnable;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/PhoneWindowManager;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
# direct methods
.method constructor <init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
.registers 2
.parameter
.prologue
iput-object p1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$12;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public run()V
.registers 3
.prologue
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$12;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
const/4 v1, 0x1
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsLongPress:Z
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$12;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
const/16 v1, 0x57
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->sendMediaButtonEvent(I)V
return-void
.end method
Open PhoneWindowManager$13.smali
paste this
Code:
.class Lcom/android/internal/policy/impl/PhoneWindowManager$13;
.super Ljava/lang/Object;
.source "PhoneWindowManager.java"
# interfaces
.implements Ljava/lang/Runnable;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/PhoneWindowManager;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
# direct methods
.method constructor <init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
.registers 2
.parameter
.prologue
iput-object p1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$13;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public run()V
.registers 3
.prologue
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$13;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
const/4 v1, 0x1
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsLongPress:Z
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$13;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
const/16 v1, 0x58
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->sendMediaButtonEvent(I)V
return-void
.end method
Open PhoneWindowManager.smali
In # static fields
add
Code:
.field private static final LONG_PRESS_TIMEOUT:I = 0x3e8[COLOR="Blue"]/*=1000ms in hex*/[/COLOR]
in # instance fields
add
Code:
.field mIsLongPress:Z
.field mVolumeDownLongPress:Ljava/lang/Runnable;
.field mVolumeUpLongPress:Ljava/lang/Runnable;
find
Code:
.method public constructor <init>()V
go to the end of this method above
Code:
.line 2855
return-void
.end method
add
Code:
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$12;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$12;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$13;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$13;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
add this to the end of file
Code:
.method handleVolumeLongPress(I)V
.registers 6
.parameter "keycode"
.prologue
const/16 v1, 0x18
if-ne p1, v1, :cond_f
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
.local v0, btnHandler:Ljava/lang/Runnable;
:goto_6
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
sget v2, Lcom/android/internal/policy/impl/PhoneWindowManager;->LONG_PRESS_TIMEOUT:I
int-to-long v2, v2
invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
.end local v0 #btnHandler:Ljava/lang/Runnable;
:cond_f
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
.restart local v0 #btnHandler:Ljava/lang/Runnable;
goto :goto_6
.end method
.method handleVolumeLongPressAbort()V
.registers 3
.prologue
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
return-void
.end method
.method protected sendMediaButtonEvent(I)V
.registers 15
.parameter "code"
.prologue
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v1
.local v1, eventtime:J
new-instance v11, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v11, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
.local v11, downIntent:Landroid/content/Intent;
new-instance v0, Landroid/view/KeyEvent;
const/4 v5, 0x0
const/4 v7, 0x0
move-wide v3, v1
move v6, p1
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;-><init>(JJIII)V
.local v0, downEvent:Landroid/view/KeyEvent;
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v11, v4, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v11, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
new-instance v12, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v12, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
.local v12, upIntent:Landroid/content/Intent;
new-instance v3, Landroid/view/KeyEvent;
const/4 v8, 0x1
const/4 v10, 0x0
move-wide v4, v1
move-wide v6, v1
move v9, p1
invoke-direct/range {v3 .. v10}, Landroid/view/KeyEvent;-><init>(JJIII)V
.local v3, upEvent:Landroid/view/KeyEvent;
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v12, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v12, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
return-void
.end method
Now we moding
Code:
.method public interceptKeyBeforeQueueing(JIIIIIZ)I
There are alot of minor code
So compare with your method or just extract attacment and use my file
*Bonus can make long press to kill app, change FM channel. All are in XDA
Make FM Radio work without Earphone and in Airplane mode
Decompile FmRadio.apk
Edit /smali/com/samsung/app/fmradio/FmRadioPlaybackService.smali
Bypass Earphone plugged check
find all line
Code:
iget-boolean v2, p0, Lcom/samsung/app/fmradio/FmRadioPlaybackService;->mHeadsetPlugged:Z
replace 1st and 3rd line with
Code:
const/4 v2, 0x1
Bypass Airplane Mode check
Find all line
Code:
iget-boolean v2, p0, Lcom/samsung/app/fmradio/FmRadioPlaybackService;->mAirplaneMode:Z
replace 1st and 3rd line with
Code:
const/4 v2, 0x0
Save and recopile FmRadio.apk
*Note: without Earphone FM signal very bad. or you can cut an 3.5mm jack and plug to phone so you have better signal while sound still at phone speaker
Nice bro
GOod work mahn..
What the thread is about???
Sent from my GT-S5670 using xda app-developers app
that crt on guide ...is it a improvement to crt on or jus adding a switch to settings ??
It's called optimize code: less edit > less code to run >system run smooth( theoretically, because 1 code doesnot make system slower XD)
the swipe to remove mod made it swipe function really smoother !! gr8
Before know this, i hate sweep to remove it's annoying
Tổng hợp đầy đủ lắm anh, thêm vài bài hay nữa cho em học hỏi nào :x
So great. Thanks so much!
Anh Sơn ơi, u can make a tut mod this launcher ?
http://forum.xda-developers.com/showthread.php?t=1689249
Click to expand...
Click to collapse
Hì, thanks anh!
any rom with all des features ?
Those Are Really Helpful..! Specially For Every One Who Are Building There Own Rom..
shocklads said:
Tổng hợp đầy đủ lắm anh, thêm vài bài hay nữa cho em học hỏi nào :x
So great. Thanks so much!
Anh Sơn ơi, u can make a tut mod this launcher ?
Hì, thanks anh!
Click to expand...
Click to collapse
ofcourse it will have guide.
zcop said:
ofcourse it will have guide.
Click to expand...
Click to collapse
Awesome. Keep fighting, master
Custom Date, Clock style on StatusBar
After unsolved problem with Kahvitahra's mods
I start new mod. It's not good as Kahvitahra's mods but for now it's ok
So let's start
Decompile SystemUI.apk
open DateView.smali
Find
Code:
.method private final updateClock()V
Delete all this method
paste the new one
Code:
.method private final updateClock()V
.locals 7
.prologue
.line 78
new-instance v4, Ljava/text/SimpleDateFormat;
[COLOR="blue"]# total options[/COLOR]
const/16 v1, 0x5
const/16 v2, 0x0
iget-object v0, p0, Lcom/android/systemui/statusbar/DateView;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v3, "custom_date_format"
invoke-static {v0, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
[COLOR="Blue"]# Option number 1[/COLOR]
const/16 v2, 0x1
if-eq v2, v0, :cond_0
[COLOR="blue"]# Option number 2[/COLOR]
const/16 v2, 0x2
if-eq v2, v0, :cond_1
const/16 v2, 0x3
if-eq v2, v0, :cond_2
const/16 v2, 0x4
if-eq v2, v0, :cond_3
const/16 v2, 0x5
if-eq v2, v0, :cond_4
[COLOR="blue"]# you can add option number N after here[/COLOR]
[COLOR="green"]# const/16 v2, 0xN
# if-eq v2, v0, :cond_N-1[/COLOR]
[COLOR="Blue"]#all date, time is in[/COLOR] [COLOR="Red"]Simple Date Format[/COLOR].[COLOR="blue"] Google it[/COLOR]
[COLOR="Blue"]#Format of Style number 1[/COLOR]
:cond_0
const-string v5, "yyyy-MM-dd HH:mm:ss.SSSZ"
goto :goto_0
[COLOR="blue"]# Format of style number 2[/COLOR]
:cond_1
const-string v5, "yyyy-MM-dd HH:mm:ssZ"
goto :goto_0
:cond_2
const-string v5, "yyyy-MM-dd HH:mmZ"
goto :goto_0
:cond_3
const-string v5, "yyyy-MM-dd"
goto :goto_0
:cond_4
const-string v5, "HH:mm"
goto :goto_0
[COLOR="blue"]# After here put style number N[/COLOR]
[COLOR="green"] :cond_N-1
const-string v5, "dd/MM/yy E HH:mm"
goto :goto_0[/COLOR]
[COLOR="Purple"]# Below is Display date format to statusbar, no need to change[/COLOR]
:goto_0
invoke-direct {v4,v5}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
.line 85
.local v4, sdf:Ljava/text/SimpleDateFormat;
new-instance v6, Ljava/util/Date;
invoke-direct {v6}, Ljava/util/Date;-><init>()V
.local v6, now:Ljava/util/Date;
invoke-virtual {v4, v6}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v6
invoke-virtual {p0, v6}, Lcom/android/systemui/statusbar/DateView;->setText(Ljava/lang/CharSequence;)V
.line 87
return-void
.end method
Recomplie SystemUI.apk
Decompile Settings.apk( or Decompile yourPart.apk if you want to put it in Part)
open /res/values/arrays.xml
Add
Code:
<array name="custom_date_entries">
<item>yyyy-MM-dd HH:mm:ss.SSSZ</item>
<item>yyyy-MM-dd HH:mm:ssZ</item>
<item>yyyy-MM-dd HH:mmZ</item>
<item>yyyy-MM-dd</item>
<item>HH:mm</item>
[COLOR="Blue"]/*add new option Name after this */[/COLOR]
</array>
<string-array name="custom_date_values">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
[COLOR="Blue"]/*add new option number( [COLOR="Green"]N[/COLOR] ) after this */[/COLOR]
</string-array>
Put option in Settings.apk
Open /res/xml/date_time_prefs.xml
Put option in Part
open /res/xml/settings.xml
go to the end of file
above
Code:
</PreferenceScreen>
paste
Code:
<PreferenceCategory android:title="StatusBar Date">
<CheckBoxPreference android:title="Enable Custom Date" android:key="custom_date" android:summaryOn="Enabled" android:summaryOff="Disabled" android:defaultValue="false" />
<ListPreference android:persistent="true" android:entries="@array/custom_date_entries" android:title="Choose custom date" android:key="custom_date_format" android:defaultValue="4" android:entryValues="@array/custom_date_values" android:dependency="custom_date" />
</PreferenceCategory>
Recompile Settings.apk or yourPart.apk
If you want to add more option
Just do folow the COLOR TEXT
I dont think this perfect.
here is perfect
Try to port it for me

[MOD] [GUIDE] [JB BLK1] LockScreen Torch with toggle

Here is a new LockScreen Torch MOD updated for use on the new JB leak BLK1. I have made a few changes this time around (hopefully fr the better )
This new version (due to code within android.policy.jar) allows the torch to stay on until the screen times out or you unlock it. No need to hold the button in. Again, not my doing, just changes in the policy.
I have implemented a toggle to allow the user to enable or disable the torch. I did this because I love toggles, Im on a toggle kick right now
****EDIT****
This is an updated version to the LockScreen Torch guide.
It is for the newest firmware BLK1
It now includes an on/off toggle located in LockScreen Settings
Enjoy!
THE FLASHABLE ZIP IS MEANT FOR STOCK BLK1 DEODEXED ROMs. IT WILL ADD A FEW OTHER MODs AS WELL. IF YOUR ON A CUSTOM ROM IT WILL PROBABLY STILL WORK BUT IT WILL BREAK ANY THEMES YOU MAY HAVE.
​LOCKSCREEN TORCH ZIP DOWNLOAD​
The lockscreen torch will allow you to quickly turn on your flashlight from the lockscreen. Simply push the home button in for torch, it will go off when you unlock, hit the power button or it times out. Not sure who originally wrote the MOD but I have spent some time re-writing it to fit the GS3 based on a dozen or so other tutorials.
After reboot, it will take about 60 seconds before the MOD will engage. Then it will work at will as long as you are on the lockscreen.
DEVs if you want to use this in your ROM feel free, just shoot me some credit and some thanks!
Hit the Thanks Button!
Here is the guide.....
GUIDE New Version with toggle! For BLK1
First you will need to download the torch file below and drop it in /system/app, do not install.....just drop in the folder. This will be in the zip file with the smali files.
We will be working with two system files
SecSettings.apk
android.policy.jar
We will begin with SecSettings
Navigate to res/values/strings
Add the following lines somewhere in the middle or end, it doesnt matter.
Code:
<string name="enable_lockscreen_torch">LockScreen Torch</string>
<string name="enable_lockscreen_torch_text">Enables torch for lockscreen</string>
Navigate to res/xml/Lockscreen_Settings.xml
Add the following lines in RED (this assumes you have the aosplock also, if not just ignore it)
Code:
<PreferenceCategory android:title="@string/display_settings" />
<CheckBoxPreference android:title="@string/enable_aosp_lock" android:key="enable_aosp_lock" android:summary="@string/enable_aosp_lock_text" />
[COLOR="Red"]<CheckBoxPreference android:title="@string/enable_lockscreen_torch" android:key="enable_lockscreen_torch" android:summary="@string/enable_lockscreen_torch_text" />
[/COLOR] <SwitchPreferenceScreen android:title="@string/lock_screen_shortcut_title" android:key="lock_screen_shortcut" android:summary="@string/lock_screen_shortcut_summary">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.lockscreenshortcut.LockScreenShortcutSettings" />
</SwitchPreferenceScreen>
Navigate to com/android/settings/LockScreenSettings.smali
Add the following code in RED (again, this assumes you havethe AOSP lockscreen. If not, ignore that code)
Code:
.method private updateState()V
.locals 9
.prologue
const/4 v5, 0x1
const/4 v6, 0x0
.line 263
[COLOR="Red"]iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mLockScreenTorch:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v8, "enable_lockscreen_torch"
invoke-static {v4, v8, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-eqz v4, :cond_7
move v4, v5
invoke-virtual {v7, v4}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 265
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
[/COLOR]
iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v8, "enable_aosp_lock"
invoke-static {v4, v8, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-eqz v4, :cond_7
move v4, v5
invoke-virtual {v7, v4}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 265
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mClock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v8, "show_clock"
invoke-static {v4, v8, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-eqz v4, :cond_7
Code:
:cond_0
const-string v9, "clock"
invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v9
check-cast v9, Landroid/preference/CheckBoxPreference;
iput-object v9, p0, Lcom/android/settings/LockScreenSettings;->mClock:Landroid/preference/CheckBoxPreference;
.line 159
iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mClock:Landroid/preference/CheckBoxPreference;
const/4 v10, 0x0
invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
const-string v9, "enable_aosp_lock"
invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v9
check-cast v9, Landroid/preference/CheckBoxPreference;
iput-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
.line 159
iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
const/4 v10, 0x0
invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
[COLOR="red"]const-string v9, "enable_lockscreen_torch"
invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v9
check-cast v9, Landroid/preference/CheckBoxPreference;
iput-object v9, p0, Lcom/android/settings/LockScreenSettings;->mLockScreenTorch:Landroid/preference/CheckBoxPreference;
.line 159
iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mLockScreenTorch:Landroid/preference/CheckBoxPreference;
const/4 v10, 0x0
invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
[/COLOR]
.line 161
const-string v9, "weather"
invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v9
Code:
:cond_9
iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_b
.line 338
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "wake_up_lock_screen"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_a
:goto_5
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1
:cond_a
move v2, v3
goto :goto_5
:cond_b
iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
[COLOR="red"] if-eqz v4, :cond_d
[/COLOR]
.line 313
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "enable_aosp_lock"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_c
:goto_6
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 314
goto/16 :goto_1
:cond_c
move v2, v3
.line 313
goto :goto_6
[COLOR="red"]:cond_d
iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mLockScreenTorch:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_0
.line 400
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "enable_lockscreen_torch"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mLockScreenTorch:Landroid/preference/CheckBoxPreference;
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_e
:goto_7
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 450
goto/16 :goto_1
:cond_e
move v2, v3
.line 550
goto :goto_7
[/COLOR] .line 600
.end method
.method public onResume()V
Thats it for SecSettings!
Now for android.policy.jar
See next post to continue.......
PART 2 android.policy.jar
Navigate to smali/com/android/internal/policy/impl/KeyguardViewMediator$4.smali
Find the following code and add the part in RED
Code:
packed-switch v2, :pswitch_data_0
.line 1172
:goto_0
[COLOR="Red"][B] :pswitch_0
[/B][/COLOR] return-void
Find the 13 : pswitch_ lines and increase them by 1. For example
Code:
:pswitch_0 becomes :pswitch_1
:pswitch_1 becomes :pswitch_2
:pswitch_2 becomes :pswitch_3
:pswitch_3 becomes :pswitch_4
:pswitch_4 becomes :pswitch_5
:pswitch_5 becomes :pswitch_6
:pswitch_6 becomes :pswitch_7
:pswitch_7 becomes :pswitch_8
:pswitch_8 becomes :pswitch_9
:pswitch_9 becomes :pswitch_a
:pswitch_a becomes :pswitch_b
:pswitch_b becomes :pswitch_c
:pswitch_c becomes :pswitch_d
Find the following code
Code:
invoke-static {v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->access$300(Lcom/android/internal/policy/impl/KeyguardViewMediator;)V
.line 1169
monitor-exit v1
goto :goto_0
Add the following directly after
Code:
.line 974
:pswitch_e
iget-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator$4;->this$0:Lcom/android/internal/policy/impl/KeyguardViewMediator;
iget v3, p1, Landroid/os/Message;->arg1:I
if-eqz v3, :cond_2
move v3, v0
:goto_3
#calls: Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
invoke-static {v2, v3}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->access$1900(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
goto :goto_0
:cond_2
move v3, v1
goto :goto_3
Find the "nop' at the end and add another one right below it
Code:
throw v0
.line 1129
nop
nop
Find the stack of : pswitch_ lines at the end of the smali and delete : pswitch_0
Then add the following so the entire stack will end up looking like this
Code:
.packed-switch 0x1
:pswitch_1
:pswitch_2
:pswitch_3
:pswitch_4
:pswitch_5
:pswitch_6
:pswitch_7
:pswitch_8
:pswitch_9
:pswitch_a
:pswitch_b
:pswitch_c
:pswitch_d
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_e
.end packed-switch
.end method
Thats it for KeyguardViewMediator$4.smali. Save and close the file.
Navigate to smali/com/android/internal/policy/impl/KeyguardViewMediator.smali
Add the following in RED
Code:
.field private static final SET_HIDDEN:I = 0xc
[COLOR="Red"].field private static final SET_TORCH:I = 0x14[/COLOR]
.field private static final SHOW:I = 0x2
Code:
.field private mTelephonyManager:Landroid/telephony/TelephonyManager;
[COLOR="red"].field private mTorchEnabled:Z
.field private mTorchStateChanged:Z
[/COLOR]
.field private mUnlockSoundId:I
Code:
# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/android/internal/policy/impl/PhoneWindowManager;Landroid/os/LocalPowerManager;)V
.locals 11
.parameter "context"
.parameter "callback"
.parameter "powerManager"
.prologue
.line 299
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
[COLOR="red"]const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
[/COLOR]
.line 179
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mSuppressNextLockSound:Z
.line 180
const/4 v0, 0x1
Code:
iput-object p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mContext:Landroid/content/Context;
.line 302
iput-object p3, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mRealPowerManager:Landroid/os/LocalPowerManager;
[COLOR="red"] const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
[/COLOR]
.line 303
const-string v0, "power"
invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
iput-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mPM:Landroid/os/PowerManager;
.line 304
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mPM:Landroid/os/PowerManager;
const v1, 0x1000001a
Code:
.method static synthetic access$2300(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
.locals 0
.parameter "x0"
.parameter "x1"
.prologue
.line 103
invoke-direct {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetHidden(Z)V
return-void
.end method
[COLOR="red"].method static synthetic access$2400(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
.locals 0
invoke-direct {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
return-void
.end method
[/COLOR]
.method static synthetic access$300(Lcom/android/internal/policy/impl/KeyguardViewMediator;I)V
Code:
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustLocked(Z)V
.line 1411
monitor-exit p0
[COLOR="red"] invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V
[/COLOR]
goto :goto_0
:catchall_0
move-exception v0
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v0
.end method
.method private handleKeyguardDone(Z)V
Code:
invoke-virtual {v0}, Lcom/android/internal/policy/impl/KeyguardViewManager;->onScreenTurnedOff()V
.line 1562
monitor-exit p0
[COLOR="red"]invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V[/COLOR]
.line 1563
return-void
.line 1562
:catchall_0
move-exception v0
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v0
.end method
.method private handleNotifyScreenOn(Lcom/android/internal/policy/impl/KeyguardViewManager$ShowListener;)V
.locals 2
Code:
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustUserActivityLocked()V
.line 682
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustStatusBarLocked()V
[COLOR="red"] invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V
[/COLOR]
.line 684
:cond_0
monitor-exit p0
.line 685
return-void
.line 684
:catchall_0
move-exception v0
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v0
.end method
[COLOR="red"].method private handleSetTorch(Z)V
.locals 6
const/4 v0, 0x0
iget-object v5, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
const-string v4, "enable_lockscreen_torch"
invoke-static {v5, v4, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v5
if-eqz v5, :cond_0
const/4 v5, 0x0
const/4 v4, 0x1
:try_start_0
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
if-nez v1, :cond_1
iput-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
const/4 v1, 0x1
iput-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
:cond_0
:goto_0
return-void
:cond_1
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
if-eq v1, p1, :cond_0
iput-boolean p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
new-instance v0, Landroid/content/Intent;
const-string v1, "net.cactii.flash2.TOGGLE_FLASHLIGHT"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
const-string v1, "net.cactii.flash2.EXTRA_DISABLE_NOTIFICATION"
const/4 v2, 0x1
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mContext:Landroid/content/Context;
invoke-virtual {v1, v0}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception v1
goto :goto_0
.end method
[/COLOR]
.method private handleShow()V
Code:
invoke-interface {v0, v1}, Landroid/app/IActivityManager;->closeSystemDialogs(Ljava/lang/String;)V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0
.line 1380
:goto_1
:try_start_2
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mShowKeyguardWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V
[COLOR="red"]const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
[/COLOR]
.line 1381
monitor-exit p0
goto :goto_0
:catchall_0
move-exception v0
monitor-exit p0
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
Code:
.end method
[COLOR="red"].method private resetTorchState()V
.locals 1
iget-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
if-eqz v0, :cond_0
const/4 v0, 0x0
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
:cond_0
return-void
.end method
[/COLOR]
.method private showLocked()V
.locals 3
.prologue
.line 839
const-string v1, "KeyguardViewMediator"
Code:
const-string v1, "KeyguardViewMediator"
const-string v2, "done waiting for mWaitingUntilKeyguardVisible"
invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
goto :goto_1
.end method
[COLOR="red"].method public setTorch(Z)V
.locals 5
const/16 v4, 0x14
const/4 v3, 0x0
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mScreenOn:Z
if-eqz v1, :cond_0
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v4}, Landroid/os/Handler;->removeMessages(I)V
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
if-eqz p1, :cond_1
const/4 v2, 0x1
:goto_0
invoke-virtual {v1, v4, v2, v3}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;
move-result-object v0
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
:cond_0
return-void
:cond_1
move v2, v3
goto :goto_0
.end method
[/COLOR]
.method public verifyUnlock(Landroid/view/WindowManagerPolicy$OnKeyguardExitResult;)V
.locals 2
.parameter "callback"
.prologue
.line 618
monitor-enter p0
Thats it for KeyguardViewMediator.smali. Save the file and close.
Continue to post 3.........
PART 3 android.policy.jar continues.......
Navigate to smali/com/android/internal/policy/impl/PhoneWindowManager.smali
Find the following code and add the parts in RED
Code:
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpKeyConsumedByScreenRecordChord:Z
move/from16 v40, v0
if-eqz v40, :cond_15
.line 2954
:cond_14
:goto_4
const/16 v40, 0x3
move/from16 v0, v21
move/from16 v1, v40
[COLOR="Red"] if-ne v0, v1, :cond_2c
[/COLOR]
.line 2956
if-eqz p1, :cond_17
invoke-interface/range {p1 .. p1}, Landroid/view/WindowManagerPolicy$WindowState;->getAttrs()Landroid/view/WindowManager$LayoutParams;
move-result-object v4
.line 2957
.local v4, attrs:Landroid/view/WindowManager$LayoutParams;
:goto_5
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomeDoubleClickBehavior:Z
move/from16 v40, v0
if-eqz v40, :cond_18
if-eqz v19, :cond_18
const/16 v25, 0x1
.line 2959
.local v25, mSupportDoubleClick:Z
Code:
st-string v40, "WindowManager"
const-string v41, "Ignoring HOME; event canceled."
invoke-static/range {v40 .. v41}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_9
.line 3031
.end local v13 #homeWasLongPressed:Z
:cond_21
[COLOR="Red"] if-eqz v4, :cond_26
[/COLOR]
.line 3032
iget v0, v4, Landroid/view/WindowManager$LayoutParams;->type:I
move/from16 v38, v0
.line 3033
.local v38, type:I
const/16 v40, 0x7d4
move/from16 v0, v38
move/from16 v1, v40
Code:
if-eq v0, v1, :cond_22
const/16 v40, 0x7d9
move/from16 v0, v38
move/from16 v1, v40
if-ne v0, v1, :cond_24
.line 9999
:cond_22
[COLOR="red"]move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v40, v0
invoke-virtual/range {v40 .. v40}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->isShowingAndNotHidden()Z
move-result v40
if-eqz v40, :cond_23
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v40, v0
move-object/from16 v0, v40
move v1, v9
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->setTorch(Z)V
rem-int/lit8 v40, v30, 0xf
if-nez v40, :cond_23
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v40, v0
invoke-virtual/range {v40 .. v40}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->pokeWakelock()V
[/COLOR]
if-eqz v25, :cond_23
const/16 v40, 0x7d9
move/from16 v0, v38
move/from16 v1, v40
if-ne v0, v1, :cond_23
.line 3038
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomeKeyDoubleClickConcept:Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;
move-object/from16 v40, v0
invoke-virtual/range {v40 .. v40}, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->setHomeDownEventSent()V
.line 3041
:cond_23
DELETE the line below in RED
Code:
invoke-virtual/range {v40 .. v40}, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->setHomeDownEventSent()V
.line 3041
:cond_23
const-wide/16 v40, 0x0
goto/16 :goto_2
.line 3043
[COLOR="red"] :cond_24[/COLOR]
sget-object v40, Lcom/android/internal/policy/impl/PhoneWindowManager;->WINDOW_TYPES_WHERE_HOME_DOESNT_WORK:[I
move-object/from16 v0, v40
array-length v0, v0
move/from16 v39, v0
.line 3044
.local v39, typeCount:I
Here is a sort of tricky part. Starting right after the above code change you need to comb the rest of this entire method for all references to ":cond_X" and deccrement them by one. THERE ARE A LOT! Take your time and find them all. For example
Code:
:cond_33 becomes :cond_32
:cond_29 becomes :cond_28
:cond_40becomes :cond_3f
....etc. MAKE SURE YOU FIND THEM ALL! The last one you change should be from:cond_56 to :cond_55.
Thats it! Recompile everything and push!
Enjoy! Thanks Button !!
mine3.........
Alldone. I will try to get a flashable up soon.
Enjoy!
Flashable Zip added to the OP.
Notice, It will bork your home button from selecting recent apps. Not a big deal cause I dont use that anyway but i will fix it shortly.
So no go on VRBLI5? Or may it still work?
Will there be a version that has the hold to turn on feature?
nice work will try .
TokedUp said:
So no go on VRBLI5? Or may it still work?
Will there be a version that has the hold to turn on feature?
Click to expand...
Click to collapse
nothing for LI5 sorry. I like the new version not baving to hold the button so I have not really looked into going back to the other way, sorry.
Will this work on sgs3 omega v37.1
Sent from my GT-I9300 using xda app-developers app
thanks for your toturial.
but i have issue from last part.
Here is a sort of tricky part. Starting right after the above code change you need to comb the rest of this entire method for all references to ":cond_X" and deccrement them by one. THERE ARE A LOT! Take your time and find them all. For example
Code:
:cond_33 becomes :cond_32
:cond_29 becomes :cond_28
:cond_40becomes :cond_3f
....etc. MAKE SURE YOU FIND THEM ALL! The last one you change should be from:cond_56 to :cond_55.
Click to expand...
Click to collapse
i am starting to change the cond_xx decrement , but where to start?
for example on MR2, the last parameter is cond_26
invoke-virtual/range {v40 .. v40}, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->setHomeDownEventSent()V
.line 3041
:cond_23
const-wide/16 v40, 0x0
goto/16 :goto_2
.line 3043
:cond_26
sget-object v40, Lcom/android/internal/policy/impl/PhoneWindowManager;->WINDOW_TYPES_WHERE_HOME_DOESNT_WORK:[I
move-object/from16 v0, v40
array-length v0, v0
move/from16 v39, v0
.line 3044
.local v39, typeCount:I
Click to expand...
Click to collapse
i should start from this numbers? (which cond_xx is for starting to decrement?)
cond_26 -> cond_25
cond_27 -> cond_26
.......
or start from cond_0 -> cond_?
thanks
Has anyone tried this with a SPRINT S3 ?
Just wanted to mention that this line is missing in LockScreenSettings.smali:
Code:
.field private mLockScreenTorch:Landroid/preference/CheckBoxPreference;
Can you POST here original android.policy.jar ?
It ease to see difference some times instead of instruction.
Thanks.
With some modifications, I managed to get this working on the SGS3 GT-i9300
I'll make a thread in their forums.
Kryten2k35 said:
With some modifications, I managed to get this working on the SGS3 GT-i9300
I'll make a thread in their forums.
Click to expand...
Click to collapse
Please link to it here!
Any idea if it will work on Sprint ?
Sent from my SPH-L710
Tried this on a t-mo gs3 & everything seemed to work fine but whenever I hold the home button down like to show recent apps and stuff nothing happens. Any idea why?
could someone help me with this??
Here is a sort of tricky part. Starting right after the above code change you need to comb the rest of this entire method for all references to ":cond_X" and deccrement them by one. THERE ARE A LOT! Take your time and find them all. For example???
didnt get it tbh
AskinSavascisi said:
could someone help me with this??
Here is a sort of tricky part. Starting right after the above code change you need to comb the rest of this entire method for all references to ":cond_X" and deccrement them by one. THERE ARE A LOT! Take your time and find them all. For example???
didnt get it tbh
Click to expand...
Click to collapse
you edit every cond_X by -1
so if say you are starting with cond_29 it becomes cond_28
then you will go down find a cond_28 that then becomes cond_27
go down a bit find cond_27 that then becomes cond_26
and so on until they are done.
andybones said:
you edit every cond_X by -1
so if say you are starting with cond_29 it becomes cond_28
then you will go down find a cond_28 that then becomes cond_27
go down a bit find cond_27 that then becomes cond_26
and so on until they are done.
Click to expand...
Click to collapse
ok thanks may i ask u another question :fingers-crossed:
Code:
packed-switch v2, :pswitch_data_0
.line 1267
:goto_0
:pswitch_0
return-void
but mine looks like:
Code:
packed-switch v2, :pswitch_data_72
.line 1172
:goto_7
[COLOR="Red"]:pswitch_0[/COLOR] -> do i need to keep this still 0 or make it 8? coz my pswitch_ lines starts from :pswitch_8
return-void
and this will look like this rigt?
Code:
:pswitch_data_72
.packed-switch 0x1
:pswitch_8 -> [COLOR="red"]9[/COLOR]
:pswitch_10 ->[COLOR="red"]11[/COLOR]
:pswitch_16 ->[COLOR="red"]17[/COLOR]
:pswitch_1c ->[COLOR="red"]1d[/COLOR]
:pswitch_22 ->[COLOR="red"]23[/COLOR]
:pswitch_28 ->[COLOR="red"]29[/COLOR]
:pswitch_2e ->[COLOR="red"]2f[/COLOR]
:pswitch_38 ->[COLOR="red"]39[/COLOR]
:pswitch_40 ->[COLOR="red"]41[/COLOR]
:pswitch_4c ->[COLOR="red"]4d[/COLOR]
:pswitch_52 ->[COLOR="red"]53[/COLOR]
:pswitch_58 ->[COLOR="red"]59[/COLOR]
:pswitch_64 ->[COLOR="Red"]65[/COLOR]
.end packed-switch
.end method

[GUIDE][STABLE] Add Swipe to Remove notification for Galaxy Pocket

Hello guys, today i want to share to u, how to add swipe to remove notification for galaxy pocket..
CREDITS:
hansip87 (thanks for the tutor) <Thread>
zcop (thanks for the fixement tuts) <Thread>
buddyisdead (thanks for the Galaxy Y systemUI, so i can change some smali's code from zcop to make compability) <Thread>
Click to expand...
Click to collapse
Here, lets us start now!
SYSTEMUI
1. Create folder anim (if not exists yet) inside /res folder
2. Create 2 file named slide_out_left_basic.xml and slide_out_right_basic.xml inside res/anim folder
3. for slide_out_left_basic.xml, edit the file and fill with this
Code:
Code:
<?xml version="1.0" encoding="utf-8"?>
<translate android:duration="@android:integer/config_mediumAnimTime" android:fromXDelta="0.0" android:toXDelta="-50.0%p"
xmlns:android="http://schemas.android.com/apk/res/android" />
4. for slide_out_right_basic.xml, edit the file and fill with this
Code:
<?xml version="1.0" encoding="utf-8"?>
<translate android:duration="@android:integer/config_mediumAnimTime" android:fromXDelta="0.0" android:toXDelta="50.0%p"
xmlns:android="http://schemas.android.com/apk/res/android" />
5. Save both
* Editing res/layout/status_bar_latest_event.xml
We are replacing LinearLayout object used in StatusBar with LatestItemContainer here, so notification can be removed. We handle the Styling first by editing this .xml first. Here are the steps:
6. Change the code from Original code to this (change the bold one)
Code:
<?xml version="1.0" encoding="utf-8"?>
<[B]com.android.systemui.statusbar.LatestItemContainer[/B] android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="65.0sp"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.systemui.statusbar.LatestItemView android:id="@id/content" android:background="@android:drawable/status_bar_item_background" android:paddingRight="6.0sp" android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="64.0sp" android:shadowColor="#ff000000" android:shadowDx="0.0" android:shadowDy="1.0" android:shadowRadius="2.0" />
<View android:background="@drawable/divider_horizontal_light_opaque" android:layout_width="fill_parent" android:layout_height="wrap_content" />
<[B]/com.android.systemui.statusbar.LatestItemContainer[/B]>
7. Save
* Editing res/values/public.xml
This one is for registering anim file that we made on step 1.1 to be available publicly and to be recognized in .smali program. Here are the steps:
8. Recompile your apk after putting anim file into /res folder
9. Decompile again the resulting apk
10. Inside /res/values/public.xml, you'll found something like this in the end:
Code:
<resources>
.
.
.
<public type="anim" name="slide_out_left_basic" id="0x7f0a0000" />
<public type="anim" name="slide_out_right_basic" id="0x7f0a0001" />
</resources>
11. Remember the ID for both anim lines. As a backup
12. Extract the StatusBarService$7.smali from smali_files.zip at attachment
13. Extract the ItemTouchDispatcher$1.smali from smali_files.zip at attachment
14. Extract the ItemTouchDispatcher.smali from smali_files.zip at attachment
15. Extract the LatestItemContainer.smali from smali_files.zip at attachment
16. Put these 4 files in smali/com/android/systemui/statusbar/
17. Open /smali/com/android/systemui/statusbar/ExpandedView.smali
add under # instance fields
Code:
.field mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
18. Delete any method u found after this
Code:
.method protected onFinishInflate()V
.locals 0
.prologue
.line 42
invoke-super {p0}, Landroid/widget/LinearLayout;->onFinishInflate()V
.line 43
return-void
.end method
19. Then, add this method below the method above
Code:
.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
.locals 1
.parameter "event"
.prologue
.line 51
iget-object v0, p0, Lcom/android/systemui/statusbar/ExpandedView;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
invoke-virtual {v0, p1}, Lcom/android/systemui/statusbar/ItemTouchDispatcher;->needsInterceptTouch(Landroid/view/MotionEvent;)Z
move-result v0
if-eqz v0, :cond_0
.line 52
const/4 v0, 0x1
.line 54
:goto_0
return v0
:cond_0
invoke-super {p0, p1}, Landroid/widget/LinearLayout;->onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
goto :goto_0
.end method
.method protected onLayout(ZIIII)V
.locals 3
.parameter "changed"
.parameter "left"
.parameter "top"
.parameter "right"
.parameter "bottom"
.prologue
.line 53
invoke-super/range {p0 .. p5}, Landroid/widget/LinearLayout;->onLayout(ZIIII)V
.line 54
sub-int v0, p5, p3
.line 55
.local v0, height:I
iget v1, p0, Lcom/android/systemui/statusbar/ExpandedView;->mPrevHeight:I
if-eq v0, v1, :cond_0
.line 58
iput v0, p0, Lcom/android/systemui/statusbar/ExpandedView;->mPrevHeight:I
.line 59
iget-object v1, p0, Lcom/android/systemui/statusbar/ExpandedView;->mService:Lcom/android/systemui/statusbar/StatusBarService;
const/16 v2, -0x2710
invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/StatusBarService;->updateExpandedViewPos(I)V
.line 61
:cond_0
return-void
.end method
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.locals 2
.parameter "event"
.prologue
.line 59
iget-object v1, p0, Lcom/android/systemui/statusbar/ExpandedView;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
invoke-virtual {v1, p1}, Lcom/android/systemui/statusbar/ItemTouchDispatcher;->handleTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
.line 61
.local v0, handled:Z
invoke-super {p0, p1}, Landroid/widget/LinearLayout;->onTouchEvent(Landroid/view/MotionEvent;)Z
move-result v1
if-eqz v1, :cond_0
.line 62
const/4 v0, 0x1
.line 65
:cond_0
return v0
.end method
20. Save.
21. Edit StatusBarService.smali
Add under .field private mTicking:Z in #instance fields
Code:
.field mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
22. In .method private makeStatusBarView
above
Code:
const v7, 0x1050005
invoke-virtual {v4, v7}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
23. Add
Code:
new-instance v5, Lcom/android/systemui/statusbar/ItemTouchDispatcher;
invoke-direct {v5, p0}, Lcom/android/systemui/statusbar/ItemTouchDispatcher;-><init>(Landroid/content/Context;)V
iput-object v5, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
24. Above
Code:
const v7, 0x7f030004
invoke-static {p1, v7, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
25. Add
Code:
iget-object v5, p0, Lcom/android/systemui/statusbar/StatusBarService;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
iput-object v5, v1, Lcom/android/systemui/statusbar/ExpandedView;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
26. Replace method makeNotificationView ( from begin to end)
with modified
Code:
.method makeNotificationView(Lcom/android/internal/statusbar/StatusBarNotification;Landroid/view/ViewGroup;)[Landroid/view/View;
.locals 19
.parameter "notification"
.parameter "parent"
.prologue
.line 574
move-object/from16 v0, p1
iget-object v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->notification:Landroid/app/Notification;
move-object/from16 v16, v0
.line 575
.local v16, n:Landroid/app/Notification;
move-object/from16 v0, v16
iget-object v0, v0, Landroid/app/Notification;->contentView:Landroid/widget/RemoteViews;
move-object/from16 v17, v0
.line 576
.local v17, remoteViews:Landroid/widget/RemoteViews;
if-nez v17, :cond_0
.line 577
const/4 v4, 0x0
.line 611
:goto_0
return-object v4
.line 581
:cond_0
const-string v4, "layout_inflater"
move-object/from16 v0, p0
move-object v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/StatusBarService;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v15
check-cast v15, Landroid/view/LayoutInflater;
.line 582
.local v15, inflater:Landroid/view/LayoutInflater;
const v4, 0x7f030008
const/4 v5, 0x0
move-object v0, v15
move v1, v4
move-object/from16 v2, p2
move v3, v5
invoke-virtual {v0, v1, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
move-result-object v18
check-cast v18, Lcom/android/systemui/statusbar/LatestItemContainer;
.local v18, row:Lcom/android/systemui/statusbar/LatestItemContainer;
move-object/from16 v0, v16
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x2
if-nez v4, :cond_1
move-object/from16 v0, v16
iget v0, v0, Landroid/app/Notification;->flags:I
move v4, v0
and-int/lit8 v4, v4, 0x20
if-nez v4, :cond_1
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/StatusBarService;->mTouchDispatcher:Lcom/android/systemui/statusbar/ItemTouchDispatcher;
move-object v4, v0
new-instance v5, Lcom/android/systemui/statusbar/StatusBarService$7;
move-object v0, v5
move-object/from16 v1, p0
move-object/from16 v2, p1
invoke-direct {v0, v1, v2}, Lcom/android/systemui/statusbar/StatusBarService$7;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Lcom/android/internal/statusbar/StatusBarNotification;)V
move-object/from16 v0, v18
move-object v1, v4
move-object v2, v5
invoke-virtual {v0, v1, v2}, Lcom/android/systemui/statusbar/LatestItemContainer;->setOnSwipeCallback(Lcom/android/systemui/statusbar/ItemTouchDispatcher;Ljava/lang/Runnable;)V
:cond_1
const v4, 0x7f090024
move-object/from16 v0, v18
move v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->findViewById(I)Landroid/view/View;
move-result-object v10
check-cast v10, Landroid/view/ViewGroup;
.line 586
.local v10, content:Landroid/view/ViewGroup;
const/high16 v4, 0x6
invoke-virtual {v10, v4}, Landroid/view/ViewGroup;->setDescendantFocusability(I)V
.line 587
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/StatusBarService;->mFocusChangeListener:Landroid/view/View$OnFocusChangeListener;
move-object v4, v0
invoke-virtual {v10, v4}, Landroid/view/ViewGroup;->setOnFocusChangeListener(Landroid/view/View$OnFocusChangeListener;)V
.line 588
move-object/from16 v0, v16
iget-object v0, v0, Landroid/app/Notification;->contentIntent:Landroid/app/PendingIntent;
move-object v6, v0
.line 589
.local v6, contentIntent:Landroid/app/PendingIntent;
if-eqz v6, :cond_2
.line 590
new-instance v4, Lcom/android/systemui/statusbar/StatusBarService$Launcher;
move-object/from16 v0, p1
iget-object v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->pkg:Ljava/lang/String;
move-object v7, v0
move-object/from16 v0, p1
iget-object v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->tag:Ljava/lang/String;
move-object v8, v0
move-object/from16 v0, p1
iget v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->id:I
move v9, v0
move-object/from16 v5, p0
invoke-direct/range {v4 .. v9}, Lcom/android/systemui/statusbar/StatusBarService$Launcher;-><init>(Lcom/android/systemui/statusbar/StatusBarService;Landroid/app/PendingIntent;Ljava/lang/String;Ljava/lang/String;I)V
invoke-virtual {v10, v4}, Landroid/view/ViewGroup;->setOnClickListener(Landroid/view/View$OnClickListener;)V
.line 594
:cond_2
const/4 v13, 0x0
.line 595
.local v13, expanded:Landroid/view/View;
const/4 v12, 0x0
.line 597
.local v12, exception:Ljava/lang/Exception;
:try_start_0
move-object/from16 v0, v17
move-object/from16 v1, p0
move-object v2, v10
invoke-virtual {v0, v1, v2}, Landroid/widget/RemoteViews;->apply(Landroid/content/Context;Landroid/view/ViewGroup;)Landroid/view/View;
:try_end_0
.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v13
.line 602
:goto_1
if-nez v13, :cond_3
.line 603
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
move-object/from16 v0, p1
iget-object v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->pkg:Ljava/lang/String;
move-object v5, v0
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
const-string v5, "/0x"
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
move-object/from16 v0, p1
iget v0, v0, Lcom/android/internal/statusbar/StatusBarNotification;->id:I
move v5, v0
invoke-static {v5}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
move-result-object v5
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v14
.line 604
.local v14, ident:Ljava/lang/String;
const-string v4, "StatusBarService"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "couldn\'t inflate view for notification "
.end local v6 #contentIntent:Landroid/app/PendingIntent;
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5, v14}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v4, v5, v12}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
.line 605
const/4 v4, 0x0
goto/16 :goto_0
.line 599
.end local v14 #ident:Ljava/lang/String;
.restart local v6 #contentIntent:Landroid/app/PendingIntent;
:catch_0
move-exception v11
.line 600
.local v11, e:Ljava/lang/RuntimeException;
move-object v12, v11
goto :goto_1
.line 607
.end local v11 #e:Ljava/lang/RuntimeException;
:cond_3
invoke-virtual {v10, v13}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V
.line 608
const/4 v4, 0x1
move-object/from16 v0, v18
move v1, v4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/LatestItemContainer;->setDrawingCacheEnabled(Z)V
.line 611
const/4 v4, 0x3
new-array v4, v4, [Landroid/view/View;
const/4 v5, 0x0
aput-object v18, v4, v5
const/4 v5, 0x1
aput-object v10, v4, v5
const/4 v5, 0x2
aput-object v13, v4, v5
goto/16 :goto_0
.end method
27. Save
28. Recompile your SystemUI.apk
FRAMEWORK.JAR
The tutorial for this, i will share soon..
Use my framework.jar for now.. (work with almost rom)
<deleted>
Thank you very much
Thank you very much for this guide.
I was trying very hard with Hancip's guide, but SystemUI structure of galaxy y is different.
Editing SystemUI was only problem, not framwork.jar which you solved.
Thanks button pressed.
Note for Galaxy y users, framework.jar attached is of Galaxy Pocket. If you want a bootloop you can use it.

Help me bypass GoogleSignatureVerifier!!!

Hello guys,
I've already written there but I think that was the wrong forum.
I need to bypass google signature check in application Waze in order to mod Waze and bring back radars in France!
I think I've found the smali files to patch which is googleSignatureverifier.smali.
I try to spoof the genuine signature but I get crashes every time!
I think some of you have already broken this type of security since it is necessary to mod GAPPs!
Code:
.class public Lcom/google/android/gms/common/GoogleSignatureVerifier;
.super Ljava/lang/Object;
# static fields
.field private static final zzaqd:Lcom/google/android/gms/common/GoogleSignatureVerifier;
# direct methods
.method static constructor <clinit>()V
.locals 1
new-instance v0, Lcom/google/android/gms/common/GoogleSignatureVerifier;
invoke-direct {v0}, Lcom/google/android/gms/common/GoogleSignatureVerifier;-><init>()V
sput-object v0, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzaqd:Lcom/google/android/gms/common/GoogleSignatureVerifier;
return-void
.end method
.method private constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static getInstance()Lcom/google/android/gms/common/GoogleSignatureVerifier;
.locals 1
sget-object v0, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzaqd:Lcom/google/android/gms/common/GoogleSignatureVerifier;
return-object v0
.end method
.method private zzb(Landroid/content/pm/PackageInfo;Z)Z
.locals 5
const/4 v2, 0x1
const/4 v1, 0x0
iget-object v0, p1, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
array-length v0, v0
if-eq v0, v2, :cond_0
const-string/jumbo v0, "GoogleSignatureVerifier"
const-string/jumbo v2, "Package has more than one signature."
invoke-static {v0, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
move v0, v1
:goto_0
return v0
:cond_0
new-instance v3, Lcom/google/android/gms/common/zzc$zzb;
iget-object v0, p1, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
aget-object v0, v0, v1
invoke-virtual {v0}, Landroid/content/pm/Signature;->toByteArray()[B
move-result-object v0
invoke-direct {v3, v0}, Lcom/google/android/gms/common/zzc$zzb;-><init>([B)V
if-eqz p2, :cond_1
invoke-static {}, Lcom/google/android/gms/common/zzc;->zzpc()Ljava/util/Set;
move-result-object v0
:goto_1
invoke-interface {v0, v3}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_2
move v0, v2
goto :goto_0
:cond_1
invoke-static {}, Lcom/google/android/gms/common/zzc;->zzpd()Ljava/util/Set;
move-result-object v0
goto :goto_1
:cond_2
const-string/jumbo v0, "GoogleSignatureVerifier"
const/4 v2, 0x2
invoke-static {v0, v2}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
move-result v0
if-eqz v0, :cond_3
const-string/jumbo v0, "GoogleSignatureVerifier"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v4, "Signature not valid. Found: \n"
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v3}, Lcom/google/android/gms/common/zzc$zza;->getBytes()[B
move-result-object v3
invoke-static {v3, v1}, Landroid/util/Base64;->encodeToString([BI)Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-static {v0, v2}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
:cond_3
move v0, v1
goto :goto_0
.end method
# virtual methods
.method public isPackageGoogleSigned(Landroid/content/pm/PackageManager;Landroid/content/pm/PackageInfo;)Z
.locals 3
.param p1, "packageManager" # Landroid/content/pm/PackageManager;
.param p2, "packageInfo" # Landroid/content/pm/PackageInfo;
.prologue
const/4 v2, 0x1
const/4 v0, 0x0
if-nez p2, :cond_1
:cond_0
:goto_0
return v0
:cond_1
invoke-static {p1}, Lcom/google/android/gms/common/GooglePlayServicesUtilLight;->honorsDebugCertificates(Landroid/content/pm/PackageManager;)Z
move-result v1
if-eqz v1, :cond_2
invoke-direct {p0, p2, v2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzb(Landroid/content/pm/PackageInfo;Z)Z
move-result v0
goto :goto_0
:cond_2
invoke-direct {p0, p2, v0}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzb(Landroid/content/pm/PackageInfo;Z)Z
move-result v0
if-nez v0, :cond_0
invoke-direct {p0, p2, v2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzb(Landroid/content/pm/PackageInfo;Z)Z
move-result v1
if-eqz v1, :cond_0
const-string/jumbo v1, "GoogleSignatureVerifier"
const-string/jumbo v2, "Test-keys aren\'t accepted on this build."
invoke-static {v1, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_0
.end method
.method public isPackageGoogleSigned(Landroid/content/pm/PackageManager;Ljava/lang/String;)Z
.locals 3
.param p1, "packageManager" # Landroid/content/pm/PackageManager;
.param p2, "callingPackage" # Ljava/lang/String;
.prologue
const/16 v0, 0x40
:try_start_0
invoke-virtual {p1, p2, v0}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
:try_end_0
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v0
invoke-virtual {p0, p1, v0}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->isPackageGoogleSigned(Landroid/content/pm/PackageManager;Landroid/content/pm/PackageInfo;)Z
move-result v0
:goto_0
return v0
:catch_0
move-exception v0
const-string/jumbo v0, "GoogleSignatureVerifier"
const/4 v1, 0x3
invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
move-result v0
if-eqz v0, :cond_0
const-string/jumbo v0, "GoogleSignatureVerifier"
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v2, "Package manager can\'t find package "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
const-string/jumbo v2, ", defaulting to false"
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method public isUidGoogleSigned(Landroid/content/pm/PackageManager;I)Z
.locals 5
.param p1, "packageManager" # Landroid/content/pm/PackageManager;
.param p2, "uid" # I
.prologue
const/4 v0, 0x0
invoke-virtual {p1, p2}, Landroid/content/pm/PackageManager;->getPackagesForUid(I)[Ljava/lang/String;
move-result-object v2
if-eqz v2, :cond_0
array-length v1, v2
if-nez v1, :cond_1
:cond_0
:goto_0
return v0
:cond_1
array-length v3, v2
move v1, v0
:goto_1
if-ge v1, v3, :cond_0
aget-object v4, v2, v1
invoke-virtual {p0, p1, v4}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->isPackageGoogleSigned(Landroid/content/pm/PackageManager;Ljava/lang/String;)Z
move-result v4
if-eqz v4, :cond_2
const/4 v0, 0x1
goto :goto_0
:cond_2
add-int/lit8 v1, v1, 0x1
goto :goto_1
.end method
.method public verifyPackageIsGoogleSigned(Landroid/content/pm/PackageManager;Ljava/lang/String;)V
.locals 3
.param p1, "packageManager" # Landroid/content/pm/PackageManager;
.param p2, "callingPackage" # Ljava/lang/String;
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/SecurityException;
}
.end annotation
.prologue
invoke-virtual {p0, p1, p2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->isPackageGoogleSigned(Landroid/content/pm/PackageManager;Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_0
new-instance v0, Ljava/lang/SecurityException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v2, "Signature check failed for "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V
throw v0
:cond_0
return-void
.end method
.method public verifyUidIsGoogleSigned(Landroid/content/pm/PackageManager;I)V
.locals 2
.param p1, "packageManager" # Landroid/content/pm/PackageManager;
.param p2, "uid" # I
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/SecurityException;
}
.end annotation
.prologue
if-nez p1, :cond_0
new-instance v0, Ljava/lang/SecurityException;
const-string/jumbo v1, "Unknown error: invalid Package Manager"
invoke-direct {v0, v1}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V
throw v0
:cond_0
invoke-virtual {p0, p1, p2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->isUidGoogleSigned(Landroid/content/pm/PackageManager;I)Z
move-result v0
if-nez v0, :cond_1
new-instance v0, Ljava/lang/SecurityException;
const-string/jumbo v1, "Uid is not Google Signed"
invoke-direct {v0, v1}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V
throw v0
:cond_1
return-void
.end method
.method varargs zza(Landroid/content/pm/PackageInfo;[Lcom/google/android/gms/common/zzc$zza;)Lcom/google/android/gms/common/zzc$zza;
.locals 6
const/4 v2, 0x0
const/4 v1, 0x0
iget-object v0, p1, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
array-length v0, v0
const/4 v3, 0x1
if-eq v0, v3, :cond_0
const-string/jumbo v0, "GoogleSignatureVerifier"
const-string/jumbo v1, "Package has more than one signature."
invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
move-object v0, v2
:goto_0
return-object v0
:cond_0
new-instance v3, Lcom/google/android/gms/common/zzc$zzb;
iget-object v0, p1, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
aget-object v0, v0, v1
invoke-virtual {v0}, Landroid/content/pm/Signature;->toByteArray()[B
move-result-object v0
invoke-direct {v3, v0}, Lcom/google/android/gms/common/zzc$zzb;-><init>([B)V
move v0, v1
:goto_1
array-length v4, p2
if-ge v0, v4, :cond_2
aget-object v4, p2, v0
invoke-virtual {v4, v3}, Lcom/google/android/gms/common/zzc$zza;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_1
aget-object v0, p2, v0
goto :goto_0
:cond_1
add-int/lit8 v0, v0, 0x1
goto :goto_1
:cond_2
const-string/jumbo v0, "GoogleSignatureVerifier"
const/4 v4, 0x2
invoke-static {v0, v4}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
move-result v0
if-eqz v0, :cond_3
const-string/jumbo v0, "GoogleSignatureVerifier"
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v5, "Signature not valid. Found: \n"
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v3}, Lcom/google/android/gms/common/zzc$zza;->getBytes()[B
move-result-object v3
invoke-static {v3, v1}, Landroid/util/Base64;->encodeToString([BI)Ljava/lang/String;
move-result-object v1
invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
:cond_3
move-object v0, v2
goto :goto_0
.end method
.method public zza(Landroid/content/pm/PackageInfo;Z)Z
.locals 4
const/4 v0, 0x1
const/4 v1, 0x0
if-eqz p1, :cond_1
iget-object v2, p1, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
if-eqz v2, :cond_1
if-eqz p2, :cond_0
sget-object v2, Lcom/google/android/gms/common/zzc$zzcm;->zzapV:[Lcom/google/android/gms/common/zzc$zza;
invoke-virtual {p0, p1, v2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza(Landroid/content/pm/PackageInfo;[Lcom/google/android/gms/common/zzc$zza;)Lcom/google/android/gms/common/zzc$zza;
move-result-object v2
:goto_0
if-eqz v2, :cond_1
:goto_1
return v0
:cond_0
new-array v2, v0, [Lcom/google/android/gms/common/zzc$zza;
sget-object v3, Lcom/google/android/gms/common/zzc$zzcm;->zzapV:[Lcom/google/android/gms/common/zzc$zza;
aget-object v3, v3, v1
aput-object v3, v2, v1
invoke-virtual {p0, p1, v2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza(Landroid/content/pm/PackageInfo;[Lcom/google/android/gms/common/zzc$zza;)Lcom/google/android/gms/common/zzc$zza;
move-result-object v2
goto :goto_0
:cond_1
move v0, v1
goto :goto_1
.end method
.method public zza(Landroid/content/pm/PackageManager;Landroid/content/pm/PackageInfo;)Z
.locals 3
const/4 v2, 0x1
const/4 v0, 0x0
if-nez p2, :cond_1
:cond_0
:goto_0
return v0
:cond_1
invoke-static {p1}, Lcom/google/android/gms/common/GooglePlayServicesUtilLight;->honorsDebugCertificates(Landroid/content/pm/PackageManager;)Z
move-result v1
if-eqz v1, :cond_2
invoke-virtual {p0, p2, v2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza(Landroid/content/pm/PackageInfo;Z)Z
move-result v0
goto :goto_0
:cond_2
invoke-virtual {p0, p2, v0}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza(Landroid/content/pm/PackageInfo;Z)Z
move-result v0
if-nez v0, :cond_0
invoke-virtual {p0, p2, v2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza(Landroid/content/pm/PackageInfo;Z)Z
move-result v1
if-eqz v1, :cond_0
const-string/jumbo v1, "GoogleSignatureVerifier"
const-string/jumbo v2, "Test-keys aren\'t accepted on this build."
invoke-static {v1, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_0
.end method
As for the problem the OP is facing, there is a ridiculously powerful app called My Android Tools available on the playstore that I believe will do everything you need to accomplish.
Those features are left out purposely because its illegal to include in certain areas. And so we don't need it discussed on XDA.
Thread closed.
Darth
Forum Moderator

[HELP][LOG]java.lang.NullPointerException:

Short story, i am modifying systemui and got forcing close.
This is my logcat
Code:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setTextSize(int, float)' on a null object reference
at com.android.systemui.statusbar.phone.KeyguardStatusBarView.onConfigurationChanged(KeyguardStatusBarView.java)
at android.view.View.dispatchConfigurationChanged(View.java:8940)
at android.view.ViewGroup.dispatchConfigurationChanged(ViewGroup.java:1174)
at android.view.ViewGroup.dispatchConfigurationChanged(ViewGroup.java:1178)
at android.view.ViewGroup.dispatchConfigurationChanged(ViewGroup.java:1178)
at android.view.ViewGroup.dispatchConfigurationChanged(ViewGroup.java:1178)
at android.view.ViewGroup.dispatchConfigurationChanged(ViewGroup.java:1178)
at android.view.ViewRootImpl.updateConfiguration(ViewRootImpl.java:3065)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3211)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:5389)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
And this is smali part from the error log
Code:
.method protected onConfigurationChanged(Landroid/content/res/Configuration;)V
.locals 4
const/4 v3, 0x0
invoke-super {p0, p1}, Landroid/widget/RelativeLayout;->onConfigurationChanged(Landroid/content/res/Configuration;)V
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mCarrierLabel:Landroid/widget/TextView;
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->getResources()Landroid/content/res/Resources;
move-result-object v1
const v2, 0x10500f2
invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v1
int-to-float v1, v1
invoke-virtual {v0, v3, v1}, Landroid/widget/TextView;->setTextSize(IF)V
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryLevel:Landroid/widget/TextView;
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->getResources()Landroid/content/res/Resources;
move-result-object v1
const v2, 0x7f0e00b5
invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v1
int-to-float v1, v1
invoke-virtual {v0, v3, v1}, Landroid/widget/TextView;->setTextSize(IF)V
return-void
.end method
And this is fullpart KeyguardStatusBarView.smali
Code:
.class public Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;
.super Landroid/widget/RelativeLayout;
.source "KeyguardStatusBarView.java"
# interfaces
.implements Lcom/android/systemui/statusbar/policy/BatteryController$BatteryPercentCallback;
.implements Lcom/android/systemui/statusbar/policy/BatteryController$BatteryStateChangeCallback;
# instance fields
.field private mBatteryCharging:Z
.field private mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
.field private mBatteryLevel:Landroid/widget/TextView;
.field private mBatteryListening:Z
.field private mCarrierLabel:Landroid/widget/TextView;
.field private mFastOutSlowInInterpolator:Landroid/view/animation/Interpolator;
.field private mKeyguardUserSwitcher:Lcom/android/systemui/statusbar/policy/KeyguardUserSwitcher;
.field private mKeyguardUserSwitcherShowing:Z
.field private mMultiUserAvatar:Landroid/widget/ImageView;
.field private mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
.field private mSystemIconsSuperContainer:Landroid/view/View;
.field private mSystemIconsSwitcherHiddenExpandedMargin:I
# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals 0
invoke-direct {p0, p1, p2}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
return-void
.end method
.method static synthetic access$000(Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;)Landroid/widget/ImageView;
.locals 1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserAvatar:Landroid/widget/ImageView;
return-object v0
.end method
.method static synthetic access$100(Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;)Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
.locals 1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
return-object v0
.end method
.method static synthetic access$200(Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;)Landroid/view/View;
.locals 1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mSystemIconsSuperContainer:Landroid/view/View;
return-object v0
.end method
.method static synthetic access$300(Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;)Landroid/view/animation/Interpolator;
.locals 1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mFastOutSlowInInterpolator:Landroid/view/animation/Interpolator;
return-object v0
.end method
.method private animateNextLayoutChange()V
.locals 4
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mSystemIconsSuperContainer:Landroid/view/View;
invoke-virtual {v2}, Landroid/view/View;->getLeft()I
move-result v0
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/MultiUserSwitch;->getParent()Landroid/view/ViewParent;
move-result-object v2
if-ne v2, p0, :cond_0
const/4 v1, 0x1
:goto_0
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->getViewTreeObserver()Landroid/view/ViewTreeObserver;
move-result-object v2
new-instance v3, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView$2;
invoke-direct {v3, p0, v1, v0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView$2;-><init>(Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;ZI)V
invoke-virtual {v2, v3}, Landroid/view/ViewTreeObserver;->addOnPreDrawListener(Landroid/view/ViewTreeObserver$OnPreDrawListener;)V
return-void
:cond_0
const/4 v1, 0x0
goto :goto_0
.end method
.method private loadDimens()V
.locals 2
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->getResources()Landroid/content/res/Resources;
move-result-object v0
const v1, 0x7f0e0091
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v0
iput v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mSystemIconsSwitcherHiddenExpandedMargin:I
return-void
.end method
.method private updateSystemIconsLayoutParams()V
.locals 3
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mSystemIconsSuperContainer:Landroid/view/View;
invoke-virtual {v2}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
move-result-object v0
check-cast v0, Landroid/widget/RelativeLayout$LayoutParams;
iget-boolean v2, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mKeyguardUserSwitcherShowing:Z
if-eqz v2, :cond_1
iget v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mSystemIconsSwitcherHiddenExpandedMargin:I
:goto_0
invoke-virtual {v0}, Landroid/widget/RelativeLayout$LayoutParams;->getMarginEnd()I
move-result v2
if-eq v1, v2, :cond_0
invoke-virtual {v0, v1}, Landroid/widget/RelativeLayout$LayoutParams;->setMarginEnd(I)V
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mSystemIconsSuperContainer:Landroid/view/View;
invoke-virtual {v2, v0}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
:cond_0
return-void
:cond_1
const/4 v1, 0x0
goto :goto_0
.end method
.method private updateUserSwitcher()V
.locals 2
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mKeyguardUserSwitcher:Lcom/android/systemui/statusbar/policy/KeyguardUserSwitcher;
if-eqz v1, :cond_0
const/4 v0, 0x1
:goto_0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
invoke-virtual {v1, v0}, Lcom/android/systemui/statusbar/phone/MultiUserSwitch;->setClickable(Z)V
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
invoke-virtual {v1, v0}, Lcom/android/systemui/statusbar/phone/MultiUserSwitch;->setFocusable(Z)V
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
invoke-virtual {v1, v0}, Lcom/android/systemui/statusbar/phone/MultiUserSwitch;->setKeyguardMode(Z)V
return-void
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method private updateVisibilities()V
.locals 5
const/16 v2, 0x8
const/4 v3, 0x0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
invoke-virtual {v1}, Lcom/android/systemui/statusbar/phone/MultiUserSwitch;->getParent()Landroid/view/ViewParent;
move-result-object v1
if-eq v1, p0, :cond_3
iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mKeyguardUserSwitcherShowing:Z
if-nez v1, :cond_3
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
invoke-virtual {v1}, Lcom/android/systemui/statusbar/phone/MultiUserSwitch;->getParent()Landroid/view/ViewParent;
move-result-object v1
if-eqz v1, :cond_0
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->getOverlay()Landroid/view/ViewGroupOverlay;
move-result-object v1
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
invoke-virtual {v1, v4}, Landroid/view/ViewGroupOverlay;->remove(Landroid/view/View;)V
:cond_0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
invoke-virtual {p0, v1, v3}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->addView(Landroid/view/View;I)V
:cond_1
:goto_0
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryLevel:Landroid/widget/TextView;
iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryCharging:Z
if-nez v1, :cond_2
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
invoke-virtual {v1}, Lcom/android/systemui/statusbar/policy/BatteryController;->showPercent()Z
move-result v1
if-eqz v1, :cond_4
:cond_2
move v1, v3
:goto_1
invoke-virtual {v4, v1}, Landroid/widget/TextView;->setVisibility(I)V
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->getResources()Landroid/content/res/Resources;
move-result-object v1
const v4, 0x7f0a0061
invoke-virtual {v1, v4}, Landroid/content/res/Resources;->getBoolean(I)Z
move-result v0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mCarrierLabel:Landroid/widget/TextView;
if-eqz v0, :cond_5
:goto_2
invoke-virtual {v1, v3}, Landroid/widget/TextView;->setVisibility(I)V
return-void
:cond_3
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
invoke-virtual {v1}, Lcom/android/systemui/statusbar/phone/MultiUserSwitch;->getParent()Landroid/view/ViewParent;
move-result-object v1
if-ne v1, p0, :cond_1
iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mKeyguardUserSwitcherShowing:Z
if-eqz v1, :cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->removeView(Landroid/view/View;)V
goto :goto_0
:cond_4
move v1, v2
goto :goto_1
:cond_5
move v3, v2
goto :goto_2
.end method
# virtual methods
.method public hasOverlappingRendering()Z
.locals 1
const/4 v0, 0x0
return v0
.end method
.method public onBatteryLevelChanged(IZZ)V
.locals 8
invoke-static {}, Ljava/text/NumberFormat;->getPercentInstance()Ljava/text/NumberFormat;
move-result-object v2
int-to-double v4, p1
const-wide/high16 v6, 0x4059000000000000L # 100.0
div-double/2addr v4, v6
invoke-virtual {v2, v4, v5}, Ljava/text/NumberFormat;->format(D)Ljava/lang/String;
move-result-object v1
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryLevel:Landroid/widget/TextView;
invoke-virtual {v2, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
iget-boolean v2, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryCharging:Z
if-eq v2, p3, :cond_1
const/4 v0, 0x1
:goto_0
iput-boolean p3, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryCharging:Z
if-eqz v0, :cond_0
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->updateVisibilities()V
:cond_0
return-void
:cond_1
const/4 v0, 0x0
goto :goto_0
.end method
.method protected onConfigurationChanged(Landroid/content/res/Configuration;)V
.locals 4
const/4 v3, 0x0
invoke-super {p0, p1}, Landroid/widget/RelativeLayout;->onConfigurationChanged(Landroid/content/res/Configuration;)V
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mCarrierLabel:Landroid/widget/TextView;
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->getResources()Landroid/content/res/Resources;
move-result-object v1
const v2, 0x10500f2
invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v1
int-to-float v1, v1
invoke-virtual {v0, v3, v1}, Landroid/widget/TextView;->setTextSize(IF)V
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryLevel:Landroid/widget/TextView;
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->getResources()Landroid/content/res/Resources;
move-result-object v1
const v2, 0x7f0e00b5
invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v1
int-to-float v1, v1
invoke-virtual {v0, v3, v1}, Landroid/widget/TextView;->setTextSize(IF)V
return-void
.end method
.method protected onFinishInflate()V
.locals 2
invoke-super {p0}, Landroid/widget/RelativeLayout;->onFinishInflate()V
const v0, 0x7f1000a0
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mSystemIconsSuperContainer:Landroid/view/View;
const v0, 0x7f10009e
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
const v0, 0x7f10009f
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/ImageView;
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserAvatar:Landroid/widget/ImageView;
const v0, 0x7f1000a2
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/TextView;
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryLevel:Landroid/widget/TextView;
const v0, 0x7f1000a3
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/TextView;
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mCarrierLabel:Landroid/widget/TextView;
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->loadDimens()V
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->getContext()Landroid/content/Context;
move-result-object v0
const v1, 0x10c000d
invoke-static {v0, v1}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mFastOutSlowInInterpolator:Landroid/view/animation/Interpolator;
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->updateUserSwitcher()V
return-void
.end method
.method public onPowerSaveChanged()V
.locals 0
return-void
.end method
.method public onShowPercentChanged()V
.locals 0
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->updateVisibilities()V
return-void
.end method
.method public setBatteryController(Lcom/android/systemui/statusbar/policy/BatteryController;)V
.locals 1
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
const v0, 0x7f100112
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Lcom/android/systemui/BatteryMeterView;
invoke-virtual {v0, p1}, Lcom/android/systemui/BatteryMeterView;->setBatteryController(Lcom/android/systemui/statusbar/policy/BatteryController;)V
return-void
.end method
.method public setKeyguardUserSwitcher(Lcom/android/systemui/statusbar/policy/KeyguardUserSwitcher;)V
.locals 1
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mKeyguardUserSwitcher:Lcom/android/systemui/statusbar/policy/KeyguardUserSwitcher;
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
invoke-virtual {v0, p1}, Lcom/android/systemui/statusbar/phone/MultiUserSwitch;->setKeyguardUserSwitcher(Lcom/android/systemui/statusbar/policy/KeyguardUserSwitcher;)V
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->updateUserSwitcher()V
return-void
.end method
.method public setKeyguardUserSwitcherShowing(ZZ)V
.locals 0
iput-boolean p1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mKeyguardUserSwitcherShowing:Z
if-eqz p2, :cond_0
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->animateNextLayoutChange()V
:cond_0
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->updateVisibilities()V
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->updateSystemIconsLayoutParams()V
return-void
.end method
.method public setListening(Z)V
.locals 1
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryListening:Z
if-ne p1, v0, :cond_0
:goto_0
return-void
:cond_0
iput-boolean p1, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryListening:Z
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryListening:Z
if-eqz v0, :cond_1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
invoke-virtual {v0, p0}, Lcom/android/systemui/statusbar/policy/BatteryController;->addStateChangedCallback(Lcom/android/systemui/statusbar/policy/BatteryController$BatteryStateChangeCallback;)V
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
invoke-virtual {v0, p0}, Lcom/android/systemui/statusbar/policy/BatteryController;->addPercentCallback(Lcom/android/systemui/statusbar/policy/BatteryController$BatteryPercentCallback;)V
goto :goto_0
:cond_1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
invoke-virtual {v0, p0}, Lcom/android/systemui/statusbar/policy/BatteryController;->removeStateChangedCallback(Lcom/android/systemui/statusbar/policy/BatteryController$BatteryStateChangeCallback;)V
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
invoke-virtual {v0, p0}, Lcom/android/systemui/statusbar/policy/BatteryController;->removePercentCallback(Lcom/android/systemui/statusbar/policy/BatteryController$BatteryPercentCallback;)V
goto :goto_0
.end method
.method public setUserInfoController(Lcom/android/systemui/statusbar/policy/UserInfoController;)V
.locals 1
new-instance v0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView$1;-><init>(Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;)V
invoke-virtual {p1, v0}, Lcom/android/systemui/statusbar/policy/UserInfoController;->addListener(Lcom/android/systemui/statusbar/policy/UserInfoController$OnUserInfoChangedListener;)V
return-void
.end method
.method public setUserSwitcherController(Lcom/android/systemui/statusbar/policy/UserSwitcherController;)V
.locals 1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
invoke-virtual {v0, p1}, Lcom/android/systemui/statusbar/phone/MultiUserSwitch;->setUserSwitcherController(Lcom/android/systemui/statusbar/policy/UserSwitcherController;)V
return-void
.end method
.method public setVisibility(I)V
.locals 2
invoke-super {p0, p1}, Landroid/widget/RelativeLayout;->setVisibility(I)V
if-eqz p1, :cond_0
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mSystemIconsSuperContainer:Landroid/view/View;
invoke-virtual {v0}, Landroid/view/View;->animate()Landroid/view/ViewPropertyAnimator;
move-result-object v0
invoke-virtual {v0}, Landroid/view/ViewPropertyAnimator;->cancel()V
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/MultiUserSwitch;->animate()Landroid/view/ViewPropertyAnimator;
move-result-object v0
invoke-virtual {v0}, Landroid/view/ViewPropertyAnimator;->cancel()V
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;->mMultiUserSwitch:Lcom/android/systemui/statusbar/phone/MultiUserSwitch;
const/high16 v1, 0x3f800000 # 1.0f
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/MultiUserSwitch;->setAlpha(F)V
:cond_0
return-void
.end method
Any help is apreciated.
Upload all the files in a zip
-Hope- said:
Upload all the files in a zip
Click to expand...
Click to collapse
Here the files, packed in a zip
nophyan said:
Here the files, packed in a zip
Click to expand...
Click to collapse
Hello, did you get your logcat using adb?
plug your phone to pc type in : adb logcat > logcatname2017.txt
work with the phone until the error pops up -while it's still plugged in-
wait a bit then press ctrl +C then upload the logcat
logging through adb is better to understand
-Hope- said:
Hello, did you get your logcat using adb?
plug your phone to pc type in : adb logcat > logcatname2017.txt
work with the phone until the error pops up -while it's still plugged in-
wait a bit then press ctrl +C then upload the logcat
logging through adb is better to understand
Click to expand...
Click to collapse
Oh, i use autogenerated log by android for crash app on data/system/dropbox/crash.txt
I will upload adb log later
Now i attach logcat via adb
nophyan said:
Now i attach logcat via adb
Click to expand...
Click to collapse
Hello again i surfed through the log and found out it was AndroidRuntime having problem executing methods
however try using CM security to see it it detects what's wrong or try these basic troubleshootings: https://android-fix.com/android-errors/41-unfortunately-system-ui-has-stopped.html
-Hope- said:
Hello again i surfed through the log and found out it was AndroidRuntime having problem executing methods
however try using CM security to see it it detects what's wrong or try these basic troubleshootings: https://android-fix.com/android-errors/41-unfortunately-system-ui-has-stopped.html
Click to expand...
Click to collapse
I think that app will not help, because i was modified my systemui using apktool, and on half way i found this error log, the only way is change the smali code, but i'm bad on coding
nophyan said:
I think that app will not help, because i was modified my systemui using apktool, and on half way i found this error log, the only way is change the smali code, but i'm bad on coding
Click to expand...
Click to collapse
What did you modify exactly?

Categories

Resources