[Android] ahmed.nasser.hk:
GUIDE GestureAnyWhere

Work and Tested - CM 12.1 & LP Based

​

1. Decompile framework

copy and paste ingredients into place

Recompile.

2. Decompile SystemUI

copy and paste ingredients into place

Then go res/values/colors.xml.

Then go res/values/id.xml

Recompile-Decompile again..

Go to & open

smali/com/android/systemui/statusbar/BaseStatusBar.smali

-copy and paste the line below
.field protected mGestureAnywhereView:Lcom/android/systemui/pac/gestureanywhere/GestureAnywhereView;
.annotation runtime Landroid/annotation/ChaosLab;
classification = .enum Landroid/annotation/ChaosLab$Classification;->NEW_FIELD:Landroid/annotation/ChaosLab$Classification;
name = "GestureAnywhere"
.end annotation
.end field

-right below
.field private mFontScale:F

--------------------------------------------------------------------------
-copy and paste the line below
.method protected addGestureAnywhereView()V
.locals 3
.annotation runtime Landroid/annotation/ChaosLab;
classification = .enum Landroid/annotation/ChaosLab$Classification;->NEW_METHOD:Landroid/annotation/ChaosLab$Classification;
name = "GestureAnywhere"
.end annotation

.prologue
.line 2413
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;

const v1, 0x7f040011

const/4 v2, 0x0

invoke-static {v0, v1, v2}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

move-result-object v0

check-cast v0, Lcom/android/systemui/pac/gestureanywhere/GestureAnywhereView;

iput-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mGestureAnywhereView:Lcom/android/systemui/pac/gestureanywhere/GestureAnywhereView;

.line 2415
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mWindowManager:Landroid/view/WindowManager;

iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mGestureAnywhereView:Lcom/android/systemui/pac/gestureanywhere/GestureAnywhereView;

const/4 v2, 0x3

invoke-virtual {p0, v2}, Lcom/android/systemui/statusbar/BaseStatusBar;->getGestureAnywhereViewLayoutParams(I)Landroid/view/WindowManager$LayoutParams;

move-result-object v2

invoke-interface {v0, v1, v2}, Landroid/view/WindowManager;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

.line 2416
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mGestureAnywhereView:Lcom/android/systemui/pac/gestureanywhere/GestureAnywhereView;

invoke-virtual {v0, p0}, Lcom/android/systemui/pac/gestureanywhere/GestureAnywhereView;->setStatusBar(Lcom/android/systemui/statusbar/BaseStatusBar;)V

.line 2417
return-void
.end method

-right below
# virtual methods

<Replace ID const v1, 0x7f040011 WITH --> type="layout" name="gesture_anywhere_overlay">
--------------------------------------------------------------------------
-copy and paste the line below
.method protected getGestureAnywhereViewLayoutParams(I)Landroid/view/WindowManager$LayoutParams;
.locals 6
.param p1, "gravity" # I
.annotation runtime Landroid/annotation/ChaosLab;
classification = .enum Landroid/annotation/ChaosLab$Classification;->NEW_METHOD:Landroid/annotation/ChaosLab$Classification;
name = "GestureAnywhere"
.end annotation

.prologue
.line 2427
new-instance v0, Landroid/view/WindowManager$LayoutParams;

const/4 v1, -0x2

const/4 v2, -0x1

const/16 v3, 0x7e1

const v4, 0x840068

const/4 v5, -0x3

invoke-direct/range {v0 .. v5}, Landroid/view/WindowManager$LayoutParams;-><init>(IIIII)V

.line 2438
.local v0, "lp":Landroid/view/WindowManager$LayoutParams;
iget v1, v0, Landroid/view/WindowManager$LayoutParams;->privateFlags:I

or-int/lit8 v1, v1, 0x40

iput v1, v0, Landroid/view/WindowManager$LayoutParams;->privateFlags:I

.line 2439
or-int/lit8 v1, p1, 0x30

iput v1, v0, Landroid/view/WindowManager$LayoutParams;->gravity:I

.line 2440
const-string v1, "GestureAnywhereView"

invoke-virtual {v0, v1}, Landroid/view/WindowManager$LayoutParams;->setTitle(Ljava/lang/CharSequence;)V

.line 2442
return-object v0
.end method

.method public getHandler()Landroid/os/Handler;
.locals 1

.prologue
.line 344
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mHandler:Lcom/android/systemui/statusbar/BaseStatusBar$H;

if-eqz v0, :cond_0

iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mHandler:Lcom/android/systemui/statusbar/BaseStatusBar$H;

:goto_0
return-object v0

:cond_0
invoke-virtual {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->createHandler()Lcom/android/systemui/statusbar/BaseStatusBar$H;

move-result-object v0

goto :goto_0
.end method

-right Above
.method protected abstract getMaxKeyguardNotifications()I
--------------------------------------------------------------------------

Go to & open

smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali

-Look
.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

-Immediately after
.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#.locals 51 # 51 you may be different, it does not pay attention

-copy and paste the line below
.annotation runtime Landroid/annotation/ChaosLab;
classification = .enum Landroid/annotation/ChaosLab$Classification;->CHANGE_CODE:Landroid/annotation/ChaosLab$Classification;
name = "GestureAnywhere"
.end annotation

-Look Next
invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->startGlyphRasterizeHack()V

-copy and paste the line below
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->addGestureAnywhereView()V

Replace id below conform with public.xml

3. Decompile Settings.apk

copy and paste ingredients into place

Then go res/values/arrays.xml

Then go res/values/colors.xml

Then go res/values/dimens.xml

Then go res/values/ids.xml

Then go res/values/strings.xml

Then go res/xml/display.xml

Then in AndroidManifest.xml

At the bottom before </ application> add

Recompile-Decompile again..

Replace id below conform with public.xml

DONE

Files and Compare Press Me​