[Q] Small AM/PM for Synergy JB v0.2 - Verizon Samsung Galaxy S III

I know how to make the Clock.smali edit to make this change on ICS but I can not figure out how to change it on JB. Is there more changes than just the Clock.smali edit that needs made?
Complete ****.smali code from the ROM here:
Code:
.class public Lcom/android/systemui/statusbar/policy/Clock;
.super Landroid/widget/TextView;
.source "Clock.java"
# static fields
.field private static final AM_PM_STYLE_GONE:I = 0x2
.field private static final AM_PM_STYLE_NORMAL:I = 0x0
.field private static final AM_PM_STYLE_SMALL:I = 0x1
.field private static final DEBUG:Z = false
.field private static final TW_TAG:Ljava/lang/String; = "STATUSBAR-Clock"
# instance fields
.field private AM_PM_STYLE:I
.field private mAttached:Z
.field private mCalendar:Ljava/util/Calendar;
.field private mClockFormat:Ljava/text/SimpleDateFormat;
.field private mClockFormatString:Ljava/lang/String;
.field private mExpandedHeader:Z
.field private final mIntentReceiver:Landroid/content/BroadcastReceiver;
.field private mLocaleChanged:Z
.field private mOldLocale:Ljava/util/Locale;
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 1
.parameter "context"
.prologue
.line 90
const/4 v0, 0x0
invoke-direct {p0, p1, v0}, Lcom/android/systemui/statusbar/policy/Clock;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.line 91
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals 1
.parameter "context"
.parameter "attrs"
.prologue
.line 94
const/4 v0, 0x0
invoke-direct {p0, p1, p2, v0}, Lcom/android/systemui/statusbar/policy/Clock;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.line 95
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.locals 3
.parameter "context"
.parameter "attrs"
.parameter "defStyle"
.prologue
const/4 v2, 0x0
.line 98
invoke-direct {p0, p1, p2, p3}, Landroid/widget/TextView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.line 80
iput v2, p0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
.line 151
new-instance v1, Lcom/android/systemui/statusbar/policy/Clock$1;
invoke-direct {v1, p0}, Lcom/android/systemui/statusbar/policy/Clock$1;-><init>(Lcom/android/systemui/statusbar/policy/Clock;)V
iput-object v1, p0, Lcom/android/systemui/statusbar/policy/Clock;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 99
sget-object v1, Lcom/android/systemui/R$styleable;->Clock:[I
invoke-virtual {p1, p2, v1, p3, v2}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;
move-result-object v0
.line 101
.local v0, a:Landroid/content/res/TypedArray;
invoke-virtual {v0, v2, v2}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
move-result v1
iput-boolean v1, p0, Lcom/android/systemui/statusbar/policy/Clock;->mExpandedHeader:Z
.line 103
invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V
.line 104
return-void
.end method
.method static synthetic access$000(Lcom/android/systemui/statusbar/policy/Clock;)Ljava/util/Calendar;
.locals 1
.parameter "x0"
.prologue
.line 60
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/Clock;->mCalendar:Ljava/util/Calendar;
return-object v0
.end method
.method static synthetic access$002(Lcom/android/systemui/statusbar/policy/Clock;Ljava/util/Calendar;)Ljava/util/Calendar;
.locals 0
.parameter "x0"
.parameter "x1"
.prologue
.line 60
iput-object p1, p0, Lcom/android/systemui/statusbar/policy/Clock;->mCalendar:Ljava/util/Calendar;
return-object p1
.end method
.method static synthetic access$100(Lcom/android/systemui/statusbar/policy/Clock;)Ljava/text/SimpleDateFormat;
.locals 1
.parameter "x0"
.prologue
.line 60
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormat:Ljava/text/SimpleDateFormat;
return-object v0
.end method
.method static synthetic access$200(Lcom/android/systemui/statusbar/policy/Clock;)Ljava/util/Locale;
.locals 1
.parameter "x0"
.prologue
.line 60
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/Clock;->mOldLocale:Ljava/util/Locale;
return-object v0
.end method
.method static synthetic access$202(Lcom/android/systemui/statusbar/policy/Clock;Ljava/util/Locale;)Ljava/util/Locale;
.locals 0
.parameter "x0"
.parameter "x1"
.prologue
.line 60
iput-object p1, p0, Lcom/android/systemui/statusbar/policy/Clock;->mOldLocale:Ljava/util/Locale;
return-object p1
.end method
.method static synthetic access$302(Lcom/android/systemui/statusbar/policy/Clock;Z)Z
.locals 0
.parameter "x0"
.parameter "x1"
.prologue
.line 60
iput-boolean p1, p0, Lcom/android/systemui/statusbar/policy/Clock;->mLocaleChanged:Z
return p1
.end method
.method private final getSmallTime()Ljava/lang/CharSequence;
.locals 22
.prologue
.line 227
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/policy/Clock;->getContext()Landroid/content/Context;
move-result-object v8
.line 228
.local v8, context:Landroid/content/Context;
invoke-static {v8}, Landroid/text/format/DateFormat;->is24HourFormat(Landroid/content/Context;)Z
move-result v6
.line 234
.local v6, b24:Z
if-eqz v6, :cond_3
.line 235
const v16, 0x10400a3
.line 249
.local v16, res:I
:goto_0
const v2, 0xef00
.line 250
.local v2, MAGIC1:C
const v3, 0xef01
.line 253
.local v3, MAGIC2:C
move/from16 v0, v16
invoke-virtual {v8, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v9
.line 256
.local v9, format:Ljava/lang/String;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormatString:Ljava/lang/String;
move-object/from16 v20, v0
move-object/from16 v0, v20
invoke-virtual {v9, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v20
if-eqz v20, :cond_0
if-nez v6, :cond_8
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mLocaleChanged:Z
move/from16 v20, v0
if-eqz v20, :cond_8
.line 257
:cond_0
const/16 v20, 0x0
move/from16 v0, v20
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/systemui/statusbar/policy/Clock;->mLocaleChanged:Z
.line 264
move-object/from16 v0, p0
iget v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
move/from16 v20, v0
if-eqz v20, :cond_7
.line 265
const/4 v4, -0x1
.line 266
.local v4, a:I
const/4 v15, 0x0
.line 267
.local v15, quoted:Z
const/4 v11, 0x0
.local v11, i:I
:goto_1
invoke-virtual {v9}, Ljava/lang/String;->length()I
move-result v20
move/from16 v0, v20
if-ge v11, v0, :cond_2
.line 268
invoke-virtual {v9, v11}, Ljava/lang/String;->charAt(I)C
move-result v7
.line 270
.local v7, c:C
const/16 v20, 0x27
move/from16 v0, v20
if-ne v7, v0, :cond_1
.line 271
if-nez v15, :cond_4
const/4 v15, 0x1
.line 273
:cond_1
:goto_2
if-nez v15, :cond_5
const/16 v20, 0x61
move/from16 v0, v20
if-ne v7, v0, :cond_5
.line 274
move v4, v11
.line 279
.end local v7 #c:C
:cond_2
if-ltz v4, :cond_7
.line 281
move v5, v4
.line 282
.local v5, b:I
:goto_3
if-lez v4, :cond_6
add-int/lit8 v20, v4, -0x1
move/from16 v0, v20
invoke-virtual {v9, v0}, Ljava/lang/String;->charAt(I)C
move-result v20
invoke-static/range {v20 .. v20}, Ljava/lang/Character;->isWhitespace(C)Z
move-result v20
if-eqz v20, :cond_6
.line 283
add-int/lit8 v4, v4, -0x1
goto :goto_3
.line 237
.end local v2 #MAGIC1:C
.end local v3 #MAGIC2:C
.end local v4 #a:I
.end local v5 #b:I
.end local v9 #format:Ljava/lang/String;
.end local v11 #i:I
.end local v15 #quoted:Z
.end local v16 #res:I
:cond_3
const v16, 0x10400a2
.restart local v16 #res:I
goto :goto_0
.line 271
.restart local v2 #MAGIC1:C
.restart local v3 #MAGIC2:C
.restart local v4 #a:I
.restart local v7 #c:C
.restart local v9 #format:Ljava/lang/String;
.restart local v11 #i:I
.restart local v15 #quoted:Z
:cond_4
const/4 v15, 0x0
goto :goto_2
.line 267
:cond_5
add-int/lit8 v11, v11, 0x1
goto :goto_1
.line 285
.end local v7 #c:C
.restart local v5 #b:I
:cond_6
new-instance v20, Ljava/lang/StringBuilder;
invoke-direct/range {v20 .. v20}, Ljava/lang/StringBuilder;-><init>()V
const/16 v21, 0x0
move/from16 v0, v21
invoke-virtual {v9, v0, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v21
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
const v21, 0xef00
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
move-result-object v20
invoke-virtual {v9, v4, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v21
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
const-string v21, "a"
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
const v21, 0xef01
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
move-result-object v20
add-int/lit8 v21, v5, 0x1
move/from16 v0, v21
invoke-virtual {v9, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;
move-result-object v21
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
invoke-virtual/range {v20 .. v20}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v9
.line 290
.end local v4 #a:I
.end local v5 #b:I
.end local v11 #i:I
.end local v15 #quoted:Z
:cond_7
new-instance v18, Ljava/text/SimpleDateFormat;
move-object/from16 v0, v18
invoke-direct {v0, v9}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
.local v18, sdf:Ljava/text/SimpleDateFormat;
move-object/from16 v0, v18
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormat:Ljava/text/SimpleDateFormat;
.line 291
move-object/from16 v0, p0
iput-object v9, v0, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormatString:Ljava/lang/String;
.line 295
:goto_4
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mCalendar:Ljava/util/Calendar;
move-object/from16 v20, v0
invoke-virtual/range {v20 .. v20}, Ljava/util/Calendar;->getTime()Ljava/util/Date;
move-result-object v20
move-object/from16 v0, v18
move-object/from16 v1, v20
invoke-virtual {v0, v1}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v17
.line 297
.local v17, result:Ljava/lang/String;
move-object/from16 v0, p0
iget v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
move/from16 v20, v0
if-eqz v20, :cond_d
.line 298
const v20, 0xef00
move-object/from16 v0, v17
move/from16 v1, v20
invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(I)I
move-result v12
.line 299
.local v12, magic1:I
const v20, 0xef01
move-object/from16 v0, v17
move/from16 v1, v20
invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(I)I
move-result v13
.line 300
.local v13, magic2:I
if-ltz v12, :cond_d
if-le v13, v12, :cond_d
.line 301
new-instance v10, Landroid/text/SpannableStringBuilder;
move-object/from16 v0, v17
invoke-direct {v10, v0}, Landroid/text/SpannableStringBuilder;-><init>(Ljava/lang/CharSequence;)V
.line 302
.local v10, formatted:Landroid/text/SpannableStringBuilder;
move-object/from16 v0, p0
iget v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
move/from16 v20, v0
const/16 v21, 0x2
move/from16 v0, v20
move/from16 v1, v21
if-ne v0, v1, :cond_9
.line 303
add-int/lit8 v20, v13, 0x1
move/from16 v0, v20
invoke-virtual {v10, v12, v0}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;
.line 324
.end local v10 #formatted:Landroid/text/SpannableStringBuilder;
.end local v12 #magic1:I
.end local v13 #magic2:I
:goto_5
return-object v10
.line 293
.end local v17 #result:Ljava/lang/String;
.end local v18 #sdf:Ljava/text/SimpleDateFormat;
:cond_8
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormat:Ljava/text/SimpleDateFormat;
move-object/from16 v18, v0
.restart local v18 #sdf:Ljava/text/SimpleDateFormat;
goto :goto_4
.line 305
.restart local v10 #formatted:Landroid/text/SpannableStringBuilder;
.restart local v12 #magic1:I
.restart local v13 #magic2:I
.restart local v17 #result:Ljava/lang/String;
:cond_9
move-object/from16 v0, p0
iget v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
move/from16 v20, v0
const/16 v21, 0x1
move/from16 v0, v20
move/from16 v1, v21
if-ne v0, v1, :cond_c
.line 307
const v14, 0x3f333333
.line 308
.local v14, proportion:F
sget-boolean v20, Lcom/android/systemui/statusbar/BaseStatusBar;->useTouchWizGUI:Z
if-eqz v20, :cond_b
sget-boolean v20, Lcom/android/systemui/statusbar/BaseStatusBar;->canStatusBarHide:Z
if-eqz v20, :cond_a
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mExpandedHeader:Z
move/from16 v20, v0
if-eqz v20, :cond_b
.line 309
:cond_a
const/high16 v14, 0x3f00
.line 312
:cond_b
new-instance v19, Landroid/text/style/RelativeSizeSpan;
move-object/from16 v0, v19
invoke-direct {v0, v14}, Landroid/text/style/RelativeSizeSpan;-><init>(F)V
.line 314
.local v19, style:Landroid/text/style/CharacterStyle;
const/16 v20, 0x22
move-object/from16 v0, v19
move/from16 v1, v20
invoke-virtual {v10, v0, v12, v13, v1}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V
.line 317
.end local v14 #proportion:F
.end local v19 #style:Landroid/text/style/CharacterStyle;
:cond_c
add-int/lit8 v20, v13, 0x1
move/from16 v0, v20
invoke-virtual {v10, v13, v0}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;
.line 318
add-int/lit8 v20, v12, 0x1
move/from16 v0, v20
invoke-virtual {v10, v12, v0}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;
goto :goto_5
.end local v10 #formatted:Landroid/text/SpannableStringBuilder;
.end local v12 #magic1:I
.end local v13 #magic2:I
:cond_d
move-object/from16 v10, v17
.line 324
goto :goto_5
.end method
# virtual methods
.method protected onAttachedToWindow()V
.locals 6
.prologue
const/4 v5, 0x1
.line 108
invoke-super {p0}, Landroid/widget/TextView;->onAttachedToWindow()V
.line 110
iget-boolean v1, p0, Lcom/android/systemui/statusbar/policy/Clock;->mAttached:Z
if-nez v1, :cond_1
.line 111
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/Clock;->mAttached:Z
.line 112
new-instance v0, Landroid/content/IntentFilter;
invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V
.line 114
.local v0, filter:Landroid/content/IntentFilter;
const-string v1, "android.intent.action.TIME_TICK"
invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 115
const-string v1, "android.intent.action.TIME_SET"
invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 116
const-string v1, "android.intent.action.TIMEZONE_CHANGED"
invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 117
const-string v1, "android.intent.action.CONFIGURATION_CHANGED"
invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 118
const-string v1, "android.intent.action.SCREEN_ON"
invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 120
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/Clock;->getContext()Landroid/content/Context;
move-result-object v1
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/Clock;->mIntentReceiver:Landroid/content/BroadcastReceiver;
const/4 v3, 0x0
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/Clock;->getHandler()Landroid/os/Handler;
move-result-object v4
invoke-virtual {v1, v2, v0, v3, v4}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;Ljava/lang/String;Landroid/os/Handler;)Landroid/content/Intent;
.line 123
sget-boolean v1, Lcom/android/systemui/statusbar/BaseStatusBar;->useTouchWizGUI:Z
if-eqz v1, :cond_1
sget-boolean v1, Lcom/android/systemui/statusbar/BaseStatusBar;->canStatusBarHide:Z
if-eqz v1, :cond_0
iget-boolean v1, p0, Lcom/android/systemui/statusbar/policy/Clock;->mExpandedHeader:Z
if-eqz v1, :cond_1
.line 124
:cond_0
iput v5, p0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
.line 133
.end local v0 #filter:Landroid/content/IntentFilter;
:cond_1
invoke-static {}, Ljava/util/TimeZone;->getDefault()Ljava/util/TimeZone;
move-result-object v1
invoke-static {v1}, Ljava/util/Calendar;->getInstance(Ljava/util/TimeZone;)Ljava/util/Calendar;
move-result-object v1
iput-object v1, p0, Lcom/android/systemui/statusbar/policy/Clock;->mCalendar:Ljava/util/Calendar;
.line 136
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/Clock;->updateClock()V
.line 139
invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;
move-result-object v1
iput-object v1, p0, Lcom/android/systemui/statusbar/policy/Clock;->mOldLocale:Ljava/util/Locale;
.line 140
return-void
.end method
.method protected onDetachedFromWindow()V
.locals 2
.prologue
.line 144
invoke-super {p0}, Landroid/widget/TextView;->onDetachedFromWindow()V
.line 145
iget-boolean v0, p0, Lcom/android/systemui/statusbar/policy/Clock;->mAttached:Z
if-eqz v0, :cond_0
.line 146
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/Clock;->getContext()Landroid/content/Context;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/Clock;->mIntentReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {v0, v1}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V
.line 147
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/systemui/statusbar/policy/Clock;->mAttached:Z
.line 149
:cond_0
return-void
.end method
.method final updateClock()V
.locals 3
.prologue
.line 191
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/Clock;->mCalendar:Ljava/util/Calendar;
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v1
invoke-virtual {v0, v1, v2}, Ljava/util/Calendar;->setTimeInMillis(J)V
.line 196
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/Clock;->getSmallTime()Ljava/lang/CharSequence;
move-result-object v0
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/policy/Clock;->setText(Ljava/lang/CharSequence;)V
.line 224
return-void
.end method

I'll bump it once then leave it alone.

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][MOD][4.0.4] Add Hide time and am/pm toggle Samsung ICS Devices

***Here is a guide for Adding Hide time and am/pm toggle in Samsung ICS Devices***
This guide is specially for GT-S7562. But should work for other Samsung ICS devices also. Values may differ.​
Things you need:
Tool for decompiling/compiling work (I will not cover this, there are many guides for this)
Notepad++
Patience
Some common sense
Click to expand...
Click to collapse
Here, we will edit two files:
SecSettings.apk
SystemUI.apk
Here we start-
Decompile SecSettings.apk
Open smali/com/android/settings/DateTimeSettings.smali
Add blue one
Code:
# instance fields
.field private mAutoTimePref:Landroid/preference/CheckBoxPreference;
.field private mAutoTimeZonePref:Landroid/preference/CheckBoxPreference;
.field private mDateFormat:Landroid/preference/ListPreference;
.field private mDatePref:Landroid/preference/Preference;
.field private mDummyDate:Ljava/util/Calendar;
[COLOR="Blue"].field private mHideAmPm:Landroid/preference/Preference;[/COLOR]
[COLOR="blue"].field private mHideTime:Landroid/preference/Preference;[/COLOR]
.field private mIntentReceiver:Landroid/content/BroadcastReceiver;
.field private mSettingsObserver:Lcom/android/settings/DateTimeSettings$SettingsObserver;
.field private mTime24Pref:Landroid/preference/Preference;
.field private mTimePref:Landroid/preference/Preference;
.field private mTimeZone:Landroid/preference/Preference;
Search
.method private initUI()V
Click to expand...
Click to collapse
Replace the whole method with this
Code:
.method private initUI()V
.locals 8
.prologue
const/4 v5, 0x1
const/4 v6, 0x0
.line 152
const-string v4, "auto_time"
invoke-direct {p0, v4}, Lcom/android/settings/DateTimeSettings;->getAutoState(Ljava/lang/String;)Z
move-result v0
.line 153
.local v0, autoTimeEnabled:Z
const-string v4, "auto_time_zone"
invoke-direct {p0, v4}, Lcom/android/settings/DateTimeSettings;->getAutoState(Ljava/lang/String;)Z
move-result v1
.line 155
.local v1, autoTimeZoneEnabled:Z
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getActivity()Landroid/app/Activity;
move-result-object v4
invoke-virtual {v4}, Landroid/app/Activity;->getIntent()Landroid/content/Intent;
move-result-object v2
.line 156
.local v2, intent:Landroid/content/Intent;
const-string v4, "firstRun"
invoke-virtual {v2, v4, v6}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v3
.line 158
.local v3, isFirstRun:Z
invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;
move-result-object v4
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mDummyDate:Ljava/util/Calendar;
.line 160
const-string v4, "auto_time"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/CheckBoxPreference;
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mAutoTimePref:Landroid/preference/CheckBoxPreference;
.line 161
iget-object v4, p0, Lcom/android/settings/DateTimeSettings;->mAutoTimePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v4, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 162
const-string v4, "auto_zone"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/CheckBoxPreference;
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mAutoTimeZonePref:Landroid/preference/CheckBoxPreference;
.line 165
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getActivity()Landroid/app/Activity;
move-result-object v4
invoke-static {v4}, Lcom/android/settings/Utils;->isWifiOnly(Landroid/content/Context;)Z
move-result v4
if-nez v4, :cond_0
if-eqz v3, :cond_2
.line 166
.line 167
:cond_0
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getActivity()Landroid/app/Activity;
move-result-object v4
invoke-static {v4}, Lcom/android/settings/Utils;->isWifiOnly(Landroid/content/Context;)Z
move-result v4
if-eqz v4, :cond_1
.line 168
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v4
iget-object v7, p0, Lcom/android/settings/DateTimeSettings;->mAutoTimePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v4, v7}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
.line 169
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v7, "auto_time_zone"
invoke-static {v4, v7, v6}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 171
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v7, "auto_time"
invoke-static {v4, v7, v6}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 173
const/4 v0, 0x0
.line 175
:cond_1
const/4 v1, 0x0
.line 177
:cond_2
iget-object v4, p0, Lcom/android/settings/DateTimeSettings;->mAutoTimeZonePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 179
const-string v4, "time"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mTimePref:Landroid/preference/Preference;
.line 180
const-string v4, "24 hour"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
.line 181
const-string v4, "timezone"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mTimeZone:Landroid/preference/Preference;
.line 182
const-string v4, "date"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mDatePref:Landroid/preference/Preference;
.line 183
const-string v4, "date_format"
invoke-virtual {p0, v4}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/ListPreference;
iput-object v4, p0, Lcom/android/settings/DateTimeSettings;->mDateFormat:Landroid/preference/ListPreference;
.line 184
if-eqz v3, :cond_3
.line 185
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v4
iget-object v7, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
invoke-virtual {v4, v7}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
.line 186
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v4
iget-object v7, p0, Lcom/android/settings/DateTimeSettings;->mDateFormat:Landroid/preference/ListPreference;
invoke-virtual {v4, v7}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
.line 189
:cond_3
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->updateDateFormatEntries()V
.line 192
iget-object v7, p0, Lcom/android/settings/DateTimeSettings;->mTimePref:Landroid/preference/Preference;
if-nez v0, :cond_6
move v4, v5
:goto_0
invoke-virtual {v7, v4}, Landroid/preference/Preference;->setEnabled(Z)V
.line 193
iget-object v7, p0, Lcom/android/settings/DateTimeSettings;->mDatePref:Landroid/preference/Preference;
if-nez v0, :cond_7
move v4, v5
:goto_1
invoke-virtual {v7, v4}, Landroid/preference/Preference;->setEnabled(Z)V
.line 194
iget-object v4, p0, Lcom/android/settings/DateTimeSettings;->mTimeZone:Landroid/preference/Preference;
if-nez v1, :cond_8
:goto_2
invoke-virtual {v4, v5}, Landroid/preference/Preference;->setEnabled(Z)V
.line 197
invoke-direct {p0}, Lcom/android/settings/DateTimeSettings;->applyEDMDateTimeChangePolicy()V
.line 199
const-string v6, "hide_time"
invoke-virtual {p0, v6}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v6
check-cast v6, Landroid/preference/Preference;
iput-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
const-string v6, "hide_ampm"
invoke-virtual {p0, v6}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v6
check-cast v6, Landroid/preference/Preference;
iput-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
if-eqz v0, :cond_4
const/4 v0, 0x0
iget-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v6, v0}, Landroid/preference/Preference;->setEnabled(Z)V
iget-object v6, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
invoke-virtual {v6, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:cond_4
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
if-eqz v0, :cond_5
const/4 v0, 0x0
iget-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v6, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:cond_5
return-void
:cond_6
move v4, v6
.line 192
goto :goto_0
:cond_7
move v4, v6
.line 193
goto :goto_1
:cond_8
move v5, v6
.line 194
goto :goto_2
.end method
Search this method
Code:
.method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
Replace full method with this
Code:
.method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
.locals 6
.parameter "preferenceScreen"
.parameter "preference"
.prologue
const/4 v1, 0x1
.line 490
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mDatePref:Landroid/preference/Preference;
if-ne p2, v0, :cond_1
.line 491
const/4 v0, 0x0
invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->showDialog(I)V
.line 501
:cond_0
:goto_0
invoke-super {p0, p1, p2}, Lcom/android/settings/SettingsPreferenceFragment;->onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
move-result v0
return v0
.line 492
:cond_1
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTimePref:Landroid/preference/Preference;
if-ne p2, v0, :cond_2
.line 494
invoke-virtual {p0, v1}, Lcom/android/settings/DateTimeSettings;->removeDialog(I)V
.line 495
invoke-virtual {p0, v1}, Lcom/android/settings/DateTimeSettings;->showDialog(I)V
goto :goto_0
.line 496
:cond_2
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
if-ne p2, v0, :cond_4
.line 497
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
invoke-direct {p0, v0}, Lcom/android/settings/DateTimeSettings;->set24Hour(Z)V
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
if-nez v0, :cond_3
const/4 v0, 0x1
goto :goto_1
:cond_3
const/4 v0, 0x0
:goto_1
invoke-virtual {v1, v0}, Landroid/preference/Preference;->setEnabled(Z)V
.line 498
:goto_2
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getActivity()Landroid/app/Activity;
move-result-object v0
invoke-virtual {p0, v0}, Lcom/android/settings/DateTimeSettings;->updateTimeAndDateDisplay(Landroid/content/Context;)V
.line 499
invoke-direct {p0}, Lcom/android/settings/DateTimeSettings;->timeUpdated()V
goto :goto_0
:cond_4
const-string v3, "hide_ampm"
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
if-ne p2, v0, :cond_5
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v2
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "hide_ampm"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_2
:cond_5
const-string v3, "hide_time"
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
if-ne p2, v0, :cond_0
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v2
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "hide_time"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
if-nez v2, :cond_6
const/4 v2, 0x1
goto :goto_3
:cond_6
const/4 v2, 0x0
:goto_3
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v1, v2}, Landroid/preference/Preference;->setEnabled(Z)V
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
invoke-virtual {v1, v2}, Landroid/preference/Preference;->setEnabled(Z)V
goto :goto_2
.end method
Save it.
Now open res/xm/Date_Time_Prefs.xml
Add blue lines
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/date_and_time"
xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference android:title="@string/date_time_auto" android:key="auto_time" android:summaryOn="@string/date_time_auto_summaryOn" android:summaryOff="@string/date_time_auto_summaryOff" />
<Preference android:title="@string/date_time_set_date" android:key="date" android:summary="03/10/2008" android:widgetLayout="@layout/round_more_icon" />
<Preference android:title="@string/date_time_set_time" android:key="time" android:summary="12:00am" android:widgetLayout="@layout/round_more_icon" />
<CheckBoxPreference android:title="@string/zone_auto" android:key="auto_zone" android:summaryOn="@string/zone_auto_summaryOn" android:summaryOff="@string/zone_auto_summaryOff" />
[COLOR="blue"]<CheckBoxPreference android:title="@string/disable_time" android:key="hide_time" android:summary="@string/disable_time_text" />
<CheckBoxPreference android:title="@string/disable_ampm" android:key="hide_ampm" android:summary="@string/disable_ampm_text" />[/COLOR]
<PreferenceScreen android:title="@string/date_time_set_timezone" android:key="timezone" android:summary="GMT-8:00" android:fragment="com.android.settings.ZonePicker" />
<CheckBoxPreference android:title="@string/date_time_24hour" android:key="24 hour" />
<ListPreference android:title="@string/date_time_date_format" android:key="date_format" android:summary="mm/dd/yyyy" android:widgetLayout="@layout/round_more_icon" />
</PreferenceScreen>
Save it.
Open res/values/strings.xml
Add these lines at the end
Code:
<string name="disable_time">Hide time</string>
<string name="disable_time_text">Remove time from status bar</string>
<string name="disable_ampm">Hide AM/PM</string>
<string name="disable_ampm_text">Remove AM/PM from time in status bar</string>
Save it and recompile SecSettings.apk
Conitnue to next Post
Decompile SystemUI.apk
Open smali/com/android/systemui/statusbar/policy/Clock.smali
Search-
Code:
.method private final getSmallTime()Ljava/lang/CharSequence;
Replace whole method with this
Code:
.method private final getSmallTime()Ljava/lang/CharSequence;
.locals 22
.prologue
.line 237
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/policy/Clock;->getContext()Landroid/content/Context;
move-result-object v8
.line 238
.local v8, context:Landroid/content/Context;
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v7, "hide_time"
const/4 v0, 0x0
invoke-static {v2, v7, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v7
const/4 v0, 0x0
if-eqz v7, :cond_0
const/16 v0, 0x8
:cond_0
[COLOR="Red"]const v1, 0x7f0f003d[/COLOR]
move-object/from16 v2, p0
invoke-virtual {v2, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v1
invoke-virtual {v1, v0}, Landroid/view/View;->setVisibility(I)V
invoke-static {v8}, Landroid/text/format/DateFormat;->is24HourFormat(Landroid/content/Context;)Z
move-result v6
.line 244
.local v6, b24:Z
if-eqz v6, :cond_5
.line 245
const v16, 0x104007f
.line 259
.local v16, res:I
:goto_0
const v2, 0xef00
.line 260
.local v2, MAGIC1:C
const v3, 0xef01
.line 263
.local v3, MAGIC2:C
move/from16 v0, v16
invoke-virtual {v8, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v9
if-nez v6, :cond_1
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "hide_ampm"
const/4 v0, 0x0
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v7
const-string v0, "ampm"
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "getint returned="
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, v7}, Ljava/lang/StringBuilder;->append(I)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/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
move v2, v7
if-eqz v2, :cond_1
const-string v9, "h:mm"
.line 266
.local v9, format:Ljava/lang/String;
:cond_1
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormatString:Ljava/lang/String;
move-object/from16 v20, v0
move-object/from16 v0, v20
invoke-virtual {v9, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v20
if-eqz v20, :cond_2
if-nez v6, :cond_a
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mLocaleChanged:Z
move/from16 v20, v0
if-eqz v20, :cond_a
.line 267
:cond_2
const/16 v20, 0x0
move/from16 v0, v20
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/systemui/statusbar/policy/Clock;->mLocaleChanged:Z
.line 274
sget v20, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
if-eqz v20, :cond_9
.line 275
const/4 v4, -0x1
.line 276
.local v4, a:I
const/4 v15, 0x0
.line 277
.local v15, quoted:Z
const/4 v11, 0x0
.local v11, i:I
:goto_1
invoke-virtual {v9}, Ljava/lang/String;->length()I
move-result v20
move/from16 v0, v20
if-ge v11, v0, :cond_4
.line 278
invoke-virtual {v9, v11}, Ljava/lang/String;->charAt(I)C
move-result v7
.line 280
.local v7, c:C
const/16 v20, 0x27
move/from16 v0, v20
if-ne v7, v0, :cond_3
.line 281
if-nez v15, :cond_6
const/4 v15, 0x1
.line 283
:cond_3
:goto_2
if-nez v15, :cond_7
const/16 v20, 0x61
move/from16 v0, v20
if-ne v7, v0, :cond_7
.line 284
move v4, v11
.line 289
.end local v7 #c:C
:cond_4
if-ltz v4, :cond_9
.line 291
move v5, v4
.line 292
.local v5, b:I
:goto_3
if-lez v4, :cond_8
add-int/lit8 v20, v4, -0x1
move/from16 v0, v20
invoke-virtual {v9, v0}, Ljava/lang/String;->charAt(I)C
move-result v20
invoke-static/range {v20 .. v20}, Ljava/lang/Character;->isWhitespace(C)Z
move-result v20
if-eqz v20, :cond_8
.line 293
add-int/lit8 v4, v4, -0x1
goto :goto_3
.line 247
.end local v2 #MAGIC1:C
.end local v3 #MAGIC2:C
.end local v4 #a:I
.end local v5 #b:I
.end local v9 #format:Ljava/lang/String;
.end local v11 #i:I
.end local v15 #quoted:Z
.end local v16 #res:I
:cond_5
const v16, 0x104007e
.restart local v16 #res:I
goto/16 :goto_0
.line 281
.restart local v2 #MAGIC1:C
.restart local v3 #MAGIC2:C
.restart local v4 #a:I
.restart local v7 #c:C
.restart local v9 #format:Ljava/lang/String;
.restart local v11 #i:I
.restart local v15 #quoted:Z
:cond_6
const/4 v15, 0x0
goto :goto_2
.line 277
:cond_7
add-int/lit8 v11, v11, 0x1
goto :goto_1
.line 295
.end local v7 #c:C
.restart local v5 #b:I
:cond_8
new-instance v20, Ljava/lang/StringBuilder;
invoke-direct/range {v20 .. v20}, Ljava/lang/StringBuilder;-><init>()V
const/16 v21, 0x0
move/from16 v0, v21
invoke-virtual {v9, v0, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v21
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
const v21, 0xef00
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
move-result-object v20
invoke-virtual {v9, v4, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v21
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
const-string v21, "a"
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
const v21, 0xef01
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
move-result-object v20
add-int/lit8 v21, v5, 0x1
move/from16 v0, v21
invoke-virtual {v9, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;
move-result-object v21
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
invoke-virtual/range {v20 .. v20}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v9
.line 300
.end local v4 #a:I
.end local v5 #b:I
.end local v11 #i:I
.end local v15 #quoted:Z
:cond_9
new-instance v18, Ljava/text/SimpleDateFormat;
move-object/from16 v0, v18
invoke-direct {v0, v9}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
.local v18, sdf:Ljava/text/SimpleDateFormat;
move-object/from16 v0, v18
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormat:Ljava/text/SimpleDateFormat;
.line 301
move-object/from16 v0, p0
iput-object v9, v0, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormatString:Ljava/lang/String;
.line 305
:goto_4
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mCalendar:Ljava/util/Calendar;
move-object/from16 v20, v0
invoke-virtual/range {v20 .. v20}, Ljava/util/Calendar;->getTime()Ljava/util/Date;
move-result-object v20
move-object/from16 v0, v18
move-object/from16 v1, v20
invoke-virtual {v0, v1}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v17
.line 307
.local v17, result:Ljava/lang/String;
sget v20, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
if-eqz v20, :cond_e
.line 308
const v20, 0xef00
move-object/from16 v0, v17
move/from16 v1, v20
invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(I)I
move-result v12
.line 309
.local v12, magic1:I
const v20, 0xef01
move-object/from16 v0, v17
move/from16 v1, v20
invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(I)I
move-result v13
.line 310
.local v13, magic2:I
if-ltz v12, :cond_e
if-le v13, v12, :cond_e
.line 311
new-instance v10, Landroid/text/SpannableStringBuilder;
move-object/from16 v0, v17
invoke-direct {v10, v0}, Landroid/text/SpannableStringBuilder;-><init>(Ljava/lang/CharSequence;)V
.line 312
.local v10, formatted:Landroid/text/SpannableStringBuilder;
sget v20, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
const/16 v21, 0x2
move/from16 v0, v20
move/from16 v1, v21
if-ne v0, v1, :cond_b
.line 313
add-int/lit8 v20, v13, 0x1
move/from16 v0, v20
invoke-virtual {v10, v12, v0}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;
.line 334
.end local v10 #formatted:Landroid/text/SpannableStringBuilder;
.end local v12 #magic1:I
.end local v13 #magic2:I
:goto_5
return-object v10
.line 303
.end local v17 #result:Ljava/lang/String;
.end local v18 #sdf:Ljava/text/SimpleDateFormat;
:cond_a
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/policy/Clock;->mClockFormat:Ljava/text/SimpleDateFormat;
move-object/from16 v18, v0
.restart local v18 #sdf:Ljava/text/SimpleDateFormat;
goto :goto_4
.line 315
.restart local v10 #formatted:Landroid/text/SpannableStringBuilder;
.restart local v12 #magic1:I
.restart local v13 #magic2:I
.restart local v17 #result:Ljava/lang/String;
:cond_b
sget v20, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
const/16 v21, 0x1
move/from16 v0, v20
move/from16 v1, v21
if-ne v0, v1, :cond_d
.line 317
const v14, 0x3f333333
.line 318
.local v14, proportion:F
sget-boolean v20, Lcom/android/systemui/statusbar/StatusBar;->useTouchWizGUI:Z
if-eqz v20, :cond_c
sget-boolean v20, Lcom/android/systemui/statusbar/StatusBar;->canStatusBarHide:Z
if-nez v20, :cond_c
.line 319
const/high16 v14, 0x3f00
.line 322
:cond_c
new-instance v19, Landroid/text/style/RelativeSizeSpan;
move-object/from16 v0, v19
invoke-direct {v0, v14}, Landroid/text/style/RelativeSizeSpan;-><init>(F)V
.line 324
.local v19, style:Landroid/text/style/CharacterStyle;
const/16 v20, 0x22
move-object/from16 v0, v19
move/from16 v1, v20
invoke-virtual {v10, v0, v12, v13, v1}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V
.line 327
.end local v14 #proportion:F
.end local v19 #style:Landroid/text/style/CharacterStyle;
:cond_d
add-int/lit8 v20, v13, 0x1
move/from16 v0, v20
invoke-virtual {v10, v13, v0}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;
.line 328
add-int/lit8 v20, v12, 0x1
move/from16 v0, v20
invoke-virtual {v10, v12, v0}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;
goto :goto_5
.end local v10 #formatted:Landroid/text/SpannableStringBuilder;
.end local v12 #magic1:I
.end local v13 #magic2:I
:cond_e
move-object/from16 v10, v17
.line 334
goto :goto_5
.end method
One ID is highlighted in red color in the above method, match this ID with "Clock" ID in res/values/public.xml. Make them same if they are different.
Save it and recompile SystemUI.apk
Thats it
Enjoy
Credits:
Me
Codename13
Didact74
Click to expand...
Click to collapse

[Guide] Setting Up The Recent Apps

Hello guys
Here is a new guide on setting up the recents.
Credit:-
KachalkinGeorg (The GK)
Requirements (deodexed):-
1.Settings.apk
2.SystemUI.apk
3.NotePad++
4.Patience.. if you dont have try to get it
First Part ( Settings.apk )
1.Decompile Settings.apk
2.Download recentsettings.zip from attachment. extract and copy to your Decompiled Settings.
3.Open Settings\res\values\ids.xml and add below code
Code:
<item type="id" name="gk_system_section">false</item>
4.Open Settings\res\values\strings.xml and add below code
Code:
<string name="header_gk_system_special">Systemâ„¢</string>
<string name="recents_panel_title">Recents panel</string>
<string name="recents_panel_settings">Recents panel settings</string>
<string name="show_clear_all_recents_button_title">Clear all recents button</string>
<string name="show_clear_all_recents_button_summary">Show clear all button on recents panel</string>
<string name="recents_clear_all_location_title">Clear all recents location</string>
<string name="recents_clear_all_location_top_right">Top right</string>
<string name="recents_clear_all_location_top_left">Top left</string>
<string name="recents_clear_all_location_top_center">Top center</string>
<string name="recents_clear_all_location_bottom_right">Bottom right</string>
<string name="recents_clear_all_location_bottom_left">Bottom left</string>
<string name="recents_clear_all_location_bottom_center">Bottom center</string>
<string name="recents_clear_all_dismiss_all_title">Clear all tasks</string>
<string name="recents_clear_all_dismiss_all_summary">Choose whether to dismiss all tasks or ignore the foreground task</string>
<string name="recents_show_searchbar">Show Search Bar in Recents</string>
<string name="recents_show_searchbar_summary">Enable or disable the Google search bar in the recents menu</string>
5.Open Settings\res\values\arrays.xml and add below code
Code:
<string-array name="recents_clear_all_location_entries">
<item>@string/recents_clear_all_location_top_right</item>
<item>@string/recents_clear_all_location_top_left</item>
<item>@string/recents_clear_all_location_top_center</item>
<item>@string/recents_clear_all_location_bottom_right</item>
<item>@string/recents_clear_all_location_bottom_left</item>
<item>@string/recents_clear_all_location_bottom_center</item>
</string-array>
6.Open Settings\res\xml\dashboard_categories.xml and add below code
Code:
<dashboard-tile android:icon="@drawable/ic_settings_gk_system" android:id="@id/gk_system_section" android:title="@string/header_gk_system_special" android:fragment="com.android.settings.gk.GKmodSystem" />
7.Now Recompile and Decompile Settings (For ids)
8.Open Settings\smali\com\android\settings\gk\GKmodSystem.smali and find below code
Code:
0x7f050055
replace with below id
Code:
<public type="xml" name="gk_system_settings"
9.Open Settings\smali\com\android\settings\gk\Resents\RecentsPanelSettings.smali and find below codes
find
Code:
0x7f090356
replace with below id
Code:
<public type="string" name="recents_clear_all_location_top_right"
find
Code:
0x7f090357
replace with below id
Code:
<public type="string" name="recents_clear_all_location_top_left"
find
Code:
0x7f090358
replace with below id
Code:
<public type="string" name="recents_clear_all_location_top_center"
find
Code:
0x7f090359
replace with below code
Code:
<public type="string" name="recents_clear_all_location_bottom_right"
find
Code:
0x7f09035a
replace with below id
Code:
<public type="string" name="recents_clear_all_location_bottom_left"
find
Code:
0x7f09035b
replace with below id
Code:
<public type="string" name="recents_clear_all_location_bottom_center"
find
Code:
0x7f060042
replace with below id
Code:
<public type="xml" name="gk_recents_panel_settings"
10.Now Compile Settings and move to your device.
Continued in next post
Final Part ( SystemUI.apk )
1.Decompile SystemUI.apk
2.Download recetsystemui.zip from attachment. extract and copy to your decompiled SystemUI
3.Open SystemUI\res\values\colors.xml and add below code
Code:
<color name="gk_recents_color">#ff90A4AE</color>
<color name="gk_recents_icon_color">#ffffffff</color>
4.Open SystemUI\res\values\dimens.xml and add below code
Code:
<dimen name="gk_recents_action_button_height">54.0dip</dimen>
<dimen name="gk_recents_action_button_width">54.0dip</dimen>
<dimen name="gk_recents_action_button_translation_z">12.0dip</dimen>
<dimen name="gk_recents_action_button_margin_side">32.0dip</dimen>
<dimen name="gk_recents_action_button_margin_bottom">45.0dip</dimen>
5.Open SystemUI\res\values\ids.xml and add below code
Code:
<item type="id" name="gk_recents">false</item>
6.Now Recompile and Decompile SystemUI (For ids)
7.Open SystemUI\smali\com\android\systemui\recents\RecentsActivity.smali and do below edittings.
find below method
Code:
.method bindSearchBarAppWidget()V
replace whole method with this
Code:
.method bindSearchBarAppWidget()V
.locals 5
.prologue
const/4 v4, 0x0
.line 293
invoke-static {}, Lcom/android/systemui/recents/model/RecentsTaskLoader;->getInstance()Lcom/android/systemui/recents/model/RecentsTaskLoader;
move-result-object v3
invoke-virtual {v3}, Lcom/android/systemui/recents/model/RecentsTaskLoader;->getSystemServicesProxy()Lcom/android/systemui/recents/misc/SystemServicesProxy;
move-result-object v1
.line 296
.local v1, "ssp":Lcom/android/systemui/recents/misc/SystemServicesProxy;
iput-object v4, p0, Lcom/android/systemui/recents/RecentsActivity;->mSearchAppWidgetHostView:Landroid/appwidget/AppWidgetHostView;
.line 297
iput-object v4, p0, Lcom/android/systemui/recents/RecentsActivity;->mSearchAppWidgetInfo:Landroid/appwidget/AppWidgetProviderInfo;
.line 300
iget-object v3, p0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget v0, v3, Lcom/android/systemui/recents/RecentsConfiguration;->searchBarAppWidgetId:I
.line 301
.local v0, "appWidgetId":I
if-ltz v0, :cond_0
.line 302
invoke-virtual {v1, v0}, Lcom/android/systemui/recents/misc/SystemServicesProxy;->getAppWidgetInfo(I)Landroid/appwidget/AppWidgetProviderInfo;
move-result-object v3
iput-object v3, p0, Lcom/android/systemui/recents/RecentsActivity;->mSearchAppWidgetInfo:Landroid/appwidget/AppWidgetProviderInfo;
.line 303
iget-object v3, p0, Lcom/android/systemui/recents/RecentsActivity;->mSearchAppWidgetInfo:Landroid/appwidget/AppWidgetProviderInfo;
if-nez v3, :cond_0
.line 306
iget-object v3, p0, Lcom/android/systemui/recents/RecentsActivity;->mAppWidgetHost:Lcom/android/systemui/recents/RecentsAppWidgetHost;
invoke-virtual {v1, v3, v0}, Lcom/android/systemui/recents/misc/SystemServicesProxy;->unbindSearchAppWidget(Landroid/appwidget/AppWidgetHost;I)V
.line 307
const/4 v0, -0x1
.line 312
:cond_0
if-gez v0, :cond_1
.line 313
iget-object v3, p0, Lcom/android/systemui/recents/RecentsActivity;->mAppWidgetHost:Lcom/android/systemui/recents/RecentsAppWidgetHost;
invoke-virtual {v1, v3}, Lcom/android/systemui/recents/misc/SystemServicesProxy;->bindSearchAppWidget(Landroid/appwidget/AppWidgetHost;)Landroid/util/Pair;
move-result-object v2
.line 315
.local v2, "widgetInfo":Landroid/util/Pair;, "Landroid/util/Pair<Ljava/lang/Integer;Landroid/appwidget/AppWidgetProviderInfo;>;"
if-eqz v2, :cond_2
.line 317
iget-object v4, p0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget-object v3, v2, Landroid/util/Pair;->first:Ljava/lang/Object;
check-cast v3, Ljava/lang/Integer;
invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I
move-result v3
invoke-virtual {v4, p0, v3}, Lcom/android/systemui/recents/RecentsConfiguration;->updateSearchBarAppWidgetId(Landroid/content/Context;I)V
.line 318
iget-object v3, v2, Landroid/util/Pair;->second:Ljava/lang/Object;
check-cast v3, Landroid/appwidget/AppWidgetProviderInfo;
iput-object v3, p0, Lcom/android/systemui/recents/RecentsActivity;->mSearchAppWidgetInfo:Landroid/appwidget/AppWidgetProviderInfo;
.line 324
.end local v2 # "widgetInfo":Landroid/util/Pair;, "Landroid/util/Pair<Ljava/lang/Integer;Landroid/appwidget/AppWidgetProviderInfo;>;"
:cond_1
:goto_0
return-void
.line 320
.restart local v2 # "widgetInfo":Landroid/util/Pair;, "Landroid/util/Pair<Ljava/lang/Integer;Landroid/appwidget/AppWidgetProviderInfo;>;"
:cond_2
iget-object v3, p0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
const/4 v4, -0x1
invoke-virtual {v3, p0, v4}, Lcom/android/systemui/recents/RecentsConfiguration;->updateSearchBarAppWidgetId(Landroid/content/Context;I)V
goto :goto_0
.end method
find below method
Code:
.method public onAllTaskViewsDismissed()V
replace whole method with this
Code:
.method public onAllTaskViewsDismissed()V
.locals 1
.prologue
.line 663
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mFinishLaunchHomeRunnable:Lcom/android/systemui/recents/RecentsActivity$FinishRecentsRunnable;
invoke-virtual {v0}, Lcom/android/systemui/recents/RecentsActivity$FinishRecentsRunnable;->run()V
.line 664
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/RecentsView;->endFABanimation()V
.line 665
return-void
.end method
find below method
Code:
.method public onBackPressed()V
replace whole method with this
Code:
.method public onBackPressed()V
.locals 1
.prologue
.line 598
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget-boolean v0, v0, Lcom/android/systemui/recents/RecentsConfiguration;->debugModeEnabled:Z
if-eqz v0, :cond_0
.line 604
:goto_0
return-void
.line 601
:cond_0
const/4 v0, 0x1
invoke-virtual {p0, v0}, Lcom/android/systemui/recents/RecentsActivity;->dismissRecentsToFocusedTaskOrHome(Z)Z
.line 603
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/RecentsView;->endFABanimation()V
goto :goto_0
.end method
find below method
Code:
.method public onEnterAnimationTriggered()V
replace whole method with this
Code:
.method public onEnterAnimationTriggered()V
.locals 1
.prologue
.line 633
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mScrimViews:Lcom/android/systemui/recents/views/SystemBarScrimViews;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/SystemBarScrimViews;->startEnterRecentsAnimation()V
.line 634
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/RecentsView;->startFABanimation()V
.line 635
return-void
.end method
find below method
Code:
.method public onExitToHomeAnimationTriggered()V
replace whole method with this
Code:
.method public onExitToHomeAnimationTriggered()V
.locals 1
.prologue
.line 642
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mScrimViews:Lcom/android/systemui/recents/views/SystemBarScrimViews;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/SystemBarScrimViews;->startExitRecentsAnimation()V
.line 643
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/RecentsView;->endFABanimation()V
.line 644
return-void
.end method
find below method
Code:
.method public onTaskLaunchFailed()V
replace whole method with this
Code:
.method public onTaskLaunchFailed()V
.locals 1
.prologue
.line 657
const/4 v0, 0x1
invoke-virtual {p0, v0}, Lcom/android/systemui/recents/RecentsActivity;->dismissRecentsToHomeRaw(Z)V
.line 658
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/RecentsView;->endFABanimation()V
.line 659
return-void
.end method
find below method
Code:
.method public onTaskViewClicked()V
replace whole method with this
Code:
.method public onTaskViewClicked()V
.locals 1
.prologue
const/4 v0, 0x0
.line 649
invoke-static {v0}, Lcom/android/systemui/recents/AlternateRecentsComponent;->notifyVisibilityChanged(Z)V
.line 650
iput-boolean v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mVisible:Z
.line 651
iget-object v0, p0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
invoke-virtual {v0}, Lcom/android/systemui/recents/views/RecentsView;->endFABanimation()V
.line 652
return-void
.end method
Continued in next post
Continued.
find below method
Code:
.method updateRecentsTasks(Landroid/content/Intent;)V
replace whole method with this
Code:
.method updateRecentsTasks(Landroid/content/Intent;)V
.locals 19
.param p1, "launchIntent" # Landroid/content/Intent;
.prologue
.line 189
const-string v16, "recents.triggeredOverSearchHome"
const/16 v17, 0x0
move-object/from16 v0, p1
move-object/from16 v1, v16
move/from16 v2, v17
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v3
.line 191
.local v3, "fromSearchHome":Z
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v17, v0
if-nez v3, :cond_0
const-string v16, "recents.triggeredOverHome"
const/16 v18, 0x0
move-object/from16 v0, p1
move-object/from16 v1, v16
move/from16 v2, v18
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v16
if-eqz v16, :cond_3
:cond_0
const/16 v16, 0x1
:goto_0
move/from16 v0, v16
move-object/from16 v1, v17
iput-boolean v0, v1, Lcom/android/systemui/recents/RecentsConfiguration;->launchedFromHome:Z
.line 193
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v16, v0
const-string v17, "recents.animatingWithThumbnail"
const/16 v18, 0x0
move-object/from16 v0, p1
move-object/from16 v1, v17
move/from16 v2, v18
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v17
move/from16 v0, v17
move-object/from16 v1, v16
iput-boolean v0, v1, Lcom/android/systemui/recents/RecentsConfiguration;->launchedFromAppWithThumbnail:Z
.line 195
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v16, v0
const-string v17, "recents.thumbnail"
const/16 v18, 0x0
move-object/from16 v0, p1
move-object/from16 v1, v17
move/from16 v2, v18
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v17
move/from16 v0, v17
move-object/from16 v1, v16
iput-boolean v0, v1, Lcom/android/systemui/recents/RecentsConfiguration;->launchedFromAppWithScreenshot:Z
.line 197
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v16, v0
const-string v17, "recents.activeTaskId"
const/16 v18, -0x1
move-object/from16 v0, p1
move-object/from16 v1, v17
move/from16 v2, v18
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v17
move/from16 v0, v17
move-object/from16 v1, v16
iput v0, v1, Lcom/android/systemui/recents/RecentsConfiguration;->launchedToTaskId:I
.line 199
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v16, v0
const-string v17, "recents.triggeredFromAltTab"
const/16 v18, 0x0
move-object/from16 v0, p1
move-object/from16 v1, v17
move/from16 v2, v18
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v17
move/from16 v0, v17
move-object/from16 v1, v16
iput-boolean v0, v1, Lcom/android/systemui/recents/RecentsConfiguration;->launchedWithAltTab:Z
.line 203
invoke-static {}, Lcom/android/systemui/recents/model/RecentsTaskLoader;->getInstance()Lcom/android/systemui/recents/model/RecentsTaskLoader;
move-result-object v7
.line 204
.local v7, "loader":Lcom/android/systemui/recents/model/RecentsTaskLoader;
const/16 v16, 0x6
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v17, v0
move-object/from16 v0, v17
iget-boolean v0, v0, Lcom/android/systemui/recents/RecentsConfiguration;->launchedFromHome:Z
move/from16 v17, v0
move-object/from16 v0, p0
move/from16 v1, v16
move/from16 v2, v17
invoke-virtual {v7, v0, v1, v2}, Lcom/android/systemui/recents/model/RecentsTaskLoader;->reload(Landroid/content/Context;IZ)Lcom/android/systemui/recents/model/SpaceNode;
move-result-object v9
.line 207
.local v9, "root":Lcom/android/systemui/recents/model/SpaceNode;
invoke-virtual {v9}, Lcom/android/systemui/recents/model/SpaceNode;->getStacks()Ljava/util/ArrayList;
move-result-object v11
.line 208
.local v11, "stacks":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/android/systemui/recents/model/TaskStack;>;"
invoke-virtual {v11}, Ljava/util/ArrayList;->isEmpty()Z
move-result v16
if-nez v16, :cond_1
.line 209
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
move-object/from16 v16, v0
invoke-virtual {v9}, Lcom/android/systemui/recents/model/SpaceNode;->getStacks()Ljava/util/ArrayList;
move-result-object v17
invoke-virtual/range {v16 .. v17}, Lcom/android/systemui/recents/views/RecentsView;->setTaskStacks(Ljava/util/ArrayList;)V
.line 211
:cond_1
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v17, v0
invoke-virtual {v9}, Lcom/android/systemui/recents/model/SpaceNode;->hasTasks()Z
move-result v16
if-nez v16, :cond_4
const/16 v16, 0x1
:goto_1
move/from16 v0, v16
move-object/from16 v1, v17
iput-boolean v0, v1, Lcom/android/systemui/recents/RecentsConfiguration;->launchedWithNoRecentTasks:Z
.line 214
new-instance v4, Landroid/content/Intent;
const-string v16, "android.intent.action.MAIN"
const/16 v17, 0x0
move-object/from16 v0, v16
move-object/from16 v1, v17
invoke-direct {v4, v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
.line 215
.local v4, "homeIntent":Landroid/content/Intent;
const-string v16, "android.intent.category.HOME"
move-object/from16 v0, v16
invoke-virtual {v4, v0}, Landroid/content/Intent;->addCategory(Ljava/lang/String;)Landroid/content/Intent;
.line 216
const/high16 v16, 0x10200000
move/from16 v0, v16
invoke-virtual {v4, v0}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;
.line 218
new-instance v18, Lcom/android/systemui/recents/RecentsActivity$FinishRecentsRunnable;
if-eqz v3, :cond_5
const v16, 0x7f05002e
move/from16 v17, v16
:goto_2
if-eqz v3, :cond_6
const v16, 0x7f05002f
:goto_3
move-object/from16 v0, p0
move/from16 v1, v17
move/from16 v2, v16
invoke-static {v0, v1, v2}, Landroid/app/ActivityOptions;->makeCustomAnimation(Landroid/content/Context;II)Landroid/app/ActivityOptions;
move-result-object v16
move-object/from16 v0, v18
move-object/from16 v1, p0
move-object/from16 v2, v16
invoke-direct {v0, v1, v4, v2}, Lcom/android/systemui/recents/RecentsActivity$FinishRecentsRunnable;-><init>(Lcom/android/systemui/recents/RecentsActivity;Landroid/content/Intent;Landroid/app/ActivityOptions;)V
move-object/from16 v0, v18
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/systemui/recents/RecentsActivity;->mFinishLaunchHomeRunnable:Lcom/android/systemui/recents/RecentsActivity$FinishRecentsRunnable;
.line 226
invoke-virtual {v11}, Ljava/util/ArrayList;->size()I
move-result v14
.line 227
.local v14, "taskStackCount":I
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v16, v0
move-object/from16 v0, v16
iget v0, v0, Lcom/android/systemui/recents/RecentsConfiguration;->launchedToTaskId:I
move/from16 v16, v0
const/16 v17, -0x1
move/from16 v0, v16
move/from16 v1, v17
if-eq v0, v1, :cond_8
.line 228
const/4 v5, 0x0
.local v5, "i":I
:goto_4
if-ge v5, v14, :cond_8
.line 229
invoke-virtual {v11, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v10
check-cast v10, Lcom/android/systemui/recents/model/TaskStack;
.line 230
.local v10, "stack":Lcom/android/systemui/recents/model/TaskStack;
invoke-virtual {v10}, Lcom/android/systemui/recents/model/TaskStack;->getTasks()Ljava/util/ArrayList;
move-result-object v15
.line 231
.local v15, "tasks":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/android/systemui/recents/model/Task;>;"
invoke-virtual {v15}, Ljava/util/ArrayList;->size()I
move-result v13
.line 232
.local v13, "taskCount":I
const/4 v6, 0x0
.local v6, "j":I
:goto_5
if-ge v6, v13, :cond_2
.line 233
invoke-virtual {v15, v6}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v12
check-cast v12, Lcom/android/systemui/recents/model/Task;
.line 234
.local v12, "t":Lcom/android/systemui/recents/model/Task;
iget-object v0, v12, Lcom/android/systemui/recents/model/Task;->key:Lcom/android/systemui/recents/model/Task$TaskKey;
move-object/from16 v16, v0
move-object/from16 v0, v16
iget v0, v0, Lcom/android/systemui/recents/model/Task$TaskKey;->id:I
move/from16 v16, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v17, v0
move-object/from16 v0, v17
iget v0, v0, Lcom/android/systemui/recents/RecentsConfiguration;->launchedToTaskId:I
move/from16 v17, v0
move/from16 v0, v16
move/from16 v1, v17
if-ne v0, v1, :cond_7
.line 235
const/16 v16, 0x1
move/from16 v0, v16
iput-boolean v0, v12, Lcom/android/systemui/recents/model/Task;->isLaunchTarget:Z
.line 228
.end local v12 # "t":Lcom/android/systemui/recents/model/Task;
:cond_2
add-int/lit8 v5, v5, 0x1
goto :goto_4
.line 191
.end local v4 # "homeIntent":Landroid/content/Intent;
.end local v5 # "i":I
.end local v6 # "j":I
.end local v7 # "loader":Lcom/android/systemui/recents/model/RecentsTaskLoader;
.end local v9 # "root":Lcom/android/systemui/recents/model/SpaceNode;
.end local v10 # "stack":Lcom/android/systemui/recents/model/TaskStack;
.end local v11 # "stacks":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/android/systemui/recents/model/TaskStack;>;"
.end local v13 # "taskCount":I
.end local v14 # "taskStackCount":I
.end local v15 # "tasks":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/android/systemui/recents/model/Task;>;"
:cond_3
const/16 v16, 0x0
goto/16 :goto_0
.line 211
.restart local v7 # "loader":Lcom/android/systemui/recents/model/RecentsTaskLoader;
.restart local v9 # "root":Lcom/android/systemui/recents/model/SpaceNode;
.restart local v11 # "stacks":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/android/systemui/recents/model/TaskStack;>;"
:cond_4
const/16 v16, 0x0
goto/16 :goto_1
.line 218
.restart local v4 # "homeIntent":Landroid/content/Intent;
:cond_5
const v16, 0x7f05002c
move/from16 v17, v16
goto/16 :goto_2
:cond_6
const v16, 0x7f05002d
goto/16 :goto_3
.line 232
.restart local v5 # "i":I
.restart local v6 # "j":I
.restart local v10 # "stack":Lcom/android/systemui/recents/model/TaskStack;
.restart local v12 # "t":Lcom/android/systemui/recents/model/Task;
.restart local v13 # "taskCount":I
.restart local v14 # "taskStackCount":I
.restart local v15 # "tasks":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/android/systemui/recents/model/Task;>;"
:cond_7
add-int/lit8 v6, v6, 0x1
goto :goto_5
.line 243
.end local v5 # "i":I
.end local v6 # "j":I
.end local v10 # "stack":Lcom/android/systemui/recents/model/TaskStack;
.end local v12 # "t":Lcom/android/systemui/recents/model/Task;
.end local v13 # "taskCount":I
.end local v15 # "tasks":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/android/systemui/recents/model/Task;>;"
:cond_8
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v16, v0
move-object/from16 v0, v16
iget-boolean v0, v0, Lcom/android/systemui/recents/RecentsConfiguration;->launchedWithNoRecentTasks:Z
move/from16 v16, v0
if-eqz v16, :cond_d
.line 244
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mEmptyView:Landroid/view/View;
move-object/from16 v16, v0
if-nez v16, :cond_9
.line 245
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mEmptyViewStub:Landroid/view/ViewStub;
move-object/from16 v16, v0
invoke-virtual/range {v16 .. v16}, Landroid/view/ViewStub;->inflate()Landroid/view/View;
move-result-object v16
move-object/from16 v0, v16
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/systemui/recents/RecentsActivity;->mEmptyView:Landroid/view/View;
.line 247
:cond_9
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mEmptyView:Landroid/view/View;
move-object/from16 v16, v0
const/16 v17, 0x0
invoke-virtual/range {v16 .. v17}, Landroid/view/View;->setVisibility(I)V
.line 248
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
move-object/from16 v16, v0
const/16 v17, 0x8
invoke-virtual/range {v16 .. v17}, Lcom/android/systemui/recents/views/RecentsView;->setSearchBarVisibility(I)V
.line 249
const v16, 0x7f0e0170
move-object/from16 v0, p0
move/from16 v1, v16
invoke-virtual {v0, v1}, Lcom/android/systemui/recents/RecentsActivity;->findViewById(I)Landroid/view/View;
move-result-object v16
const/16 v17, 0x8
invoke-virtual/range {v16 .. v17}, Landroid/view/View;->setVisibility(I)V
.line 273
:cond_a
:goto_6
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/RecentsActivity;->getResources()Landroid/content/res/Resources;
move-result-object v8
.line 275
.local v8, "reso":Landroid/content/res/Resources;
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/RecentsActivity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v16
const-string v17, "recents_show_hide_search_bar"
const/16 v18, 0x0
invoke-static/range {v16 .. v18}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v16
const/16 v17, 0x1
move/from16 v0, v16
move/from16 v1, v17
if-eq v0, v1, :cond_b
.line 277
const/16 v16, 0x0
sput v16, Lcom/android/systemui/recents/RecentsConfiguration;->searchBarSpaceHeightPx:I
.line 281
:cond_b
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/RecentsActivity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v16
const-string v17, "recents_show_hide_search_bar"
const/16 v18, 0x1
invoke-static/range {v16 .. v18}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v16
if-eqz v16, :cond_c
.line 283
const v16, 0x7f08006d
move/from16 v0, v16
invoke-virtual {v8, v0}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v16
sput v16, Lcom/android/systemui/recents/RecentsConfiguration;->searchBarSpaceHeightPx:I
.line 287
:cond_c
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mScrimViews:Lcom/android/systemui/recents/views/SystemBarScrimViews;
move-object/from16 v16, v0
invoke-virtual/range {v16 .. v16}, Lcom/android/systemui/recents/views/SystemBarScrimViews;->prepareEnterRecentsAnimation()V
.line 288
return-void
.line 251
.end local v8 # "reso":Landroid/content/res/Resources;
:cond_d
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mEmptyView:Landroid/view/View;
move-object/from16 v16, v0
if-eqz v16, :cond_e
.line 252
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mEmptyView:Landroid/view/View;
move-object/from16 v16, v0
const/16 v17, 0x8
invoke-virtual/range {v16 .. v17}, Landroid/view/View;->setVisibility(I)V
.line 254
:cond_e
const v16, 0x7f0e0170
move-object/from16 v0, p0
move/from16 v1, v16
invoke-virtual {v0, v1}, Lcom/android/systemui/recents/RecentsActivity;->findViewById(I)Landroid/view/View;
move-result-object v16
const/16 v17, 0x0
invoke-virtual/range {v16 .. v17}, Landroid/view/View;->setVisibility(I)V
.line 255
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
move-object/from16 v16, v0
invoke-virtual/range {v16 .. v16}, Lcom/android/systemui/recents/views/RecentsView;->hasSearchBar()Z
move-result v16
if-eqz v16, :cond_10
.line 257
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/RecentsActivity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v16
const-string v17, "recents_show_hide_search_bar"
const/16 v18, 0x0
invoke-static/range {v16 .. v18}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v16
const/16 v17, 0x1
move/from16 v0, v16
move/from16 v1, v17
if-ne v0, v1, :cond_f
.line 259
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
move-object/from16 v16, v0
const/16 v17, 0x0
invoke-virtual/range {v16 .. v17}, Lcom/android/systemui/recents/views/RecentsView;->setSearchBarVisibility(I)V
goto/16 :goto_6
.line 261
:cond_f
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/recents/RecentsActivity;->mRecentsView:Lcom/android/systemui/recents/views/RecentsView;
move-object/from16 v16, v0
const/16 v17, 0x8
invoke-virtual/range {v16 .. v17}, Lcom/android/systemui/recents/views/RecentsView;->setSearchBarVisibility(I)V
goto/16 :goto_6
.line 264
:cond_10
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/RecentsActivity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v16
const-string v17, "recents_show_hide_search_bar"
const/16 v18, 0x0
invoke-static/range {v16 .. v18}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v16
const/16 v17, 0x1
move/from16 v0, v16
move/from16 v1, v17
if-ne v0, v1, :cond_a
.line 266
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/RecentsActivity;->addSearchBarAppWidgetView()V
goto/16 :goto_6
.end method
Find and replace id's
0x7f05002e - <public type="anim" name="recents_to_search_launcher_enter"
0x7f05002f - <public type="anim" name="recents_to_search_launcher_exit"
0x7f05002c - <public type="anim" name="recents_to_launcher_enter"
0x7f05002d - <public type="anim" name="recents_to_launcher_exit"
0x7f0e0170 - <public type="id" name="gk_recents"
0x7f08006d - <public type="dimen" name="recents_search_bar_space_height"
0x7f0e0170 - <public type="id" name="gk_recents"
Click to expand...
Click to collapse
8.Open SystemUI\smali\com\android\systemui\recents\views\RecentsView.smali
find
Code:
.field mDebugOverlay:Lcom/android/systemui/recents/views/DebugOverlayView;
below add a new field
Code:
.field mFloatingButton:Landroid/view/View;
find below method
Code:
.method public dismissFocusedTask()V
below add a new method
Code:
.method public endFABanimation()V
.locals 4
.prologue
.line 360
invoke-virtual {p0}, Lcom/android/systemui/recents/views/RecentsView;->getParent()Landroid/view/ViewParent;
move-result-object v0
check-cast v0, Landroid/view/View;
const v1, 0x7f0e0170
invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
.line 361
iget-object v0, p0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
invoke-virtual {v0}, Landroid/view/View;->animate()Landroid/view/ViewPropertyAnimator;
move-result-object v0
const/4 v1, 0x0
invoke-virtual {v0, v1}, Landroid/view/ViewPropertyAnimator;->alpha(F)Landroid/view/ViewPropertyAnimator;
move-result-object v0
const-wide/16 v2, 0x0
invoke-virtual {v0, v2, v3}, Landroid/view/ViewPropertyAnimator;->setStartDelay(J)Landroid/view/ViewPropertyAnimator;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget v1, v1, Lcom/android/systemui/recents/RecentsConfiguration;->taskBarExitAnimDuration:I
int-to-long v2, v1
invoke-virtual {v0, v2, v3}, Landroid/view/ViewPropertyAnimator;->setDuration(J)Landroid/view/ViewPropertyAnimator;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget-object v1, v1, Lcom/android/systemui/recents/RecentsConfiguration;->fastOutLinearInInterpolator:Landroid/view/animation/Interpolator;
invoke-virtual {v0, v1}, Landroid/view/ViewPropertyAnimator;->setInterpolator(Landroid/animation/TimeInterpolator;)Landroid/view/ViewPropertyAnimator;
move-result-object v0
invoke-virtual {v0}, Landroid/view/ViewPropertyAnimator;->withLayer()Landroid/view/ViewPropertyAnimator;
move-result-object v0
invoke-virtual {v0}, Landroid/view/ViewPropertyAnimator;->start()V
.line 367
return-void
.end method
find and replace id
0x7f0e0170 - <public type="id" name="gk_recents"
Click to expand...
Click to collapse
find
Code:
.method protected onAttachedToWindow()V
replace whole method with this
Code:
.method protected onAttachedToWindow()V
.locals 2
.prologue
.line 371
invoke-super {p0}, Landroid/widget/FrameLayout;->onAttachedToWindow()V
.line 372
invoke-virtual {p0}, Lcom/android/systemui/recents/views/RecentsView;->getParent()Landroid/view/ViewParent;
move-result-object v0
check-cast v0, Landroid/view/View;
const v1, 0x7f0e0170
invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
.line 373
invoke-virtual {p0}, Lcom/android/systemui/recents/views/RecentsView;->getParent()Landroid/view/ViewParent;
move-result-object v0
check-cast v0, Landroid/view/View;
const v1, 0x7f0e0115
invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/recents/views/RecentsView;->mClearRecents:Landroid/view/View;
.line 374
iget-object v0, p0, Lcom/android/systemui/recents/views/RecentsView;->mClearRecents:Landroid/view/View;
new-instance v1, Lcom/android/systemui/recents/views/RecentsView$1;
invoke-direct {v1, p0}, Lcom/android/systemui/recents/views/RecentsView$1;-><init>(Lcom/android/systemui/recents/views/RecentsView;)V
invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V
.line 379
return-void
.end method
find and replace id's
0x7f0e0170 - <public type="id" name="gk_recents"
0x7f0e0115 - <public type="id" name="clear_recents"
Click to expand...
Click to collapse
continued on next page
Continued.
find
Code:
.method protected onMeasure(II)V
replace whole method with this
Code:
.method protected onMeasure(II)V
.locals 17
.param p1, "widthMeasureSpec" # I
.param p2, "heightMeasureSpec" # I
.prologue
.line 274
invoke-static/range {p1 .. p1}, Landroid/view/View$MeasureSpec;->getSize(I)I
move-result v3
.line 275
.local v3, "width":I
invoke-static/range {p2 .. p2}, Landroid/view/View$MeasureSpec;->getSize(I)I
move-result v4
.line 278
.local v4, "height":I
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mSearchBar:Landroid/view/View;
if-eqz v2, :cond_0
.line 279
new-instance v13, Landroid/graphics/Rect;
invoke-direct {v13}, Landroid/graphics/Rect;-><init>()V
.line 280
.local v13, "searchBarSpaceBounds":Landroid/graphics/Rect;
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget-object v5, v5, Lcom/android/systemui/recents/RecentsConfiguration;->systemInsets:Landroid/graphics/Rect;
iget v5, v5, Landroid/graphics/Rect;->top:I
invoke-virtual {v2, v3, v4, v5, v13}, Lcom/android/systemui/recents/RecentsConfiguration;->getSearchBarBounds(IIILandroid/graphics/Rect;)V
.line 281
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mSearchBar:Landroid/view/View;
invoke-virtual {v13}, Landroid/graphics/Rect;->width()I
move-result v5
const/high16 v6, 0x40000000
invoke-static {v5, v6}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I
move-result v5
invoke-virtual {v13}, Landroid/graphics/Rect;->height()I
move-result v6
const/high16 v16, 0x40000000
move/from16 v0, v16
invoke-static {v6, v0}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I
move-result v6
invoke-virtual {v2, v5, v6}, Landroid/view/View;->measure(II)V
.line 286
.end local v13 # "searchBarSpaceBounds":Landroid/graphics/Rect;
:cond_0
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v5, "show_clear_all_recents"
const/4 v6, 0x1
invoke-static {v2, v5, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
const/4 v5, 0x1
if-ne v2, v5, :cond_2
const/4 v14, 0x1
.line 289
.local v14, "showClearAllRecents":Z
:goto_0
new-instance v7, Landroid/graphics/Rect;
invoke-direct {v7}, Landroid/graphics/Rect;-><init>()V
.line 290
.local v7, "taskStackBounds":Landroid/graphics/Rect;
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget-object v5, v5, Lcom/android/systemui/recents/RecentsConfiguration;->systemInsets:Landroid/graphics/Rect;
iget v5, v5, Landroid/graphics/Rect;->top:I
move-object/from16 v0, p0
iget-object v6, v0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget-object v6, v6, Lcom/android/systemui/recents/RecentsConfiguration;->systemInsets:Landroid/graphics/Rect;
iget v6, v6, Landroid/graphics/Rect;->right:I
invoke-virtual/range {v2 .. v7}, Lcom/android/systemui/recents/RecentsConfiguration;->getTaskStackBounds(IIIILandroid/graphics/Rect;)V
.line 293
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
if-eqz v2, :cond_3
if-eqz v14, :cond_3
.line 294
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v5, "recents_clear_all_location"
const/4 v6, 0x3
invoke-static {v2, v5, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v10
.line 296
.local v10, "clearRecentsLocation":I
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
invoke-virtual {v2}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
move-result-object v12
check-cast v12, Landroid/widget/FrameLayout$LayoutParams;
.line 298
.local v12, "params":Landroid/widget/FrameLayout$LayoutParams;
iget v2, v7, Landroid/graphics/Rect;->top:I
iput v2, v12, Landroid/widget/FrameLayout$LayoutParams;->topMargin:I
.line 299
packed-switch v10, :pswitch_data_0
.line 305
const/16 v2, 0x35
iput v2, v12, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
.line 320
:goto_1
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
invoke-virtual {v2, v12}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
.line 327
.end local v10 # "clearRecentsLocation":I
.end local v12 # "params":Landroid/widget/FrameLayout$LayoutParams;
:goto_2
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/recents/views/RecentsView;->getChildCount()I
move-result v9
.line 328
.local v9, "childCount":I
const/4 v11, 0x0
.local v11, "i":I
:goto_3
if-ge v11, v9, :cond_4
.line 329
move-object/from16 v0, p0
invoke-virtual {v0, v11}, Lcom/android/systemui/recents/views/RecentsView;->getChildAt(I)Landroid/view/View;
move-result-object v8
.line 330
.local v8, "child":Landroid/view/View;
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mSearchBar:Landroid/view/View;
if-eq v8, v2, :cond_1
invoke-virtual {v8}, Landroid/view/View;->getVisibility()I
move-result v2
const/16 v5, 0x8
if-eq v2, v5, :cond_1
move-object v15, v8
.line 331
check-cast v15, Lcom/android/systemui/recents/views/TaskStackView;
.line 333
.local v15, "tsv":Lcom/android/systemui/recents/views/TaskStackView;
invoke-virtual {v15, v7}, Lcom/android/systemui/recents/views/TaskStackView;->setStackInsetRect(Landroid/graphics/Rect;)V
.line 334
move/from16 v0, p1
move/from16 v1, p2
invoke-virtual {v15, v0, v1}, Lcom/android/systemui/recents/views/TaskStackView;->measure(II)V
.line 328
.end local v15 # "tsv":Lcom/android/systemui/recents/views/TaskStackView;
:cond_1
add-int/lit8 v11, v11, 0x1
goto :goto_3
.line 286
.end local v7 # "taskStackBounds":Landroid/graphics/Rect;
.end local v8 # "child":Landroid/view/View;
.end local v9 # "childCount":I
.end local v11 # "i":I
.end local v14 # "showClearAllRecents":Z
:cond_2
const/4 v14, 0x0
goto :goto_0
.line 301
.restart local v7 # "taskStackBounds":Landroid/graphics/Rect;
.restart local v10 # "clearRecentsLocation":I
.restart local v12 # "params":Landroid/widget/FrameLayout$LayoutParams;
.restart local v14 # "showClearAllRecents":Z
:pswitch_0
const/16 v2, 0x33
iput v2, v12, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
goto :goto_1
.line 308
:pswitch_1
const/16 v2, 0x31
iput v2, v12, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
goto :goto_1
.line 311
:pswitch_2
const/16 v2, 0x53
iput v2, v12, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
goto :goto_1
.line 314
:pswitch_3
const/16 v2, 0x55
iput v2, v12, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
goto :goto_1
.line 317
:pswitch_4
const/16 v2, 0x51
iput v2, v12, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
goto :goto_1
.line 322
.end local v10 # "clearRecentsLocation":I
.end local v12 # "params":Landroid/widget/FrameLayout$LayoutParams;
:cond_3
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
const/16 v5, 0x8
invoke-virtual {v2, v5}, Landroid/view/View;->setVisibility(I)V
goto :goto_2
.line 338
.restart local v9 # "childCount":I
.restart local v11 # "i":I
:cond_4
move-object/from16 v0, p0
invoke-virtual {v0, v3, v4}, Lcom/android/systemui/recents/views/RecentsView;->setMeasuredDimension(II)V
.line 339
return-void
.line 299
nop
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
:pswitch_1
:pswitch_3
:pswitch_2
:pswitch_4
.end packed-switch
.end method
find below method
Code:
.method public unfilterFilteredStacks()Z
add this on above of previous methos
Code:
.method public startFABanimation()V
.locals 4
.prologue
.line 349
invoke-virtual {p0}, Lcom/android/systemui/recents/views/RecentsView;->getParent()Landroid/view/ViewParent;
move-result-object v0
check-cast v0, Landroid/view/View;
const v1, 0x7f0e0170
invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
.line 350
iget-object v0, p0, Lcom/android/systemui/recents/views/RecentsView;->mFloatingButton:Landroid/view/View;
invoke-virtual {v0}, Landroid/view/View;->animate()Landroid/view/ViewPropertyAnimator;
move-result-object v0
const/high16 v1, 0x3f800000
invoke-virtual {v0, v1}, Landroid/view/ViewPropertyAnimator;->alpha(F)Landroid/view/ViewPropertyAnimator;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget v1, v1, Lcom/android/systemui/recents/RecentsConfiguration;->taskBarEnterAnimDelay:I
int-to-long v2, v1
invoke-virtual {v0, v2, v3}, Landroid/view/ViewPropertyAnimator;->setStartDelay(J)Landroid/view/ViewPropertyAnimator;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget v1, v1, Lcom/android/systemui/recents/RecentsConfiguration;->taskBarEnterAnimDuration:I
int-to-long v2, v1
invoke-virtual {v0, v2, v3}, Landroid/view/ViewPropertyAnimator;->setDuration(J)Landroid/view/ViewPropertyAnimator;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/recents/views/RecentsView;->mConfig:Lcom/android/systemui/recents/RecentsConfiguration;
iget-object v1, v1, Lcom/android/systemui/recents/RecentsConfiguration;->fastOutLinearInInterpolator:Landroid/view/animation/Interpolator;
invoke-virtual {v0, v1}, Landroid/view/ViewPropertyAnimator;->setInterpolator(Landroid/animation/TimeInterpolator;)Landroid/view/ViewPropertyAnimator;
move-result-object v0
invoke-virtual {v0}, Landroid/view/ViewPropertyAnimator;->withLayer()Landroid/view/ViewPropertyAnimator;
move-result-object v0
invoke-virtual {v0}, Landroid/view/ViewPropertyAnimator;->start()V
.line 356
return-void
.end method
find and replace id's
0x7f0e0170 - <public type="id" name="gk_recents"
Click to expand...
Click to collapse
9.Open SystemUI\smali\com\android\systemui\recents\views\TaskStackView.smali
find
Code:
.method private updateStackTransforms(Ljava/util/ArrayList;Ljava/util/ArrayList;F[IZ)Z
add this on above of previous method
Code:
.method static synthetic access$000(Lcom/android/systemui/recents/views/TaskStackView;)Z
.locals 1
.param p0, "x0" # Lcom/android/systemui/recents/views/TaskStackView;
.prologue
.line 57
invoke-direct {p0}, Lcom/android/systemui/recents/views/TaskStackView;->dismissAll()Z
move-result v0
return v0
.end method
.method static synthetic access$102(Lcom/android/systemui/recents/views/TaskStackView;Landroid/widget/PopupMenu;)Landroid/widget/PopupMenu;
.locals 0
.param p0, "x0" # Lcom/android/systemui/recents/views/TaskStackView;
.param p1, "x1" # Landroid/widget/PopupMenu;
.prologue
.line 57
iput-object p1, p0, Lcom/android/systemui/recents/views/TaskStackView;->mPopup:Landroid/widget/PopupMenu;
return-object p1
.end method
.method private dismissAll()Z
.locals 3
.prologue
const/4 v0, 0x1
.line 495
iget-object v1, p0, Lcom/android/systemui/recents/views/TaskStackView;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "recents_clear_all_dismiss_all"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v0, :cond_0
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
10.Open SystemUI\smali\com\android\systemui\recents\RecentsConfiguration.smali
find
Code:
.field static sPrevConfigurationHashCode:I
below add this code
Code:
.field public static searchBarSpaceHeightPx:I
find and remove below code
Code:
.field public searchBarSpaceHeightPx:I
find below method
Code:
.method public getSearchBarBounds(IIILandroid/graphics/Rect;)V
in the same method find below line
Code:
iget v0, p0, Lcom/android/systemui/recents/RecentsConfiguration;->searchBarSpaceHeightPx:I
replace the line with below code
Code:
sget v0, Lcom/android/systemui/recents/RecentsConfiguration;->searchBarSpaceHeightPx:I
find
Code:
.method update (Landroid / content / Context;) V
in the same method find and remove the below code
Code:
.line 201
const v7, 0x7f080064
invoke-virtual {v2, v7}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v7
iput v7, p0, Lcom/android/systemui/recents/RecentsConfiguration;->searchBarSpaceHeightPx:I
0x7f080064 - <public type="dimen" name="recents_search_bar_space_height"
Click to expand...
Click to collapse
11.Decompile SystemUI and move to your device
Abdullaharis said:
Hello guys
Here is a new guide on setting up the recents.
Credit:-
KachalkinGeorg (The GK)
Requirements (deodexed):-
1.Settings.apk
2.SystemUI.apk
3.NotePad++
4.Patience.. if you dont have try to get it
Click to expand...
Click to collapse
Can anyone get this in a module for the Xposed Installer ???
guillermorojaz said:
Can anyone get this in a module for the Xposed Installer ???
Click to expand...
Click to collapse
Editting Manually is Best i think.
Abdullaharis said:
Editting Manually is Best i think.
Click to expand...
Click to collapse
Thank you for prompt reply.
Unfortunately I do not have that knowledge :crying:
Can you help me
If I send the Settings.apk and the SystemUI.apk from my ROM you could help me?
Thank you in advance.
EDIT AND AGREEMENT.
Actually what I want is the button to clean recent apps all along the bottom of the screen, as shown in the image I attached
Unfortunately I do not have that knowledge :crying:
Can you help me
If I send the Settings.apk and the SystemUI.apk from my ROM you could help me?
Click to expand...
Click to collapse
ok, just send the files i will try

Categories

Resources