[HELP][LOG]java.lang.NullPointerException: - General Questions and Answers

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?

Related

Change/Fake Screen Size in Dalvik not DPI

As the titles implies, i'd be glad to know if there is a way to fake or change the screen size of the optimus one...
I'm not talking about DPI but the aspect ratio... I want to basically let an application think that my screen is an 800x480 or more.
I have tried by decompiling the apk and tweaking with some codes, but i'm no java expert so i've decided to change my approach to this issue.
By searching around i found out that this apk directly reads the screen size from the "DeviceInfoAndroid,smali" which i assume takes the code directly from the dalvik.
Thanks in advance
This is the DeviceInfoAndroid.smali
Code:
.class public Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;
.super Ljava/lang/Object;
# static fields
.field static a:Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;
# instance fields
.field b:J
.field c:Landroid/net/wifi/WifiManager;
.field d:Landroid/telephony/TelephonyManager;
.field e:Landroid/net/ConnectivityManager;
.field f:Landroid/content/pm/PackageManager;
.field g:Landroid/view/WindowManager;
.field h:Landroid/app/ActivityManager;
# direct methods
.method public constructor <init>()V
.locals 2
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
sput-object p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->a:Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;
invoke-direct {p0}, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->createCPPFacade()J
move-result-wide v0
iput-wide v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->b:J
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
const-string v1, "wifi"
invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/net/wifi/WifiManager;
iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->c:Landroid/net/wifi/WifiManager;
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
const-string v1, "phone"
invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/telephony/TelephonyManager;
iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
const-string v1, "connectivity"
invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/net/ConnectivityManager;
iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->e:Landroid/net/ConnectivityManager;
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
invoke-virtual {v0}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v0
iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->f:Landroid/content/pm/PackageManager;
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
const-string v1, "window"
invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/view/WindowManager;
iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->g:Landroid/view/WindowManager;
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
const-string v1, "activity"
invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/ActivityManager;
iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->h:Landroid/app/ActivityManager;
return-void
.end method
.method private _areVoiceCallsSupported()Z
.locals 3
const/4 v0, 0x0
:try_start_0
invoke-virtual {p0}, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->_isLargeScreen()Z
move-result v1
if-nez v1, :cond_0
iget-object v1, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;
invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getPhoneType()I
move-result v1
if-eqz v1, :cond_0
iget-object v1, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;
invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getPhoneType()I
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
move-result v1
const/4 v2, 0x3
if-eq v1, v2, :cond_0
const/4 v0, 0x1
:cond_0
:goto_0
return v0
:catch_0
move-exception v1
goto :goto_0
.end method
.method private _getCPUInfo()Ljava/lang/String;
.locals 1
const-string v0, "ARM"
return-object v0
.end method
.method private _getCurrentNetworkConnectionType()Ljava/lang/String;
.locals 2
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->e:Landroid/net/ConnectivityManager;
const/4 v1, 0x1
invoke-virtual {v0, v1}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo;
move-result-object v0
invoke-virtual {v0}, Landroid/net/NetworkInfo;->isConnected()Z
move-result v0
if-eqz v0, :cond_0
const-string v0, "WiFi"
:goto_0
return-object v0
:cond_0
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->e:Landroid/net/ConnectivityManager;
const/4 v1, 0x0
invoke-virtual {v0, v1}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo;
move-result-object v0
invoke-virtual {v0}, Landroid/net/NetworkInfo;->isConnected()Z
move-result v0
if-eqz v0, :cond_1
const-string v0, "Cellular"
goto :goto_0
:cond_1
const-string v0, "UNKNOWN"
goto :goto_0
.end method
.method private _getMACAddress()Ljava/lang/String;
.locals 1
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->c:Landroid/net/wifi/WifiManager;
if-eqz v0, :cond_1
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->c:Landroid/net/wifi/WifiManager;
invoke-virtual {v0}, Landroid/net/wifi/WifiManager;->getConnectionInfo()Landroid/net/wifi/WifiInfo;
move-result-object v0
invoke-virtual {v0}, Landroid/net/wifi/WifiInfo;->getMacAddress()Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_0
:goto_0
return-object v0
:cond_0
const-string v0, ""
goto :goto_0
:cond_1
const-string v0, ""
goto :goto_0
.end method
.method private _getMaxAppMemory()J
.locals 2
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Runtime;->maxMemory()J
move-result-wide v0
return-wide v0
.end method
.method private _getMemoryInfo()J
.locals 2
new-instance v0, Landroid/app/ActivityManager$MemoryInfo;
invoke-direct {v0}, Landroid/app/ActivityManager$MemoryInfo;-><init>()V
iget-object v1, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->h:Landroid/app/ActivityManager;
invoke-virtual {v1, v0}, Landroid/app/ActivityManager;->getMemoryInfo(Landroid/app/ActivityManager$MemoryInfo;)V
iget-wide v0, v0, Landroid/app/ActivityManager$MemoryInfo;->availMem:J
return-wide v0
.end method
.method private _getNetworkCarrierName()Ljava/lang/String;
.locals 2
:try_start_0
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;
invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getSimState()I
move-result v0
const/4 v1, 0x5
if-ne v0, v1, :cond_0
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;
invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getSimOperatorName()Ljava/lang/String;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v0
:goto_0
return-object v0
:catch_0
move-exception v0
:cond_0
const-string v0, "UNKNOWN"
goto :goto_0
.end method
.method private _getScreenSize()D
.locals 5
invoke-virtual {p0}, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->_getScreenResolution()[I
move-result-object v0
new-instance v1, Landroid/util/DisplayMetrics;
invoke-direct {v1}, Landroid/util/DisplayMetrics;-><init>()V
iget-object v2, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->g:Landroid/view/WindowManager;
invoke-interface {v2}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;
move-result-object v2
invoke-virtual {v2, v1}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V
const/4 v2, 0x0
aget v2, v0, v2
int-to-float v2, v2
iget v3, v1, Landroid/util/DisplayMetrics;->xdpi:F
div-float/2addr v2, v3
float-to-double v2, v2
const/4 v4, 0x1
aget v0, v0, v4
int-to-float v0, v0
iget v1, v1, Landroid/util/DisplayMetrics;->ydpi:F
div-float/2addr v0, v1
float-to-double v0, v0
mul-double/2addr v2, v2
mul-double/2addr v0, v0
add-double/2addr v0, v2
invoke-static {v0, v1}, Ljava/lang/Math;->sqrt(D)D
move-result-wide v0
const-wide/high16 v2, 0x4024
mul-double/2addr v0, v2
double-to-int v0, v0
int-to-float v0, v0
const/high16 v1, 0x4120
div-float/2addr v0, v1
float-to-double v0, v0
return-wide v0
.end method
.method private _getTotalStorage()J
.locals 2
const-wide/16 v0, 0x0
return-wide v0
.end method
.method private _isInstalledInInternalMemory()Z
.locals 4
const/4 v0, 0x0
:try_start_0
iget-object v1, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->f:Landroid/content/pm/PackageManager;
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v2
invoke-virtual {v2}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getPackageName()Ljava/lang/String;
move-result-object v2
const/4 v3, 0x0
invoke-virtual {v1, v2, v3}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
move-result-object v1
iget-object v1, v1, Landroid/content/pm/PackageInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;
iget v1, v1, Landroid/content/pm/ApplicationInfo;->flags:I
:try_end_0
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
const/high16 v2, 0x4
and-int/2addr v1, v2
if-lez v1, :cond_0
const/4 v0, 0x1
:cond_0
:goto_0
return v0
:catch_0
move-exception v1
goto :goto_0
.end method
.method private _isRoaming()Z
.locals 1
:try_start_0
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;
invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->isNetworkRoaming()Z
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
move-result v0
:goto_0
return v0
:catch_0
move-exception v0
const/4 v0, 0x0
goto :goto_0
.end method
.method public static a()Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;
.locals 1
sget-object v0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->a:Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;
return-object v0
.end method
.method private native createCPPFacade()J
.end method
# virtual methods
.method public _getAndroidID()Ljava/lang/String;
.locals 2
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
invoke-virtual {v0}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "android_id"
invoke-static {v0, v1}, Landroid/provider/Settings$Secure;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_0
:goto_0
return-object v0
:cond_0
const-string v0, ""
goto :goto_0
.end method
.method public _getMake()Ljava/lang/String;
.locals 1
sget-object v0, Landroid/os/Build;->MANUFACTURER:Ljava/lang/String;
return-object v0
.end method
.method public _getModel()Ljava/lang/String;
.locals 2
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
sget-object v1, Landroid/os/Build;->MODEL:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, " ("
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
sget-object v1, Landroid/os/Build;->PRODUCT:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, ")"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public _getOSVersion()Ljava/lang/String;
.locals 1
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
invoke-static {v0}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public _getScreenResolution()[I
.locals 7
const/4 v2, 0x0
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0xd
if-lt v0, v1, :cond_2
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->g:Landroid/view/WindowManager;
invoke-interface {v0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;
move-result-object v3
:try_start_0
const-class v0, Landroid/view/Display;
const-string v1, "getRawWidth"
const/4 v4, 0x0
new-array v4, v4, [Ljava/lang/Class;
invoke-virtual {v0, v1, v4}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v4
const-class v0, Landroid/view/Display;
const-string v1, "getRawHeight"
const/4 v5, 0x0
new-array v5, v5, [Ljava/lang/Class;
invoke-virtual {v0, v1, v5}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v0
const/4 v1, 0x0
new-array v1, v1, [Ljava/lang/Object;
invoke-virtual {v0, v3, v1}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/Integer;
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
move-result v1
const/4 v0, 0x0
new-array v0, v0, [Ljava/lang/Object;
invoke-virtual {v4, v3, v0}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/Integer;
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
move-result v0
if-le v1, v0, :cond_0
move v3, v1
:goto_0
if-le v1, v0, :cond_1
:goto_1
move v1, v3
:goto_2
const/4 v3, 0x2
new-array v3, v3, [I
aput v1, v3, v2
const/4 v1, 0x1
aput v0, v3, v1
return-object v3
:cond_0
move v3, v0
goto :goto_0
:cond_1
move v0, v1
goto :goto_1
:catch_0
move-exception v0
move v0, v2
move v1, v2
goto :goto_2
:cond_2
new-instance v1, Landroid/util/DisplayMetrics;
invoke-direct {v1}, Landroid/util/DisplayMetrics;-><init>()V
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->g:Landroid/view/WindowManager;
invoke-interface {v0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;
move-result-object v0
invoke-virtual {v0, v1}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V
iget v0, v1, Landroid/util/DisplayMetrics;->widthPixels:I
iget v3, v1, Landroid/util/DisplayMetrics;->heightPixels:I
if-le v0, v3, :cond_3
iget v0, v1, Landroid/util/DisplayMetrics;->widthPixels:I
:goto_3
iget v3, v1, Landroid/util/DisplayMetrics;->widthPixels:I
iget v4, v1, Landroid/util/DisplayMetrics;->heightPixels:I
if-le v3, v4, :cond_4
iget v1, v1, Landroid/util/DisplayMetrics;->heightPixels:I
:goto_4
move v6, v1
move v1, v0
move v0, v6
goto :goto_2
:cond_3
iget v0, v1, Landroid/util/DisplayMetrics;->heightPixels:I
goto :goto_3
:cond_4
iget v1, v1, Landroid/util/DisplayMetrics;->widthPixels:I
goto :goto_4
.end method
.method public _isLargeScreen()Z
.locals 2
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
invoke-virtual {v0}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getResources()Landroid/content/res/Resources;
move-result-object v0
invoke-virtual {v0}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;
move-result-object v0
iget v0, v0, Landroid/content/res/Configuration;->screenLayout:I
and-int/lit8 v0, v0, 0xf
const/4 v1, 0x4
if-lt v0, v1, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method

Change/Fake Screen Size in Dalvik not DPI

As the titles implies, i'd be glad to know if there is a way to fake or change the screen size of the optimus one...
I'm not talking about DPI but the aspect ratio... I want to basically let an application think that my screen is an 800x480 or more.
I have tried by decompiling the apk and tweaking with some codes, but i'm no java expert so i've decided to change my approach to this issue.
By searching around i found out that this apk directly reads the screen size from the "DeviceInfoAndroid,smali" which i assume takes the code directly from the dalvik.
Thanks in advance
This is the DeviceInfoAndroid.smali
Code:
.class public Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;
.super Ljava/lang/Object;
# static fields
.field static a:Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;
# instance fields
.field b:J
.field c:Landroid/net/wifi/WifiManager;
.field d:Landroid/telephony/TelephonyManager;
.field e:Landroid/net/ConnectivityManager;
.field f:Landroid/content/pm/PackageManager;
.field g:Landroid/view/WindowManager;
.field h:Landroid/app/ActivityManager;
# direct methods
.method public constructor <init>()V
.locals 2
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
sput-object p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->a:Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;
invoke-direct {p0}, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->createCPPFacade()J
move-result-wide v0
iput-wide v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->b:J
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
const-string v1, "wifi"
invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/net/wifi/WifiManager;
iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->c:Landroid/net/wifi/WifiManager;
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
const-string v1, "phone"
invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/telephony/TelephonyManager;
iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
const-string v1, "connectivity"
invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/net/ConnectivityManager;
iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->e:Landroid/net/ConnectivityManager;
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
invoke-virtual {v0}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v0
iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->f:Landroid/content/pm/PackageManager;
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
const-string v1, "window"
invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/view/WindowManager;
iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->g:Landroid/view/WindowManager;
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
const-string v1, "activity"
invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/ActivityManager;
iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->h:Landroid/app/ActivityManager;
return-void
.end method
.method private _areVoiceCallsSupported()Z
.locals 3
const/4 v0, 0x0
:try_start_0
invoke-virtual {p0}, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->_isLargeScreen()Z
move-result v1
if-nez v1, :cond_0
iget-object v1, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;
invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getPhoneType()I
move-result v1
if-eqz v1, :cond_0
iget-object v1, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;
invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getPhoneType()I
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
move-result v1
const/4 v2, 0x3
if-eq v1, v2, :cond_0
const/4 v0, 0x1
:cond_0
:goto_0
return v0
:catch_0
move-exception v1
goto :goto_0
.end method
.method private _getCPUInfo()Ljava/lang/String;
.locals 1
const-string v0, "ARM"
return-object v0
.end method
.method private _getCurrentNetworkConnectionType()Ljava/lang/String;
.locals 2
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->e:Landroid/net/ConnectivityManager;
const/4 v1, 0x1
invoke-virtual {v0, v1}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo;
move-result-object v0
invoke-virtual {v0}, Landroid/net/NetworkInfo;->isConnected()Z
move-result v0
if-eqz v0, :cond_0
const-string v0, "WiFi"
:goto_0
return-object v0
:cond_0
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->e:Landroid/net/ConnectivityManager;
const/4 v1, 0x0
invoke-virtual {v0, v1}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo;
move-result-object v0
invoke-virtual {v0}, Landroid/net/NetworkInfo;->isConnected()Z
move-result v0
if-eqz v0, :cond_1
const-string v0, "Cellular"
goto :goto_0
:cond_1
const-string v0, "UNKNOWN"
goto :goto_0
.end method
.method private _getMACAddress()Ljava/lang/String;
.locals 1
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->c:Landroid/net/wifi/WifiManager;
if-eqz v0, :cond_1
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->c:Landroid/net/wifi/WifiManager;
invoke-virtual {v0}, Landroid/net/wifi/WifiManager;->getConnectionInfo()Landroid/net/wifi/WifiInfo;
move-result-object v0
invoke-virtual {v0}, Landroid/net/wifi/WifiInfo;->getMacAddress()Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_0
:goto_0
return-object v0
:cond_0
const-string v0, ""
goto :goto_0
:cond_1
const-string v0, ""
goto :goto_0
.end method
.method private _getMaxAppMemory()J
.locals 2
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Runtime;->maxMemory()J
move-result-wide v0
return-wide v0
.end method
.method private _getMemoryInfo()J
.locals 2
new-instance v0, Landroid/app/ActivityManager$MemoryInfo;
invoke-direct {v0}, Landroid/app/ActivityManager$MemoryInfo;-><init>()V
iget-object v1, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->h:Landroid/app/ActivityManager;
invoke-virtual {v1, v0}, Landroid/app/ActivityManager;->getMemoryInfo(Landroid/app/ActivityManager$MemoryInfo;)V
iget-wide v0, v0, Landroid/app/ActivityManager$MemoryInfo;->availMem:J
return-wide v0
.end method
.method private _getNetworkCarrierName()Ljava/lang/String;
.locals 2
:try_start_0
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;
invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getSimState()I
move-result v0
const/4 v1, 0x5
if-ne v0, v1, :cond_0
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;
invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getSimOperatorName()Ljava/lang/String;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v0
:goto_0
return-object v0
:catch_0
move-exception v0
:cond_0
const-string v0, "UNKNOWN"
goto :goto_0
.end method
.method private _getScreenSize()D
.locals 5
invoke-virtual {p0}, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->_getScreenResolution()[I
move-result-object v0
new-instance v1, Landroid/util/DisplayMetrics;
invoke-direct {v1}, Landroid/util/DisplayMetrics;-><init>()V
iget-object v2, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->g:Landroid/view/WindowManager;
invoke-interface {v2}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;
move-result-object v2
invoke-virtual {v2, v1}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V
const/4 v2, 0x0
aget v2, v0, v2
int-to-float v2, v2
iget v3, v1, Landroid/util/DisplayMetrics;->xdpi:F
div-float/2addr v2, v3
float-to-double v2, v2
const/4 v4, 0x1
aget v0, v0, v4
int-to-float v0, v0
iget v1, v1, Landroid/util/DisplayMetrics;->ydpi:F
div-float/2addr v0, v1
float-to-double v0, v0
mul-double/2addr v2, v2
mul-double/2addr v0, v0
add-double/2addr v0, v2
invoke-static {v0, v1}, Ljava/lang/Math;->sqrt(D)D
move-result-wide v0
const-wide/high16 v2, 0x4024
mul-double/2addr v0, v2
double-to-int v0, v0
int-to-float v0, v0
const/high16 v1, 0x4120
div-float/2addr v0, v1
float-to-double v0, v0
return-wide v0
.end method
.method private _getTotalStorage()J
.locals 2
const-wide/16 v0, 0x0
return-wide v0
.end method
.method private _isInstalledInInternalMemory()Z
.locals 4
const/4 v0, 0x0
:try_start_0
iget-object v1, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->f:Landroid/content/pm/PackageManager;
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v2
invoke-virtual {v2}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getPackageName()Ljava/lang/String;
move-result-object v2
const/4 v3, 0x0
invoke-virtual {v1, v2, v3}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
move-result-object v1
iget-object v1, v1, Landroid/content/pm/PackageInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;
iget v1, v1, Landroid/content/pm/ApplicationInfo;->flags:I
:try_end_0
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
const/high16 v2, 0x4
and-int/2addr v1, v2
if-lez v1, :cond_0
const/4 v0, 0x1
:cond_0
:goto_0
return v0
:catch_0
move-exception v1
goto :goto_0
.end method
.method private _isRoaming()Z
.locals 1
:try_start_0
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;
invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->isNetworkRoaming()Z
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
move-result v0
:goto_0
return v0
:catch_0
move-exception v0
const/4 v0, 0x0
goto :goto_0
.end method
.method public static a()Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;
.locals 1
sget-object v0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->a:Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;
return-object v0
.end method
.method private native createCPPFacade()J
.end method
# virtual methods
.method public _getAndroidID()Ljava/lang/String;
.locals 2
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
invoke-virtual {v0}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "android_id"
invoke-static {v0, v1}, Landroid/provider/Settings$Secure;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_0
:goto_0
return-object v0
:cond_0
const-string v0, ""
goto :goto_0
.end method
.method public _getMake()Ljava/lang/String;
.locals 1
sget-object v0, Landroid/os/Build;->MANUFACTURER:Ljava/lang/String;
return-object v0
.end method
.method public _getModel()Ljava/lang/String;
.locals 2
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
sget-object v1, Landroid/os/Build;->MODEL:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, " ("
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
sget-object v1, Landroid/os/Build;->PRODUCT:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, ")"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public _getOSVersion()Ljava/lang/String;
.locals 1
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
invoke-static {v0}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public _getScreenResolution()[I
.locals 7
const/4 v2, 0x0
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0xd
if-lt v0, v1, :cond_2
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->g:Landroid/view/WindowManager;
invoke-interface {v0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;
move-result-object v3
:try_start_0
const-class v0, Landroid/view/Display;
const-string v1, "getRawWidth"
const/4 v4, 0x0
new-array v4, v4, [Ljava/lang/Class;
invoke-virtual {v0, v1, v4}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v4
const-class v0, Landroid/view/Display;
const-string v1, "getRawHeight"
const/4 v5, 0x0
new-array v5, v5, [Ljava/lang/Class;
invoke-virtual {v0, v1, v5}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v0
const/4 v1, 0x0
new-array v1, v1, [Ljava/lang/Object;
invoke-virtual {v0, v3, v1}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/Integer;
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
move-result v1
const/4 v0, 0x0
new-array v0, v0, [Ljava/lang/Object;
invoke-virtual {v4, v3, v0}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/Integer;
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
move-result v0
if-le v1, v0, :cond_0
move v3, v1
:goto_0
if-le v1, v0, :cond_1
:goto_1
move v1, v3
:goto_2
const/4 v3, 0x2
new-array v3, v3, [I
aput v1, v3, v2
const/4 v1, 0x1
aput v0, v3, v1
return-object v3
:cond_0
move v3, v0
goto :goto_0
:cond_1
move v0, v1
goto :goto_1
:catch_0
move-exception v0
move v0, v2
move v1, v2
goto :goto_2
:cond_2
new-instance v1, Landroid/util/DisplayMetrics;
invoke-direct {v1}, Landroid/util/DisplayMetrics;-><init>()V
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->g:Landroid/view/WindowManager;
invoke-interface {v0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;
move-result-object v0
invoke-virtual {v0, v1}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V
iget v0, v1, Landroid/util/DisplayMetrics;->widthPixels:I
iget v3, v1, Landroid/util/DisplayMetrics;->heightPixels:I
if-le v0, v3, :cond_3
iget v0, v1, Landroid/util/DisplayMetrics;->widthPixels:I
:goto_3
iget v3, v1, Landroid/util/DisplayMetrics;->widthPixels:I
iget v4, v1, Landroid/util/DisplayMetrics;->heightPixels:I
if-le v3, v4, :cond_4
iget v1, v1, Landroid/util/DisplayMetrics;->heightPixels:I
:goto_4
move v6, v1
move v1, v0
move v0, v6
goto :goto_2
:cond_3
iget v0, v1, Landroid/util/DisplayMetrics;->heightPixels:I
goto :goto_3
:cond_4
iget v1, v1, Landroid/util/DisplayMetrics;->widthPixels:I
goto :goto_4
.end method
.method public _isLargeScreen()Z
.locals 2
invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;
move-result-object v0
invoke-virtual {v0}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getResources()Landroid/content/res/Resources;
move-result-object v0
invoke-virtual {v0}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;
move-result-object v0
iget v0, v0, Landroid/content/res/Configuration;->screenLayout:I
and-int/lit8 v0, v0, 0xf
const/4 v1, 0x4
if-lt v0, v1, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method

[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][HOW TO] Quick PIN Unlock And Scramble Pad For Lollipop

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

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

Categories

Resources