[Guide][KitKat][Xperia] Guide How to add Flip Animation Quick Settings - Sony Cross-Device General

Guide Smali How to add Flip Animation Quick Settings
Flip Animation Quick Settings , Youtube https://www.youtube.com/watch?v=DBBEsLk6ti4&feature=youtu.be
REQUIREMENT :
- ApkTool RC
- Notepad++
- Xperia KitKat
- Brain
- Patient
- Experience
STEP -1
Decompile SystemUI.apk
Download attached resources and sources, merge to your decompiled systemui
STEP -2
SystemUI.apk/res/layout/
Code:
somc_statusbar_notification_tools_button.xml
or
Code:
status_bar_notification_tools_button.xml
add the red line
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center" android:orientation="vertical" android:id="@id/tools_button_layout" android:background="@drawable/somc_quick_settings_tool_button_bg" [COLOR="Red"]android:clickable="true"[/COLOR] android:layout_width="wrap_content" android:layout_height="wrap_content" android:minHeight="1.0dip"
xmlns:android="http://schemas.android.com/apk/res/android">
<FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageView android:id="@id/tools_button_img" android:layout_width="@dimen/qs_tile_icon_size" android:layout_height="@dimen/qs_tile_icon_size" android:scaleType="center" android:contentDescription="@null" />
<ImageView android:id="@id/tools_button_anim" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="wrap_content" android:scaleType="center" android:contentDescription="@null" />
</FrameLayout>
<TextView android:textSize="@dimen/status_bar_tools_button_label_text_size" android:gravity="top|center" android:id="@id/tools_button_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/status_bar_tools_button_margin_bottom" android:lines="2" android:scrollHorizontally="false" android:includeFontPadding="false" />
</LinearLayout>
go to
com/sonymobile/systemui/statusbar/tools/ToolsButton.smali
Add the red line
Code:
# static fields
.field private static final TAG:Ljava/lang/String;
# instance fields
[COLOR="Red"].field private mHandler:Landroid/os/Handler;[/COLOR]
.field private mAccentColor:I
.field private mAnimationFrames:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
Add the red line and pay attention to the register number in blue hint, each device can be different ,
it can be v3, v2, .. you must adapt it.
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.param p1, "context" # Landroid/content/Context;
.prologue
const/4 v8, 0x1
const/4 v7, 0x0
const/4 v6, -0x1
const/4 v5, 0x0
invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V
const/high16 v3, -0x80000000
iput v3, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mState:I
iput v7, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mCurrentAnimationImage:I
iput-object v5, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mAnimationFrames:Ljava/util/ArrayList;
new-instance v3, Landroid/util/SparseArray;
const/16 v4, 0xa
invoke-direct {v3, v4}, Landroid/util/SparseArray;-><init>(I)V
iput-object v3, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mBitmaps:Landroid/util/SparseArray;
iput-boolean v7, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mButtonClicked:Z
iput v7, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mButtonType:I
iput-object p1, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mContext:Landroid/content/Context;
new-instance [COLOR="Blue"]v3[/COLOR], Landroid/util/SparseArray;
invoke-direct {[COLOR="Blue"]v3[/COLOR]}, Landroid/util/SparseArray;-><init>()V
iput-object [COLOR="Blue"]v3[/COLOR], p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mStateIcons:Landroid/util/SparseArray;
[COLOR="Red"]new-instance [COLOR="Blue"]v3[/COLOR], Landroid/os/Handler;
invoke-direct {[COLOR="Blue"]v3[/COLOR]}, Landroid/os/Handler;-><init>()V
iput-object [COLOR="Blue"]v3[/COLOR], p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mHandler:Landroid/os/Handler;[/COLOR]
new-instance [COLOR="Blue"]v3[/COLOR], Landroid/util/SparseIntArray;
invoke-direct {[COLOR="Blue"]v3[/COLOR]}, Landroid/util/SparseIntArray;-><init>()V
iput-object [COLOR="Blue"]v3[/COLOR], p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mStateContentDescription:Landroid/util/SparseIntArray;
new-instance v2, Landroid/widget/FrameLayout$LayoutParams;
invoke-direct {v2, v6, v6}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V
.local v2, "params":Landroid/widget/FrameLayout$LayoutParams;
invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
move-result-object v1
.local v1, "inflater":Landroid/view/LayoutInflater;
const [COLOR="Blue"]v3[/COLOR], 0x7f04001d
invoke-virtual {v1, [COLOR="Blue"]v3[/COLOR], v5}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object [COLOR="Blue"]v3[/COLOR]
check-cast [COLOR="Blue"]v3[/COLOR], Landroid/widget/LinearLayout;
iput-object [COLOR="Blue"]v3[/COLOR], p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mVerticalLayout:Landroid/widget/LinearLayout;
[COLOR="Red"]iget-object [COLOR="Blue"]v3[/COLOR], p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mVerticalLayout:Landroid/widget/LinearLayout;
invoke-virtual {[COLOR="Blue"]v3[/COLOR], p0}, Landroid/widget/LinearLayout;->setOnClickListener(Landroid/view/View$OnClickListener;)V
iget-object [COLOR="Blue"]v3[/COLOR], p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mVerticalLayout:Landroid/widget/LinearLayout;
invoke-virtual {[COLOR="Blue"]v3[/COLOR], p0}, Landroid/widget/LinearLayout;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V
[/COLOR]
Next
add the red mehod
Code:
.method private enableButton(Z)V
.locals 1
.param p1, "enable" # Z
.prologue
if-eqz p1, :cond_0
move-object v0, p0
.local v0, "enableButton":Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;
:goto_0
invoke-virtual {p0, v0}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V
invoke-virtual {p0, v0}, Landroid/view/View;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V
invoke-virtual {p0, v0}, Landroid/view/View;->setOnTouchListener(Landroid/view/View$OnTouchListener;)V
return-void
.end local v0 # "enableButton":Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
[COLOR="Red"].method private mOnLongClickVerticalLayout()V
.locals 6
.prologue
iget-object v0, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mVerticalLayout:Landroid/widget/LinearLayout;
return-void
.end method[/COLOR]
.method private setImageBitmap(Landroid/widget/ImageView;Landroid/graphics/Bitmap;Z)V
.locals 2
.param p1, "imageView" # Landroid/widget/ImageView;
.param p2, "bitmap" # Landroid/graphics/Bitmap;
.param p3, "colorize" # Z
.prologue
invoke-virtual {p1, p2}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V
const v0, -0x55555556
invoke-static {p3}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v1
invoke-virtual {p1, v0, v1}, Landroid/view/View;->setTag(ILjava/lang/Object;)V
Next find this line
Code:
# virtual methods
and add all red method
Code:
# virtual methods
[COLOR="Red"].method public flip()V
.locals 2
.prologue
const/4 v0, 0x0
invoke-virtual {p0, v0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->flipTile(I)V
return-void
.end method
.method public flipTile(I)V
.locals 1
.param p1, "delay" # I
.prologue
.line 159
const/4 v0, 0x1
invoke-virtual {p0, p1, v0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->flipTile(IZ)V
.line 160
return-void
.end method
.method public flipTile(IZ)V
.locals 5
.param p1, "delay" # I
.param p2, "flipRight" # Z
.prologue
.line 163
invoke-virtual {p0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->isFlipTilesEnabled()Z
move-result v2
if-nez v2, :cond_0
.line 190
:goto_0
return-void
.line 164
:cond_0
iget-object v3, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mContext:Landroid/content/Context;
if-eqz p2, :cond_1
const v2, 0x7f05001c
:goto_1
invoke-static {v3, v2}, Landroid/animation/AnimatorInflater;->loadAnimator(Landroid/content/Context;I)Landroid/animation/Animator;
move-result-object v0
check-cast v0, Landroid/animation/AnimatorSet;
.line 167
.local v0, "anim":Landroid/animation/AnimatorSet;
iget-object v2, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mVerticalLayout:Landroid/widget/LinearLayout;
invoke-virtual {v0, v2}, Landroid/animation/AnimatorSet;->setTarget(Ljava/lang/Object;)V
.line 168
const-wide/16 v2, 0xc8
invoke-virtual {v0, v2, v3}, Landroid/animation/AnimatorSet;->setDuration(J)Landroid/animation/AnimatorSet;
.line 169
new-instance v2, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton$31;
invoke-direct {v2, p0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton$31;-><init>(Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;)V
invoke-virtual {v0, v2}, Landroid/animation/AnimatorSet;->addListener(Landroid/animation/Animator$AnimatorListener;)V
.line 182
new-instance v1, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton$32;
invoke-direct {v1, p0, v0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton$32;-><init>(Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;Landroid/animation/AnimatorSet;)V
.line 189
.local v1, "doAnimation":Ljava/lang/Runnable;
iget-object v2, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mHandler:Landroid/os/Handler;
int-to-long v3, p1
invoke-virtual {v2, v1, v3, v4}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
goto :goto_0
.line 164
.end local v0 # "anim":Landroid/animation/AnimatorSet;
.end local v1 # "doAnimation":Ljava/lang/Runnable;
:cond_1
const v2, 0x7f05001b
goto :goto_1
.end method
.method public isFlipTilesEnabled()Z
.locals 3
.prologue
const/4 v0, 0x1
.line 154
iget-object v1, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "quick_settings_tiles_flip"
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[/COLOR]
.method protected varargs addState(ILjava/lang/Integer;Lcom/sonymobile/systemui/statusbar/tools/ToolsButton$ToolsIcon;[Lcom/sonymobile/systemui/statusbar/tools/ToolsButton$ToolsIcon;)V
.locals 2
.param p1, "stateId" # I
.param p2, "stringId" # Ljava/lang/Integer;
.param p3, "stateIcon" # Lcom/sonymobile/systemui/statusbar/tools/ToolsButton$ToolsIcon;
.param p4, "animationIcons" # [Lcom/sonymobile/systemui/statusbar/tools/ToolsButton$ToolsIcon;
.prologue
iget-object v0, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mStateIcons:Landroid/util/SparseArray;
invoke-virtual {v0, p1, p3}, Landroid/util/SparseArray;->put(ILjava/lang/Object;)V
iget-object v0, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mStateContentDescription:Landroid/util/SparseIntArray;
invoke-virtual {p2}, Ljava/lang/Integer;->intValue()I
next search this method and add the red line
Code:
.method public onClick(Landroid/view/View;)V
.locals 2
.param p1, "view" # Landroid/view/View;
.prologue
iget-object v0, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mAnimationView:Landroid/widget/ImageView;
invoke-virtual {v0}, Landroid/view/View;->getVisibility()I
move-result v0
if-nez v0, :cond_0
iget v0, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mButtonType:I
const/4 v1, 0x2
if-ne v0, v1, :cond_1
:cond_0
invoke-virtual {p0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->onAction()V
[COLOR="Red"]invoke-virtual {p0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->flip()V[/COLOR]
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mButtonClicked:Z
:cond_1
return-void
.end method
.method public onLongClick(Landroid/view/View;)Z
.locals 2
.param p1, "view" # Landroid/view/View;
.prologue
const/4 v0, 0x0
.local v0, "clickHandled":Z
iget-object v1, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mAnimationView:Landroid/widget/ImageView;
invoke-virtual {v1}, Landroid/view/View;->getVisibility()I
move-result v1
if-eqz v1, :cond_0
invoke-virtual {p0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->onLongClickPopup()Z
move-result v1
if-eqz v1, :cond_1
const/4 v0, 0x1
:cond_0
:goto_0
[COLOR="Red"]invoke-direct {p0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mOnLongClickVerticalLayout()V[/COLOR]
return v0
:cond_1
const/4 v0, 0x0
goto :goto_0
.end method
Compile your systemUI
STEP-3
Decompile the newly recompiled again
next go to systemui/res/values/public.xml
Code:
<public type="anim" name="wallpaper_recents_launch_from_launcher_exit" id="0x7f05001a" />
[COLOR="Blue"]<public type="anim" name="flip_left" id="[COLOR="Red"]0x7f??????[/COLOR]" />[/COLOR]
[COLOR="Blue"]<public type="anim" name="flip_right" id="[COLOR="Red"]0x7f??????[/COLOR]" />[/COLOR]
<public type="xml" name="somc_skin_permissions" id="0x7f060000" />
next go to
com/sonymobile/systemui/statusbar/tools/ToolsButton.smali
serach this method
Code:
.method public flipTile(IZ)V
.locals 5
.param p1, "delay" # I
.param p2, "flipRight" # Z
.prologue
.line 163
invoke-virtual {p0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->isFlipTilesEnabled()Z
move-result v2
if-nez v2, :cond_0
.line 190
:goto_0
return-void
.line 164
:cond_0
iget-object v3, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mContext:Landroid/content/Context;
if-eqz p2, :cond_1
const v2, [COLOR="Red"]0x7f05001c[/COLOR]
:goto_1
invoke-static {v3, v2}, Landroid/animation/AnimatorInflater;->loadAnimator(Landroid/content/Context;I)Landroid/animation/Animator;
move-result-object v0
check-cast v0, Landroid/animation/AnimatorSet;
.line 167
.local v0, "anim":Landroid/animation/AnimatorSet;
iget-object v2, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mVerticalLayout:Landroid/widget/LinearLayout;
invoke-virtual {v0, v2}, Landroid/animation/AnimatorSet;->setTarget(Ljava/lang/Object;)V
.line 168
const-wide/16 v2, 0xc8
invoke-virtual {v0, v2, v3}, Landroid/animation/AnimatorSet;->setDuration(J)Landroid/animation/AnimatorSet;
.line 169
new-instance v2, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton$31;
invoke-direct {v2, p0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton$31;-><init>(Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;)V
invoke-virtual {v0, v2}, Landroid/animation/AnimatorSet;->addListener(Landroid/animation/Animator$AnimatorListener;)V
.line 182
new-instance v1, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton$32;
invoke-direct {v1, p0, v0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton$32;-><init>(Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;Landroid/animation/AnimatorSet;)V
.line 189
.local v1, "doAnimation":Ljava/lang/Runnable;
iget-object v2, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mHandler:Landroid/os/Handler;
int-to-long v3, p1
invoke-virtual {v2, v1, v3, v4}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
goto :goto_0
.line 164
.end local v0 # "anim":Landroid/animation/AnimatorSet;
.end local v1 # "doAnimation":Ljava/lang/Runnable;
:cond_1
const v2, [COLOR="Red"]0x7f05001b[/COLOR]
goto :goto_1
.end method
change the red value in the smali
according to the value you got in your own public.xml
const v2, 0x7f05001c
with
Code:
[COLOR="Blue"]<public type="anim" name="flip_right" id="[COLOR="Red"]0x7f??????[/COLOR]" />[/COLOR]
and
const v2, 0x7f05001b
with
Code:
[COLOR="Blue"]<public type="anim" name="flip_left" id="[COLOR="Red"]0x7f??????[/COLOR]" />[/COLOR]
Done and compile your systemUI
Credits :
- Sony
- Darck CM
- CyanogenMod

reserved 1

reserved 2

Hey bro I already this tutorial but get smali error and I don't know about smali code ....
If you don't mind could you make this in my systemUI.apk
Sent from my D2105 using XDA Free mobile app

Vicky7999 said:
Hey bro I already this tutorial but get smali error and I don't know about smali code ....
If you don't mind could you make this in my systemUI.apk
Sent from my D2105 using XDA Free mobile app
Click to expand...
Click to collapse
Sure, upload your SystemUI.apk via XDA attachment
Sent from my GT-I8150 using XDA Free mobile app

Thanks bro .....and sorry I can't upload via attachment
https://www.dropbox.com/s/9mq94kjvk3iiwx9/SystemUI.apk?dl=0
Send From Xperia E1 Dual

Vicky7999 said:
Hey bro I already this tutorial but get smali error and I don't know about smali code ....
If you don't mind could you make this in my systemUI.apk
Sent from my D2105 using XDA Free mobile app
Click to expand...
Click to collapse
Do you try at xe1 dual and get error ? i will try in myy xe1 single soon

rayanbg_ said:
Do you try at xe1 dual and get error ? i will try in myy xe1 single soon
Click to expand...
Click to collapse
OK...but tell me its work or not in ur xe1 single
Send From Xperia E1 Dual
---------- Post added at 11:08 AM ---------- Previous post was at 11:07 AM ----------
rayanbg_ hey you have any idea about small app for xperia e1 phone
Send From Xperia E1 Dual

Vicky7999 said:
Thanks bro .....and sorry I can't upload via attachment
https://www.dropbox.com/s/9mq94kjvk3iiwx9/SystemUI.apk?dl=0
Send From Xperia E1 Dual
Click to expand...
Click to collapse
Here try it https://db.tt/bw8o3NCN
Sent from my GT-I8150 using XDA Free mobile app

Smali error , seems that you guys not using the latest apktool ?
Or can you guys post screenshot the smali error ?
Sent from my GT-I8150 using XDA Free mobile app

Thanks bro work perfect thank soooo much ur GREAT man[emoji1] [emoji1]
Send From Xperia E1 Dual

wow.....thanks master!!!
from galaxy w then lenovo and now sony...... you're the best...... :good:

Works like a dream
I love this mod
You are a star!

hi,
i am on KitSlim Evo9 (Stock modified and rooted .108 firmware).
I tried your method, but got a big problem:
STEP -2
SystemUI.apk/res/layout/somc_statusbar_notification_tools_button.xml
add the red line
Click to expand...
Click to collapse
In my case there is no such xml
All other steps are easy to do...
What to do now or is it impossible then to add flip tiles?

moonryder said:
hi,
i am on KitSlim Evo9 (Stock modified and rooted .108 firmware).
I tried your method, but got a big problem:
In my case there is no such xml
All other steps are easy to do...
What to do now or is it impossible then to add flip tiles?
Click to expand...
Click to collapse
can you upload here your SystemUI , I'll take a look

Adi Aisiteru Reborn said:
can you upload here your SystemUI , I'll take a look
Click to expand...
Click to collapse
here it is

moonryder said:
here it is
Click to expand...
Click to collapse
oke here is yours
Code:
status_bar_notification_tools_button.xml
if something wrong, try to skip that step

Adi Aisiteru Reborn said:
oke here is yours
Code:
status_bar_notification_tools_button.xml
if something wrong, try to skip that step
Click to expand...
Click to collapse
i tried it this afternoon, and the result was an invisible status- and navbar.
Will try it without that step and report later.
EDIT:
- tried it without step 1: same result, status- and navbar are invisible
- tried it complete one more time with "status_bar_notification_tools_button_xml": the functionality of the tiles are ok, but on each press the error "SystemUI has stopped" popped up.
So i think this mod is impossible with KitSlim - very pity...

moonryder said:
i tried it this afternoon, and the result was an invisible status- and navbar.
Will try it without that step and report later.
EDIT:
- tried it without step 1: same result, status- and navbar are invisible
- tried it complete one more time with "status_bar_notification_tools_button_xml": the functionality of the tiles are ok, but on each press the error "SystemUI has stopped" popped up.
So i think this mod is impossible with KitSlim - very pity...
Click to expand...
Click to collapse
here test it, and post logcat if you get SystemUI force closes

Thread updated :
STEP -2
SystemUI.apk/res/layout/
Code:
somc_statusbar_notification_tools_button.xml
or
Code:
status_bar_notification_tools_button.xml

Related

[SOLVED]Disable signature checks

I found this
http://forum.xda-developers.com/showthread.php?p=25753055
Im wondering if anyone knows if this would work for the S4? I'd give it a try but I'm a bit busy with a newborn lol.
If no one else tries I'll see if I can test it this weekend.
Figured it out. The way the guide I linked did it did not work, I had to do it as below.
I think I figured it out......but it may cause some security holes, not exactly sure. I think I am turning off androids checks for shared user signatures.
What I did was, open /system/framework/services.jar navigate to smali/com/android/server/pm/PackageManagerService.smali
search for " has no signatures that match those in shared user "
it should look like this:
Code:
const-string v3, " has no signatures that match those in shared user "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
iget-object v3, p1, Lcom/android/server/pm/PackageSetting;->sharedUser:Lcom/android/server/pm/SharedUserSetting;
iget-object v3, v3, Lcom/android/server/pm/SharedUserSetting;->name:Ljava/lang/String;
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
const-string v3, "; ignoring!"
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-static {v1, v2}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 4635
const/4 v1, -0x8
iput v1, p0, Lcom/android/server/pm/PackageManagerService;->mLastScanError:I
goto :goto_0
.line 4639
:cond_1
const/4 v0, 0x1
goto :goto_0
.end method
we will be changing 2 lines:
const/4 v1, -0x8
to
const/4 v1, 0x0
and delete
goto :goto_0
should now look like this:
Code:
const-string v3, " has no signatures that match those in shared user "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
iget-object v3, p1, Lcom/android/server/pm/PackageSetting;->sharedUser:Lcom/android/server/pm/SharedUserSetting;
iget-object v3, v3, Lcom/android/server/pm/SharedUserSetting;->name:Ljava/lang/String;
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
const-string v3, "; ignoring!"
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-static {v1, v2}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 4635
const/4 v1, 0x0
iput v1, p0, Lcom/android/server/pm/PackageManagerService;->mLastScanError:I
.line 4639
:cond_1
const/4 v0, 0x1
goto :goto_0
.end method
The reason to do this is getting things like Toggle2G to work without having to resign everything every update (since I imagine services.jar is updated less then systemUI, so I can just push my modded services.jar after a new update)

[GUIDE] [JAVA to SMALI] Create SystemUI.apk external settings app - v1.1 - 13/04/14

Hi community!! Here is a complete guide showing you how to create an "External Settings App" to control SystemUI.apk look and feel.
I have received tons of pm and mentions from users asking me how did I manage such "magic" work into my mods over Xperia's firmware, so I have decided to create this thread to share you "the concept" I've created. I really hope this guide help people to create your own settings apk from scratch, but not just for the SystemUI.apk, but for anyone in which you need/want to control.
I know that Xposed Framework do the same and also it is the right choice, mine choice too, but the meaning of this thread is: Knowledge exchange!!
Talking about Xposed Framework, here is my module to Xperia devices.
Back to topic...
First of all, a brief feedback about my mods over xda that use concept you will see:
- Serajr Swiping Power Toggles - SystemUI
- Xperia SystemUI + 23 JB Toggles + Sliders + Apps
- Xperia GX Home Launcher for All Xperias (Multi-Resolution)
Let's do it!!
Requirements:
- Java programming skills (I'M NOT GOING TO SHOW HOW TO BUILD APPS OUTSIDE THREAD CONTEXT, NEITHER HOW TO DEVELOP ON THAT PLATFORM)
- Apktool decompile/compile skills (I'M NOT GOING TO SHOW HOW DO DO THAT)
- Logcat (in case you face any FC)
My lab:
- Windows 7 x64
- Eclipse
- Android SDK
- Java
- Apktool
My precious:
- Sony Xperia ZQ
- JB 4.3
External Settings App:
It has a very simple ui and code, with a single CheckBoxPreference!
Don't mind about deprecated functions, they are there purposely to make the simplest possible code. We know that the right choice for preferences is PreferenceFragment.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Java - External Settings App - Eclipse Project:
MainActivity.java
Every field and method contents is commented on for better understanding, but here, what really metters is:
Save current preference value to Settings.System
The app needs to have proper permission to write there, and the right one is:
Code:
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
To make things easier in the future, I've created a "clone" PhoneStatusBar.java class with full package path too, and within it are all related code that "does the magic" (I'll explain every method further). This class has no function over our settings app context (NEVER INSTANTIATE IT), it is there just to allow us to write our SystemUI modifications in Java and get the Smali easily!!!
Take a look:
PHP:
makeStatusBarView()
Here is where SystemUI.apk creates all its contents, so we need to call our setup and handle methods here too.
PHP:
setupExternalSettingsObserver()
Here we setup our content observer (preferences keys we created in our settings app).
PHP:
externalPreferencesObserverCallback(Uri uri)
Here we filter which preference key has changed its state and do proper changes.
PHP:
handleStatusBarChangeClockToRed()
Here we set the status bar clock text color according current preference state.
PHP:
private class MyExternalPreferencesObserver extends ContentObserver
I've also created a inner class that will store our preferences keys Uri's to later pass changed ones to the callback method!
That´s it!!
Now we need to go deep into the "necessary evil" titled: smali !!
1. Get the newly built ExternalPreferences.apk from Eclipse project ( \bin folder )
2. Decompile it
3. Go to ExternalPreferences.apk decompiled folder: ...\smali\com\android\systemui\statusbar\phone\
4. Copy PhoneStatusBar$MyExternalPreferencesObserver.smali file and paste it under SystemUI.apk respective folder, than you will get something like this file structure:
Code:
PhoneStatusBar$FastColorDrawable.smali
PhoneStatusBar$H.smali
[COLOR="Red"]PhoneStatusBar$MyExternalPreferencesObserver.smali[/COLOR]
PhoneStatusBar$MyTicker.smali
PhoneStatusBar.smali
5. While on SystemUI.apk folder, open PhoneStatusBar.smali file (with notepad++)
6. Let's implement our observer class under annotations MemberClasses (in red)
Code:
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$FastColorDrawable;[COLOR="Red"],[/COLOR]
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;[COLOR="red"],[/COLOR]
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$H;[COLOR="red"],[/COLOR]
[COLOR="red"]Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyExternalPreferencesObserver;[/COLOR]
}
.end annotation
Obs.: JUST last item has no , (comma) after its name!
Now let's copy our three new methods from ExternalPreferences.apk (PhoneStatusBar.smali) file to SystemUI.apk (PhoneStatusBar.smali file)
By copying them you will get (in red):
Under # direct methods
Code:
# direct methods
[COLOR="Red"].method private handleStatusBarChangeClockToRed()V
.locals 7
.prologue
.line 127
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const-string v4, "clock"
const-string v5, "id"
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v6}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v6
invoke-virtual {v3, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v1
.line 128
.local v1, resId:I
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Landroid/view/View;
invoke-virtual {v3, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/TextView;
.line 131
.local v0, clock:Landroid/widget/TextView;
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const-string v4, "TextAppearance.StatusBar.Clock"
const-string v5, "style"
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v6}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v6
invoke-virtual {v3, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v1
.line 132
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v0, v3, v1}, Landroid/widget/TextView;->setTextAppearance(Landroid/content/Context;I)V
.line 136
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "status_bar_change_clock_to_red"
const/4 v5, 0x0
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
.line 137
.local v2, value:I
const/4 v3, 0x1
if-ne v2, v3, :cond_0
.line 140
const/high16 v3, -0x1
invoke-virtual {v0, v3}, Landroid/widget/TextView;->setTextColor(I)V
.line 143
:cond_0
return-void
.end method
.method private setupExternalSettingsObserver()V
.locals 5
.prologue
.line 44
new-instance v1, Ljava/util/LinkedList;
invoke-direct {v1}, Ljava/util/LinkedList;-><init>()V
.line 47
.local v1, list:Ljava/util/List;,"Ljava/util/List<Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyExternalPreferencesObserver;>;"
new-instance v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyExternalPreferencesObserver;
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHandler:Landroid/os/Handler;
const-string v4, "status_bar_change_clock_to_red"
invoke-static {v4}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v4
invoke-direct {v2, p0, v3, v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyExternalPreferencesObserver;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/os/Handler;Landroid/net/Uri;)V
invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 60
invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v0
.line 61
.local v0, iterator:Ljava/util/Iterator;
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-nez v2, :cond_0
.line 67
return-void
.line 64
:cond_0
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyExternalPreferencesObserver;
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyExternalPreferencesObserver;->observe()V
goto :goto_0
.end method[/COLOR]
.method public constructor <init>()V
.locals 5
.prologue
const/4 v4, 0x2
const/4 v3, -0x1
const/4 v0, 0x0
const/4 v2, 0x0
.line 140
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;-><init>()V
.
.
.
Under # virtual methods
Code:
# virtual methods
[COLOR="Red"].method public externalPreferencesObserverCallback(Landroid/net/Uri;)V
.locals 1
.parameter "uri"
.prologue
.line 76
const-string v0, "status_bar_change_clock_to_red"
invoke-static {v0}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v0
invoke-virtual {p1, v0}, Landroid/net/Uri;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_0
.line 79
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->handleStatusBarChangeClockToRed()V
.line 115
:cond_0
return-void
.end method[/COLOR]
.method public addIcon(Ljava/lang/String;IILcom/android/internal/statusbar/StatusBarIcon;)V
.locals 5
.parameter "slot"
.parameter "index"
.parameter "viewIndex"
.parameter "icon"
.prologue
.line 1323
new-instance v0, Lcom/android/systemui/statusbar/StatusBarIconView;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
const/4 v2, 0x0
invoke-direct {v0, v1, p1, v2}, Lcom/android/systemui/statusbar/StatusBarIconView;-><init>(Landroid/content/Context;Ljava/lang/String;Landroid/app/Notification;)V
.
.
.
Before going on, we need to fix some stuff within our new methods (just within them) due diffs from our Java "clone" class and real one!!
From (red):
Code:
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:[COLOR="red"]Landroid/view/View;[/COLOR]
invoke-virtual {v3, v1}, [COLOR="red"]Landroid/view/View;[/COLOR]->findViewById(I)Landroid/view/View;
To blue:
Code:
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:[COLOR="blue"]Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;[/COLOR]
invoke-virtual {v3, v1}, [COLOR="blue"]Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;[/COLOR]->findViewById(I)Landroid/view/View;
Pay attention on mContext field too!!
7. While on SystemUI.apk look for this method:
Code:
.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
8. Found, now look for its return-object line (in blue), something like (yours can be tottaly different from mine, but return-object is there!!):
Code:
.line 1005
const-string v0, "com.sonymobile.notes.NEW_SKETCH"
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->isAppInstalled(Ljava/lang/String;)Z
move-result v0
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mRightVisible:Z
.line 1007
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
[B][COLOR="Blue"]return-object[/COLOR][/B] v0
:cond_14
move v1, v2
.line 825
goto/16 :goto_7
9. Found, now let's implement "calls" to our setup and handle methods (in red)
Code:
.line 1005
const-string v0, "com.sonymobile.notes.NEW_SKETCH"
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->isAppInstalled(Ljava/lang/String;)Z
move-result v0
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mRightVisible:Z
[COLOR="Red"].line 34
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupExternalSettingsObserver()V
.line 37
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->handleStatusBarChangeClockToRed()V[/COLOR]
.line 1007
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
[B][COLOR="Blue"]return-object[/COLOR][/B] v0
:cond_14
move v1, v2
.line 825
goto/16 :goto_7
- First "call" setup our Content Observer preference key list!
- Second "call" ensures that clock text color will be red if preference enabled (just after boot)!
10. Double check your changes, save everything, compile your modified SystemUI.apk and... done!!
11. Don't forget to check out 3th post for new mods in which you can complement your project!!
Known issues:
You tell me!!
To do:
You tell me too!!
Special thanks: (if I forgot someone, please remember me!!)
- Sony
- @poria1999 for the encouragement (I blame you by this guide)
If you like it, press thanks... Simple so!!
.
.
Changelog
v1.1 - 13/04/2014
- New mods under 3th post
v1 - 09/04/2014
- Initial guide
New mods...
Here I'm gonna try to show you other mods you can try!!
Change Battery Icons Guide
1. First you need to put new battery resources within your decompiled SystemUI.apk
2. Go to \res\drawable folder and look for:
Code:
stat_sys_battery.xml
stat_sys_battery_charge.xml
3. Found, these two xml files are where all respective png's are mapped!
Let's name them as our "default" preference value (gonna be 0), so we do nothing with them
4. While at \res\drawable folder, create (CTRL+C and CTRL+V) two new files based on above ones, you will get (in red):
Code:
stat_sys_battery.xml
[COLOR="Red"]stat_sys_battery_1.xml[/COLOR]
stat_sys_battery_charge.xml
[COLOR="red"]stat_sys_battery_charge_1.xml[/COLOR]
New red files gonna be our value 1 preference
5. By editing new red files above, you will get something like this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<level-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/stat_sys_battery_0" android:maxLevel="4" />
<item android:drawable="@drawable/stat_sys_battery_15" android:maxLevel="15" />
<item android:drawable="@drawable/stat_sys_battery_28" android:maxLevel="35" />
<item android:drawable="@drawable/stat_sys_battery_43" android:maxLevel="49" />
<item android:drawable="@drawable/stat_sys_battery_57" android:maxLevel="60" />
<item android:drawable="@drawable/stat_sys_battery_71" android:maxLevel="75" />
<item android:drawable="@drawable/stat_sys_battery_85" android:maxLevel="90" />
<item android:drawable="@drawable/stat_sys_battery_100" android:maxLevel="100" />
</level-list>
6. Here you need to change the drawables mapping to your new battery png's you put within your \res\drawable\YOUR_DENSITY folder:
E.g.: New png's have _1 suffix!!
Code:
<?xml version="1.0" encoding="utf-8"?>
<level-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/stat_sys_battery_0[COLOR="red"]_1[/COLOR]" android:maxLevel="4" />
<item android:drawable="@drawable/stat_sys_battery_15[COLOR="red"]_1[/COLOR]" android:maxLevel="15" />
<item android:drawable="@drawable/stat_sys_battery_28[COLOR="red"]_1[/COLOR]" android:maxLevel="35" />
<item android:drawable="@drawable/stat_sys_battery_43[COLOR="red"]_1[/COLOR]" android:maxLevel="49" />
<item android:drawable="@drawable/stat_sys_battery_57[COLOR="red"]_1[/COLOR]" android:maxLevel="60" />
<item android:drawable="@drawable/stat_sys_battery_71[COLOR="red"]_1[/COLOR]" android:maxLevel="75" />
<item android:drawable="@drawable/stat_sys_battery_85[COLOR="red"]_1[/COLOR]" android:maxLevel="90" />
<item android:drawable="@drawable/stat_sys_battery_100[COLOR="red"]_1[/COLOR]" android:maxLevel="100" />
</level-list>
7. Done with new resources!!!
Remember you can put as much as new ones you want, just change their suffix to next integer value!!!
Java
- New "clone" com.android.systemui.statusbar.policy package
- New "clone" BatteryController.java class with two new methods and all related comments there too
- Added into "clone" PhoneStatusBar.java the new handleStatusBarChangeBatteryIcons method and its "calls", take a look at:
makeStatusBarView
setupExternalSettingsObserver
externalPreferencesObserverCallback
handleStatusBarChangeBatteryIcons
Click to expand...
Click to collapse
Get new Eclipse Project from attachments!!
Smali
1. Get the newly built ExternalPreferences.apk from Eclipse project ( \bin folder )
2. Decompile it
3. Go to ExternalPreferences.apk decompiled folder: ...\smali\com\android\systemui\statusbar\phone\
4. Open PhoneStatusBar.smali
Now let's copy our new method from ExternalPreferences.apk (PhoneStatusBar.smali) file to SystemUI.apk (PhoneStatusBar.smali file)
By copying it you will get (in red):
Under # direct methods
Code:
# direct methods
[COLOR="red"].method private handleStatusBarChangeBatteryIcons()V
.locals 9
.prologue
const/4 v8, 0x0
.line 125
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
const/4 v5, 0x0
new-instance v6, Landroid/content/IntentFilter;
const-string v7, "android.intent.action.BATTERY_CHANGED"
invoke-direct {v6, v7}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
invoke-virtual {v4, v5, v6}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
move-result-object v0
.line 126
.local v0, getIntent:Landroid/content/Intent;
const-string v4, "level"
invoke-virtual {v0, v4, v8}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v2
.line 127
.local v2, level:I
const-string v4, "plugged"
invoke-virtual {v0, v4, v8}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v3
.line 131
.local v3, plugged:I
new-instance v1, Landroid/content/Intent;
const-string v4, "android.intent.action.BATTERY_CHANGED"
invoke-direct {v1, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 132
.local v1, intent:Landroid/content/Intent;
const-string v4, "level"
invoke-virtual {v1, v4, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;
.line 133
const-string v4, "plugged"
invoke-virtual {v1, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;
.line 134
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v4, v1}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V
.line 136
return-void
.end method[/COLOR]
5. Also replace setupExternalSettingsObserver and externalPreferencesObserverCallback whole methods by the new ones
6. While on SystemUI.apk look for our last implemented method (from original guide, but now in blue) inside makeStatusBarView method, and add red lines
Code:
.line 1005
const-string v0, "com.sonymobile.notes.NEW_SKETCH"
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->isAppInstalled(Ljava/lang/String;)Z
move-result v0
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mRightVisible:Z
[COLOR="Blue"].line 34
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupExternalSettingsObserver()V
.line 37
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->handleStatusBarChangeClockToRed()V[/COLOR]
[COLOR="Red"].line 40
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->handleStatusBarChangeBatteryIcons()V[/COLOR]
.line 1007
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
return-object v0
:cond_14
move v1, v2
.line 825
goto/16 :goto_7
7. Go to ExternalPreferences.apk decompiled folder: ...\smali\com\android\systemui\statusbar\policy\
8. Open BatteryController.smali
Now let's copy our new methods from ExternalPreferences.apk (BatteryController.smali) file to SystemUI.apk (BatteryController.smali file)
By copying them you will get (in red):
Under # direct methods
Code:
# direct methods
[COLOR="Red"].method private getStatSysBatteryChargeResId()I
.locals 6
.prologue
.line 62
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
const-string v3, "stat_sys_battery_charge"
const-string v4, "drawable"
iget-object v5, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v5
invoke-virtual {v2, v3, v4, v5}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v0
.line 65
.local v0, resId:I
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "status_bar_change_battery_icons"
const/4 v4, 0x0
invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
.line 66
.local v1, value:I
packed-switch v1, :pswitch_data_0
.line 77
:goto_0
return v0
.line 71
:pswitch_0
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
const-string v3, "stat_sys_battery_charge_1"
const-string v4, "drawable"
iget-object v5, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v5
invoke-virtual {v2, v3, v4, v5}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v0
goto :goto_0
.line 66
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
.end packed-switch
.end method
.method private getStatSysBatteryResId()I
.locals 6
.prologue
.line 36
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
const-string v3, "stat_sys_battery"
const-string v4, "drawable"
iget-object v5, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v5
invoke-virtual {v2, v3, v4, v5}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v0
.line 39
.local v0, resId:I
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "status_bar_change_battery_icons"
const/4 v4, 0x0
invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
.line 40
.local v1, value:I
packed-switch v1, :pswitch_data_0
.line 51
:goto_0
return v0
.line 45
:pswitch_0
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
const-string v3, "stat_sys_battery_1"
const-string v4, "drawable"
iget-object v5, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v5
invoke-virtual {v2, v3, v4, v5}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v0
goto :goto_0
.line 40
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
.end packed-switch
.end method[/COLOR]
9. While on SystemUI.apk BatteryController.smali file look for this method:
Code:
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
9. Found, now let's implement "calls" to our new "get" methods (in red)
Pay attention on v6 (in green), method must return as v6 (or the v? from your decompiled code)
Code:
.
.
.
.line 117
.end local v8 #plugType:I
:cond_1
:goto_1
if-eqz v9, :cond_3
const [COLOR="SeaGreen"]v6[/COLOR], 0x7f020130
[COLOR="red"]invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/BatteryController;->getStatSysBatteryChargeResId()I
move-result [COLOR="SeaGreen"]v6[/COLOR][/COLOR]
.line 120
.local [COLOR="SeaGreen"]v6[/COLOR], icon:I
:goto_2
move-object/from16 v0, p0
iget-object v13, v0, Lcom/android/systemui/statusbar/policy/BatteryController;->mIconViews:Ljava/util/ArrayList;
invoke-virtual {v13}, Ljava/util/ArrayList;->size()I
move-result v1
.
.
.
.
.
.
.line 117
.end local v8 #plugType:I
:cond_3
const [COLOR="green"]v6[/COLOR], 0x7f020127
[COLOR="Red"]invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/BatteryController;->getStatSysBatteryResId()I
move-result [COLOR="SeaGreen"]v6[/COLOR][/COLOR]
goto :goto_2
.line 128
.restart local v1 #N:I
.restart local v4 #i:I
.restart local v6 #icon:I
.
.
.
0x7f020130 is the hex value from original stat_sys_battery_charge resource (under SystemUI.apk public.xml)
0x7f020127 is the hex value from original stat_sys_battery resource (under SystemUI.apk public.xml)
Your values may differ!!!
10. Double check your changes, save everything, compile your modified SystemUI.apk and... done!!
Others soon...
.
.
Glad That Im the first person Who says Thank you!
Thanks button is not enough....
Sent from my LT18i using Tapatalk 2
Awesome my friend great guide :good: start learning again
Thank you very much
Sent from my LT25i using Tapatalk
Wow a new master piece, I will try this ASAP !
Envoyé de mon C6603 en utilisant Tapatalk
No words can say how I'm feeling now, I've been searching for a tutorial on how to work with smali and SystemUI.apk, and know I found it by you, the Xperia man. Thanks a lot.
Good but hard!
ITS REALLY HARD TO UNDERSTAND XD ME NEWBZ -.- :good:
BUT KEEP UP THE GOOD WORK! :good:
---------- Post added at 08:32 AM ---------- Previous post was at 08:25 AM ----------
IT JUST HAPPENED TO BE BROKEN!! it just did SHUT DOWN AND CANT BE TURNED ON!!
HERES THE VIDEO LINK: https://www.youtube.com/watch?v=wBfMWMQ58Qc
:good: :good: HELP ME!
DsvCdsSoftware said:
No words can say how I'm feeling now, I've been searching for a tutorial on how to work with smali and SystemUI.apk, and know I found it by you, the Xperia man. Thanks a lot.
Click to expand...
Click to collapse
Hi bro... The guide covers just a very small portion in what we can do there, but I think it is a good start to people that want to learn something new (like you) and later say: I did it! Enjoy it !!
Im really impressed, great job!
Thanks for this thread,
subscribed !
sure will take some code from your guide sir
I couldn't care less about a red status bar clock and I don't know if I'm ever going to use this, but this is exactly the kind of post that I'd like to see on xda-developers. :good:
This could be very useful!
Thank you!
Sent from my C6603 using Tapatalk
Amazing guide mate.... :good:
Awesome Guide bro keep it up
Awesome guide, gonaa test it soon
Remember by name Rahul Singhal , thats enough for me
master piece...
subscribed ...
good work going to try it
|Pay attention on mContext field too!!
can you explain this? Do those need changed also? Getting fc on systemUI so Im looking at everything.
Really clever mod.
EDIT : ALL GOOD. we actually found an alternative method but this put us on the right track.
fernando sor said:
|Pay attention on mContext field too!!
can you explain this? Do those need changed also? Getting fc on systemUI so Im looking at everything.
Really clever mod.
EDIT : ALL GOOD. we actually found an alternative method but this put us on the right track.
Click to expand...
Click to collapse
Great... so have you found its diffs by yourself?
Let me know about your app and how did guide helped you!! Thanks...
Sir Can You Add mod
serajr said:
Here I'm gonna try to show you other mods you can try!!
Change Battery Icons Guide
1. First you need to put new battery resources within your decompiled SystemUI.apk
2. Go to \res\drawable folder and look for:
Code:
stat_sys_battery.xml
stat_sys_battery_charge.xml
3. Found, these two xml files are where all respective png's are mapped!
Let's name them as our "default" preference value (gonna be 0), so we do nothing with them
4. While at \res\drawable folder, create (CTRL+C and CTRL+V) two new files based on above ones, you will get (in red):
Code:
stat_sys_battery.xml
[COLOR="Red"]stat_sys_battery_1.xml[/COLOR]
stat_sys_battery_charge.xml
[COLOR="red"]stat_sys_battery_charge_1.xml[/COLOR]
New red files gonna be our value 1 preference
5. By editing new red files above, you will get something like this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<level-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/stat_sys_battery_0" android:maxLevel="4" />
<item android:drawable="@drawable/stat_sys_battery_15" android:maxLevel="15" />
<item android:drawable="@drawable/stat_sys_battery_28" android:maxLevel="35" />
<item android:drawable="@drawable/stat_sys_battery_43" android:maxLevel="49" />
<item android:drawable="@drawable/stat_sys_battery_57" android:maxLevel="60" />
<item android:drawable="@drawable/stat_sys_battery_71" android:maxLevel="75" />
<item android:drawable="@drawable/stat_sys_battery_85" android:maxLevel="90" />
<item android:drawable="@drawable/stat_sys_battery_100" android:maxLevel="100" />
</level-list>
6. Here you need to change the drawables mapping to your new battery png's you put within your \res\drawable\YOUR_DENSITY folder:
E.g.: New png's have _1 suffix!!
Code:
<?xml version="1.0" encoding="utf-8"?>
<level-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/stat_sys_battery_0[COLOR="red"]_1[/COLOR]" android:maxLevel="4" />
<item android:drawable="@drawable/stat_sys_battery_15[COLOR="red"]_1[/COLOR]" android:maxLevel="15" />
<item android:drawable="@drawable/stat_sys_battery_28[COLOR="red"]_1[/COLOR]" android:maxLevel="35" />
<item android:drawable="@drawable/stat_sys_battery_43[COLOR="red"]_1[/COLOR]" android:maxLevel="49" />
<item android:drawable="@drawable/stat_sys_battery_57[COLOR="red"]_1[/COLOR]" android:maxLevel="60" />
<item android:drawable="@drawable/stat_sys_battery_71[COLOR="red"]_1[/COLOR]" android:maxLevel="75" />
<item android:drawable="@drawable/stat_sys_battery_85[COLOR="red"]_1[/COLOR]" android:maxLevel="90" />
<item android:drawable="@drawable/stat_sys_battery_100[COLOR="red"]_1[/COLOR]" android:maxLevel="100" />
</level-list>
7. Done with new resources!!!
Remember you can put as much as new ones you want, just change their suffix to next integer value!!!
Java
- New "clone" com.android.systemui.statusbar.policy package
- New "clone" BatteryController.java class with two new methods and all related comments there too
- Added into "clone" PhoneStatusBar.java the new handleStatusBarChangeBatteryIcons method and its "calls", take a look at:
Get new Eclipse Project from attachments!!
Smali
1. Get the newly built ExternalPreferences.apk from Eclipse project ( \bin folder )
2. Decompile it
3. Go to ExternalPreferences.apk decompiled folder: ...\smali\com\android\systemui\statusbar\phone\
4. Open PhoneStatusBar.smali
Now let's copy our new method from ExternalPreferences.apk (PhoneStatusBar.smali) file to SystemUI.apk (PhoneStatusBar.smali file)
By copying it you will get (in red):
Under # direct methods
Code:
# direct methods
[COLOR="red"].method private handleStatusBarChangeBatteryIcons()V
.locals 9
.prologue
const/4 v8, 0x0
.line 125
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
const/4 v5, 0x0
new-instance v6, Landroid/content/IntentFilter;
const-string v7, "android.intent.action.BATTERY_CHANGED"
invoke-direct {v6, v7}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
invoke-virtual {v4, v5, v6}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
move-result-object v0
.line 126
.local v0, getIntent:Landroid/content/Intent;
const-string v4, "level"
invoke-virtual {v0, v4, v8}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v2
.line 127
.local v2, level:I
const-string v4, "plugged"
invoke-virtual {v0, v4, v8}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v3
.line 131
.local v3, plugged:I
new-instance v1, Landroid/content/Intent;
const-string v4, "android.intent.action.BATTERY_CHANGED"
invoke-direct {v1, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 132
.local v1, intent:Landroid/content/Intent;
const-string v4, "level"
invoke-virtual {v1, v4, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;
.line 133
const-string v4, "plugged"
invoke-virtual {v1, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;
.line 134
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v4, v1}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V
.line 136
return-void
.end method[/COLOR]
5. Also replace setupExternalSettingsObserver and externalPreferencesObserverCallback whole methods by the new ones
6. While on SystemUI.apk look for our last implemented method (from original guide, but now in blue) inside makeStatusBarView method, and add red lines
Code:
.line 1005
const-string v0, "com.sonymobile.notes.NEW_SKETCH"
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->isAppInstalled(Ljava/lang/String;)Z
move-result v0
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mRightVisible:Z
[COLOR="Blue"].line 34
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupExternalSettingsObserver()V
.line 37
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->handleStatusBarChangeClockToRed()V[/COLOR]
[COLOR="Red"].line 40
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->handleStatusBarChangeBatteryIcons()V[/COLOR]
.line 1007
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
return-object v0
:cond_14
move v1, v2
.line 825
goto/16 :goto_7
7. Go to ExternalPreferences.apk decompiled folder: ...\smali\com\android\systemui\statusbar\policy\
8. Open BatteryController.smali
Now let's copy our new methods from ExternalPreferences.apk (BatteryController.smali) file to SystemUI.apk (BatteryController.smali file)
By copying them you will get (in red):
Under # direct methods
Code:
# direct methods
[COLOR="Red"].method private getStatSysBatteryChargeResId()I
.locals 6
.prologue
.line 62
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
const-string v3, "stat_sys_battery_charge"
const-string v4, "drawable"
iget-object v5, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v5
invoke-virtual {v2, v3, v4, v5}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v0
.line 65
.local v0, resId:I
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "status_bar_change_battery_icons"
const/4 v4, 0x0
invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
.line 66
.local v1, value:I
packed-switch v1, :pswitch_data_0
.line 77
:goto_0
return v0
.line 71
:pswitch_0
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
const-string v3, "stat_sys_battery_charge_1"
const-string v4, "drawable"
iget-object v5, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v5
invoke-virtual {v2, v3, v4, v5}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v0
goto :goto_0
.line 66
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
.end packed-switch
.end method
.method private getStatSysBatteryResId()I
.locals 6
.prologue
.line 36
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
const-string v3, "stat_sys_battery"
const-string v4, "drawable"
iget-object v5, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v5
invoke-virtual {v2, v3, v4, v5}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v0
.line 39
.local v0, resId:I
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "status_bar_change_battery_icons"
const/4 v4, 0x0
invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
.line 40
.local v1, value:I
packed-switch v1, :pswitch_data_0
.line 51
:goto_0
return v0
.line 45
:pswitch_0
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
const-string v3, "stat_sys_battery_1"
const-string v4, "drawable"
iget-object v5, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v5
invoke-virtual {v2, v3, v4, v5}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v0
goto :goto_0
.line 40
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
.end packed-switch
.end method[/COLOR]
9. While on SystemUI.apk BatteryController.smali file look for this method:
Code:
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
9. Found, now let's implement "calls" to our new "get" methods (in red)
Pay attention on v6 (in green), method must return as v6 (or the v? from your decompiled code)
Code:
.
.
.
.line 117
.end local v8 #plugType:I
:cond_1
:goto_1
if-eqz v9, :cond_3
const [COLOR="SeaGreen"]v6[/COLOR], 0x7f020130
[COLOR="red"]invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/BatteryController;->getStatSysBatteryChargeResId()I
move-result [COLOR="SeaGreen"]v6[/COLOR][/COLOR]
.line 120
.local [COLOR="SeaGreen"]v6[/COLOR], icon:I
:goto_2
move-object/from16 v0, p0
iget-object v13, v0, Lcom/android/systemui/statusbar/policy/BatteryController;->mIconViews:Ljava/util/ArrayList;
invoke-virtual {v13}, Ljava/util/ArrayList;->size()I
move-result v1
.
.
.
.
.
.
.line 117
.end local v8 #plugType:I
:cond_3
const [COLOR="green"]v6[/COLOR], 0x7f020127
[COLOR="Red"]invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/BatteryController;->getStatSysBatteryResId()I
move-result [COLOR="SeaGreen"]v6[/COLOR][/COLOR]
goto :goto_2
.line 128
.restart local v1 #N:I
.restart local v4 #i:I
.restart local v6 #icon:I
.
.
.
0x7f020130 is the hex value from original stat_sys_battery_charge resource (under SystemUI.apk public.xml)
0x7f020127 is the hex value from original stat_sys_battery resource (under SystemUI.apk public.xml)
Your values may differs!!!
10. Double check your changes, save everything, compile your modified SystemUI.apk and... done!!
Others soon...
.
.
Click to expand...
Click to collapse
Sir Can You Mode Like Show\Hide Left\Right\Center Carrier Logo?

[Guide][Dev only] How to fix read mode on custom kernels MiUI 8/9

So, it's a known issue that custom kernel breaks read mode cause xiaomi didn't cover up that part in released source code.
But, all the kernels (almost all) supports kcal. That's technology that used for example in kernel adiutor app allowing you to change your display color. More explained here - https://forum.xda-developers.com/android/software-hacking/dev-kcal-advanced-color-control-t3032080.
And that's the technology I used to bring back read mode in my xposed module here - https://forum.xda-developers.com/redmi-note-3/themes/app-bring-read-mode-custom-kernels-t3648558
So, now I share the guide with you how to bring read mode on any MIUI 8/9 device with custom kernel that supports kcal.
You need to know how to decompile/recompile jar files.
framework.jar/miui/hareware/display/DisplayFeatureManager.smali
find
Code:
# instance fields
add bellow following lines
Code:
.field public blue:[Ljava/lang/String;
.field public count:I
.field level:I
.field line:Ljava/lang/String;
.field old_blue:Ljava/lang/String;
.field path:Ljava/lang/String;
.field rgb_old:[Ljava/lang/String;
.field toogle_state:Z
find
Code:
.method private constructor <init>()V
.locals 2
and change it to
Code:
.method private constructor <init>()V
.locals 4
.prologue
const/4 v3, 0x0
Two strings were added and locals 2 now locals 4.
Inside
Code:
.method private constructor <init>()V
find
Code:
return-void
and paste above
Code:
.line 19
const-string v0, " "
iput-object v0, p0, Lmiui/hareware/display/DisplayFeatureManager;->old_blue:Ljava/lang/String;
.line 21
const-string v0, "/sys/devices/platform/kcal_ctrl.0/kcal"
iput-object v0, p0, Lmiui/hareware/display/DisplayFeatureManager;->path:Ljava/lang/String;
.line 23
const/4 v0, 0x0
iput-object v0, p0, Lmiui/hareware/display/DisplayFeatureManager;->rgb_old:[Ljava/lang/String;
.line 24
iput v3, p0, Lmiui/hareware/display/DisplayFeatureManager;->level:I
.line 25
const/16 v0, 0x8
new-array v0, v0, [Ljava/lang/String;
const-string v1, "220"
aput-object v1, v0, v3
const/4 v1, 0x1
const-string v2, "205"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "190"
aput-object v2, v0, v1
const/4 v1, 0x3
const-string v2, "175"
aput-object v2, v0, v1
const/4 v1, 0x4
const-string v2, "160"
aput-object v2, v0, v1
const/4 v1, 0x5
const-string v2, "145"
aput-object v2, v0, v1
const/4 v1, 0x6
const-string v2, "130"
aput-object v2, v0, v1
const/4 v1, 0x7
const-string v2, "125"
aput-object v2, v0, v1
iput-object v0, p0, Lmiui/hareware/display/DisplayFeatureManager;->blue:[Ljava/lang/String;
.line 27
iput v3, p0, Lmiui/hareware/display/DisplayFeatureManager;->count:I
now find
Code:
.method public setEyeCare(I)V
inside it find
Code:
return-void
and paste above it
Code:
invoke-virtual {p0, p1}, Lmiui/hareware/display/DisplayFeatureManager;->s0bes(I)V
now at the end of the smali file add following lines
Code:
.method public RMcontrol(ZLjava/lang/String;)V
.locals 9
.param p1, "z" # Z
.param p2, "b" # Ljava/lang/String;
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/FileNotFoundException;,
Ljava/io/IOException;
}
.end annotation
.prologue
const/4 v6, 0x1
.line 54
const/4 v5, 0x0
.line 55
:try_start_0
new-instance v1, Ljava/io/FileInputStream;
iget-object v4, p0, Lmiui/hareware/display/DisplayFeatureManager;->path:Ljava/lang/String;
invoke-direct {v1, v4}, Ljava/io/FileInputStream;-><init>(Ljava/lang/String;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_3
.line 56
.local v1, "fis":Ljava/io/InputStream;
:try_start_1
new-instance v2, Ljava/io/InputStreamReader;
const-string v4, "UTF-8"
invoke-static {v4}, Ljava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;
move-result-object v4
invoke-direct {v2, v1, v4}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_2
.line 57
.local v2, "isr":Ljava/io/InputStreamReader;
:try_start_2
new-instance v0, Ljava/io/BufferedReader;
invoke-direct {v0, v2}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_4
.line 60
.local v0, "br":Ljava/io/BufferedReader;
if-eqz p1, :cond_b
.line 61
:try_start_3
iget v4, p0, Lmiui/hareware/display/DisplayFeatureManager;->count:I
if-ge v4, v6, :cond_0
.line 62
iget v4, p0, Lmiui/hareware/display/DisplayFeatureManager;->count:I
add-int/lit8 v4, v4, 0x1
iput v4, p0, Lmiui/hareware/display/DisplayFeatureManager;->count:I
.line 63
:goto_0
invoke-virtual {v0}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
move-result-object v4
iput-object v4, p0, Lmiui/hareware/display/DisplayFeatureManager;->line:Ljava/lang/String;
if-nez v4, :cond_5
.line 66
:cond_0
invoke-virtual {v0}, Ljava/io/BufferedReader;->close()V
.line 67
new-instance v4, Ljava/lang/StringBuilder;
iget-object v6, p0, Lmiui/hareware/display/DisplayFeatureManager;->rgb_old:[Ljava/lang/String;
const/4 v7, 0x0
aget-object v6, v6, v7
invoke-static {v6}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v6
invoke-direct {v4, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
const-string v6, " "
invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
iget-object v6, p0, Lmiui/hareware/display/DisplayFeatureManager;->rgb_old:[Ljava/lang/String;
const/4 v7, 0x1
aget-object v6, v6, v7
invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
const-string v6, " "
invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
.line 68
.local v3, "rgb":Ljava/lang/String;
iget-object v4, p0, Lmiui/hareware/display/DisplayFeatureManager;->path:Ljava/lang/String;
invoke-static {v4, v3}, Landroid/miui/Shell;->write(Ljava/lang/String;Ljava/lang/String;)Z
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
.line 77
.end local v3 # "rgb":Ljava/lang/String;
:cond_1
:goto_1
if-eqz v0, :cond_2
:try_start_4
invoke-virtual {v0}, Ljava/io/BufferedReader;->close()V
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_4
:cond_2
if-eqz v2, :cond_3
:try_start_5
invoke-virtual {v2}, Ljava/io/InputStreamReader;->close()V
:try_end_5
.catchall {:try_start_5 .. :try_end_5} :catchall_2
:cond_3
if-eqz v1, :cond_4
:try_start_6
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
:try_end_6
.catchall {:try_start_6 .. :try_end_6} :catchall_3
.line 79
:cond_4
return-void
.line 64
:cond_5
:try_start_7
iget-object v4, p0, Lmiui/hareware/display/DisplayFeatureManager;->line:Ljava/lang/String;
const-string v6, " "
invoke-virtual {v4, v6}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
move-result-object v4
iput-object v4, p0, Lmiui/hareware/display/DisplayFeatureManager;->rgb_old:[Ljava/lang/String;
:try_end_7
.catchall {:try_start_7 .. :try_end_7} :catchall_0
goto :goto_0
.line 77
:catchall_0
move-exception v4
if-eqz v0, :cond_6
:try_start_8
invoke-virtual {v0}, Ljava/io/BufferedReader;->close()V
:cond_6
throw v4
:try_end_8
.catchall {:try_start_8 .. :try_end_8} :catchall_1
:catchall_1
move-exception v5
move-object v8, v5
move-object v5, v4
move-object v4, v8
.end local v0 # "br":Ljava/io/BufferedReader;
:goto_2
if-nez v5, :cond_c
move-object v5, v4
:cond_7
:goto_3
if-eqz v2, :cond_8
:try_start_9
invoke-virtual {v2}, Ljava/io/InputStreamReader;->close()V
:cond_8
throw v5
:try_end_9
.catchall {:try_start_9 .. :try_end_9} :catchall_2
.end local v2 # "isr":Ljava/io/InputStreamReader;
:catchall_2
move-exception v4
if-nez v5, :cond_d
move-object v5, v4
:cond_9
:goto_4
if-eqz v1, :cond_a
:try_start_a
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
:cond_a
throw v5
:try_end_a
.catchall {:try_start_a .. :try_end_a} :catchall_3
.end local v1 # "fis":Ljava/io/InputStream;
:catchall_3
move-exception v4
if-nez v5, :cond_e
:goto_5
throw v4
.line 71
.restart local v0 # "br":Ljava/io/BufferedReader;
.restart local v1 # "fis":Ljava/io/InputStream;
.restart local v2 # "isr":Ljava/io/InputStreamReader;
:cond_b
:try_start_b
iget-object v4, p0, Lmiui/hareware/display/DisplayFeatureManager;->rgb_old:[Ljava/lang/String;
if-eqz v4, :cond_1
.line 72
new-instance v4, Ljava/lang/StringBuilder;
iget-object v6, p0, Lmiui/hareware/display/DisplayFeatureManager;->rgb_old:[Ljava/lang/String;
const/4 v7, 0x0
aget-object v6, v6, v7
invoke-static {v6}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v6
invoke-direct {v4, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
const-string v6, " "
invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
iget-object v6, p0, Lmiui/hareware/display/DisplayFeatureManager;->rgb_old:[Ljava/lang/String;
const/4 v7, 0x1
aget-object v6, v6, v7
invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
const-string v6, " "
invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
iget-object v6, p0, Lmiui/hareware/display/DisplayFeatureManager;->rgb_old:[Ljava/lang/String;
const/4 v7, 0x2
aget-object v6, v6, v7
invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
.line 73
.restart local v3 # "rgb":Ljava/lang/String;
iget-object v4, p0, Lmiui/hareware/display/DisplayFeatureManager;->path:Ljava/lang/String;
invoke-static {v4, v3}, Landroid/miui/Shell;->write(Ljava/lang/String;Ljava/lang/String;)Z
:try_end_b
.catchall {:try_start_b .. :try_end_b} :catchall_0
goto :goto_1
.line 77
.end local v0 # "br":Ljava/io/BufferedReader;
.end local v3 # "rgb":Ljava/lang/String;
:cond_c
if-eq v5, v4, :cond_7
:try_start_c
invoke-virtual {v5, v4}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
:try_end_c
.catchall {:try_start_c .. :try_end_c} :catchall_2
goto :goto_3
.end local v2 # "isr":Ljava/io/InputStreamReader;
:cond_d
if-eq v5, v4, :cond_9
:try_start_d
invoke-virtual {v5, v4}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
:try_end_d
.catchall {:try_start_d .. :try_end_d} :catchall_3
goto :goto_4
.end local v1 # "fis":Ljava/io/InputStream;
:cond_e
if-eq v5, v4, :cond_f
invoke-virtual {v5, v4}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
:cond_f
move-object v4, v5
goto :goto_5
.restart local v1 # "fis":Ljava/io/InputStream;
.restart local v2 # "isr":Ljava/io/InputStreamReader;
:catchall_4
move-exception v4
goto :goto_2
.end method
.method public s0bes(I)V
.locals 3
.param p1, "param" # I
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/Throwable;
}
.end annotation
.prologue
const/4 v2, 0x0
.line 31
if-eqz p1, :cond_0
.line 32
iput p1, p0, Lmiui/hareware/display/DisplayFeatureManager;->level:I
.line 33
const/4 v0, 0x1
iget-object v1, p0, Lmiui/hareware/display/DisplayFeatureManager;->blue:[Ljava/lang/String;
iget v2, p0, Lmiui/hareware/display/DisplayFeatureManager;->level:I
add-int/lit8 v2, v2, -0x1
aget-object v1, v1, v2
invoke-virtual {p0, v0, v1}, Lmiui/hareware/display/DisplayFeatureManager;->RMcontrol(ZLjava/lang/String;)V
.line 38
:goto_0
return-void
.line 35
:cond_0
iput v2, p0, Lmiui/hareware/display/DisplayFeatureManager;->level:I
.line 36
iget-object v0, p0, Lmiui/hareware/display/DisplayFeatureManager;->blue:[Ljava/lang/String;
iget v1, p0, Lmiui/hareware/display/DisplayFeatureManager;->level:I
aget-object v0, v0, v1
invoke-virtual {p0, v2, v0}, Lmiui/hareware/display/DisplayFeatureManager;->RMcontrol(ZLjava/lang/String;)V
goto :goto_0
.end method
I have already tested that approach here - https://forum.xda-developers.com/showpost.php?p=73728907&postcount=734 and as people reported it works.
@Orochixxx, @JamFlux , you can use the guide to fix the issue in your MIUI9 ports.
UPDATE 03.12.2017
If the hack doesn't work anymore
it's easy to fix
The instruction is the same except the path. Now it's in services.jar/com/android/server/display/DisplayFeatureManager.smali
And after you paste new code you should replace (ctrl+H)
Code:
Lmiui/hareware/display/DisplayFeatureManager
to
Code:
Lcom/android/server/display/DisplayFeatureManager
Thanks @S0bes, very usefull.
I will to test and apply to epic rom port if every goes well and smooth.
---------- Post added at 04:58 PM ---------- Previous post was at 04:18 PM ----------
I tried it but its didn't work for me.
Please, may be I missunterstood the instructions.
Please, write me to @JamFlux on telegram.
How to fix switch on read mode crash restart
No method echo in framework.jar
Tested in rom epic 7.8.31 nouget
Add method
.method public echo(Ljava/lang/String;Ljava/lang/StringV
.locals 4
.param p1, "value" # Ljava/lang/String;
.param p2, "path" # Ljava/lang/String;
.prologue
.line 42
new-instance v2, Ljava/lang/StringBuilder;
const-string v3, "echo "
invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/StringV
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v2
const-string v3, " > "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v2
const-string v3, "\n"
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
.line 44
.local v0, "cmd":Ljava/lang/String;
:try_start_0
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v2
const-string v3, "su"
invoke-virtual {v2, v3}, Ljava/lang/Runtime;->exec(Ljava/lang/StringLjava/lang/Process;
move-result-object v2
iput-object v2, p0, Lmiui/hareware/display/DisplayFeatureManager;->suProcess:Ljava/lang/Process;
.line 45
iget-object v2, p0, Lmiui/hareware/display/DisplayFeatureManager;->suProcess:Ljava/lang/Process;
invoke-virtual {v2}, Ljava/lang/Process;->getOutputStream()Ljava/io/OutputStream;
move-result-object v1
.line 46
.local v1, "os":Ljava/io/OutputStream;
invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B
move-result-object v2
invoke-virtual {v1, v2}, Ljava/io/OutputStream;->write([B)V
.line 47
invoke-virtual {v1}, Ljava/io/OutputStream;->flush()V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.line 50
.end local v1 # "os":Ljava/io/OutputStream;
:goto_0
return-void
.line 48
:catch_0
move-exception v2
goto :goto_0
.end method
No
.field private suProcess:Ljava/lang/Process;
In guide add
Done
@Joekerz_HxM
If you use the guide right you can not get these errors you discribed. What I see is you took RMcontrol from somewhere else (like my patch_1) cause it contains echo method. Then you pasted suProcess field cause it used in echo method.
this guide doesn't requires root access so, there's no point in echo method.
instead I use that string in RMcontrol method (in place where was echo method called)
Code:
invoke-static {v4, v3}, Landroid/miui/Shell;->write(Ljava/lang/String;Ljava/lang/String;)Z
which does the same as echo method in patch_1 I released for turk rom but without root permission
Ok read mode done now fixed thanks you
Do you know how to fix auto brightness I following this guide
https://forum.xda-developers.com/redmi-note-2/development/autobrightness-fix-miui-roms-t3516409
But stille not work
Joekerz_HxM said:
Ok read mode done now fixed thanks you
Do you know how to fix auto brightness I following this guide
https://forum.xda-developers.com/redmi-note-2/development/autobrightness-fix-miui-roms-t3516409
But stille not work
Click to expand...
Click to collapse
well, as I heard not everyone is facing the issue with autobrightness. That could be cause of different sensors phone shipped with. As far as I know there're 2 revisions of light sensor on our device - normal one and the one with gyro bug (when there's less then 10lux phone gyro freezes). You can google the issue, a lot of people facing it when trying to play youtube 360 video in the dark area. So, my point is that the problem with autobrightnes could be hardware related, so there won't be any fix at all. Or may be I wrong. May be we just should copy missing libraries for light sensor (just like with 2 revisions of fingerprint scanner).
What I think you should do is to decompile service.jar from MIUI9 MM beta and look inside .smali files and replace lines or even the whole .smali file according to this https://forum.xda-developers.com/redmi-note-2/development/autobrightness-fix-miui-roms-t3516409
BTW, could you describe what is wtong exactly with autobrightness cause I don't use the rom now
Is it possible to make a universal flashable zip for this mod?
Sent from my Redmi Note 3 using Tapatalk
Not work latest miui 9 nougat 7.11.16
I tried. But not working in miuipro rom
.method private constructor <init>()V
.registers 3
.prologue
.line 40
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
I find this
Updated. FIxed
UPDATE 03.12.2017
If the hack doesn't work anymore
it's easy to fix
The instruction is the same except the path. Now it's in services.jar/com/android/server/display/DisplayFeatureManager.smali
And after you paste new code you should replace (ctrl+H)
Code:
Lmiui/hareware/display/DisplayFeatureManager
to
Code:
Lcom/android/server/display/DisplayFeatureManager
[/QUOTE]
Only this can fix the issue without editing framework.jar
There is a problem with kcal in custom kernel vs miui9 in mido , every time unlocking screen the colors will reset to default by miui , is their any way to disable this function or miui color engine so we can use kcal in custom kernel . thanks

fix screen backlight (brightness slide) gsi rom *

prehistory: on many recent assemblies, GSI does not work on many vendors, the backlight slider and previous fixes and the presence of overlay.device do not help.
I found a solution :laugh: to return everything as it was :
instruction :
We decompile framework / service.jar and in
\services\smali\com\android\server\lights\LightsService$LightImpl.smali
Replace the whole method
Code:
.method public setBrightness(II)V
to
Code:
.method public setBrightness(II)V
.registers 12
monitor-enter p0
const/4 v0, 0x2
if-ne p2, v0, :cond_2e
:try_start_4
const-string p2, "LightsService"
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v1, "setBrightness with LOW_PERSISTENCE unexpected #"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget v1, p0, Lcom/android/server/lights/LightsService$LightImpl;->mId:I
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string v1, ": brightness=0x"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-static {p1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
move-result-object p1
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-static {p2, p1}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;)I
monitor-exit p0
return-void
:catchall_2b
move-exception p1
goto/16 :goto_10a
:cond_2e
const/16 v0, 0xff
if-nez p2, :cond_48
invoke-direct {p0}, Lcom/android/server/lights/LightsService$LightImpl;->shouldBeInLowPersistenceMode()Z
move-result v1
if-nez v1, :cond_48
iget v1, p0, Lcom/android/server/lights/LightsService$LightImpl;->mSurfaceControlMaximumBrightness:I
if-ne v1, v0, :cond_48
iget-object p2, p0, Lcom/android/server/lights/LightsService$LightImpl;->mDisplayToken:Landroid/os/IBinder;
int-to-float p1, p1
iget v0, p0, Lcom/android/server/lights/LightsService$LightImpl;->mSurfaceControlMaximumBrightness:I
int-to-float v0, v0
div-float/2addr p1, v0
invoke-static {p2, p1}, Landroid/view/SurfaceControl;->setDisplayBrightness(Landroid/os/IBinder;F)Z
monitor-exit p0
return-void
:cond_48
iget v1, p0, Lcom/android/server/lights/LightsService$LightImpl;->mId:I
if-nez v1, :cond_f5
const-string/jumbo v1, "ro.vendor.build.fingerprint"
const-string v2, "hello"
invoke-static {v1, v2}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
const-string v2, ".*astarqlte.*"
invoke-virtual {v1, v2}, Ljava/lang/String;->matches(Ljava/lang/String;)Z
move-result v2
const-wide v3, 0x406fe00000000000L # 255.0
const/4 v5, 0x0
if-eqz v2, :cond_83
nop
const-string/jumbo v0, "persist.sys.samsung.full_brightness"
invoke-static {v0, v5}, Landroid/os/SystemProperties;->getBoolean(Ljava/lang/String;Z)Z
move-result v0
if-eqz v0, :cond_78
int-to-double v0, p1
const-wide v5, 0x4076d00000000000L # 365.0
mul-double/2addr v0, v5
div-double/2addr v0, v3
double-to-int p1, v0
move v1, p1
goto :goto_79
:cond_78
move v1, p1
:goto_79
const/4 v2, 0x2
const/4 v3, 0x0
const/4 v4, 0x0
move-object v0, p0
move v5, p2
invoke-direct/range {v0 .. v5}, Lcom/android/server/lights/LightsService$LightImpl;->setLightLocked(IIIII)V
monitor-exit p0
return-void
:cond_83
const-string/jumbo v2, "persist.sys.phh.samsung_backlight"
const/4 v6, -0x1
invoke-static {v2, v6}, Landroid/os/SystemProperties;->getInt(Ljava/lang/String;I)I
move-result v2
const/4 v7, 0x1
if-eqz v2, :cond_ca
if-gtz v2, :cond_a8
const-string v8, ".*beyond.*lte.*"
invoke-virtual {v1, v8}, Ljava/lang/String;->matches(Ljava/lang/String;)Z
move-result v8
if-nez v8, :cond_a8
const-string v8, ".*(crown|star)[q2]*lte.*"
invoke-virtual {v1, v8}, Ljava/lang/String;->matches(Ljava/lang/String;)Z
move-result v8
if-nez v8, :cond_a8
const-string v8, ".*(SC-0[23]K|SCV3[89]).*"
invoke-virtual {v1, v8}, Ljava/lang/String;->matches(Ljava/lang/String;)Z
move-result v1
if-eqz v1, :cond_ca
:cond_a8
const/16 v0, 0x64
if-le v2, v7, :cond_ad
move v0, v2
:cond_ad
mul-int/2addr v0, p1
const-string/jumbo v1, "persist.sys.samsung.full_brightness"
invoke-static {v1, v5}, Landroid/os/SystemProperties;->getBoolean(Ljava/lang/String;Z)Z
move-result v1
if-eqz v1, :cond_bf
int-to-double v0, p1
const-wide/high16 v5, 0x40e4000000000000L # 40960.0
mul-double/2addr v0, v5
div-double/2addr v0, v3
double-to-int v0, v0
move v2, v0
goto :goto_c0
:cond_bf
move v2, v0
:goto_c0
const/4 v3, 0x2
const/4 v4, 0x0
const/4 v5, 0x0
move-object v1, p0
move v6, p2
invoke-direct/range {v1 .. v6}, Lcom/android/server/lights/LightsService$LightImpl;->setLightLocked(IIIII)V
monitor-exit p0
return-void
:cond_ca
const-string/jumbo v1, "persist.extend.brightness"
invoke-static {v1, v5}, Landroid/os/SystemProperties;->getBoolean(Ljava/lang/String;Z)Z
move-result v1
const-string/jumbo v2, "persist.display.max_brightness"
const/16 v3, 0x3ff
invoke-static {v2, v3}, Landroid/os/SystemProperties;->getInt(Ljava/lang/String;I)I
move-result v2
const-string/jumbo v3, "persist.sys.qcom-brightness"
invoke-static {v3, v6}, Landroid/os/SystemProperties;->getInt(Ljava/lang/String;I)I
move-result v3
if-eq v3, v6, :cond_e6
nop
move v2, v3
move v1, v7
:cond_e6
if-eqz v1, :cond_f5
mul-int/2addr p1, v2
div-int/lit16 v2, p1, 0xff
const/4 v3, 0x0
const/4 v4, 0x0
const/4 v5, 0x0
move-object v1, p0
move v6, p2
invoke-direct/range {v1 .. v6}, Lcom/android/server/lights/LightsService$LightImpl;->setLightLocked(IIIII)V
monitor-exit p0
return-void
:cond_f5
and-int/2addr p1, v0
const/high16 v0, -0x1000000
shl-int/lit8 v1, p1, 0x10
or-int/2addr v0, v1
shl-int/lit8 v1, p1, 0x8
or-int/2addr v0, v1
or-int v2, v0, p1
const/4 v3, 0x0
const/4 v4, 0x0
const/4 v5, 0x0
move-object v1, p0
move v6, p2
invoke-direct/range {v1 .. v6}, Lcom/android/server/lights/LightsService$LightImpl;->setLightLocked(IIIII)V
monitor-exit p0
return-void
:goto_10a
monitor-exit p0
:try_end_10b
.catchall {:try_start_4 .. :try_end_10b} :catchall_2b
throw p1
.end method
compile service.jar ,
backup in twrp system , and replace service.jar.
if you do not have overlay on your device, then you have to do this:
adb console :
Code:
adb shell su -c setprop persist.sys.qcom-brightness $(cat /sys/class/leds/lcd-backlight/max_brightness)
or from the phone in the terminal emulator :
Code:
su
setprop persist.sys.qcom-brightness $(cat /sys/class/leds/lcd-backlight/max_brightness)
reboot .
it works on many rom, but I can not say that at all)

[GUIDE][SMALI][Android 10][How to Add Blur Expanded Notification Panel Android 10]

Hello guys i wana share you how to make blur effect on your expanded notification Android 10, huge thanks to @serajr for source code blur LP
ALWAYS BACKUP BEFORE YOU MODIFY YOUR ROM
I don't take any responsibility for any damage that may occur while you doing this, you are free no force to do this
Tested On Xperia XZP running [Bliss ROM Android 10]
Credit and thanks to :
- Sir @serajr for source code
- Abdullah Ba'agill
- @Nathan Ali Ashari
- paraS.H.I.T team
- mediatek Android Art and Dev Reborn (MAAaDR) (Fb group)
- Hidannn
- Bliss ROM
- And You
Requirements:
1. Knowledge About editing smali
2. SystemUI.apk
3. Latest APKTool
4. text Editor like Notepad ++
Start:
- Download smali.zip on Attached Files
- Decompile SystemUI.apk
- Merge the complete files to your SystemUI.apk
- Now Open com/android/systemui/statusbar/phone/NotificationPanelView.smali
above # static fields
add :
Code:
[COLOR="Blue"]# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/systemui/statusbar/phone/NotificationPanelView$Animation;
}
.end annotation[/COLOR]
below # static fields
add
Code:
# static fields
[COLOR="blue"].field private static mAlphaAnimation:Landroid/view/animation/AlphaAnimation;
.field private static mAnimationListener:Landroid/view/animation/Animation$AnimationListener;
.field private static mBlurRadius:I
.field private static mBlurScale:I
.field public static mBlurredScreenBitmap:Landroid/graphics/Bitmap;
.field private static mBlurredStatusBarExpandedEnabled:Z
.field private static mBlurredView:Landroid/widget/FrameLayout;
.field public static mDisplay:[I
.field public static mKontek:Landroid/content/Context;[/COLOR]
below # direct methods
add
Code:
[COLOR="blue"].method static synthetic access$L1000010()Landroid/view/animation/AlphaAnimation;
.locals 3
sget-object v2, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mAlphaAnimation:Landroid/view/animation/AlphaAnimation;
move-object v0, v2
return-object v0
.end method
.method static synthetic access$L1000004()Landroid/widget/FrameLayout;
.locals 1
.line 57
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
return-object v0
.end method
.method static synthetic access$S1000010(Landroid/view/animation/AlphaAnimation;)V
.locals 4
move-object v0, p0
move-object v3, v0
sput-object v3, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mAlphaAnimation:Landroid/view/animation/AlphaAnimation;
return-void
.end method[/COLOR]
search .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;Lcom/android/systemui/util/InjectionInflationController;Lcom/android/systemui/statusbar/notification/NotificationWakeUpCoordinator;Lcom/android/systemui/statusbar/PulseExpansionHandler;Lcom/android/systemui/statusbar/notification/DynamicPrivacyController;Lcom/android/systemui/statusbar/phone/KeyguardBypassController;Lcom/android/systemui/plugins/FalsingManagerV
add red line
Code:
[COLOR="blue"].method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;Lcom/android/systemui/util/InjectionInflationController;Lcom/android/systemui/statusbar/notification/NotificationWakeUpCoordinator;Lcom/android/systemui/statusbar/PulseExpansionHandler;Lcom/android/systemui/statusbar/notification/DynamicPrivacyController;Lcom/android/systemui/statusbar/phone/KeyguardBypassController;Lcom/android/systemui/plugins/FalsingManager;)V
.locals 13
move-object v0, p0
move-object v1, p1
move-object/from16 v2, p5
.line 505
invoke-direct {p0, p1, p2}, Lcom/android/systemui/statusbar/phone/PanelView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V[/COLOR]
[COLOR="Red"]new-instance v3, Lcom/android/systemui/statusbar/phone/NotificationPanelView$Animation;
invoke-direct {v3, p0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView$Animation;-><init>(Lcom/android/systemui/statusbar/phone/NotificationPanelView;)V
sput-object v3, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mAnimationListener:Landroid/view/animation/Animation$AnimationListener;[/COLOR]
[COLOR="Blue"].line 197
new-instance v3, Lcom/android/systemui/statusbar/phone/NotificationPanelView$1;
invoke-direct {v3, p0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView$1;-><init>(Lcom/android/systemui/statusbar/phone/NotificationPanelView;)V
iput-object v3, v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mKeyguardUpdateCallback:Lcom/android/keyguard/KeyguardUpdateMonitorCallback;[/COLOR]
below # virtual methods
add
Code:
[COLOR="blue"].method public blurBitmap(Landroid/graphics/Bitmap;I)Landroid/graphics/Bitmap;
.locals 11
.prologue
.line 116
move-object v0, p0
move-object v1, p1
move v2, p2
sget-object v9, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mKontek:Landroid/content/Context;
invoke-static {v9}, Landroid/renderscript/RenderScript;->create(Landroid/content/Context;)Landroid/renderscript/RenderScript;
move-result-object v9
move-object v4, v9
.line 117
move-object v9, v4
move-object v10, v4
invoke-static {v10}, Landroid/renderscript/Element;->U8_4(Landroid/renderscript/RenderScript;)Landroid/renderscript/Element;
move-result-object v10
invoke-static {v9, v10}, Landroid/renderscript/ScriptIntrinsicBlur;->create(Landroid/renderscript/RenderScript;Landroid/renderscript/Element;)Landroid/renderscript/ScriptIntrinsicBlur;
move-result-object v9
move-object v5, v9
.line 118
move-object v9, v4
move-object v10, v1
invoke-static {v9, v10}, Landroid/renderscript/Allocation;->createFromBitmap(Landroid/renderscript/RenderScript;Landroid/graphics/Bitmap;)Landroid/renderscript/Allocation;
move-result-object v9
move-object v6, v9
.line 119
move-object v9, v4
move-object v10, v6
invoke-virtual {v10}, Landroid/renderscript/Allocation;->getType()Landroid/renderscript/Type;
move-result-object v10
invoke-static {v9, v10}, Landroid/renderscript/Allocation;->createTyped(Landroid/renderscript/RenderScript;Landroid/renderscript/Type;)Landroid/renderscript/Allocation;
move-result-object v9
move-object v7, v9
.line 120
move-object v9, v5
move v10, v2
int-to-float v10, v10
invoke-virtual {v9, v10}, Landroid/renderscript/ScriptIntrinsicBlur;->setRadius(F)V
.line 121
move-object v9, v5
move-object v10, v6
invoke-virtual {v9, v10}, Landroid/renderscript/ScriptIntrinsicBlur;->setInput(Landroid/renderscript/Allocation;)V
.line 122
move-object v9, v5
move-object v10, v7
invoke-virtual {v9, v10}, Landroid/renderscript/ScriptIntrinsicBlur;->forEach(Landroid/renderscript/Allocation;)V
.line 123
move-object v9, v7
move-object v10, v1
invoke-virtual {v9, v10}, Landroid/renderscript/Allocation;->copyTo(Landroid/graphics/Bitmap;)V
.line 124
move-object v9, v1
move-object v0, v9
return-object v0
.end method
.method public createBlurredView()V
.locals 10
.annotation system Ldalvik/annotation/Signature;
value = {
"()V"
}
.end annotation
.prologue
.line 419
move-object v0, p0
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->getContext()Landroid/content/Context;
move-result-object v2
sput-object v2, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mKontek:Landroid/content/Context;
.line 420
new-instance v2, Landroid/view/animation/AlphaAnimation;
move-object v9, v2
move-object v2, v9
move-object v3, v9
const/4 v4, 0x0
const/high16 v5, 0x3f800000 # 1.0f
invoke-direct {v3, v4, v5}, Landroid/view/animation/AlphaAnimation;-><init>(FF)V
sput-object v2, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mAlphaAnimation:Landroid/view/animation/AlphaAnimation;
.line 421
sget-object v2, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mAlphaAnimation:Landroid/view/animation/AlphaAnimation;
const/16 v3, 0x12c
int-to-long v3, v3
invoke-virtual {v2, v3, v4}, Landroid/view/animation/AlphaAnimation;->setDuration(J)V
.line 422
sget-object v2, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mAlphaAnimation:Landroid/view/animation/AlphaAnimation;
move-object v3, v0
sget-object v3, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mAnimationListener:Landroid/view/animation/Animation$AnimationListener;
invoke-virtual {v2, v3}, Landroid/view/animation/AlphaAnimation;->setAnimationListener(Landroid/view/animation/Animation$AnimationListener;)V
.line 423
new-instance v2, Landroid/widget/FrameLayout;
move-object v9, v2
move-object v2, v9
move-object v3, v9
move-object v4, v0
iget-object v4, v4, Landroid/view/View;->mContext:Landroid/content/Context;
invoke-direct {v3, v4}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V
sput-object v2, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
.line 424
move-object v2, v0
sget-object v3, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
const/4 v4, 0x0
new-instance v5, Landroid/widget/FrameLayout$LayoutParams;
move-object v9, v5
move-object v5, v9
move-object v6, v9
const/4 v7, -0x1
const/4 v8, -0x1
invoke-direct {v6, v7, v8}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V
invoke-virtual {v2, v3, v4, v5}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V
.line 425
move-object v2, v0
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->requestLayout()V
.line 426
sget-object v2, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
const-string v3, "ready_to_blur"
invoke-virtual {v2, v3}, Landroid/widget/FrameLayout;->setTag(Ljava/lang/Object;)V
.line 427
sget-object v2, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
const/4 v3, 0x4
invoke-virtual {v2, v3}, Landroid/widget/FrameLayout;->setVisibility(I)V
return-void
.end method
.method public handleFadeInOut()V
.locals 12
.annotation system Ldalvik/annotation/Signature;
value = {
"()V"
}
.end annotation
.prologue
.line 65
move-object v0, p0
move-object v5, v0
invoke-virtual {v5}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->handleUpdateForUser()V
.line 66
sget-object v5, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
const-string v6, "blur_applied"
invoke-virtual {v5, v6}, Landroid/widget/FrameLayout;->setTag(Ljava/lang/Object;)V
.line 67
const/4 v5, 0x4
move v2, v5
.line 68
sget-boolean v5, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredStatusBarExpandedEnabled:Z
if-eqz v5, :cond_1
.line 69
move-object v5, v0
iget-boolean v5, v5, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mKeyguardShowing:Z
if-nez v5, :cond_0
move-object v5, v0
invoke-virtual {v5}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->isPanelVisibleBecauseOfHeadsUp()Z
move-result v5
if-eqz v5, :cond_4
:cond_0
const/4 v5, 0x4
:goto_0
move v3, v5
.line 70
move v5, v3
move v2, v5
.line 72
:cond_1
sget v5, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurScale:I
const/4 v6, 0x0
if-ne v5, v6, :cond_2
.line 73
const/4 v5, 0x1
sput v5, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurScale:I
.line 75
:cond_2
sget v5, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurRadius:I
const/4 v6, 0x0
if-ne v5, v6, :cond_3
.line 76
const/4 v5, 0x1
sput v5, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurRadius:I
.line 78
:cond_3
move-object v5, v0
sget-object v6, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredScreenBitmap:Landroid/graphics/Bitmap;
sget-object v7, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mDisplay:[I
const/4 v8, 0x0
aget v7, v7, v8
sget v8, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurScale:I
div-int/2addr v7, v8
sget-object v8, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mDisplay:[I
const/4 v9, 0x1
aget v8, v8, v9
sget v9, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurScale:I
div-int/2addr v8, v9
const/4 v9, 0x0
invoke-static {v6, v7, v8, v9}, Landroid/graphics/Bitmap;->createScaledBitmap(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;
move-result-object v6
sget v7, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurRadius:I
invoke-virtual {v5, v6, v7}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->blurBitmap(Landroid/graphics/Bitmap;I)Landroid/graphics/Bitmap;
move-result-object v5
sput-object v5, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredScreenBitmap:Landroid/graphics/Bitmap;
.line 79
sget-object v5, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
invoke-virtual {v5}, Landroid/widget/FrameLayout;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
move-result-object v5
sget-object v6, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mDisplay:[I
const/4 v7, 0x0
aget v6, v6, v7
iput v6, v5, Landroid/view/ViewGroup$LayoutParams;->width:I
.line 80
sget-object v5, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
invoke-virtual {v5}, Landroid/widget/FrameLayout;->requestLayout()V
.line 81
new-instance v5, Landroid/graphics/drawable/BitmapDrawable;
move-object v11, v5
move-object v5, v11
move-object v6, v11
sget-object v7, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredScreenBitmap:Landroid/graphics/Bitmap;
invoke-direct {v6, v7}, Landroid/graphics/drawable/BitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V
move-object v3, v5
.line 82
move-object v5, v3
const/4 v6, -0x1
sget-object v7, Landroid/graphics/PorterDuff$Mode;->MULTIPLY:Landroid/graphics/PorterDuff$Mode;
invoke-virtual {v5, v6, v7}, Landroid/graphics/drawable/BitmapDrawable;->setColorFilter(ILandroid/graphics/PorterDuff$Mode;)V
.line 83
sget-object v5, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
move-object v6, v3
invoke-virtual {v5, v6}, Landroid/widget/FrameLayout;->setBackground(Landroid/graphics/drawable/Drawable;)V
.line 84
sget-object v5, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
move v6, v2
invoke-virtual {v5, v6}, Landroid/widget/FrameLayout;->setVisibility(I)V
return-void
.line 69
:cond_4
const/4 v5, 0x0
goto :goto_0
.end method
.method public handleUpdateForUser()V
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"()V"
}
.end annotation
.prologue
const/4 v3, 0x3
const/4 v0, 0x1
.line 553
sget-object v1, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mKontek:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
.line 555
const-string v2, "BLUR_SCALA"
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
sput v2, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurScale:I
.line 557
const-string v2, "BLUR_RADIUS"
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
sput v2, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurRadius:I
.line 559
const-string v2, "BLUR"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-eq v1, v0, :cond_0
const/4 v0, 0x0
:cond_0
sput-boolean v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredStatusBarExpandedEnabled:Z
return-void
.end method
.method public recycle()V
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()V"
}
.end annotation
.prologue
const/4 v1, 0x0
.line 613
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
if-eqz v0, :cond_1
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
invoke-virtual {v0}, Landroid/widget/FrameLayout;->getBackground()Landroid/graphics/drawable/Drawable;
move-result-object v0
if-eqz v0, :cond_1
.line 615
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
invoke-virtual {v0}, Landroid/widget/FrameLayout;->getBackground()Landroid/graphics/drawable/Drawable;
move-result-object v0
instance-of v0, v0, Landroid/graphics/drawable/BitmapDrawable;
if-eqz v0, :cond_0
.line 616
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
invoke-virtual {v0}, Landroid/widget/FrameLayout;->getBackground()Landroid/graphics/drawable/Drawable;
move-result-object v0
check-cast v0, Landroid/graphics/drawable/BitmapDrawable;
invoke-virtual {v0}, Landroid/graphics/drawable/BitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;
move-result-object v0
.line 617
if-eqz v0, :cond_0
.line 618
invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V
move-object v0, v1
.line 619
check-cast v0, Landroid/graphics/Bitmap;
.line 623
:cond_0
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
check-cast v1, Landroid/graphics/drawable/Drawable;
invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setBackground(Landroid/graphics/drawable/Drawable;)V
.line 625
:cond_1
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
const-string v1, "ready_to_blur"
invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setTag(Ljava/lang/Object;)V
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
const/4 v1, 0x4
invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setVisibility(I)V
return-void
.end method
.method public startBlurTask()V
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()V"
}
.end annotation
.prologue
.line 91
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mKontek:Landroid/content/Context;
invoke-static {v0}, Lcom/znxt/systemui/DisplayUtils;->TakeScreenshotSurface(Landroid/content/Context;)Landroid/graphics/Bitmap;
move-result-object v0
sput-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredScreenBitmap:Landroid/graphics/Bitmap;
.line 92
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mKontek:Landroid/content/Context;
invoke-static {v0}, Lcom/znxt/systemui/DisplayUtils;->getRealDimensionDisplay(Landroid/content/Context;)[I
move-result-object v0
sput-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mDisplay:[I
.line 93
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mKeyguardShowing:Z
if-eqz v0, :cond_0
.line 94
sget-object v0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mBlurredView:Landroid/widget/FrameLayout;
const/4 v1, 0x4
invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setVisibility(I)V
.line 98
:goto_0
return-void
.line 97
:cond_0
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->handleUpdateForUser()V
.line 98
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->handleFadeInOut()V
goto :goto_0
.end method[/COLOR]
search .method protected onFinishInflate()V
add red line
Code:
[COLOR="blue"].method protected onFinishInflate()V
.locals 3
.line 575
invoke-super {p0}, Lcom/android/systemui/statusbar/phone/PanelView;->onFinishInflate()V[/COLOR]
[COLOR="Red"].line 437
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->createBlurredView()V[/COLOR]
[COLOR="blue"].line 576
sget v0, Lcom/android/systemui/R$id;->keyguard_header:I
invoke-virtual {p0, v0}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mKeyguardStatusBar:Lcom/android/systemui/statusbar/phone/KeyguardStatusBarView;[/COLOR]
Save and Close
- open com/android/systemui/statusbar/phone/StatusBar.smali
search .method makeExpandedVisible(Z)V
add red line
Code:
[COLOR="blue"].method makeExpandedVisible(Z)V
.locals[/COLOR] [COLOR="Red"]3 <--- change .locals 3 to locals. 4[/COLOR]
[COLOR="blue"]if-nez p1, :cond_1
.line 2639
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mExpandedVisible:Z
if-nez v0, :cond_0
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mCommandQueue:Lcom/android/systemui/statusbar/CommandQueue;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/CommandQueue;->panelsEnabled()Z
move-result v0
if-nez v0, :cond_1
:cond_0
return-void
:cond_1
const/4 v0, 0x1[/COLOR]
[COLOR="Red"]iget-object v3, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/NotificationPanelView;
.line 2673
invoke-virtual {v3}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->startBlurTask()V[/COLOR]
[COLOR="blue"].line 2643
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mExpandedVisible:Z[/COLOR]
ScreenRecord:
https://youtu.be/pADQyCZDw4Y
- save and close
- recompile systemui and push
- don't forget instal app on Attached
- reboot your phone and tada
Screenshot
Screenshot
@Arif JeNong
The smali.zip is empty mate, there is nothing inside
Pandemic said:
@Arif JeNong
The smali.zip is empty mate, there is nothing inside
Click to expand...
Click to collapse
sorry . . . edit and re-upload, please try download again
Arif JeNong said:
sorry . . . edit and re-upload, please try download again
Click to expand...
Click to collapse
Great and i pm you but cant you send a message.
Hope there's a guide for aosp android 8.1.0
@Arif JeNong
This guide aint work for Xperia 1's SystemUI to many errors when compile, send me a pm please and you have telegram ?
Ya i have, my Telegram is @ Arifjenong46
Arif JeNong said:
Ya i have, my Telegram is @ Arifjenong46
Click to expand...
Click to collapse
Hi, I PM'd you on Telegram, can you help?
most of the codes seem similar to Samsung.
Would it work for Samsung too?
I tried but it was not booting, maybe i missed something
josephpatrick said:
most of the codes seem similar to Samsung.
Would it work for Samsung too?
I tried but it was not booting, maybe i missed something
Click to expand...
Click to collapse
Oks and no its not working and this is a sony forum
Pandemic said:
Oks and no its not working and this is a sony forum
Click to expand...
Click to collapse
Yes, i had seen it is not a Samsung forum but most of the codes were similar, so thought of checking

Categories

Resources