[Android] ahmed.nasser.hk:
GUIDE Header Images Auto machine

Work and Tested - CM 12.1 & LP Based

​

1. Decompile settings.apk

At the file:

Settings\res\xml\Display_Settings.xmll

Add this line

ADD THIS LINES.

Settings\res\values\strings.xml

*Compile Settings.apk DONE*

2. Decompile SystemUI.apk

ystemUI\res\layout\status_bar_expanded_header.xml

Looking for:

xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res-auto">

following inserted ::

SystemUI\res\values\ids.xml

Add this line

*compile and decompile again to assign the ID to a file*

GO TO SystemUI\smali\com\android\systemui\statusbar\phone\PhoneStatusbar.smali

Looking for:
# instance fields
following inserted ::
.field private mStatusBarHeaderMachine:Lcom/android/systemui/ahmednhk/StatusBarHeaderMachine;
----------------------------------------------------------------
Looking for:
.method protected makeStatusBarView()V
After This Line:
invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->startGlyphRasterizeHack()V
following inserted:
.line 1309
new-instance v3, Lcom/android/systemui/ahmednhk/StatusBarHeaderMachine;

move-object/from16 v0, p0

iget-object v4, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

invoke-direct {v3, v4}, Lcom/android/systemui/ahmednhk/StatusBarHeaderMachine;-><init>(Landroid/content/Context;)V

move-object/from16 v0, p0

iput-object v3, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarHeaderMachine:Lcom/android/systemui/ahmednhk/StatusBarHeaderMachine;

.line 1310
move-object/from16 v0, p0

iget-object v3, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarHeaderMachine:Lcom/android/systemui/ahmednhk/StatusBarHeaderMachine;

move-object/from16 v0, p0

iget-object v4, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHeader:Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;

invoke-virtual {v3, v4}, Lcom/android/systemui/ahmednhk/StatusBarHeaderMachine;->addObserver(Lcom/android/systemui/ahmednhk/StatusBarHeaderMachine$IStatusBarHeaderMachineObserver;)V

.line 1311
move-object/from16 v0, p0

iget-object v3, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarHeaderMachine:Lcom/android/systemui/ahmednhk/StatusBarHeaderMachine;

invoke-virtual {v3}, Lcom/android/systemui/ahmednhk/StatusBarHeaderMachine;->updateEnablement()V
----------------------------------------------------------------
SystemUI\smali\com\android\systemui\statusbar\phone\StatusBarHeaderView.smali

Looking for:
.implements Lcom/android/systemui/statusbar/policy/WeatherController$Callback;
following inserted :
.implements Lcom/android/systemui/ahmednhk/StatusBarHeaderMachine$IStatusBarHeaderMachineObserver;
----------------------------------------------------------------
Looking for:
# instance fields
following inserted :
.field private mBackgroundImage:Landroid/widget/ImageView;
----------------------------------------------------------------
Looking for:
.field private mCollapsedHeight:I
following inserted :
.field private mCurrentBackground:Landroid/graphics/drawable/Drawable;
----------------------------------------------------------------
Looking for:
.field private mExpandedHeight:I
following inserted :
.field private mLastHeight:F
----------------------------------------------------------------
Looking for:
.method static synthetic access$900(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;)Landroid/widget/Switch;
At the end of it -> inserted :
.method static synthetic access$100001(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;Landroid/graphics/drawable/Drawable;Z)V
.locals 0
.param p0, "x0" # Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;
.param p1, "x1" # Landroid/graphics/drawable/Drawable;
.param p2, "x2" # Z

.prologue
.line 71
invoke-direct {p0, p1, p2}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->doUpdateStatusBarCustomHeader(Landroid/graphics/drawable/Drawable;Z)V

return-void
.end method

.method static synthetic access$100002(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;)Landroid/widget/ImageView;
.locals 1
.param p0, "x0" # Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;

.prologue
.line 71
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

return-object v0
.end method

