Remove the Alpha parameter over icons from Statusbar - Galaxy Note II, Galaxy S III Developer Discussion

Hi
im currently working on my new rom, but i have a big problem on status bar.
see the icons between the orange arrows, they are set to Alpha parameter.
{
"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"
}
it seems the samsung's developers are defined the alpha parameter on icons into statusbar, i do a search on xml files. it seems the parameter is defined on smali files, buti can't find that, anyone can help me? i can't read the smali files.
the xml file
Code:
<com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" />
the smali file.
PHP:
.class public Lcom/android/systemui/statusbar/phone/IconMerger;
.super Landroid/widget/LinearLayout;
.source "IconMerger.java"
# static fields
.field private static final DEBUG:Z = false
.field private static final TAG:Ljava/lang/String; = "IconMerger"
# instance fields
.field public mCarrierNameShown:Z
.field private mIconSize:I
.field public mLongCarrierNameShown:Z
.field private mMoreView:Landroid/view/View;
# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals 2
.parameter "context"
.parameter "attrs"
.prologue
const/4 v0, 0x0
.line 49
invoke-direct {p0, p1, p2}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.line 44
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mLongCarrierNameShown:Z
.line 45
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mCarrierNameShown:Z
.line 51
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const v1, 0x7f0c000d
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v0
iput v0, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mIconSize:I
.line 57
return-void
.end method
.method static synthetic access$000(Lcom/android/systemui/statusbar/phone/IconMerger;)Landroid/view/View;
.locals 1
.parameter "x0"
.prologue
.line 36
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mMoreView:Landroid/view/View;
return-object v0
.end method
.method private checkOverflow(I)V
.locals 10
.parameter "width"
.prologue
const/16 v9, 0x8
const/4 v6, 0x1
const/4 v7, 0x0
.line 78
iget-object v8, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mMoreView:Landroid/view/View;
if-nez v8, :cond_1
.line 115
:cond_0
:goto_0
return-void
.line 80
:cond_1
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/IconMerger;->getChildCount()I
move-result v0
.line 81
.local v0, N:I
const/4 v5, 0x0
.line 82
.local v5, visibleChildren:I
const/4 v2, 0x0
.local v2, i:I
:goto_1
if-ge v2, v0, :cond_3
.line 83
invoke-virtual {p0, v2}, Lcom/android/systemui/statusbar/phone/IconMerger;->getChildAt(I)Landroid/view/View;
move-result-object v8
invoke-virtual {v8}, Landroid/view/View;->getVisibility()I
move-result v8
if-eq v8, v9, :cond_2
add-int/lit8 v5, v5, 0x1
.line 82
:cond_2
add-int/lit8 v2, v2, 0x1
goto :goto_1
.line 85
:cond_3
iget-object v8, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mMoreView:Landroid/view/View;
invoke-virtual {v8}, Landroid/view/View;->getVisibility()I
move-result v8
if-nez v8, :cond_6
move v4, v6
.line 87
.local v4, overflowShown:Z
:goto_2
if-eqz v4, :cond_4
add-int/lit8 v5, v5, -0x1
.line 88
:cond_4
iget v8, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mIconSize:I
mul-int/2addr v8, v5
if-le v8, p1, :cond_7
move v3, v6
.line 90
.local v3, moreRequired:Z
:goto_3
iget v8, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mIconSize:I
if-gt p1, v8, :cond_5
iget v8, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mIconSize:I
if-ne p1, v8, :cond_8
:cond_5
move v1, v6
.line 92
.local v1, availableWidth:Z
:goto_4
if-eq v3, v4, :cond_9
.line 93
new-instance v6, Lcom/android/systemui/statusbar/phone/IconMerger$1;
invoke-direct {v6, p0, v3, v1}, Lcom/android/systemui/statusbar/phone/IconMerger$1;-><init>(Lcom/android/systemui/statusbar/phone/IconMerger;ZZ)V
invoke-virtual {p0, v6}, Lcom/android/systemui/statusbar/phone/IconMerger;->post(Ljava/lang/Runnable;)Z
goto :goto_0
.end local v1 #availableWidth:Z
.end local v3 #moreRequired:Z
.end local v4 #overflowShown:Z
:cond_6
move v4, v7
.line 85
goto :goto_2
.restart local v4 #overflowShown:Z
:cond_7
move v3, v7
.line 88
goto :goto_3
.restart local v3 #moreRequired:Z
:cond_8
move v1, v7
.line 90
goto :goto_4
.line 109
.restart local v1 #availableWidth:Z
:cond_9
iget-boolean v6, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mCarrierNameShown:Z
if-eqz v6, :cond_a
if-eqz v3, :cond_a
if-nez v1, :cond_a
.line 110
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mMoreView:Landroid/view/View;
invoke-virtual {v6, v9}, Landroid/view/View;->setVisibility(I)V
goto :goto_0
.line 111
:cond_a
iget-boolean v6, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mLongCarrierNameShown:Z
if-eqz v6, :cond_0
.line 112
if-eqz v3, :cond_0
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mMoreView:Landroid/view/View;
invoke-virtual {v6, v9}, Landroid/view/View;->setVisibility(I)V
goto :goto_0
.end method
# virtual methods
.method protected onLayout(ZIIII)V
.locals 1
.parameter "changed"
.parameter "l"
.parameter "t"
.parameter "r"
.parameter "b"
.prologue
.line 73
invoke-super/range {p0 .. p5}, Landroid/widget/LinearLayout;->onLayout(ZIIII)V
.line 74
sub-int v0, p4, p2
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/phone/IconMerger;->checkOverflow(I)V
.line 75
return-void
.end method
.method protected onMeasure(II)V
.locals 3
.parameter "widthMeasureSpec"
.parameter "heightMeasureSpec"
.prologue
.line 65
invoke-super {p0, p1, p2}, Landroid/widget/LinearLayout;->onMeasure(II)V
.line 67
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/IconMerger;->getMeasuredWidth()I
move-result v0
.line 68
.local v0, width:I
iget v1, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mIconSize:I
rem-int v1, v0, v1
sub-int v1, v0, v1
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/IconMerger;->getMeasuredHeight()I
move-result v2
invoke-virtual {p0, v1, v2}, Lcom/android/systemui/statusbar/phone/IconMerger;->setMeasuredDimension(II)V
.line 69
return-void
.end method
.method public setOverflowIndicator(Landroid/view/View;)V
.locals 0
.parameter "v"
.prologue
.line 60
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/IconMerger;->mMoreView:Landroid/view/View;
.line 61
return-void
.end method
can anybody help me?

Related

[GUIDE] How to add AOSP Lockscreen