.method static synthetic access$100003(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
.locals 0
.param p0, "x0" # Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;
.param p1, "x1" # Landroid/graphics/drawable/Drawable;

.prologue
.line 71
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCurrentBackground:Landroid/graphics/drawable/Drawable;

return-object p1
.end method

.method private doUpdateStatusBarCustomHeader(Landroid/graphics/drawable/Drawable;Z)V
.locals 2
.param p1, "next" # Landroid/graphics/drawable/Drawable;
.param p2, "force" # Z

.prologue
.line 1033
if-eqz p1, :cond_1

.line 1034
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCurrentBackground:Landroid/graphics/drawable/Drawable;

if-eq p1, v0, :cond_0

.line 1035
const-string v0, "StatusBarHeaderView"

const-string v1, "Updating status bar header background"

invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

.line 1036
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

const/4 v1, 0x0

invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setVisibility(I)V

.line 1037
invoke-direct {p0, p1, p2}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setNotificationPanelHeaderBackground(Landroid/graphics/drawable/Drawable;Z)V

.line 1038
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCurrentBackground:Landroid/graphics/drawable/Drawable;

.line 1044
:cond_0
:goto_0
return-void

.line 1041
:cond_1
const/4 v0, 0x0

iput-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCurrentBackground:Landroid/graphics/drawable/Drawable;

.line 1042
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

const/16 v1, 0x8

invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setVisibility(I)V

goto :goto_0
.end method

.method private setNotificationPanelHeaderBackground(Landroid/graphics/drawable/Drawable;Z)V
.locals 5
.param p1, "dw" # Landroid/graphics/drawable/Drawable;
.param p2, "force" # Z

.prologue
const/4 v4, 0x1

.line 1047
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

invoke-virtual {v2}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;

move-result-object v2

if-eqz v2, :cond_0

if-nez p2, :cond_0

.line 1048
const/4 v2, 0x2

new-array v0, v2, [Landroid/graphics/drawable/Drawable;

.line 1049
.local v0, "arrayDrawable":[Landroid/graphics/drawable/Drawable;
const/4 v2, 0x0

iget-object v3, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

invoke-virtual {v3}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;

move-result-object v3

aput-object v3, v0, v2

.line 1050
aput-object p1, v0, v4

.line 1052
new-instance v1, Landroid/graphics/drawable/TransitionDrawable;

invoke-direct {v1, v0}, Landroid/graphics/drawable/TransitionDrawable;-><init>([Landroid/graphics/drawable/Drawable;)V

.line 1053
.local v1, "transitionDrawable":Landroid/graphics/drawable/TransitionDrawable;
invoke-virtual {v1, v4}, Landroid/graphics/drawable/TransitionDrawable;->setCrossFadeEnabled(Z)V

.line 1054
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

invoke-virtual {v2, v1}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

.line 1055
const/16 v2, 0x3e8

invoke-virtual {v1, v2}, Landroid/graphics/drawable/TransitionDrawable;->startTransition(I)V

.line 1059
.end local v0 # "arrayDrawable":[Landroid/graphics/drawable/Drawable;
.end local v1 # "transitionDrawable":Landroid/graphics/drawable/TransitionDrawable;
:goto_0
return-void

.line 1057
:cond_0
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

invoke-virtual {v2, p1}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

goto :goto_0
.end method
----------------------------------------------------------------
Looking for:
# virtual method
following inserted :
.method public disableHeader()V
.locals 1

.prologue
.line 1072
new-instance v0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView$98;

invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView$98;-><init>(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;)V

invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->post(Ljava/lang/Runnable;)Z

.line 1078
return-void
.end method

.method public updateHeader(Landroid/graphics/drawable/Drawable;Z)V
.locals 1
.param p1, "headerImage" # Landroid/graphics/drawable/Drawable;
.param p2, "force" # Z

.prologue
.line 1063
new-instance v0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView$97;

invoke-direct {v0, p0, p1, p2}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView$97;-><init>(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;Landroid/graphics/drawable/Drawable;Z)V

invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->post(Ljava/lang/Runnable;)Z

.line 1068
return-void
.end method
----------------------------------------------------------------
Looking for:
.method protected onFinishInflate()V
After This Line:
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mDateExpanded:Landroid/widget/TextView;
following inserted ::
.line 31
const v0, 0x7f0f017a

invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->findViewById(I)Landroid/view/View;

move-result-object v0

check-cast v0, Landroid/widget/ImageView;

iput-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

.line 168

Will Find At :
<0x7f0f017a - <public type="id" name="background_image">
----------------------------------------------------------------
Looking for:
.method public setExpansion(F)V
Changing it completely with:
.method public setExpansion(F)V
.locals 5
.param p1, "t" # F

.prologue
.line 584
iget-boolean v2, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mExpanded:Z

if-nez v2, :cond_0

.line 585
const/4 p1, 0x0

.line 587
:cond_0
iput p1, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCurrentT:F

.line 588
iget v2, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCollapsedHeight:I

int-to-float v2, v2

iget v3, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mExpandedHeight:I

iget v4, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCollapsedHeight:I

sub-int/2addr v3, v4

int-to-float v3, v3

mul-float/2addr v3, p1

add-float v0, v2, v3

.line 589
.local v0, "height":F
iget v2, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mLastHeight:F

cmpl-float v2, v0, v2

if-eqz v2, :cond_3

.line 590
iget v2, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCollapsedHeight:I

int-to-float v2, v2

cmpg-float v2, v0, v2

if-gez v2, :cond_1

.line 591
iget v2, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCollapsedHeight:I

int-to-float v0, v2

.line 593
:cond_1
iget v2, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mExpandedHeight:I

int-to-float v2, v2

cmpl-float v2, v0, v2

if-lez v2, :cond_2

.line 594
iget v2, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mExpandedHeight:I

int-to-float v0, v2

.line 596
:cond_2
move v1, v0

.line 597
.local v1, "heightFinal":F
invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setClipping(F)V

.line 599
new-instance v2, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView$96;

invoke-direct {v2, p0, v1}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView$96;-><init>(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;F)V

invoke-virtual {p0, v2}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->post(Ljava/lang/Runnable;)Z

.line 607
invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->updateLayoutValues(F)V

.line 608
iput v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mLastHeight:F

.line 610
.end local v1 # "heightFinal":F
:cond_3
return-void
.end method
----------------------------------------------------------------
*assign the ID's to file*
SystemUI\smali\com\android\systemui\ahmednhk\StatusBarHeaderProvider.smali
<public type="drawable" name="notifhead_christmas"
LINE 220

<public type="drawable" name="notifhead_newyearseve"
LINE 241

<public type="drawable" name="notifhead_night"
LINE 265

<public type="drawable" name="notifhead_sunrise"
LINE 280

<public type="drawable" name="notifhead_morning"
LINE 295

<public type="drawable" name="notifhead_noon"
LINE 310

<public type="drawable" name="notifhead_afternoon"
LINE 325

<public type="drawable" name="notifhead_sunset"
LINE 342>

*Compile SystemUI.apk DONE*

Files and Compare Press Me​