before proceed this guide, you must download this files : android.policy.zip, Lidroid-res.apk and Lidroid-Parts.
please notice that this guide based on stock deodex DXLF1 firmware
decompile your android.policy.jar
unzip android.policy.zip that u have download before
now copy lidroid folder from android.policy.zip\android.policy\smali to your android.policy.jar\smali
copy lidroid folder from android.policy.zip[/B]\android.policy\smali\com to your android.policy.jar\smali\com
copy CyanogenLockScreen.smali, CyanogenLockScreen$1.smali, CyanogenLockScreen$2.smali, CyanogenLockScreen$3.smali, CyanogenLockScreen$4.smali, CyanogenLockScreen$5.smali, CyanogenLockScreen$Status.smali and KeyguardUpdateMonitor$MediaStateCallback.smali from android.policy.zip\android.policy\smali\com\android\internal\policy\impl to your android.policy.jar\smali\com\android\internal\policy\impl
now edit KeyguardUpdateMonitor.smali from your android.policy.jar\smali\com\android\internal\policy\impl
find this (line 6)
Code:
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$LockscreenWallpaperCallback;,
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$PcwInfoChangeCallback;,
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$AirplaneModeChangeCallback;,
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$SimStateCallback;,
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$InfoCallback;,
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$ConfigurationChangeCallback;,
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$SimArgs;
}
.end annotation
add this line "Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;," below this line "Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$AirplaneModeChangeCallback;,"
after :
Code:
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$LockscreenWallpaperCallback;,
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$PcwInfoChangeCallback;,
[COLOR="blue"] Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$AirplaneModeChangeCallback;,[/COLOR]
[COLOR="Red"]Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;,[/COLOR]
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$SimStateCallback;,
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$InfoCallback;,
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$ConfigurationChangeCallback;,
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$SimArgs;
}
.end annotation
find this (line 160)
.field private mLockscreenWallpaperDrawable:Landroid/graphics/drawable/Drawable;
add this line below it
Code:
[COLOR="Red"].field private mMediaCallbacks:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList",
"<",
"Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;",
">;"
}
.end annotation
.end field[/COLOR]
after :
Code:
.field private mLockscreenWallpaperDrawable:Landroid/graphics/drawable/Drawable;
[COLOR="red"].field private mMediaCallbacks:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList",
"<",
"Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;",
">;"
}
.end annotation
.end field[/COLOR]
find this (line 202)
.field private mWallpaperModeValue:I
add this line below it
Code:
[COLOR="Red"].field private timezone:Ljava/lang/String;[/COLOR]
after :
Code:
.field private mWallpaperModeValue:I
[COLOR="red"].field private timezone:Ljava/lang/String;[/COLOR]
note: if u already has this line .field private timezone:Ljava/lang/String; below .field private mWallpaperModeValue:I , u may continue to next step.
find this (line 1772)
.method private handleSimStateChange(Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$SimArgsV
add this line above it
Code:
[COLOR="red"].method private handleMediaUpdate(IILandroid/net/Uri;)V
.locals 5
.parameter "isPlaying"
.parameter "isStop"
.parameter "mediaUri"
.prologue
const/4 v4, 0x0
const/4 v3, 0x1
.line 467
if-ne p1, v3, :cond_0
move v0, v3
.line 468
.local v0, bIsPlaying:Z
:goto_0
if-ne p2, v3, :cond_1
move v1, v3
.line 470
.local v1, bIsStop:Z
:goto_1
const/4 v2, 0x0
.local v2, i:I
:goto_2
iget-object v3, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mMediaCallbacks:Ljava/util/ArrayList;
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
move-result v3
if-ge v2, v3, :cond_2
.line 471
iget-object v3, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mMediaCallbacks:Ljava/util/ArrayList;
invoke-virtual {v3, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v3
check-cast v3, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;
invoke-interface {v3, v0, v1, p3}, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;->onMediaUpdated(ZZLandroid/net/Uri;)V
.line 470
add-int/lit8 v2, v2, 0x1
goto :goto_2
.end local v0 #bIsPlaying:Z
.end local v1 #bIsStop:Z
.end local v2 #i:I
:cond_0
move v0, v4
.line 467
goto :goto_0
.restart local v0 #bIsPlaying:Z
:cond_1
move v1, v4
.line 468
goto :goto_1
.line 473
.restart local v1 #bIsStop:Z
.restart local v2 #i:I
:cond_2
return-void
.end method[/COLOR]
after :
Code:
[COLOR="red"].method private handleMediaUpdate(IILandroid/net/Uri;)V
.locals 5
.parameter "isPlaying"
.parameter "isStop"
.parameter "mediaUri"
.prologue
const/4 v4, 0x0
const/4 v3, 0x1
.line 467
if-ne p1, v3, :cond_0
move v0, v3
.line 468
.local v0, bIsPlaying:Z
:goto_0
if-ne p2, v3, :cond_1
move v1, v3
.line 470
.local v1, bIsStop:Z
:goto_1
const/4 v2, 0x0
.local v2, i:I
:goto_2
iget-object v3, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mMediaCallbacks:Ljava/util/ArrayList;
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
move-result v3
if-ge v2, v3, :cond_2
.line 471
iget-object v3, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mMediaCallbacks:Ljava/util/ArrayList;
invoke-virtual {v3, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v3
check-cast v3, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;
invoke-interface {v3, v0, v1, p3}, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;->onMediaUpdated(ZZLandroid/net/Uri;)V
.line 470
add-int/lit8 v2, v2, 0x1
goto :goto_2
.end local v0 #bIsPlaying:Z
.end local v1 #bIsStop:Z
.end local v2 #i:I
:cond_0
move v0, v4
.line 467
goto :goto_0
.restart local v0 #bIsPlaying:Z
:cond_1
move v1, v4
.line 468
goto :goto_1
.line 473
.restart local v1 #bIsStop:Z
.restart local v2 #i:I
:cond_2
return-void
.end method[/COLOR]
.method private handleSimStateChange(Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$SimArgs;)V
find this (line 2135)
.method public getFailedAttempts()I
add this line above it
Code:
.method public getChangedTimeZone()Ljava/lang/String;
.locals 1
.prologue
.line 1131
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->timezone:Ljava/lang/String;
return-object v0
.end method
after :
Code:
[COLOR="red"].method public getChangedTimeZone()Ljava/lang/String;
.locals 1
.prologue
.line 1131
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->timezone:Ljava/lang/String;
return-object v0
.end method[/COLOR]
.method public getFailedAttempts()I
find this (line 2315)
.method public isDevicePluggedIn()Z
add this line above it
Code:
.method public isDeviceCharged()Z
.locals 2
.prologue
.line 866
iget v0, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mBatteryLevel:I
const/16 v1, 0x64
if-lt v0, v1, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
after
Code:
[COLOR="red"].method public isDeviceCharged()Z
.locals 2
.prologue
.line 866
iget v0, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mBatteryLevel:I
const/16 v1, 0x64
if-lt v0, v1, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method[/COLOR]
.method public isDevicePluggedIn()Z
close and save.
now edit LockPatternKeyguardView.smali from your android.policy.jar\smali\com\android\internal\policy\impl
find this (line 2007)
.method createLockScreen()Landroid/view/View;
below this line
.prologue
.line 892
add this line
Code:
[COLOR="red"]const/4 v2, 0x0
const/4 v0, 0x0
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "lockscreen_style_pref"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
const/4 v2, 0x1
if-eq v2, v0, :cond_3
const/4 v2, 0x2
if-eq v2, v0, :cond_3
const/4 v2, 0x3
if-eq v2, v0, :cond_3
const/4 v2, 0x4
if-eq v2, v0, :cond_3
const/4 v2, 0x5
if-eq v2, v0, :cond_3
if-eqz v0, :cond_0
.line 869
const/4 v2, 0x0
const/4 v0, 0x0
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "lockscreen_style_pref"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
const/4 v2, 0x6
if-eq v2, v0, :cond_2
const/4 v2, 0x7
if-eq v2, v0, :cond_1
:cond_0
new-instance v0, Lcom/android/internal/policy/impl/LockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
goto :goto_0
:cond_1
new-instance v0, Lcom/android/internal/policy/impl/LockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
goto :goto_0
:cond_2[/COLOR]
after :
Code:
.method createLockScreen()Landroid/view/View;
.registers 7
.prologue
.line 892
[COLOR="red"]const/4 v2, 0x0
const/4 v0, 0x0
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "lockscreen_style_pref"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
const/4 v2, 0x1
if-eq v2, v0, :cond_3
const/4 v2, 0x2
if-eq v2, v0, :cond_3
const/4 v2, 0x3
if-eq v2, v0, :cond_3
const/4 v2, 0x4
if-eq v2, v0, :cond_3
const/4 v2, 0x5
if-eq v2, v0, :cond_3
if-eqz v0, :cond_0
.line 869
const/4 v2, 0x0
const/4 v0, 0x0
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "lockscreen_style_pref"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
const/4 v2, 0x6
if-eq v2, v0, :cond_2
const/4 v2, 0x7
if-eq v2, v0, :cond_1
:cond_0
new-instance v0, Lcom/android/internal/policy/impl/LockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
goto :goto_0
:cond_1
new-instance v0, Lcom/android/internal/policy/impl/LockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
goto :goto_0
:cond_2[/COLOR]
fine this (line 2129)
Code:
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/GlassLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
.line 907
:goto_13
return-object v0
and change to this
Code:
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/GlassLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
[COLOR="Red"]:goto_0[/COLOR]
.line 907
:goto_13
return-object v0
[COLOR="red"]:cond_3
new-instance v0, Lcom/android/internal/policy/impl/CyanogenLockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/CyanogenLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
goto :goto_0
[/COLOR]
save and close.
recompile android.policy.jar, set permission r-w-r-r and push to /system/framework and also with lidroid-res.apk.
set permission r-w-r-r and push Lidroid-Parts.apk to /system/app
note : if u already have 14 toggle please go to this thread to avoid force close
i hope u like it, and dont forget to press thanks :good::good::good:
credit : [email protected]
hey,have can add the "image slide" lockscreen?
Nice guide
If i help you press thanks button
sent by my Y using hyperion rom frm XDA Premium
@OP, looks like you're really sharing your thoughts bro.. thabjs a lot for this... by the way... can i request for a simple TUT bro on how to make "14 toggles work when your systemui already had swipe to remove codes" pls... i always end up frustration... resulted to fc
Sent from my GT-S5360 using xda premium
OP,I know you just wanted to share the information.But still,is it really needed?.Pratyush.creed has an awesome guide
Original Thread
.I know you've given the credits.But a copy paste tut isnt gonna help.And also put the original thread link in the Start of OP.Just a suggestion
Yes i already done And i dont just copy paste all of tread since original thread based on galaxy fit. I put some informative lines that direct exactly which line to edit but if u think im just copycat and this thread is not usefull then @mod please delete this thread since i think everyone in here good at development. Im just sharing to other noob as me. IMHO
Sent from my GT-S5360 using xda premium
any screen masbro ?
is this only aosp lockscreen? or can you choose from several lockscreens with lidroid parts?
kentoi me said:
@OP, looks like you're really sharing your thoughts bro.. thabjs a lot for this... by the way... can i request for a simple TUT bro on how to make "14 toggles work when your systemui already had swipe to remove codes" pls... i always end up frustration... resulted to fc
Sent from my GT-S5360 using xda premium
Click to expand...
Click to collapse
try this its worked for me
YudhiezChitilieaz said:
any screen masbro ?
Click to expand...
Click to collapse
1 sliding tab
2 rotary
3 rotary revamped
4 lense
5 ring
6 samsung stock
mjz2cool said:
is this only aosp lockscreen? or can you choose from several lockscreens with lidroid parts?
Click to expand...
Click to collapse
its only have 6 lockscreen (5 + 1 stock lockscreen), see screenshoot
Can u add image sliding ??
"T}{@ÑK$" ÑøT TÕ $Ä¥ Jû§T Pr€ë$ ÎT...!!!
Sent From MY ¥ Dûø$ Üs!nG ËvÕ X RoM V¡Å XpArEnT TaPtAlK 2
Any reference or ss or what rom? I try to googling seems cant find it
Sent from my GT-S5360 using xda premium
d3cka said:
its only have 6 lockscreen (5 + 1 stock lockscreen), see screenshoot
Click to expand...
Click to collapse
i posted too soon thanks anyway, trying right now
EliTSamsunG said:
hey,have can add the "image slide" lockscreen?
Click to expand...
Click to collapse
samsoul16 said:
Can u add image sliding ??
"T}{@ÑK$" ÑøT TÕ $Ä¥ Jû§T Pr€ë$ ÎT...!!!
Sent From MY ¥ Dûø$ Üs!nG ËvÕ X RoM V¡Å XpArEnT TaPtAlK 2
Click to expand...
Click to collapse
try this one :
decompile android.policy.jar, edit LockPatternKeyguardView.smali and find
(line 155)
iput-boolean v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->CIRCLELOCK_MODE:Z
and change to
iput-boolean v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->CIRCLELOCK_MODE:Z
save and compile.
note: this mod will replace ur stock lockscreen (swipe to remove) to image lockscreen
d3cka said:
try this one :
decompile android.policy.jar, edit LockPatternKeyguardView.smali and find
(line 155)
iput-boolean v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->CIRCLELOCK_MODE:Z
and change to
iput-boolean v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->CIRCLELOCK_MODE:Z
save and compile.
note: this mod will replace ur stock lockscreen (swipe to remove) to image lockscreen
Click to expand...
Click to collapse
if u want only the AOSP lockscreen then
Find in lockpatternkeyguardview.smali
Code:
.method createLockScreen()Landroid/view/View;
find that method
mine is
Code:
.method createLockScreen()Landroid/view/View;
.locals 6
.prologue
.line 868
new-instance v0, Lcom/android/internal/policy/impl/CircleLockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/CircleLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
return-object v0
.end method
now change it to this
Code:
.method createLockScreen()Landroid/view/View;
.locals 6
.prologue
.line 868
[COLOR="red"] new-instance v0, Lcom/android/internal/policy/impl/LockScreen;[/COLOR]
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
[COLOR="Red"] invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V[/COLOR]
return-object v0
.end method
Noticed red codes ?
well thats the changed parts
this enables the old sliding tab lockscreen or when u use Galaxy Y or ace i
u will have an old SGS2 lockscreen
Thanks for the guide bro
Sent from my GT-S5360 using xda premium
Did you all guys know a xda thread for Guide 8 lockscreen for galaxy y?
can't get it recompiled, always gettin errors (screenshot in attachements)
could somebody please help me? i have also attached my android.policy.jar and my modified smali files.
Pls search how to decompile .jar file
Sent from my GT-S5360 using Tapatalk 2

[Guide] LockScreen torch mod

This mod will make you able to have torch flash light while you are on LockScreen by long pressing on the home button...!!!​
Actual mod was done by RobbieHood and eybee1970
Needed tools:
1) Backsmali/Smali program from here
2) Notepad++ program from here
3) WinRAR or 7-zip archiver
The procedure:
- Backsmali android.policy.jar
- Navigate to classout/com/android/internal/policy/impl/ folder
- We will be working on 3 smali files:
KeyguardViewMediator$4.smali
- Search for "packed-switch" and add the blue line just above "return-void":
Code:
.line 1255
iget v2, p1, Landroid/os/Message;->what:I
packed-switch v2, :pswitch_data_72
.line 1298
:goto_7
[B][COLOR="Blue"]:pswitch_7[/COLOR][/B]
return-void
.line 1257
- Search for ":catchall" and add these lines above it:
Code:
.line 1295
monitor-exit v1
goto :goto_[B][COLOR="Red"]7[/COLOR][/B]
[B][COLOR="Blue"] :pswitch_6e
iget-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator$4;->this$0:Lcom/android/internal/policy/impl/KeyguardViewMediator;
iget v3, p1, Landroid/os/Message;->arg1:I
if-eqz v3, :cond_majdi
move v3, v0
:goto_nj
#calls: Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
invoke-static {v2, v3}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->access$2400(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
goto :goto_[COLOR="Red"]7[/COLOR]
:cond_majdi
move v3, v1
goto :goto_nj[/COLOR][/B]
:catchall_7b
move-exception v0
monitor-exit v1
N.B: pay attention to number 7 in goto :goto_7 that could be different in your smali according to your ROM, make sure it is the same as the first one which is just above the new line ":pswitch_6e"
Click to expand...
Click to collapse
- Search for "nop" and another "nop" line bellow it (don't forget to leave empty line in between):
Code:
.line 1255
nop
[B][COLOR="Blue"]nop[/COLOR][/B]
- Now go to the end of smali and add these switches above ".end packed-switch" line:
Code:
:pswitch_data_72
.packed-switch 0x1
:pswitch_8
:pswitch_10
:pswitch_16
:pswitch_1c
:pswitch_22
:pswitch_28
:pswitch_2e
:pswitch_38
:pswitch_40
:pswitch_4c
:pswitch_52
:pswitch_58
:pswitch_64
[B][COLOR="Blue"]:pswitch_7
:pswitch_7
:pswitch_7
:pswitch_7
:pswitch_7
:pswitch_7
:pswitch_6e[/COLOR][/B]
.end packed-switch
.end method
N.B: if your smali has :pswitch_7 and :pswitch_6e by default, then use another :pswitch_value for :pswitch_7 and :pswitch_6e. If you do so, then don't forget to change :pswitch_7 and :pswitch_6e value in added codes from the beginning above as well
Click to expand...
Click to collapse
Save changes...
KeyguardViewMediator.smali
- Search for ".field private static final SET_HIDDEN:I = 0xc" and add this line bellow it (the blue one):
Code:
.field private static final SET_HIDDEN:I = 0xc
[B][COLOR="Blue"].field private static final SET_TORCH:I = 0x14[/COLOR][/B]
.field private static final SHOW:I = 0x2
- Search for ".field private mTelephonyManager:Landroid/telephony/TelephonyManager;" and add thses lines bellow it (the blue ones):
Code:
.field private mTelephonyManager:Landroid/telephony/TelephonyManager;
[B][COLOR="Blue"].field private mTorchEnabled:Z
.field private mTorchStateChanged:Z[/COLOR][/B]
.field private mUnlockSoundId:I
- Search for this method ".method public constructor <init>(Landroid/content/Context;Lcom/android/internal/policy/impl/PhoneWindowManager;Landroid/os/LocalPowerManager;)V" and add these lines (the blue ones):
Code:
.method public constructor <init>(Landroid/content/Context;Lcom/android/internal/policy/impl/PhoneWindowManager;Landroid/os/LocalPowerManager;)V
.registers 15
.parameter "context"
.parameter "callback"
.parameter "powerManager"
.prologue
.line 308
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 188
[B][COLOR="Blue"]const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z[/COLOR][/B]
const/4 v0, 0x1
- Search for "const-string v0, "power"" and add these lines above it (the blue lines):
Code:
.line 311
iput-object p3, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mRealPowerManager:Landroid/os/LocalPowerManager;
.line 312
[B][COLOR="Blue"]const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z[/COLOR][/B]
const-string v0, "power"
- Search for this method ".method static synthetic access$300(Lcom/android/internal/policy/impl/KeyguardViewMediator;I)V" and add this new method above it:
Code:
.method static synthetic access$2300(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
.registers 2
.parameter "x0"
.parameter "x1"
.prologue
.line 110
invoke-direct {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetHidden(Z)V
return-void
.end method
[B][COLOR="Blue"].method static synthetic access$[COLOR="Red"]2400[/COLOR](Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
.registers 2
invoke-direct {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
return-void
.end method[/COLOR][/B]
.method static synthetic access$300(Lcom/android/internal/policy/impl/KeyguardViewMediator;I)V
N.B: pay attention to $2400, that is increment to the method above it
Click to expand...
Click to collapse
- Search for the method ".method private handleHide()V" and add this line at end of this method (the blue one) just after "monitor-exit p0":
Code:
.method private handleHide()V
..
..
..
.line 1449
monitor-exit p0
[B][COLOR="Blue"]invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V[/COLOR][/B]
goto :goto_18
:catchall_45
move-exception v0
monitor-exit p0
:try_end_47
.catchall {:try_start_1 .. :try_end_47} :catchall_45
throw v0
.end method
.method private handleKeyguardDone(Z)V
- Search for the method ".method private handleNotifyScreenOff()V" and add this line (the blue one) just above "return-void":
Code:
.method private handleNotifyScreenOff()V
.registers 3
.prologue
.line 1597
monitor-enter p0
.line 1598
:try_start_1
const-string v0, "KeyguardViewMediator"
const-string v1, "handleNotifyScreenOff"
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 1599
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mKeyguardViewManager:Lcom/android/internal/policy/impl/KeyguardViewManager;
invoke-virtual {v0}, Lcom/android/internal/policy/impl/KeyguardViewManager;->onScreenTurnedOff()V
.line 1600
monitor-exit p0
.line 1601
[B][COLOR="Blue"]invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V[/COLOR][/B]
return-void
- Search for the method ".method private handleSetHidden(Z)V" and add this line (the blue one) above the defined condition in the method:
Code:
.method private handleSetHidden(Z)V
.registers 3
.parameter "isHidden"
.prologue
.line 688
monitor-enter p0
.line 689
:try_start_1
iget-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHidden:Z
if-eq v0, p1, :cond_10
.line 690
iput-boolean p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHidden:Z
.line 691
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->updateActivityLockScreenState()V
.line 692
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustUserActivityLocked()V
.line 693
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustStatusBarLocked()V
.line 695
[B][COLOR="Blue"]invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V[/COLOR][/B]
:cond_10
monitor-exit p0
- Search for the method ".method private handleShow()V" and add the following new method above it:
Code:
[B][COLOR="Blue"].method private handleSetTorch(Z)V
.registers 8
const/4 v5, 0x0
const/4 v4, 0x1
:try_start_2
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
if-nez v1, :cond_majdi
iput-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
const/4 v1, 0x1
iput-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
:cond_[COLOR="Red"]b[/COLOR]
:goto_[COLOR="Red"]b[/COLOR]
return-void
:cond_majdi
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
if-eq v1, p1, :cond_[COLOR="Red"]b[/COLOR]
iput-boolean p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
new-instance v0, Landroid/content/Intent;
const-string v1, "net.cactii.flash2.TOGGLE_FLASHLIGHT"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
const-string v1, "net.cactii.flash2.EXTRA_DISABLE_NOTIFICATION"
const/4 v2, 0x1
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mContext:Landroid/content/Context;
invoke-virtual {v1, v0}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V
:try_end_maj
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_maj} :catch_jdi
goto :goto_[COLOR="Red"]b[/COLOR]
:catch_jdi
move-exception v1
goto :goto_[COLOR="Red"]b[/COLOR]
.end method[/COLOR][/B]
.method private handleShow()V
N.B: pay attention to :cond_b and :goto_b that could be differ according to your ROM where b should be the exact the same first condition in this method ".method public isGlanceViewVisible()Z"
Code:
.method public isGlanceViewVisible()Z
.registers 2
.prologue
.line 666
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mKeyguardViewManager:Lcom/android/internal/policy/impl/KeyguardViewManager;
if-eqz v0, [B][COLOR="Red"]:cond_b[/COLOR][/B]
.line 667
Click to expand...
Click to collapse
- Search for method ".method private handleShow()V", then search bellow for "Landroid/os/PowerManager$WakeLock;->release()V" and add these lines bellow it (the blue ones):
Code:
.method private handleShow()V
.registers 3
.prologue
.line 1400
monitor-enter p0
.line 1401
:try_start_1
const-string v0, "KeyguardViewMediator"
...
...
...
invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V
.line 1419
[B][COLOR="Blue"]const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z[/COLOR][/B]
monitor-exit p0
- Search for the method ".method private resetStateLocked()V" and add these lines (the blue ones) at the end before "return-void" line:
Code:
.method private resetStateLocked()V
.registers 4
...
...
invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
.line 809
[B][COLOR="Blue"]return-void
.end method
.method private resetTorchState()V
.registers 2
iget-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
if-eqz v0, :cond_[COLOR="Red"]8[/COLOR]
const/4 v0, 0x0
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
:cond_[COLOR="Red"]8[/COLOR][/COLOR][/B]
return-void
.end method
N.B: pay attention to :cond_8 that could be differ according to your ROM where 8 should be the exact the same first DEFINED condition in this method ".method private playSounds(Z)V"
Code:
.method private playSounds(Z)V
.registers 10
.parameter "locked"
.prologue
const/4 v5, 0x0
const/4 v4, 0x1
.line 1362
iget-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mSuppressNextLockSound:Z
if-eqz v0, :cond_9
.line 1363
iput-boolean v5, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mSuppressNextLockSound:Z
.line 1385
[B][COLOR="Red"]:cond_8[/COLOR][/B]
:goto_8
return-void
Click to expand...
Click to collapse
- Search for the method ".method public verifyUnlock(Landroid/view/WindowManagerPolicy$OnKeyguardExitResult;)V" and add this new method above it (the blue lines):
Code:
[B][COLOR="Blue"].method public setTorch(Z)V
.registers 7
const/16 v4, 0x14
const/4 v3, 0x0
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mScreenOn:Z
if-eqz v1, :cond_newa
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v4}, Landroid/os/Handler;->removeMessages(I)V
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
if-eqz p1, :cond_newb
const/4 v2, 0x1
:goto_[COLOR="Red"]11[/COLOR]
invoke-virtual {v1, v4, v2, v3}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;
move-result-object v0
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
:cond_newa
return-void
:cond_newb
move v2, v3
goto :goto_[COLOR="Red"]11[/COLOR]
.end method[/COLOR][/B]
.method public verifyUnlock(Landroid/view/WindowManagerPolicy$OnKeyguardExitResult;)V
N.B: pay attention to :goto_11 that could be differ according to your ROM where 11 should be the exact the same goto action in this method ".method public isInputRestricted()Z"
Code:
.method public isInputRestricted()Z
.registers 2
..
..
[B][COLOR="Red"]:goto_11[/COLOR][/B]
return v0
:cond_12
const/4 v0, 0x0
goto :goto_11
.end method
Click to expand...
Click to collapse
Save changes..
PhoneWindowManager.smali
All changes here, will be in this method ".method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J"; so it is better to know from which part of smali this method starts and ends in order to not touch other methods!!
- First search for the method ".method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J",
- Search for "Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z" and add these lines bellow it (the blue ones):
Code:
.method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J
.registers 56
...
...
...
...
.line 3364
:cond_2ba
if-nez v15, :cond_[B][COLOR="Red"]38c[/COLOR][/B]
.line 3365
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
[B][COLOR="Blue"]if-eqz v0, :cond_[COLOR="Red"]38c[/COLOR]
const/16 v3, 0x0[/COLOR][/B]
move/from16 v20, v0
N.B: pay attention to if-eqz v0, :cond_38c where the condition number 38c is the same as IF condition above it
Click to expand...
Click to collapse
- Search for this portion (you can search down for ".catch Landroid/os/RemoteException" to locate this portion) and add this line (the blue one):
Code:
.line 3373
invoke-interface/range {v44 .. v44}, Lcom/android/internal/statusbar/IStatusBarService;->cancelPreloadRecentApps()V
:try_end_2dd
.catch Landroid/os/RemoteException; {:try_start_2d4 .. :try_end_2dd} :catch_329
.line 3381
.end local v44 #statusbar:Lcom/android/internal/statusbar/IStatusBarService;
:cond_2dd
:goto_2dd
const/4 v3, 0x0
move-object/from16 v0, p0
iput-boolean v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
[B][COLOR="Blue"]invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->launchHomeFromHotKey()V[/COLOR][/B]
.line 3382
if-nez v36, :cond_32c
- Search down for "Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->setHomeDownEventSent()V" and add this new code after defined condition:
Code:
.line 3470
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomeKeyDoubleClickConcept:Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;
invoke-virtual {v3}, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->setHomeDownEventSent()V
.line 3473
:cond_3a6
[B][COLOR="Blue"]new-instance v0, Ljava/io/File;
const-string v1, "/sdcard/Android"
invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v0
if-eqz v0, :cond_majdi
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v3, v0
invoke-virtual/range {v3 .. v3}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->isShowingAndNotHidden()Z
move-result v3
if-eqz v3, :cond_majdi
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v3, v0
move-object/from16 v0, v3
move v1, v15
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->setTorch(Z)V
rem-int/lit8 v3, v41, 0xf
if-nez v3, :cond_majdi
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v3, v0
invoke-virtual/range {v3 .. v3}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->pokeWakelock()V
:cond_majdi[/COLOR][/B]
const-wide/16 v3, 0x0
goto/16 :goto_8f
- Search down for "const/16 v3, 0xbb" (v3 may differ according to ROM) and do the following editing:
before:
Code:
.line 3635
:cond_[B][COLOR="Red"]536[/COLOR][/B] [B][COLOR="Green"]<-- we need to copy bellow condition over it[/COLOR][/B]
const/16 v3, 0xbb
move/from16 v0, v32
if-ne v0, v3, :cond_[B][COLOR="Red"]56f[/COLOR][/B] [B][COLOR="Green"]<-- we need to define new condition[/COLOR][/B]
.line 3637
move-object/from16 v0, p0
after:
Code:
.line 3635
:cond_[B][COLOR="Blue"]56f[/COLOR][/B]
const/16 v3, 0xbb
move/from16 v0, v32
if-ne v0, v3, :cond_[B][COLOR="Blue"]nj[/COLOR][/B]
.line 3637
move-object/from16 v0, p0
- Now we need to redefine mentioned cond_56f (it could be differ according to ROM), search UP for ".catch Landroid/content/ActivityNotFoundException;" and modify the IF-NE condition bellow it:
before:
Code:
.catch Landroid/content/ActivityNotFoundException; {:try_start_4fd .. :try_end_506} :catch_705
.line 3839
.end local v43 #shortcutIntent:Landroid/content/Intent;
:cond_506
:goto_506
const-wide/16 v3, -0x1
goto/16 :goto_8f
.line 3621
.end local v31 #kcm:Landroid/view/KeyCharacterMap;
:cond_50a
const/16 v3, 0x54
move/from16 v0, v32
if-ne v0, v3, [B][COLOR="Red"]:cond_536[/COLOR] [COLOR="Green"]<-- redefine this condition[/COLOR][/B]
.line 3622
if-eqz v15, :cond_522
after:
Code:
.catch Landroid/content/ActivityNotFoundException; {:try_start_4fd .. :try_end_506} :catch_705
.line 3839
.end local v43 #shortcutIntent:Landroid/content/Intent;
:cond_506
:goto_506
const-wide/16 v3, -0x1
goto/16 :goto_8f
.line 3621
.end local v31 #kcm:Landroid/view/KeyCharacterMap;
:cond_50a
const/16 v3, 0x54
move/from16 v0, v32
if-ne v0, v3, [B][COLOR="Blue"]:cond_56f[/COLOR][/B]
.line 3622
if-eqz v15, :cond_522
- Search down for "const/16 v3, 0xdb" (v3 may differ according to ROM) and change the condition value above it to the new condition from above mentioned edited code:
before:
Code:
.line 3654
.end local v16 #e:Landroid/os/RemoteException;
[B][COLOR="Red"]:cond_56f[/COLOR] [COLOR="Green"]<-- change it to the new condition[/COLOR][/B]
const/16 v3, 0xdb
move/from16 v0, v32
if-ne v0, v3, :cond_5a4
after:
Code:
.line 3654
.end local v16 #e:Landroid/os/RemoteException;
[B][COLOR="Blue"]:cond_nj[/COLOR][/B]
const/16 v3, 0xdb
move/from16 v0, v32
if-ne v0, v3, :cond_5a4
Save changes...
Now backsmali classsout folder to get new classes.dex file. Now Open android.policy.jar by WinRAR or 7-zip and drag and drop the new classes.dex file inside it; then push it to your device framework folder and fix permissions to chmod 644.
Download Torch.apk from attachment bellow and push it to your device app folder and fix permissions to chmod 644 as well... and viola.. lockscreen the device and do long pressing on home button to have torch flash light..:laugh:
If you could manage to shorten this tutorial by omitting unnecessary steps, then share your experience here please
thanks man
you're awesome
For those who want to make smali comparison, I attached the 3 mentioned smali before and after editing... So it will be easier to locate differences :laugh:
You can find them in the attachment bellow
wow a lot of work, and of course big thanks
your tutorials provide a real value for comunity, I have learned a lot with these.
thanks once again and keep up a great work!
p.s. waiting for someone to qoute op lol
edit: why your tutorials are not sticky threads (wondering)
Sent from my GT-N7000 using xda app-developers app
OMG ...
How you know all this???
You are boss..
Sent from my [email protected]£@×¥
my most loved app from robbie and miui roms. these however look like rocket science to me. therefore i'll leave this rocket science to the geniuses.
thank u. mcuh appreciatrd that everyone can now embed this wonderful feature into more roms.
With the steps that you have done in this mod, does long pressing the home button turn the torch on until the screen locks so that you can take your finger off the home button, or do you need to keep your finger on the home button the whole time for the torch to stay on?
daveyannihilation said:
With the steps that you have done in this mod, does long pressing the home button turn the torch on until the screen locks so that you can take your finger off the home button, or do you need to keep your finger on the home button the whole time for the torch to stay on?
Click to expand...
Click to collapse
press and hold = light on
release button = light off
sent from my G-Note
hara74 said:
press and hold = light on
release button = light off
sent from my G-Note
Click to expand...
Click to collapse
Thanks for the reply.
Is there any way of implementing the mods done in this thread: [MOD] [GUIDE] [JB BLK1] LockScreen Torch with toggle?
This actually keeps the torch on even after you release the home button, but it will turn off when the screen turns off either by timing out or pressing the lock button.
I tried to port it to Galaxy S II but I am not a master dev like majdinj so I couldn't get it to work. I am not too worried about the toggle to turn it on and off, but keeping the torch on after letting go of the home button would be great.
Thanks in advance,
Dave
sorry m8 I don't know,
maybe majdinj knows
sent from my G-Note
daveyannihilation said:
Thanks for the reply.
Is there any way of implementing the mods done in this thread: [MOD] [GUIDE] [JB BLK1] LockScreen Torch with toggle?
This actually keeps the torch on even after you release the home button, but it will turn off when the screen turns off either by timing out or pressing the lock button.
I tried to port it to Galaxy S II but I am not a master dev like majdinj so I couldn't get it to work. I am not too worried about the toggle to turn it on and off, but keeping the torch on after letting go of the home button would be great.
Thanks in advance,
Dave
Click to expand...
Click to collapse
You should pay attention to conditions buddy.. "You will not reach glory until you taste patience".. so try and try and try till you success :good:
majdinj said:
You should pay attention to conditions buddy.. "You will not reach glory until you taste patience".. so try and try and try till you success :good:
Click to expand...
Click to collapse
Thank you majdinj.
So what you're saying is, everywhere that I see a cond_ written in a method, I need to pay attention to where that cond is and what it does? Sorry, but smali code is like Swahili to me!
Thanks for your advice.
All the best,
Dave
Hi!
I'm having problem with PhoneWindowManager.smali. Most of the .line #### is not present. Should I add them? This is for Pristine ROM v4.0.
Sample.
On ".method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J"
I should add a line under;
" .line 3365
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z"
but this codes are not present;
" .line 3364
:cond_2ba
if-nez v15, :cond_38c
.line 3365
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z"
and so on. Any help please? Thanks!
Installed apk on alborak (lt5). Seems not working (even rebooted). Any idea, sir.
Sent from my GT-N7000 using xda premium
ive perfectly followed each step of yours when i push the apk and the jar file
my phone hangs on boot screen ://
im sure ive perfectly edited the files
Hi, installed apk on lt6 sweet v9. No success. This is a useful app, can you pls do something.
Sent from my GT-N7000 using xda premium
dsmas said:
Hi, installed apk on lt6 sweet v9. No success. This is a useful app, can you pls do something.
Sent from my GT-N7000 using xda premium
Click to expand...
Click to collapse
you cannot just install the apk you have to go thru the procedure in OP.
I was searching for this mod for a long time ago.. I just found it in TeamUnion ROM .. I like the ROM but after a while it drain my battery so fast.. so I decide to install one clean Stock ROM like ebyee's ROM and add some little mod like call recording and etc.. was searching for this mod but haven't ever could figure out how it works.. Thanks majdinj for posting it here :good:
Sorry for bumping this thread. I don't entirely understand the tutorial.
I believe I'm on an odex rom (where .apk and .odex are in /system/app), and I'm not sure if it'll work for me.
I've downloaded all the programs (backsmali/smali/notepad++), but I don't understand what the procedure says. What does it mean to backsmali android.policy.jar? Where do I get this android.policy.jar?
rcheung28 said:
Sorry for bumping this thread. I don't entirely understand the tutorial.
I believe I'm on an odex rom (where .apk and .odex are in /system/app), and I'm not sure if it'll work for me.
I've downloaded all the programs (backsmali/smali/notepad++), but I don't understand what the procedure says. What does it mean to backsmali android.policy.jar? Where do I get this android.policy.jar?
Click to expand...
Click to collapse
It's in /system/framework but you will also need android.policy.odex which you will need to deodex to be able to see the smali files.
There is a thread in Samsung Galaxy SII Original Android Development by sicopat here: http://forum.xda-developers.com/showthread.php?t=1208320 which states how to deodex a jar file.
You will also need all of the other jar files from /system/framework to be able to deodex it properly.
If you need a hand or some tips, just ask.
Sent from my GT-I9505 using Tapatalk 4 Beta

[Guide] Add Switch On/Off For Battery, Data Disconnection and Keyboard Notifications

Ok, it seems that I am on toggles now
After this guide, you will be able to switch on or off the full battery notification after the device is being fully charged..
{
"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"
}
So here we go..
We will be working with two files, SystemUI.apk and SecSettings.apk
Setting The Toggle Switch >>>
1) SecSettings.apk
- Decompile SecSettings.apk
- Go to res\values folder and open strings.xml and add these new lines:
Code:
<string name="set_remove_bat">Full Battery Notification</string>
<string name="notif_on">Notification is Enabled</string>
<string name="notif_off">Notification is Disabled</string>
- Go to res\xml folder and open display_settings.xml and add these codes where you want to display the toggle check box:
Code:
<CheckBoxPreference android:title="@string/set_remove_bat" android:key="bat_sbar" android:summaryOn="@string/notif_on" android:summaryOff="@string/notif_off" />
- Now for the smali.. Go to classout\com\android\settings folder and open DisplaySettings.smali.
- Add this line to [# instance fields] section:
Code:
.field private mBatPref:Landroid/preference/CheckBoxPreference;
- On the method ".method public onCreate(Landroid/os/Bundle;)V", search for ""key_multi_window"" and add these lines:
Code:
.line 570
const-string v11, "key_multi_window"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
[B][COLOR="Blue"]const-string v11, "bat_sbar"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;[/COLOR][/B]
- Now in the method ".method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z", search for ""multi_window_enabled"" to locate this part at the end:
Code:
:cond_15c
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, [B][COLOR="Red"]:cond_179[/COLOR][/B]
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1023
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
if-eqz v0, :cond_177
:goto_172
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 [B][COLOR="Lime"]:goto_1c[/COLOR][/B]
:cond_177
move v1, v2
goto :goto_172
.end method
Add new codes before [.end method] in the previous section. Pay attention to the red color condition and the green color condition..!!!, so that section will be like this:
Code:
:cond_15c
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, [B][COLOR="Blue"]:cond_batteryToggle[/COLOR][/B]
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1023
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
if-eqz v0, :cond_177
:goto_172
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 [B][COLOR="Lime"]:goto_1c[/COLOR][/B]
:cond_177
move v1, v2
goto :goto_172
[B][COLOR="Blue"]:cond_batteryToggle
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, [COLOR="Red"]:cond_179[/COLOR]
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1023
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "bat_sbar"
if-eqz v0, :cond_majdiB
:goto_njB
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 [B][COLOR="Lime"]:goto_1c[/COLOR][/B]
:cond_majdiB
move v1, v2
goto :goto_njB[/COLOR][/B]
.end method
- Now in the method ".method public onResume()V", search for ""multi_window_enabled"" and locate this part, pay attention to the red color condition..!!!:
Code:
:cond_9d
sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z
if-eqz v0, [B][COLOR="Red"]:cond_c1[/COLOR][/B]
.line 847
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-ne v3, v1, :cond_de
:goto_af
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 848
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "multi_window_enabled"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;
invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
line 850
:cond_c1
return-void
:cond_c2
move v0, v2
And do these modification:
Code:
:cond_9d
sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z
if-eqz v0, [B][COLOR="Blue"]:cond_newBattery[/COLOR][/B]
.line 847
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-ne v3, v1, :cond_de
:goto_af
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 848
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "multi_window_enabled"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;
invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
[B][COLOR="Blue"]:cond_newBattery
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
if-eqz v0, [COLOR="Red"]:cond_c1[/COLOR]
.line 3001
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "bat_sbar"
const/4 v1, 0x0
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-eqz v3, :cond_noShow
const/4 v1, 0x1
goto :goto_yesShow
:cond_noShow
const/4 v1, 0x0
:goto_yesShow
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR][/B]
line 850
:cond_c1
return-void
:cond_c2
move v0, v2
- Save all changes and compile and push to phone and prof working then continue to next step.
Setting The Referral Switch >>>
2) SystemUI.apk
- Baksmali SystemUI.apk.
- Go to classes/com/android/systemui/power/ folder and open PowerUI.smali.
- Search for this method ".method notifyFullBatteryNotification()V" and add the blue lines and delete or comment out the red line:
Code:
.method notifyFullBatteryNotification()V
.registers 12
.prologue
const/4 v10, 0x0
.line 827
iget-object v7, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
const-string v8, "notification"
invoke-virtual {v7, v8}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/app/NotificationManager;
.line 829
.local v2, "notificationManager":Landroid/app/NotificationManager;
[B][COLOR="Blue"]move-object v0, p0
iget-object v5, v0, Lcom/android/systemui/power/PowerUI;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
const-string v6, "bat_sbar"
const/4 v7, 0x1
invoke-static {v5, v6, v7}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v5
if-nez v5, :cond_15
[COLOR="Red"]#if-nez v2, :cond_15[/COLOR][/COLOR] [COLOR="Green"]<!--- Put the same condition value in the above new condition[/COLOR][/B]
.line 830
const-string v7, "PowerUI"
const-string v8, "notifyFullBatteryNotification : fail to get NotificationManager reference"
invoke-static {v7, v8}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 860
:goto_14
return-void
.line 834
:cond_15
iget-object v7, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
- Save changes and compile and push to phone...
For those who just want to disable full battery notification without having headache of adding toggle switch, please see this thread here,,,
A lot of toggle tutorials could be done easily if you just understand the main principle here.. and for giving more options to users, use TOGGLES,,,
Cheers
More referral switches
<< Here is some switch referral settings for some notifications >>​
★ For keyboard notification ★
- Baksmali services.jar
- Navigate to classout/com/android/server/InputMethodManagerService.smali
- Find ".method public setImeWindowStatus(Landroid/os/IBinder;II)V" and add the blue codes and delete the red line:
Code:
.method public setImeWindowStatus(Landroid/os/IBinder;II)V
.registers 23
.param p1, "token" # Landroid/os/IBinder;
.param p2, "vis" # I
.param p3, "backDisposition" # I
.prologue
.line 1640
invoke-static {}, Landroid/os/Binder;->getCallingUid()I
move-result v11
.line 1641
.local v11, "uid":I
invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J
move-result-wide v4
.line 1643
.local v4, "ident":J
if-eqz p1, :cond_12
:try_start_a
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/server/InputMethodManagerService;->mCurToken:Landroid/os/IBinder;
move-object/from16 v0, p1
[B][COLOR="Blue"].line 2000
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/server/InputMethodManagerService;->mContext:Landroid/content/Context;
invoke-virtual {v12}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v12
const-string v13, "ime_sbar"
const/4 v14, 0x1
invoke-static {v12, v13, v14}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
if-nez v12, :cond_3a[/COLOR]
[COLOR="Red"] #if-eq v12, v0, :cond_3a[/COLOR][/B]
.line 1644
:cond_12
const-string v12, "InputMethodManagerService"
new-instance v13, Ljava/lang/StringBuilder;
invoke-direct {v13}, Ljava/lang/StringBuilder;-><init>()V
const-string v14, "Ignoring setImeWindowStatus of uid "
★ For mobile data connection toggle off dialogue ★
- Baksmali SystemUI.apk
- Navigate to classout\com\android\systemui\statusbar\policy\quicksetting\MobileDataQuickSettingButton.smali
- Find ".method private setMobileData(Z)V" and add the blue codes and delete the red line:
Code:
.method private setMobileData(Z)V
.registers 6
.param p1, "on" # Z
.prologue
.line 248
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "quickpanel_mobiledata_checked"
const/4 v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
.line 250
.local v0, "mChecked":I
const-string v1, "STATUSBAR-MobileDataQuickSettingButton"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "Mobile data waring checked : "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)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;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 252
[B][COLOR="Blue"]move-object v0, p0
iget-object v1, v0, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "quickpanel_mobiledata_dialogue"
const/4 v3, 0x1
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-eqz v1, :cond_2d[/COLOR][/B]
if-nez p1, :cond_2d
[B][COLOR="Red"]#if-nez v0, :cond_2d[/COLOR][/B]
.line 253
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataOffAlert()V
.line 257
:goto_2c
return-void
.line 255
:cond_2d
invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->setMobileDataEnabled(Z)V
goto :goto_2c
.end method
★ For low battery notification ★
- Baksmali SystemUI.apk.
- Go to classes/com/android/systemui/power/ folder and open PowerUI.smali.
- Search for this method ".method showLowBatteryWarning()V" and add the blue lines:
Code:
.method showLowBatteryWarning()V
.registers 20
.prologue
.line 433
const-string v16, "PowerUI"
new-instance v17, Ljava/lang/StringBuilder;
invoke-direct/range {v17 .. v17}, Ljava/lang/StringBuilder;-><init>()V
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/systemui/power/PowerUI;->mBatteryLevelTextView:Landroid/widget/TextView;
if-nez v15, :cond_78
const-string v15, "showing"
:goto_f
move-object/from16 v0, v17
invoke-virtual {v0, v15}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v15
const-string v17, " low battery warning: level="
move-object/from16 v0, v17
invoke-virtual {v15, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v15
move-object/from16 v0, p0
[B][COLOR="Blue"]move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/systemui/power/PowerUI;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
const-string v6, "bat_low"
const/4 v7, 0x1
invoke-static {v5, v6, v7}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v5
if-eqz v5, :goto_77[/COLOR] [COLOR="Green"]#<!--- goto_77 will return-void (go down & see..!!)[/COLOR][/B]
iget v0, v0, Lcom/android/systemui/power/PowerUI;->mBatteryLevel:I
move/from16 v17, v0
move/from16 v0, v17
invoke-virtual {v15, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v15
const-string v17, " ["
move-object/from16 v0, v17
invoke-virtual {v15, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v15
move-object/from16 v0, p0
iget v0, v0, Lcom/android/systemui/power/PowerUI;->mBatteryLevel:I
move/from16 v17, v0
move-object/from16 v0, p0
move/from16 v1, v17
invoke-direct {v0, v1}, Lcom/android/systemui/power/PowerUI;->findBatteryLevelBucket(I)I
move-result v17
move/from16 v0, v17
invoke-virtual {v15, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v15
const-string v17, "]"
move-object/from16 v0, v17
invoke-virtual {v15, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v15
invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v15
move-object/from16 v0, v16
invoke-static {v0, v15}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
...
...
...
.line 539
[B][COLOR="Red"]:goto_77[/COLOR] [COLOR="Green"]<!--- You should put this defined goto value in the new if-eqz[/COLOR][/B]
return-void
You will need to add the switch toggle in SecSettings.apk using the same principle in post #1
CRT-OFF Animation Toggle
Here: http://forum.xda-developers.com/showthread.php?t=2194003
Working on Note.
:good:
@kmokhtar79
I'll try them all, so some android.policy.jar can be removed from my Aroma Installer.
@majdinj
How long do you keep your note?
I ask only because of your Pimp my Phone project.
I'm staying for now on Note 1.
- there is no big difference between Note 1 and Note 2 (I mean general use)
- Note 3 isn't good as Phone (it's too big for me as phone, or my fingers are too short)
It's just your opinion.
kmokhtar79 said:
CRT-OFF Animation Toggle
Here: http://forum.xda-developers.com/showthread.php?t=2194003
Working on Note.
Click to expand...
Click to collapse
Excellent,, it has the same principle to add toggle switch in SecSettings.apk.
So it is almost the same for all.. what is left to tackle is only switch referral codes (where to incorporate key code in other jar or apk other than SecSettings.apk) which needs several testings..
tkari4 said:
@majdinj
How long do you keep your note?
I ask only because of your Pimp my Phone project.
I'm staying for now on Note 1.
- there is no big difference between Note 1 and Note 2 (I mean general use)
- Note 3 isn't good as Phone (it's too big for me as phone, or my fingers are too short)
It's just your opinion.
Click to expand...
Click to collapse
Unless I hard brick it of whatever the reason, I will stay with Note 1
Although having a new phone is not bad idea
Guys! just to let you know that on LSA firmware, mentioned toggle switches in SystemUI are already enabled by default, the only thing I had to do was link them with their referral switches to Settings.
Thanks btw for this tutorial
Just love ua stuff
Ty
Sent from my GT-N7000 using xda app-developers app
nice:good:
Nice guide... work for me for full battery notification
Just little question
for add switch on/off
there are
Code:
.field private [COLOR="Red"]mBatPref[/COLOR]:Landroid/preference/CheckBoxPreference;
and this
Code:
const-string v11,[COLOR="Red"] "bat_sbar"[/COLOR]
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
and this
Code:
:cond_[COLOR="Red"]batteryToggle[/COLOR]
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_179
My question, to which is marked in red, I have to refer to where to make it?
because I am trying to make a toggle for mobile data and does not affect anything when i checked in setting.
thanks.
Sorry My Bad English
Click to expand...
Click to collapse
thank you so much for your guide i am trying to do this for my tab 4 running kitkat and i seem to be running into some issues with recompiling. Do you think you could help me out i really want this mod in my ROM. I attached a screenshot for the errror im recieving and i also attached the decompiled secsettings folder i modified
Thanks if you can help a bro out
Download here: https://drive.google.com/file/d/0B_Sw043dvZeoZkZHNkVPSnNtZnc/view?usp=sharing
View attachment 4248531
syaeful said:
Nice guide... work for me for full battery notification
Just little question
for add switch on/off
there are
Code:
.field private [COLOR="Red"]mBatPref[/COLOR]:Landroid/preference/CheckBoxPreference;
and this
Code:
const-string v11,[COLOR="Red"] "bat_sbar"[/COLOR]
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
and this
Code:
:cond_[COLOR="Red"]batteryToggle[/COLOR]
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_179
My question, to which is marked in red, I have to refer to where to make it?
because I am trying to make a toggle for mobile data and does not affect anything when i checked in setting.
thanks.
Click to expand...
Click to collapse
Could you help me out bro if you could?

[GUIDE][MOD][4.0.4] AOSP Lockscreen with on/off toggle for Samsung ICS Devices

***Here is a guide for activating AOSP Lockscreen on Samsung ICS devices ***​
This guide is specially for GT-S7562. But should work for other Samsung ICS devices also. Values may differ.
Things you need:
Tool for decompiling/compiling work (I will not cover this, there are many guides for this)
Notepad++
Patience
Some common sense
Click to expand...
Click to collapse
Here, we will edit two files:
SecSettings.apk
android.policy.jar
Here we start---
First, we will activate Aosp lockscreen:
Decomiple android.policy.jar
Open smali/com/android/internal/policy/impl/LockPatternKeyguardView.smali
Search for
Code:
.method createLockScreen()Landroid/view/View;
Add blue lines
Code:
.method createLockScreen()Landroid/view/View;
.registers 7
.prologue
.line 1460
[COLOR="Blue"] iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "aosp_lock"
const/4 v2, 0x0
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-nez v0, :cond_1f[/COLOR]
new-instance v0, Lcom/android/internal/policy/impl/CircleLockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/CircleLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
.line 1466
.local v0, lockView:Landroid/view/View;
invoke-virtual {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V
.line 1467
return-object v0
.end method
Save and recompile android.policy.jar
Aosp Lockscreen is activated.
Now we will create on/off toggle in settings
Decompile SecSettings.apk
Open /smali/com/android/settings/LockscreenSettings.smali
Remove red line and add blue one
Code:
# instance fields
.field private isWeatherEnabled:Z
[COLOR="Blue"].field private mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
.field private mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;
.field private mClock:Landroid/preference/CheckBoxPreference;
.field private mDualclock:Landroid/preference/SwitchPreferenceScreen;
.field private mHelpText:Landroid/preference/CheckBoxPreference;
.field private mInformationTicker:Landroid/preference/SwitchPreferenceScreen;
.field private mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
.field private mLockScreenShortcut:Landroid/preference/SwitchPreferenceScreen;
.field private mMotionDialog:Landroid/app/AlertDialog;
.field private mRippleEffect:Landroid/preference/CheckBoxPreference;
[COLOR="Red"].field private mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
.field private mWeather:Landroid/preference/SwitchPreferenceScreen;
Search-
Code:
const-string v6, "unlock_text"
-In line 363
Code:
const-string v6, "unlock_text"
invoke-static {v2, v6, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, :cond_ed
move v2, v3
:goto_a2
invoke-virtual {v5, v2}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 248
:cond_a5
[COLOR="Red"]iget-object v2, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="blue"]iget-object v2, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
if-eqz v2, :cond_bb
.line 249
[COLOR="Red"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Blue"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
[COLOR="Blue"]const-string v6, "aosp_lock"[/COLOR]
[COLOR="red"]const-string v6, "wake_up_lock_screen"[/COLOR]
invoke-static {v2, v6, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
Search-
Code:
const-string v5, "say_your_wakeup"
-In line 991
Code:
const-string v5, "say_your_wakeup"
invoke-virtual {p0, v5}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v5
check-cast v5, Landroid/preference/CheckBoxPreference;
[COLOR="blue"]iput-object v5, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Red"]iput-object v5, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
.line 183
[COLOR="red"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="blue"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getResources()Landroid/content/res/Resources;
move-result-object v8
const v9, 0x7f0d0b8f
Search-
Code:
.local v1, pm:Landroid/content/pm/PackageManager;
-In line 1081
Code:
.local v1, pm:Landroid/content/pm/PackageManager;
invoke-virtual {v1, v4, v7}, Landroid/content/pm/PackageManager;->queryIntentActivities(Landroid/content/Intent;I)Ljava/util/List;
move-result-object v0
.line 199
.local v0, list:Ljava/util/List;,"Ljava/util/List<Landroid/content/pm/ResolveInfo;>;"
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v5
[COLOR="blue"]if-ge v5, v6, :cond_1aa[/COLOR]
[COLOR="red"]if-ge v5, v6, :cond_1b3[/COLOR]
.line 200
[COLOR="red"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="blue"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference; [/COLOR]
[COLOR="red"]if-eqz v5, :cond_1aa[/COLOR]
[COLOR="blue"]if-eqz v5, :cond_1a1[/COLOR]
[COLOR="red"].line 201
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v5
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
invoke-virtual {v5, v6}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z[/COLOR]
.line 202
[COLOR="red"]:cond_1aa
if-eqz v3, :cond_1b3[/COLOR]
[COLOR="blue"]:cond_1a1
if-eqz v3, :cond_1aa[/COLOR]
.line 203
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v5
invoke-virtual {v5, v3}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
.line 208
.end local v0 #list:Ljava/util/List;,"Ljava/util/List<Landroid/content/pm/ResolveInfo;>;"
.end local v1 #pm:Landroid/content/pm/PackageManager;
[COLOR="red"]:cond_1b3[/COLOR]
[COLOR="blue"]:cond_1aa[/COLOR]
return-void
.end local v3 #setWakeupCommand:Landroid/preference/PreferenceScreen;
.end local v4 #set_wakeup_commant_intent:Landroid/content/Intent;
[COLOR="red"]:cond_1b4[/COLOR]
[COLOR="blue"]:cond_1ab[/COLOR]
move v5, v7
Search-
Code:
wake_up_lock_screen
-In line 2382 (after editing all above lines)
Code:
.line 282
:cond_ad
[COLOR="red"]iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="blue"]iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference; [/COLOR]
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_1e
.line 283
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
[COLOR="red"] const-string v5, "wake_up_lock_screen"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="blue"]const-string v5, "aosp_lock"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_c8
:goto_c3
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1e
:cond_c8
move v2, v3
goto :goto_c3
.end method
Save it and now open res/xml/lockscreen_settings.xml
add edit-
Code:
[COLOR="red"]<CheckBoxPreference android:title="@string/samsung_unlock_option_say_your_wakeup_command_to_unlock_screen" android:key="say_your_wakeup" android:summary="@string/wakeup_in_lockscreen_summary" />[/COLOR]
[COLOR="Blue"]<CheckBoxPreference android:title="@string/aosp_title" android:key="say_your_wakeup" android:summary="@string/aosp_summary" />[/COLOR]
Save it.
Now open res/values/strings.xml and add these lines in the end.
Code:
<string name="aosp_title">AOSP Lockscreen</string>
<string name="aosp_summary">Official ICS lock screen</string>
Save it and recompile SecSettings.apk
Thats it.
These screenshots are from PMP™ Ultra ROM
{
"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"
}
Credits:
Me
Codename13
bombaybadboy
Mirko ddd
Click to expand...
Click to collapse
Enjoy AOSP Lockscreen on your Samsung ICS Device :laugh::good:
lockscreen shortcuts
Mohitash said:
***Here is a guide for activating AOSP Lockscreen on Samsung ICS devices ***​
This guide is specially for GT-S7562. But should work for other Samsung ICS devices also. Values may differ.
Here, we will edit two files:
SecSettings.apk
android.policy.jar
Here we start---
First, we will activate Aosp lockscreen:
Decomiple android.policy.jar
Open smali/com/android/internal/policy/impl/LockPatternKeyguardView.smali
Search for
Code:
.method createLockScreen()Landroid/view/View;
Add blue lines
Code:
.method createLockScreen()Landroid/view/View;
.registers 7
.prologue
.line 1460
[COLOR="Blue"] iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "aosp_lock"
const/4 v2, 0x0
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-nez v0, :cond_1f[/COLOR]
new-instance v0, Lcom/android/internal/policy/impl/CircleLockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/CircleLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
.line 1466
.local v0, lockView:Landroid/view/View;
invoke-virtual {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V
.line 1467
return-object v0
.end method
Save and recompile android.policy.jar
Aosp Lockscreen is activated.
Now we will create on/off toggle in settings
Decompile SecSettings.apk
Open /smali/com/android/settings/LockscreenSettings.smali
Remove red line and add blue one
Code:
# instance fields
.field private isWeatherEnabled:Z
[COLOR="Blue"].field private mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
.field private mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;
.field private mClock:Landroid/preference/CheckBoxPreference;
.field private mDualclock:Landroid/preference/SwitchPreferenceScreen;
.field private mHelpText:Landroid/preference/CheckBoxPreference;
.field private mInformationTicker:Landroid/preference/SwitchPreferenceScreen;
.field private mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
.field private mLockScreenShortcut:Landroid/preference/SwitchPreferenceScreen;
.field private mMotionDialog:Landroid/app/AlertDialog;
.field private mRippleEffect:Landroid/preference/CheckBoxPreference;
[COLOR="Red"].field private mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
.field private mWeather:Landroid/preference/SwitchPreferenceScreen;
Search-
Code:
const-string v6, "unlock_text"
-In line 363
Code:
const-string v6, "unlock_text"
invoke-static {v2, v6, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, :cond_ed
move v2, v3
:goto_a2
invoke-virtual {v5, v2}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 248
:cond_a5
[COLOR="Red"]iget-object v2, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="blue"]iget-object v2, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
if-eqz v2, :cond_bb
.line 249
[COLOR="Red"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Blue"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
[COLOR="Blue"]const-string v6, "aosp_lock"[/COLOR]
[COLOR="red"]const-string v6, "wake_up_lock_screen"[/COLOR]
invoke-static {v2, v6, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
Search-
Code:
const-string v5, "say_your_wakeup"
-In line 991
Code:
const-string v5, "say_your_wakeup"
invoke-virtual {p0, v5}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v5
check-cast v5, Landroid/preference/CheckBoxPreference;
[COLOR="blue"]iput-object v5, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Red"]iput-object v5, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
.line 183
[COLOR="red"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="blue"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getResources()Landroid/content/res/Resources;
move-result-object v8
const v9, 0x7f0d0b8f
Search-
Code:
.local v1, pm:Landroid/content/pm/PackageManager;
-In line 1081
Code:
.local v1, pm:Landroid/content/pm/PackageManager;
invoke-virtual {v1, v4, v7}, Landroid/content/pm/PackageManager;->queryIntentActivities(Landroid/content/Intent;I)Ljava/util/List;
move-result-object v0
.line 199
.local v0, list:Ljava/util/List;,"Ljava/util/List<Landroid/content/pm/ResolveInfo;>;"
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v5
[COLOR="blue"]if-ge v5, v6, :cond_1aa[/COLOR]
[COLOR="red"]if-ge v5, v6, :cond_1b3[/COLOR]
.line 200
[COLOR="red"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="blue"]iget-object v5, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference; [/COLOR]
[COLOR="red"]if-eqz v5, :cond_1aa[/COLOR]
[COLOR="blue"]if-eqz v5, :cond_1a1[/COLOR]
[COLOR="red"].line 201
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v5
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
invoke-virtual {v5, v6}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z[/COLOR]
.line 202
[COLOR="red"]:cond_1aa
if-eqz v3, :cond_1b3[/COLOR]
[COLOR="blue"]:cond_1a1
if-eqz v3, :cond_1aa[/COLOR]
.line 203
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v5
invoke-virtual {v5, v3}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
.line 208
.end local v0 #list:Ljava/util/List;,"Ljava/util/List<Landroid/content/pm/ResolveInfo;>;"
.end local v1 #pm:Landroid/content/pm/PackageManager;
[COLOR="red"]:cond_1b3[/COLOR]
[COLOR="blue"]:cond_1aa[/COLOR]
return-void
.end local v3 #setWakeupCommand:Landroid/preference/PreferenceScreen;
.end local v4 #set_wakeup_commant_intent:Landroid/content/Intent;
[COLOR="red"]:cond_1b4[/COLOR]
[COLOR="blue"]:cond_1ab[/COLOR]
move v5, v7
Search-
Code:
wake_up_lock_screen
-In line 2382 (after editing all above lines)
Code:
.line 282
:cond_ad
[COLOR="red"]iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="blue"]iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference; [/COLOR]
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_1e
.line 283
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
[COLOR="red"] const-string v5, "wake_up_lock_screen"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="blue"]const-string v5, "aosp_lock"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_c8
:goto_c3
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1e
:cond_c8
move v2, v3
goto :goto_c3
.end method
Save it and now open res/xml/lockscreen_settings.xml
add edit-
Code:
[COLOR="red"]<CheckBoxPreference android:title="@string/samsung_unlock_option_say_your_wakeup_command_to_unlock_screen" android:key="say_your_wakeup" android:summary="@string/wakeup_in_lockscreen_summary" />[/COLOR]
[COLOR="Blue"]<CheckBoxPreference android:title="@string/aosp_title" android:key="say_your_wakeup" android:summary="@string/aosp_summary" />[/COLOR]
Save it.
Now open res/values/strings.xml and add these lines in the end.
Code:
<string name="aosp_title">AOSP Lockscreen</string>
<string name="aosp_summary">Official ICS lock screen</string>
Save it and recompile SecSettings.apk
Thats it.
These screenshots are from PMP™ Ultra ROM
Enjoy AOSP Lockscreen on your Samsung ICS Device :laugh::good:
Click to expand...
Click to collapse
Is it possible to add other shortcuts like camera is already there ?? (it is possible through gravity box module which is not compatible with ICS :'( )
hey
Is it possible to add other shortcuts like camera any game etc ??
Sharique244777 said:
Is it possible to add other shortcuts like camera any game etc ??
Click to expand...
Click to collapse
Tried for one time but failed....
To bad that it only works on 4.0.4
safariking said:
To bad that it only works on 4.0.4
Click to expand...
Click to collapse
It can also be done on many Samsung Galaxy devices that are running 4.1.2.. The instructions are quite similar to this one and can be found among many other instructions for different mods.. Here's the link:
http://forum.xda-developers.com/showpost.php?p=35229966&postcount=3
(But I don't know if it will work with 4.2.2 and above though)
Thanks
any possibility that this'll work on non-samsung devices? ZTE grand x pro here...
Can I make it for my ZTE Stock ICS device?
Can I make it for my ZTE Stock ICS device?
heraSK said:
any possibility that this'll work on non-samsung devices? ZTE grand x pro here...
Click to expand...
Click to collapse
I don't think so....
But may be witg different edits...
Sent from my GT-S7562 using XDA Premium 4 mobile app
KK2ZTE said:
Can I make it for my ZTE Stock ICS device?
Click to expand...
Click to collapse
I dont know about files of ZTE device(s)
But if you think you can try...you just need to study the lines in my guide and then in your.....but this is only possible if you already know some stuffs about editing smali...
You will need to find the file(s) for editing in your device and then the editings....
Hope you are getting that what i am saying.
Regards
Mohitash
Sent from my GT-S7562 using XDA Premium 4 mobile app

[Guide][Beginners] Bypass OEM's Device Check

This is a fast and easy tutorial to bypass device not compatible with your device check.
****NOTE I've seen some similar code in Samsung apps but I'm not sure, this guide may differ from device to device. and it isn't 100% that this method is working for all devices*******
I found out that some of the HTC apps were using this device check and I'm sure those who already ported some HTC apps might know how to bypass this issue.
Well this is a very easy way and there isn't "much" that you have to do.
You'll be needing.
Apktool or baksmali
Notepad++
Common smali knowledge.
And ofc java setup to get apktool working.
Now in this example ill only write a short info (this is due to no computer at hand) but it'll cover most of it.
Once you have everything above. you're good to go!
In this example i'm using HTC_IME.apk
Decompile your desired app with either apktool
Navigate to /smali/com/HTC/ and copy the path to the directory
{
"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"
}
Open up notepad and press ctrl+f you'll get a popup window. now click on Find in files tab. And in search for window put isHTCdevice As seen in screenshot and in folder copy your copied path to your decompiled HTC location which I mentioned earlier.
Now you'll get probably several strings found with isHTCdevice like
http://forum.xda-developers.com/attachment.php?attachmentid=3237135&stc=1&d=1427751676
Which one would I take???
If your thinking straight. you want either the constructor to be it or a method.
The method should start with. .method
Code:
.method public static isHTCDevice()Z
.locals 9
.prologue
const/4 v1, 0x1
const/4 v2, 0x0
.line 255
sget v0, Lcom/htc/sense/ime/NonAndroidSDK$HtcAdded;->sIS_HTC_DEVICE:I
if-gez v0, :cond_0
.line 256
const-string v0, "ro.product.brand"
const-string v3, ""
invoke-static {v0, v3}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
.line 257
new-instance v0, Lcom/htc/sense/ime/NonAndroidSDK$HAAccUtil;
invoke-direct {v0}, Lcom/htc/sense/ime/NonAndroidSDK$HAAccUtil;-><init>()V
const-string v4, "sku_id"
const/4 v5, -0x1
invoke-virtual {v0, v4, v5}, Lcom/htc/sense/ime/NonAndroidSDK$HAAccUtil;->readInteger(Ljava/lang/String;I)I
move-result v4
.line 258
invoke-static {}, Lcom/htc/a/a;->b()Z
move-result v5
.line 261
sget v6, Landroid/os/Build$VERSION;->SDK_INT:I
.line 262
if-eqz v5, :cond_1
move v0, v1
:goto_0
sput v0, Lcom/htc/sense/ime/NonAndroidSDK$HtcAdded;->sIS_HTC_DEVICE:I
.line 264
new-instance v0, Ljava/lang/StringBuilder;
const-string v7, ", init time:"
invoke-direct {v0, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
sput-object v0, Lcom/htc/sense/ime/NonAndroidSDK$HtcAdded;->sINIT_LOG:Ljava/lang/StringBuilder;
.line 265
sget-object v0, Lcom/htc/sense/ime/NonAndroidSDK$HtcAdded;->sINIT_LOG:Ljava/lang/StringBuilder;
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v7
invoke-virtual {v0, v7, v8}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v0
const-string v7, ", systemProperty="
invoke-virtual {v0, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v3, ", accSku="
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v0
const-string v3, ", HDKLib0Util.isHTCDevice()="
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, v5}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
move-result-object v0
const-string v3, ", sdkVer="
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
.line 268
const-string v0, "HtcAdded"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "In isHTCDevice(), current time:"
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v4
invoke-virtual {v3, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v3
sget-object v4, Lcom/htc/sense/ime/NonAndroidSDK$HtcAdded;->sINIT_LOG:Ljava/lang/StringBuilder;
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v0, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 270
:cond_0
sget v0, Lcom/htc/sense/ime/NonAndroidSDK$HtcAdded;->sIS_HTC_DEVICE:I
if-lez v0, :cond_2
:goto_1
return v1
:cond_1
move v0, v2
.line 262
goto :goto_0
:cond_2
move v1, v2
.line 270
goto :goto_1
.end method
So what do we do now?
Well by judging from a fast view, the v1 result and v0 result is moved to v2, which in our case is 0x0 = FALSE
by simply changing the number to 0x1 will tell us that the result of v2 is true
This is my first tutorial and i hope for beginners this is not too hard
Note if you have issues with it not working either force close or not shown. It might be your apktook.
Then
make a copy of your original file. Open it up with your desired zip manager.
Go to your Decompiled folder and Navigate to build/apk/ and copy the classes.dex file to your opened file and you're done!
Sent from my LG-D855 using Tapatalk
How to bypass this one? please
Code:
.class public Lcom/opera/tv/browser/sony/dia/DeviceChecker;
.super Ljava/lang/Object;
.source "DeviceChecker.java"
# direct methods
.method public constructor <init>()V
.registers 1
.prologue
.line 14
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static check()V
.registers 3
.prologue
.line 20
:try_start_0
const-string v1, "com.sony.dtv.remotetouchpad.gesture.UXGestureDetector"
invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
.line 21
const-string v1, "com.mediatek.MtkMediaPlayer"
invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
:try_end_a
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_a} :catch_24
.line 26
sget-object v1, Landroid/os/Build;->MANUFACTURER:Ljava/lang/String;
const-string v2, "Brandabc"
invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_1e
sget-object v1, Landroid/os/Build;->MODEL:Ljava/lang/String;
const-string v2, "Model123"
invoke-virtual {v1, v2}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_2b
.line 27
:cond_1e
new-instance v1, Ljava/lang/UnsupportedOperationException;
invoke-direct {v1}, Ljava/lang/UnsupportedOperationException;-><init>()V
throw v1
.line 22
:catch_24
move-exception v0
.line 23
.local v0, "e":Ljava/lang/ClassNotFoundException;
new-instance v1, Ljava/lang/UnsupportedOperationException;
invoke-direct {v1}, Ljava/lang/UnsupportedOperationException;-><init>()V
throw v1
.line 28
.end local v0 # "e":Ljava/lang/ClassNotFoundException;
:cond_2b
return-void
.end method
I have a device check problem for omnipod app.
The app is compatible with some Samsung phones but I can't find any Samsung string.
How can I remove device check ?

Categories

Resources