[Guide] Full Screen Dialer - MM - Sprint Samsung Galaxy Note5

[Guide] Full Screen Dialer - MM
DO NOT QUOTE THE OP WHEN POSTING!!!
This guide assumes you are already proficient at de/recompiling stock apk's.
Features:
- Choose between any custom background or solid or gradient color backgrounds
- Dialpad digits, letters, divider & digits pressed are colorable
- All options can be turned on or off so they will not conflict with installed themes
We are modifying SecContacts_M.apk.
These modification were done on a Note 5 - 6.0.1 smali. Yours may be different and you will need to adapt.
One user already pointed out that on the S7, the ap.smali edits are in an.smali
There is an example of the an.smali edits here: http://forum.xda-developers.com/showpost.php?p=68686947&postcount=61
*** Add new files attached to the bottom of this post.
res\values\ids.xml
Add new ID
Code:
<item type="id" name="gear_panel_bg_view">false</item>
smali\com\android\dialer\dialpad\DialpadFragment.smali
Add new fields.
Code:
# instance fields
[COLOR="blue"].field private final mFullscreenBG:Z
.field private final mThemeoverride:Z
[/COLOR]
Increase .locals by 3 and add new code in BLUE
Code:
.method private K()V
.locals [COLOR="blue"]7[/COLOR]
.
.
.
const v2, 0x7f0201cc ## type="drawable" name="dialpad_fragment_background"
[COLOR="blue"] iget-boolean v4, p0, Lcom/android/dialer/dialpad/DialpadFragment;->mFullscreenBG:Z
if-eqz v4, :cond_td
invoke-virtual {p0}, Lcom/android/dialer/dialpad/DialpadFragment;->getContext()Landroid/content/Context;
move-result-object v4
const-string v5, "dialpad_fragment_background_fullscreen" # This is your resource name
const-string v6, "drawable" # This is the resource type
invoke-static {v4, v5, v6}, Lcom/android/wubydax/IdUtils;->getIdentifier(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)I
move-result v2
:cond_td
[/COLOR] invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/View;->setBackground(Landroid/graphics/drawable/Drawable;)V
goto :goto_1
.end method
Increase .locals by 3 and add new code in BLUE
Code:
.method private N()V
.locals [COLOR="blue"]5[/COLOR]
.
.
.
invoke-virtual {p0}, Lcom/android/dialer/dialpad/DialpadFragment;->getResources()Landroid/content/res/Resources;
move-result-object v0
const v1, 0x7f0201cd ## type="drawable" name="dialpad_fragment_bg"
[COLOR="blue"]iget-boolean v2, p0, Lcom/android/dialer/dialpad/DialpadFragment;->mFullscreenBG:Z
if-eqz v2, :cond_td
invoke-virtual {p0}, Lcom/android/dialer/dialpad/DialpadFragment;->getContext()Landroid/content/Context;
move-result-object v2
const-string v3, "dialpad_fragment_bg_fullscreen" # This is your resource name
const-string v4, "drawable" # This is the resource type
invoke-static {v2, v3, v4}, Lcom/android/wubydax/IdUtils;->getIdentifier(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)I
move-result v1
:cond_td
[/COLOR] invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
Increase .locals by 3 and add new code in BLUE
Code:
.method private g(Landroid/view/View;)V
.locals [COLOR="blue"]5[/COLOR]
.
.
.
invoke-virtual {p0}, Lcom/android/dialer/dialpad/DialpadFragment;->getResources()Landroid/content/res/Resources;
move-result-object v0
const v1, 0x7f0201cc ## type="drawable" name="dialpad_fragment_background"
[COLOR="blue"]iget-boolean v2, p0, Lcom/android/dialer/dialpad/DialpadFragment;->mFullscreenBG:Z
if-eqz v2, :cond_td
invoke-virtual {p0}, Lcom/android/dialer/dialpad/DialpadFragment;->getContext()Landroid/content/Context;
move-result-object v2
const-string v3, "dialpad_fragment_background_fullscreen" # This is your resource name
const-string v4, "drawable" # This is the resource type
invoke-static {v2, v3, v4}, Lcom/android/wubydax/IdUtils;->getIdentifier(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)I
move-result v1
:cond_td
[/COLOR] invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v0
invoke-virtual {p1, v0}, Landroid/view/View;->setBackground(Landroid/graphics/drawable/Drawable;)V
goto :goto_1
.end method
Add new code in BLUE
Code:
.method public b(Landroid/view/View;)V
.
.
.
const v0, 0x7f0e021a ## type="id" name="digits"
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Lcom/android/dialer/dialpad/EllipsisTextView;
iput-object v0, p0, Lcom/android/dialer/dialpad/DialpadFragment;->c:Lcom/android/dialer/dialpad/EllipsisTextView;
[COLOR="blue"]move-object/from16 v2, p0
invoke-virtual {v2, v0}, Lcom/android/dialer/dialpad/DialpadFragment;->setDialerDigitPressed(Landroid/widget/TextView;)V
[/COLOR]
iget-object v0, p0, Lcom/android/dialer/dialpad/DialpadFragment;->c:Lcom/android/dialer/dialpad/EllipsisTextView;
iget-object v2, p0, Lcom/android/dialer/dialpad/DialpadFragment;->v:Landroid/content/Context;
invoke-static {v2}, Lcom/android/dialer/dialpad/w;->a(Landroid/content/Context;)Lcom/android/dialer/dialpad/w;
move-result-object v2
invoke-virtual {v0, v2}, Lcom/android/dialer/dialpad/EllipsisTextView;->setKeyListener(Landroid/text/method/KeyListener;)V
Increase .locals by 5 and add new code in BLUE
Code:
.method public onCreateView(Landroid/view/LayoutInflater;Landroid/view/ViewGroup;Landroid/os/Bundle;)Landroid/view/View;
.locals [COLOR="blue"]10[/COLOR]
const/4 v4, 0x0
[COLOR="blue"] invoke-virtual {p0}, Lcom/android/dialer/dialpad/DialpadFragment;->setSDBackground()V
invoke-virtual {p0}, Lcom/android/dialer/dialpad/DialpadFragment;->setThemeOverride()V
[/COLOR]
sget-object v0, Lcom/android/dialer/dialpad/DialpadFragment;->O:Ljava/lang/String;
const-string/jumbo v1, "onCreateView >>>>>"
invoke-static {v0, v1}, Landroid/util/secutil/Log;->secI(Ljava/lang/String;Ljava/lang/String;)I
const v0, 0x7f030098 ## type="layout" name="dialpad_fragment"
[COLOR="blue"]iget-boolean v6, p0, Lcom/android/dialer/dialpad/DialpadFragment;->mFullscreenBG:Z
if-eqz v6, :cond_td
invoke-virtual {p0}, Lcom/android/dialer/dialpad/DialpadFragment;->getContext()Landroid/content/Context;
move-result-object v6
invoke-virtual {v6}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v6
const-string v7, "dialpad_fragment_fullscreen" # This is the resource name
const-string v8, "layout" # this is resource type
invoke-virtual {p0}, Lcom/android/dialer/dialpad/DialpadFragment;->getContext()Landroid/content/Context;
move-result-object v9
invoke-virtual {v9}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v9
invoke-virtual {v6, v7, v8, v9}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v0 #This now holds your id number
:cond_td
[/COLOR] invoke-virtual {p1, v0, p2, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
Add new methods to bottom of smali.
Code:
.method setDialerDigit(Landroid/widget/TextView;)V
.locals 3
iget-boolean v1, p0, Lcom/android/dialer/dialpad/DialpadFragment;->mThemeoverride:Z
if-eqz v1, :cond_td
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "main_digit_color"
const v2, -0x1000000
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setTextColor(I)V
:cond_td
return-void
.end method
.method setDialerDigitPressed(Landroid/widget/TextView;)V
.locals 3
iget-boolean v1, p0, Lcom/android/dialer/dialpad/DialpadFragment;->mThemeoverride:Z
if-eqz v1, :cond_td
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "main_digit_color_pressed"
const v2, -0x1000000
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setTextColor(I)V
:cond_td
return-void
.end method
.method setDialerLetter(Landroid/widget/TextView;)V
.locals 3
iget-boolean v1, p0, Lcom/android/dialer/dialpad/DialpadFragment;->mThemeoverride:Z
if-eqz v1, :cond_td
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "main_letter_color"
const v2, -0x1000000
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setTextColor(I)V
:cond_td
return-void
.end method
.method public setSDBackground()V
.locals 5
invoke-virtual {p0}, Lcom/android/dialer/dialpad/DialpadFragment;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "enable_dialer_custom_bg"
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-eqz v0, :cond_td
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/dialer/dialpad/DialpadFragment;->mFullscreenBG:Z
:cond_td
return-void
.end method
.method public setThemeOverride()V
.locals 4
const/4 v2, 0x0
iput-boolean v2, p0, Lcom/android/dialer/dialpad/DialpadFragment;->mThemeoverride:Z
invoke-virtual {p0}, Lcom/android/dialer/dialpad/DialpadFragment;->getContext()Landroid/content/Context;
move-result-object v1
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "dialer_theme_override"
const/4 v3, 0x0
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_td
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/dialer/dialpad/DialpadFragment;->mThemeoverride:Z
:cond_td
return-void
.end method
Next smali...
smali\com\android\dialer\dialpad\DialpadKeyButton.smali
Increase .locals by 3 and add new code in BLUE
Code:
.method public a()V
.locals [COLOR="blue"]6[/COLOR]
.
.
.
invoke-virtual {p0}, Lcom/android/dialer/dialpad/DialpadKeyButton;->getResources()Landroid/content/res/Resources;
move-result-object v0
## entire dialpad background setup for transparency
const v1, 0x7f020072 ## type="drawable" name="call_dial_btn_bg_easy_dialpad_button_white" id="0x7f020072" />
[COLOR="blue"] invoke-virtual {p0}, Lcom/android/dialer/dialpad/DialpadKeyButton;->getContext()Landroid/content/Context;
move-result-object v3
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "enable_dialer_custom_bg"
const/4 v5, 0x0
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-eqz v3, :cond_td
invoke-virtual {p0}, Lcom/android/dialer/dialpad/DialpadKeyButton;->getContext()Landroid/content/Context;
move-result-object v3
const-string v4, "call_dial_btn_bg_easy_dialpad_button_transparent" # This is your resource name
const-string v5, "drawable" # This is the resource type
invoke-static {v3, v4, v5}, Lcom/android/wubydax/IdUtils;->getIdentifier(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)I
move-result v1
:cond_td
[/COLOR] invoke-virtual {v0, v1, v2}, Landroid/content/res/Resources;->getDrawable(ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
move-result-object v0
invoke-virtual {p0, v0}, Lcom/android/dialer/dialpad/DialpadKeyButton;->setBackground(Landroid/graphics/drawable/Drawable;)V
goto :goto_0
.end method
Next smali...
smali\com\samsung\dialer\dialpad\ap.smali
Increase .locals by 3 and add new code in BLUE
Code:
.method private a(Landroid/widget/ImageView;Z)V
.locals [COLOR="blue"]4[/COLOR]
.
.
.
if-nez p1, :cond_0
:goto_0
return-void
:cond_0
if-eqz p2, :cond_1
const/4 v0, 0x0
invoke-virtual {p1, v0}, Landroid/widget/ImageView;->setVisibility(I)V
invoke-direct {p0}, Lcom/samsung/dialer/dialpad/ap;->c()I
move-result v0
invoke-virtual {p1, v0}, Landroid/widget/ImageView;->setImageResource(I)V
invoke-direct {p0}, Lcom/samsung/dialer/dialpad/ap;->f()I
move-result v0
[COLOR="blue"] invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v1
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "dialer_theme_override"
const/4 v3, 0x0
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_td
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v1
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "main_letter_color"
const v3, -0x1000000
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
:cond_td
[/COLOR] invoke-static {v0}, Landroid/content/res/ColorStateList;->valueOf(I)Landroid/content/res/ColorStateList;
move-result-object v0
invoke-virtual {p1, v0}, Landroid/widget/ImageView;->setImageTintList(Landroid/content/res/ColorStateList;)V
Add new code in BLUE
Code:
.method private a(Landroid/widget/TextView;I)V
.locals 1
if-nez p1, :cond_0
:goto_0
return-void
:cond_0
iget-object v0, p0, Lcom/samsung/dialer/dialpad/ap;->s:[I
aget v0, v0, p2
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setText(I)V
iget-object v0, p0, Lcom/samsung/dialer/dialpad/ap;->e:Landroid/graphics/Typeface;
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V
invoke-direct {p0}, Lcom/samsung/dialer/dialpad/ap;->e()I
move-result v0
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setTextColor(I)V
[COLOR="Blue"]move-object/from16 v1, p0
invoke-virtual {v1, p1}, Lcom/samsung/dialer/dialpad/ap;->setDialerDigit(Landroid/widget/TextView;)V[/COLOR]
Add new code in BLUE
Code:
.method private b(Landroid/widget/TextView;I)V
.
.
.
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setText(I)V
iget-object v0, p0, Lcom/samsung/dialer/dialpad/ap;->f:Landroid/graphics/Typeface;
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V
invoke-direct {p0}, Lcom/samsung/dialer/dialpad/ap;->f()I
move-result v0
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setTextColor(I)V
[COLOR="blue"]move-object/from16 v1, p0
invoke-virtual {v1, p1}, Lcom/samsung/dialer/dialpad/ap;->setDialerLetter(Landroid/widget/TextView;)V
[/COLOR]
invoke-direct {p0, p1}, Lcom/samsung/dialer/dialpad/ap;->g(Landroid/widget/TextView;)V
iget-boolean v0, p0, Lcom/samsung/dialer/dialpad/ap;->d:Z
invoke-direct {p0, p1, v0}, Lcom/samsung/dialer/dialpad/ap;->a(Landroid/widget/TextView;Z)V
invoke-direct {p0, p1}, Lcom/samsung/dialer/dialpad/ap;->i(Landroid/widget/TextView;)V
goto :goto_0
.end method
Add new code in BLUE
Code:
.method private c(Landroid/view/View;)V
.locals 5
invoke-virtual {p0}, Lcom/samsung/dialer/dialpad/ap;->a()I
move-result v1
invoke-virtual {p0}, Lcom/samsung/dialer/dialpad/ap;->b()I
move-result v2
[COLOR="blue"] invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v3, "dialer_theme_override"
const/4 v4, 0x0
invoke-static {v0, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-eqz v0, :cond_td
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v3, "main_divider_color"
const v2, -0x1000000
invoke-static {v0, v3, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
:cond_td[/COLOR]
const/4 v0, 0x0
:goto_0
Add new methods to the bottom of this smali.
Code:
.method setDialerDigit(Landroid/widget/TextView;)V
.locals 3
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "dialer_theme_override"
const/4 v2, 0x0
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-eqz v1, :cond_td
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "main_digit_color"
const v2, -0x1000000
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setTextColor(I)V
:cond_td
return-void
.end method
.method setDialerLetter(Landroid/widget/TextView;)V
.locals 3
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "dialer_theme_override"
const/4 v2, 0x0
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-eqz v1, :cond_td
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "main_letter_color"
const v2, -0x1000000
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setTextColor(I)V
:cond_td
return-void
.end method
Rom Control V2 Entries
[SOURCE CODE][DEV TOOL][SDK 21+]6thGear RomControl v2.+ for Devs by daxgirl
Add arrays
Code:
<string-array name="crop_entries">
<item>Center Crop (default)</item>
<item>Center Inside</item>
<item>Fit XY</item>
</string-array>
<string-array name="crop_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="custom_bg_type_entries">
<item>Image</item>
<item>Solid color</item>
<item>Gradient</item>
</string-array>
<string-array name="custom_bg_type_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="gradient_entries">
<item>Top to bottom</item>
<item>Bottom to top</item>
<item>Left to right</item>
<item>Right to left</item>
</string-array>
<string-array name="gradient_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
Add to your pref
Code:
<PreferenceCategory
android:title="Main Dialer Backgrounds and Colors" />
<PreferenceScreen
android:title="Main Dialer Options"
android:summary="Set backgrounds or color">
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference
android:defaultValue="false"
android:key="enable_dialer_custom_bg"
android:summaryOff="Disabled"
android:summaryOn="Enabled \n> You must also enable custom colors and modify them or the dialpad will not be very visible."
android:title="Enable custom background"/>
<com.wubydax.romcontrol.v2.prefs.MyListPreference
android:defaultValue="0"
android:dependency="enable_dialer_custom_bg"
android:entries="@array/custom_bg_type_entries"
android:entryValues="@array/custom_bg_type_values"
android:key="dialer_custom_bg_type"
android:title="Background type"/>
<com.wubydax.romcontrol.v2.prefs.UriSelectionPreference
android:dependency="enable_dialer_custom_bg"
android:key="dialer_bg"
android:title="Select image for Background"/>
<com.wubydax.romcontrol.v2.prefs.MyListPreference
android:defaultValue="0"
android:dependency="enable_dialer_custom_bg"
android:entries="@array/crop_entries"
android:entryValues="@array/crop_values"
android:key="dialer_crop_type"
android:title="Set Image Scaling Type"/>
<com.wubydax.romcontrol.v2.prefs.ColorPickerPreference
android:defaultValue="#00000000"
android:dependency="enable_dialer_custom_bg"
android:key="dialer_bg_primary_color"
android:title="Select primary color"/>
<com.wubydax.romcontrol.v2.prefs.ColorPickerPreference
android:defaultValue="#00000000"
android:dependency="enable_dialer_custom_bg"
android:key="dialer_second_gradient_color"
android:title="Secondary Color (for gradient)"/>
<com.wubydax.romcontrol.v2.prefs.MyListPreference
android:defaultValue="0"
android:dependency="enable_dialer_custom_bg"
android:entries="@array/gradient_entries"
android:entryValues="@array/gradient_values"
android:key="dialer_bg_gradient_orientation"
android:title="Gradient orientation"/>
<com.wubydax.romcontrol.v2.prefs.MySeekBarPreference
android:defaultValue="255"
android:dependency="enable_dialer_custom_bg"
android:key="dialer_opacity"
app:maxValue="255"
android:title="Background Opacity"/>
<PreferenceCategory
android:title="Dialer Colors - disable if Theme conflicts" />
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference
android:title="Digit and Letter Colors On/Off Toggle"
android:key="dialer_theme_override"
android:defaultValue="false"
android:summaryOn="Colors enabled"
android:summaryOff="Colors disabled" />
<com.wubydax.romcontrol.v2.prefs.ColorPickerPreference
android:title="Dialer Digits"
android:key="main_digit_color"
android:summary="Set digit color"
android:dependency="dialer_theme_override"
app:packageNameToKill="com.android.contacts"
android:defaultValue="#ff000000" />
<com.wubydax.romcontrol.v2.prefs.ColorPickerPreference
android:title="Dialer Letters"
android:key="main_letter_color"
android:summary="Choose letter color"
android:dependency="dialer_theme_override"
app:packageNameToKill="com.android.contacts"
android:defaultValue="#ff000000" />
<com.wubydax.romcontrol.v2.prefs.ColorPickerPreference
android:title="Dialer Divider"
android:key="main_divider_color"
android:summary="Choose divider color"
android:dependency="dialer_theme_override"
android:defaultValue="#ff000000" />
<com.wubydax.romcontrol.v2.prefs.ColorPickerPreference
android:title="Dialer Digits Pressed"
android:key="main_digit_color_pressed"
android:summary="Set digit color"
android:dependency="dialer_theme_override"
android:defaultValue="#ff000000" />
</PreferenceScreen>
Additional Notes:
- This is designed to be compatible with theme store themes. Enabling custom backgrounds or colors my conflict with themes.
Credits:
- This modification uses two really awesome modifications provided on my guide thread:
[Mod][GUIDE][CUSTOM VIEW] 6thGear Custom View for any app
and also I utilized the [How-To] Find view by ID without having to find public resource - APK Edition which has additional links provided for that one in Post #10.
I highly recommend the new method how to find public resource without public value. It has made this guide far easier for you!!! :highfive:

Reserved

Sorry sir.
I mod custumbackgound incallui so choise color and gradient ok but image not show. You have thng about this
Gửi từ SM-J710F của tôi bằng cách sử dụng Tapatalk

Works like a charm on s7 edge dialer. had to edit an.smali instead of ap.smali though. now to change that ugly green bar at the top. lol
{
"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"
}
thanks @tdunham for another awesome guide

OvrDriVE said:
Works like a charm on s7 edge dialer. had to edit an.smali instead of ap.smali though. now to change that ugly green bar at the top. lol
View attachment 3828063
thanks @tdunham for another awesome guide
Click to expand...
Click to collapse
Great job sir! Did you have any issue with the signature? I am using an older version of apktool on this one (just sticking with what I was using at the time) and ended up having to resign with TickleMyAndroid for it to work.
I know what you mean about the green. I created a different version for myself with slightly blue themed. If anyone would like to share their own customizations here as they accomplish them, I am sure it would be welcome.

These are the color edits I did to change green to blue.
Code:
<color name="dial_button_bg_easy_solid_green">#ff3ebf10</color>
<color name="dial_button_ripple_color">#4c6ebd52</color>
<color name="dialpad_button_left_icon_tint_color">#ff3ebf10</color>
<color name="dialpad_floating_action_button_color">#ff3ebf10</color>
<color name="dialpad_floating_action_button_color_call">#ff3ebf10</color>
<color name="dialpad_multisim_button_color_call">#ff3ebf10</color>
<color name="dialtacts_color_primary">#ff6ebd52</color>
<color name="dialtacts_status_bar_color">#ff6ebd52</color>
<color name="list_item_checkbox_color_on">#ff6ebd52</color>

On the OP, I have added credits with links to additional guides on some of the concepts and modifications used to create this little monster.
Please take the time to visit those posts if you are not familiar with them.
Tnx - Troy

sonnguyenpg said:
Sorry sir.
I mod custumbackgound incallui so choise color and gradient ok but image not show. You have thng about this
Click to expand...
Click to collapse
I cannot support InCallUI edits.

tdunham said:
Great job sir! Did you have any issue with the signature? I am using an older version of apktool on this one (just sticking with what I was using at the time) and ended up having to resign with TickleMyAndroid for it to work.
I know what you mean about the green. I created a different version for myself with slightly blue themed. If anyone would like to share their own customizations here as they accomplish them, I am sure it would be welcome.
Click to expand...
Click to collapse
Yes on S7 contact there is a signature issues that's gaves Parsing errors , just my friend he do it & told me about that , so i just told him to try it with new signature compiling , only this way can fixed Parsing errors ...

tdunham said:
Great job sir! Did you have any issue with the signature? I am using an older version of apktool on this one (just sticking with what I was using at the time) and ended up having to resign with TickleMyAndroid for it to work.
I know what you mean about the green. I created a different version for myself with slightly blue themed. If anyone would like to share their own customizations here as they accomplish them, I am sure it would be welcome.
Click to expand...
Click to collapse
i used apktool 2.2.0 dirty. i also dirty flashed it. but havn't tryed on a clean install yet. i did sign it though.
err my bad. it's a 2.2.0 snapshot i use
edit: just deleted seccontacts_m and /data/data for contacts and phone.. rebooted and flashed seccontacts_m and works like a charm. no parse error.

OvrDriVE said:
i used apktool 2.2.0 dirty. i also dirty flashed it. but havn't tryed on a clean install yet. i did sign it though.
err my bad. it's a 2.2.0 snapshot i use
edit: just deleted seccontacts_m and /data/data for contacts and phone.. rebooted and flashed seccontacts_m and works like a charm. no parse error.
Click to expand...
Click to collapse
Do you keep the original signature when compiling? Please report how you do your the recompiled.
I apktool use 2.1.2 dirty.

aceqott said:
Do you keep the original signature when compiling? Please report how you do your the recompiled.
I apktool use 2.1.2 dirty.
Click to expand...
Click to collapse
actually i use advancedapktool4.2.0, when i recompile i just by habit automatically tell it to sign the apk. it's probably a bad habit but hasn't failed me yet

I followed the guide without skipping a point, but the category "Dialer Colors - Theme disable if conflicts" nothing works.
Here I leave 3 smalis amending if someone can help me please.
I've already reviewed several times, I do not know what went wrong.

aceqott said:
I followed the guide without skipping a point, but the category "Dialer Colors - Theme disable if conflicts" nothing works.
Here I leave 3 smalis amending if someone can help me please.
I've already reviewed several times, I do not know what went wrong.
Click to expand...
Click to collapse
tdunham also here too , as im sure i did everything correctly my locales my edited same as mentioned on op , i even try it many times with s7/n5/s6 contact & all its same dialer colors not worked , sorry for not providing logs as i didn't find any fatal or error with contact , any help hint any idea , ? Thank u
Here my log maybe u can find something that i couldn't find it
https://mega.nz/#!Wt4mQZYQ!FRLwU_dzQAOu3gJudJUyJcuhJucrfcBAkGwNW9WSbOg
???

aceqott said:
I followed the guide without skipping a point, but the category "Dialer Colors - Theme disable if conflicts" nothing works.
Here I leave 3 smalis amending if someone can help me please.
I've already reviewed several times, I do not know what went wrong.
Click to expand...
Click to collapse
thereassaad said:
tdunham also here too , as im sure i did everything correctly my locales my edited same as mentioned on op , i even try it many times with s7/n5/s6 contact & all its same dialer colors not worked , sorry for not providing logs as i didn't find any fatal or error with contact , any help hint any idea , ? Thank u
Click to expand...
Click to collapse
Are you guys using Rom Control V2?
The filepreference toggle requires two smali edits if NOT using version 2 or it will never work.
Code:
.method public setThemeOverride()V
.
.
.
const-string v1, "/data/data/com.wubydax.romcontrol[COLOR="Red"].v2[/COLOR]/files/modcfg_theme_override"

tdunham said:
Are you guys using Rom Control V2?
The filepreference toggle requires two smali edits if NOT using version 2 or it will never work.
Code:
.method public setThemeOverride()V
.
.
.
const-string v1, "/data/data/com.wubydax.romcontrol[COLOR="Red"].v2[/COLOR]/files/modcfg_theme_override"
Click to expand...
Click to collapse
Im sure im using rom control v2 my friend

thereassaad said:
Im sure im using rom control v2 my friend
Click to expand...
Click to collapse
Well, that is the Boolean that controls the toggle in both smalis ap & DialpadFragment.
To test if it is not working, try removing any occurrences for mThemeoverride:Z
(this example is in ap.smali)
Code:
iget-boolean v1, p0, Lcom/samsung/dialer/dialpad/ap;->mThemeoverride:Z
if-eqz v1, :cond_td
.
.
.
:cond_td

tdunham said:
Well, that is the Boolean that controls the toggle in both smalis ap & DialpadFragment.
To test if it is not working, try removing any occurrences for mThemeoverride:Z
(this example is in ap.smali)
Code:
iget-boolean v1, p0, Lcom/samsung/dialer/dialpad/ap;->mThemeoverride:Z
if-eqz v1, :cond_td
.
.
.
:cond_td
Click to expand...
Click to collapse
U mean this right
iget-boolean v1, p0, Lcom/samsung/dialer/dialpad/ap;->mThemeoverride:Z
if-eqz v1, :cond_td
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "main_digit_color"
const v2, -0x1000000
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setTextColor(I)V
:cond_td
If this one then not recompiled
Log
ther:
SecContacts_M_310716115726.apk\smali\com\samsung\dialer\dialpad\ap.smali[3177,4] no viable alternative at input 'return-void'
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/samsung/dialer/dialpad/ap.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:67)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:51)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:38)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:364)
at brut.androlib.Androlib.buildSources(Androlib.java:295)
at brut.androlib.Androlib.build(Androlib.java:278)
at brut.androlib.Androlib.build(Androlib.java:254)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:84)
???

thereassaad said:
U mean this right
iget-boolean v1, p0, Lcom/samsung/dialer/dialpad/ap;->mThemeoverride:Z
if-eqz v1, :cond_td
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "main_digit_color"
const v2, -0x1000000
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setTextColor(I)V
:cond_td
If this one then not recompiled
Log
ther:
SecContacts_M_310716115726.apk\smali\com\samsung\dialer\dialpad\ap.smali[3177,4] no viable alternative at input 'return-void'
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/samsung/dialer/dialpad/ap.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:67)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:51)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:38)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:364)
at brut.androlib.Androlib.buildSources(Androlib.java:295)
at brut.androlib.Androlib.build(Androlib.java:278)
at brut.androlib.Androlib.build(Androlib.java:254)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:84)
???
Click to expand...
Click to collapse
I only ask you to remove three lines where they occur so I dont know what you did.

tdunham said:
Well, that is the Boolean that controls the toggle in both smalis ap & DialpadFragment.
To test if it is not working, try removing any occurrences for mThemeoverride:Z
(this example is in ap.smali)
Code:
iget-boolean v1, p0, Lcom/samsung/dialer/dialpad/ap;->mThemeoverride:Z
if-eqz v1, :cond_td
.
.
.
:cond_td
Click to expand...
Click to collapse
Remove these three lines everywhere(path is different in dialpadfragment and they may not be exactly the same) in both smalis to see if the problem is setting Boolean with filepref.

Related

[MOD][GUIDE] IME Icon visibility w/ toggle + AOSP Lock vibration w/ toggle

Here is a couple simple MODs I worked up. The IME MOD is in my Multi-Mod and the AOSP Vibrate was something AndyBones requested a few days ago. Keep in mind most of these guides from here on out will assume you are using my ROM Control settings. Its much easier to protect from updates and much easier to edit when adding new MODs.
Lets start with SecSettings....
Navigate to res/xml/rom_settings.xml
Add the following code in RED
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/rom_settings"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings.didact">
<PreferenceCategory android:title="@string/rom_settings_section_one_title" />
<ListPreference android:persistent="true" android:entries="@array/lockscreen_entries" android:title="Choose Your LockScreen" android:key="lockscreen_type_key" android:defaultValue="1" android:entryValues="@array/lockscreen_values" />
<CheckBoxPreference android:title="@string/enable_lockscreen_torch" android:key="enable_lockscreen_torch" android:summary="@string/enable_lockscreen_torch_text" />
[COLOR="red"]<CheckBoxPreference android:title="@string/enable_aosp_vibrate" android:key="aosp_vibrate" android:summary="@string/enable_aosp_vibrate_text" />
[/COLOR] <PreferenceCategory android:title="@string/rom_settings_section_two_title" />
<ListPreference android:entries="@array/clock_style_entries" android:title="@string/clock_title_enable" android:key="clock_style" android:entryValues="@array/clock_style_values" />
<ListPreference android:entries="@array/clock_ampm_entries" android:title="@string/title_clock_ampm_entries" android:key="clock_am_pm_style" android:entryValues="@array/clock_ampm_values" />
<ListPreference android:entries="@array/clock_weekday_entries" android:title="@string/enable_clock_weekday" android:key="clock_weekday" android:summary="@string/enable_clock_weekday_summary" android:entryValues="@array/clock_weekday_values" />
<PreferenceCategory android:title="@string/rom_settings_section_three_title" />
<ListPreference android:entries="@array/battery_icon_entries" android:title="@string/battery_icon" android:key="battery_icon_list" android:entryValues="@array/battery_icon_values" />
<PreferenceCategory android:title="@string/rom_settings_section_four_title" />
[COLOR="red"]<CheckBoxPreference android:title="@string/enable_ime_icon" android:key="enable_ime_icon" android:summary="@string/enable_ime_icon_text" />
[/COLOR] <CheckBoxPreference android:persistent="false" android:title="@string/long_press_volume_title" android:key="music_control" android:summary="@string/long_press_volume_summary" />
<CheckBoxPreference android:title="@string/crtanimation_title" android:key="crtanimation_toggle" android:summary="@string/crtanimation_summary" />
</PreferenceScreen>
Navigate to res/values/strings
Add the following code
Code:
<string name="enable_ime_icon">Keyboard icon</string>
<string name="enable_ime_icon_text">Enable IME keyboard icon</string>
<string name="enable_aosp_vibrate">AOSP lockscreen vibration</string>
<string name="enable_aosp_vibrate_text">Enable lockscreen vibration</string>
Navigate to smali/com/android/settings/didact/RomSettings.smali
Add the following code in RED to the # instance Fields
Code:
# instance fields
.field mBatteryIcon:Landroid/preference/ListPreference;
.field mBatteryStyle:Landroid/preference/ListPreference;
.field mClockAmPmstyle:Landroid/preference/ListPreference;
.field mClockStyle:Landroid/preference/ListPreference;
.field mClockWeekday:Landroid/preference/ListPreference;
.field mCrtAnimationPreference:Landroid/preference/CheckBoxPreference;
[COLOR="red"].field mImeIcon:Landroid/preference/CheckBoxPreference;
[/COLOR]
.field mLockScreenStylePref:Landroid/preference/ListPreference;
.field mLockScreenTorch:Landroid/preference/CheckBoxPreference;
.field mMusicControl:Landroid/preference/CheckBoxPreference;
[COLOR="red"].field mAospLockVibration:Landroid/preference/CheckBoxPreference;
[/COLOR]
Locate .method public onCreate(Landroid/os/BundleV
Add the code in RED
Code:
const-string v5, "enable_lockscreen_torch"
invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v2, :cond_0
move v1, v2
:goto_0
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[COLOR="red"] const-string v1, "enable_ime_icon"
invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/CheckBoxPreference;
iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mImeIcon:Landroid/preference/CheckBoxPreference;
iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mImeIcon:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v1
invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v5, "enable_ime_icon"
invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v2, :cond_1
move v1, v2
:goto_1
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[/COLOR]
const-string v1, "music_control"
invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/CheckBoxPreference;
iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mMusicControl:Landroid/preference/CheckBoxPreference;
iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mMusicControl:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v1
invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v5, "music_control"
invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v2, :cond_2
move v1, v2
:goto_2
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
const-string v1, "crtanimation_toggle"
invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/CheckBoxPreference;
iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mCrtAnimationPreference:Landroid/preference/CheckBoxPreference;
iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mCrtAnimationPreference:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v1
invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v5, "crtanimation_toggle"
invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v2, :cond_3
move v1, v2
:goto_3
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[COLOR="red"]const-string v1, "aosp_vibrate"
invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/CheckBoxPreference;
iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mAospLockVibration:Landroid/preference/CheckBoxPreference;
iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mAospLockVibration:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v1
invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v5, "aosp_vibrate"
invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v2, :cond_4
move v1, v2
:goto_4
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[/COLOR]
return-void
:cond_0
move v1, v3
goto :goto_0
[COLOR="red"]:cond_1
move v1, v3
goto :goto_1
[/COLOR]
:cond_2
move v1, v3
goto :goto_2
:cond_3
move v1, v3
goto :goto_3
[COLOR="red"]:cond_4
move v1, v3
goto :goto_4
[/COLOR].end method
Find .method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/PreferenceZ
Add the following in RED
Code:
.locals 5
const/4 v0, 0x0
const/4 v1, 0x1
iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mLockScreenTorch:Landroid/preference/CheckBoxPreference;
[COLOR="red"]if-ne p2, v2, :cond_2
[/COLOR]
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v2
invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "enable_lockscreen_torch"
check-cast p2, Landroid/preference/CheckBoxPreference;
invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_0
move v0, v1
:cond_0
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
:goto_0
return v1
:cond_1
invoke-super {p0, p1, p2}, Lcom/android/settings/SettingsPreferenceFragment;->onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
move-result v1
goto :goto_0
[COLOR="red"]:cond_2
iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mImeIcon:Landroid/preference/CheckBoxPreference;
if-ne p2, v2, :cond_4
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v2
invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "enable_ime_icon"
check-cast p2, Landroid/preference/CheckBoxPreference;
invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_3
move v0, v1
:cond_3
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_0[/COLOR]
:cond_4
iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mMusicControl:Landroid/preference/CheckBoxPreference;
if-ne p2, v2, :cond_6
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v2
invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "music_control"
check-cast p2, Landroid/preference/CheckBoxPreference;
invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_5
move v0, v1
:cond_5
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_0
:cond_6
iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mCrtAnimationPreference:Landroid/preference/CheckBoxPreference;
if-ne p2, v2, :cond_8
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v2
invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "crtanimation_toggle"
check-cast p2, Landroid/preference/CheckBoxPreference;
invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_7
move v0, v1
[COLOR="red"]:cond_7
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_0
:cond_8
iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mAospLockVibration:Landroid/preference/CheckBoxPreference;
if-ne p2, v2, :cond_1
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v2
invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "aosp_vibrate"
check-cast p2, Landroid/preference/CheckBoxPreference;
invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_9
move v0, v1
:cond_9
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_0[/COLOR][code][/hide]
Thats all you need for SecSettings. Recompile and push to /system/app and test the toggles. They wont do anything yet but they should be there and should be able to click them on and off.
Next we will add in the logic code forthe IME icon functionality.
Decompile Services.jar
Navigate to smali/com/android/server/InputMethodManagerService.smali
Find .method public setImeWindowStatus(Landroid/os/IBinder;II)V
Add the following in RED
[hide][code]
:try_start_0
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/server/InputMethodManagerService;->mCurToken:Landroid/os/IBinder;
move-object/from16 v0, p1
[COLOR="red"]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, "enable_ime_icon"
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_1
[/COLOR]
:cond_0
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 "
Thats it for Services.jar. Recompile and push to /system/framework
Now for the last part. The AOSP lockscreen vibration toggle. For this we will need to decompile framework2.jar
Navigate to smali/com/android/internal/widget/multiwaveview/GlowPadView.smali
Find .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSetV
Add the following code in RED
Code:
const/16 v8, 0x30
invoke-virtual {v0, v7, v8}, Landroid/content/res/TypedArray;->getInt(II)I
move-result v8
iput v8, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mGravity:I
invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V
[COLOR="red"]iget-object v8, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mContext:Landroid/content/Context;
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v8
const-string v7, "aosp_vibrate"
invoke-static {v8, v7, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v8
if-eqz v8, :cond_8
[/COLOR]
:goto_0
invoke-virtual {p0, v6}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->setVibrateEnabled(Z)V
invoke-direct {p0}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->assignDefaultsIfNeeded()V
new-instance v6, Lcom/android/internal/widget/multiwaveview/PointCloud;
So thats it. I am also including a flashable ZIP for those who are already using my Multi-Mod. I will include these in my next Multi-Mod update as well. If you are not using my Multi-Mod this flashable zip wont work for you....sorry.
Flashable ZIP Download
Great Work Man!! Can i build this just into my SecSettings without your rom control?
sbreen94 said:
Great Work Man!! Can i build this just into my SecSettings without your rom control?
Click to expand...
Click to collapse
PM me bro that's what I originally wanted it to be, but Didact did all the ground work for us, we just gotta figure out how to put it in settings instead of rom control.
I wouldn't make it a seperate mod either if I were Didact, ROM Control is amazing, and it makes it so much easier to add in MODs like this.
but I do want to figure it out for those that do not use ROM Control.
And Didact thank you so much for this bro!!!
You are the man!
You added in CRT animation??
Sent from my SCH-I535 using xda app-developers app
sbreen94 said:
Great Work Man!! Can i build this just into my SecSettings without your rom control?
Click to expand...
Click to collapse
I can, i just dont have time right now. I can try to work something out for you guys this weekend.
tu3218 said:
You added in CRT animation??
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
LOL....it works with the right kernel, not the stock one unfortunately
Didact74 said:
I can, i just dont have time right now. I can try to work something out for you guys this weekend.
LOL....it works with the right kernel, not the stock one unfortunately
Click to expand...
Click to collapse
Of course. The stock kernel would give that sort of trouble for you devs. Thanks though man. You're a beast. BTW, do you know what kernel is required for such mod?
Sent from my SCH-I535 using xda app-developers app
Didact74 said:
I can, i just dont have time right now. I can try to work something out for you guys this weekend.
LOL....it works with the right kernel, not the stock one unfortunately
Click to expand...
Click to collapse
Its cool man I appreciate your hard work. I think I might be able to figure it out
Sent from my GT-N8013 using xda app-developers app
Code:
E/AndroidRuntime(16346): *** FATAL EXCEPTION IN SYSTEM PROCESS: WindowManagerPolicy
E/AndroidRuntime(16346): java.lang.VerifyError: com/android/internal/widget/multiwaveview/GlowPadView
E/AndroidRuntime(16346): at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime(16346): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
E/AndroidRuntime(16346): at android.view.LayoutInflater.createView(LayoutInflater.java)
E/AndroidRuntime(16346): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java)
E/AndroidRuntime(16346): at android.view.LayoutInflater.rInflate(LayoutInflater.java)
E/AndroidRuntime(16346): at android.view.LayoutInflater.rInflate(LayoutInflater.java)
E/AndroidRuntime(16346): at android.view.LayoutInflater.inflate(LayoutInflater.java)
E/AndroidRuntime(16346): at android.view.LayoutInflater.inflate(LayoutInflater.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.LockScreen.<init>(LockScreen.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.LockPatternKeyguardView.createLockScreen(LockPatternKeyguardView.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.LockPatternKeyguardView.recreateLockScreen(LockPatternKeyguardView.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.LockPatternKeyguardView.updateScreen(LockPatternKeyguardView.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.LockPatternKeyguardView.<init>(LockPatternKeyguardView.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.LockPatternKeyguardViewProperties.createKeyguardView(LockPatternKeyguardViewProperties.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.KeyguardViewManager.show(KeyguardViewManager.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.KeyguardViewMediator.handleShow(KeyguardViewMediator.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.KeyguardViewMediator.access$1400(KeyguardViewMediator.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.KeyguardViewMediator$4.handleMessage(KeyguardViewMediator.java)
E/AndroidRuntime(16346): at android.os.Handler.dispatchMessage(Handler.java)
E/AndroidRuntime(16346): at android.os.Looper.loop(Looper.java)
E/AndroidRuntime(16346): at com.android.server.wm.WindowManagerService$PolicyThread.run(WindowManagerService.java)
I get this error regarding the framework2.jar changes (the services.jar works ok, I think).
This is what my smali looks like:
Code:
invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V
[COLOR="Red"]iget v8, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mVibrationDuration:I
if-lez v8, :cond_8[/COLOR]
:goto_0
invoke-virtual {p0, v6}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->setVibrateEnabled(Z)V
invoke-direct {p0}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->assignDefaultsIfNeeded()V
new-instance v6, Lcom/android/internal/widget/multiwaveview/PointCloud;
I'm experimenting with the lines in red, as they differ from yours and they're the only parts that do.
Attach your GlowpadView.smali so I can have a peek.
Cheers
It may be a mess in there as I was playing around trying things, but nothing other than the lines we're using.
did you catch my comments in the transparency thread?
EDIT:
Also, the ime switcher icon toggle works great
Kryten2k35 said:
I get this error regarding the framework2.jar changes (the services.jar works ok, I think).
This is what my smali looks like:
Code:
invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V
[COLOR="Red"]iget v8, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mVibrationDuration:I
if-lez v8, :cond_8[/COLOR]
:goto_0
invoke-virtual {p0, v6}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->setVibrateEnabled(Z)V
invoke-direct {p0}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->assignDefaultsIfNeeded()V
new-instance v6, Lcom/android/internal/widget/multiwaveview/PointCloud;
I'm experimenting with the lines in red, as they differ from yours and they're the only parts that do.
Click to expand...
Click to collapse
Just overwrite those two lines, and change the two variables in blue
Code:
const/16 v8, 0x30
invoke-virtual {v0, v7, v8}, Landroid/content/res/TypedArray;->getInt(II)I
move-result v8
iput v8, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mGravity:I
invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V
[COLOR="Red"]iget-object v8, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mContext:Landroid/content/Context;
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v8
const-string [COLOR="Blue"]v4[/COLOR], "aosp_vibrate"
invoke-static {v8, [COLOR="blue"]v4[/COLOR], v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v8
if-eqz v8, :cond_8[/COLOR]
:goto_0
invoke-virtual {p0, v6}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->setVibrateEnabled(Z)V
invoke-direct {p0}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->assignDefaultsIfNeeded()V
new-instance v6, Lcom/android/internal/widget/multiwaveview/PointCloud;
Just the two in blue? Not the others?
Cheers I'll give it a whack
EDIT:
That works Cheers loserskater!
By the looks of the changes I'd need to add ROM control ( Not quite advanced enough to port that yet)
hednik said:
By the looks of the changes I'd need to add ROM control ( Not quite advanced enough to port that yet)
Click to expand...
Click to collapse
Yes you would. Unless you know how to port the code directly into one of your settings smali
Sent from my SCH-I535 using xda premium
hednik said:
By the looks of the changes I'd need to add ROM control ( Not quite advanced enough to port that yet)
Click to expand...
Click to collapse
sbreen94 said:
Yes you would. Unless you know how to port the code directly into one of your settings smali
Sent from my SCH-I535 using xda premium
Click to expand...
Click to collapse
Im not saying this just because its what I did, but with a stand alone settings file like my Rom Control it makes adding and removing future code a breeze. Plus you never have to worry about updates changing any of the code.
You ROM control is amazing. On my first rom it was a basic way to add all these awesome mods for a beginner and then customize little things.
Now that I'm trying to add all of these mods in individually on a t-mo port (data was just hit and miss with vzw 4.1.2 on at&t) I don't think in have the knowledge yet to port ROM control over to this new firmware. My head nearly exploded trying to do the on the fly battery mod alone haha.
Still awesome work you do and what you contribute
Sent from my SAMSUNG-SGH-I747 using xda premium
Thanks for the guide first..
ive managed to get the aosp toggle but i wanted to add vibrate so ive decompile framework2.jar
made the edits but when i try to compile back im getting the error "cond_8 not defined"
Thanks for all your help and all these Mod Tuts!!
By the way... if you havent heard this "Originally Posted by My Wife
You spent the last three days on the laptop for what reasn? So you could make the clock on your phone disappear? That's Brilliant sweetie" (taken from didact74's sig) you either arent married or arent a developer
LOVE IT!!!

[MOD][GUIDE] Real Time Statusbar Transparency Settings

Happy Easter!​
What does this MOD do?
It will allow you to change the status bar transparency settings without the need to reboot.
This will also be included as part of the Multi-Mod update coming shortly.
The attached zip is not flashable, its a file that's needed for the mod. A flashable zip will be added soon in the form of a link, not an attachment.
We will be working with two files:
SecSettings
SystemUI
As usual, I will assume you are using Rom Control for you settings controls. If not, you can port this to whichever settings header you prefer but I will not be going over how to do that here. I created Rom Control to eliminate the time needed to do all that.
There will be a zip included with a file that needs to be added to SystemUI. This is not a flashable zip. The file will need to be dropped in:
smali/com/android/systemui/statusbar/phone
Lets begin with SecSettings....
Navigate to res/xml/rom_settings.xml
Add the following code in RED
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/rom_settings"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings.didact">
<PreferenceCategory android:title="@string/rom_settings_section_one_title" />
<ListPreference android:persistent="true" android:entries="@array/lockscreen_entries" android:title="Choose Your LockScreen" android:key="lockscreen_type_key" android:defaultValue="1" android:entryValues="@array/lockscreen_values" />
<CheckBoxPreference android:title="@string/enable_lockscreen_torch" android:key="enable_lockscreen_torch" android:summary="@string/enable_lockscreen_torch_text" />
<CheckBoxPreference android:title="@string/enable_aosp_vibrate" android:key="aosp_vibrate" android:summary="@string/enable_aosp_vibrate_text" />
<PreferenceCategory android:title="@string/rom_settings_section_two_title" />
<ListPreference android:entries="@array/clock_style_entries" android:title="@string/clock_title_enable" android:key="clock_style" android:entryValues="@array/clock_style_values" />
<ListPreference android:entries="@array/clock_ampm_entries" android:title="@string/title_clock_ampm_entries" android:key="clock_am_pm_style" android:entryValues="@array/clock_ampm_values" />
<ListPreference android:entries="@array/clock_weekday_entries" android:title="@string/enable_clock_weekday" android:key="clock_weekday" android:summary="@string/enable_clock_weekday_summary" android:entryValues="@array/clock_weekday_values" />
<PreferenceCategory android:title="@string/rom_settings_section_three_title" />
<ListPreference android:entries="@array/battery_icon_entries" android:title="@string/battery_icon" android:key="battery_icon_list" android:entryValues="@array/battery_icon_values" />
<PreferenceCategory android:title="@string/rom_settings_section_four_title" />
<CheckBoxPreference android:title="@string/enable_ime_icon" android:key="enable_ime_icon" android:summary="@string/enable_ime_icon_text" />
<CheckBoxPreference android:persistent="false" android:title="@string/long_press_volume_title" android:key="music_control" android:summary="@string/long_press_volume_summary" />
<CheckBoxPreference android:title="@string/crtanimation_title" android:key="crtanimation_toggle" android:summary="@string/crtanimation_summary" />
[COLOR="red"]<ListPreference android:entries="@array/entries_status_bar_transparency" android:title="@string/status_bar_transparency_title" android:key="status_bar_transparency" android:summary="@string/status_bar_transparency_summary" android:defaultValue="0" android:entryValues="@array/values_status_bar_transparency" />
</PreferenceScreen>[/COLOR]
Navigate to res/values/arrays..
Add the following code
Code:
<string-array name="entries_status_bar_transparency">
<item>0%</item>
<item>50%</item>
<item>100%</item>
</string-array>
<string-array name="values_status_bar_transparency">
<item>100</item>
<item>75</item>
<item>50</item>
</string-array>
Navigate to res/values/strings...
Add the following code...
Code:
<string name="status_bar_transparency_title">Statusbar Transparency</string>
<string name="status_bar_transparency_summary">Adjust statusbar transparency</string>
Navigate to smali/com/android/settings/didact/RomSettings.smali
Add the following code in RED
Code:
# instance fields
.field mBatteryIcon:Landroid/preference/ListPreference;
.field mBatteryStyle:Landroid/preference/ListPreference;
.field mClockAmPmstyle:Landroid/preference/ListPreference;
.field mClockStyle:Landroid/preference/ListPreference;
.field mClockWeekday:Landroid/preference/ListPreference;
.field mCrtAnimationPreference:Landroid/preference/CheckBoxPreference;
.field mImeIcon:Landroid/preference/CheckBoxPreference;
.field mLockScreenStylePref:Landroid/preference/ListPreference;
.field mLockScreenTorch:Landroid/preference/CheckBoxPreference;
.field mMusicControl:Landroid/preference/CheckBoxPreference;
.field mAospLockVibration:Landroid/preference/CheckBoxPreference;
[COLOR="red"].field mStatusbarTransparency:Landroid/preference/ListPreference;
[/COLOR]
Find method "onCreate(Landroid/os/BundleV"
Add the following code in RED
Code:
const-string v5, "lockscreen_type_key"
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object v4
invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
[COLOR="red"]const-string v1, "status_bar_transparency"
invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/ListPreference;
iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mStatusbarTransparency:Landroid/preference/ListPreference;
iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mStatusbarTransparency:Landroid/preference/ListPreference;
invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mStatusbarTransparency:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v4
invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "status_bar_transparency"
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object v4
invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
[/COLOR]
const-string v1, "enable_lockscreen_torch"
invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/CheckBoxPreference;
Find method "onPreferenceChange(Landroid/preference/Preference;Ljava/lang/ObjectZ"
Add the following code in RED
Code:
:cond_4
iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mLockScreenStylePref:Landroid/preference/ListPreference;
if-ne p1, v5, [COLOR="red"]:cond_6[/COLOR]
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v4
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v5
invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
if-eqz v5, :cond_5
const-string v6, "lockscreen_ripple_effect"
const/4 v2, 0x0
invoke-static {v5, v6, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
const-string v6, "lockscreen_type_key"
invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_0
:cond_5
const-string v6, "lockscreen_type_key"
invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
const/4 v2, 0x1
const-string v6, "lockscreen_ripple_effect"
invoke-static {v5, v6, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_0
[COLOR="red"]:cond_6
iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mStatusbarTransparency:Landroid/preference/ListPreference;
if-ne p1, v5, :cond_0
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v4
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v5
invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
const-string v6, "status_bar_transparency"
invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
move-result v2
goto :goto_0
[/COLOR].end method
That's it for SecSettings. Compile and push to /system/app. Test out your new options, they wont work yet but they should be selectable.
Lets move on to SystemUI...
Open the attached zip and drop the observer file in smali/com/android/systemui/statusbar/phone if you have not already done so.
Navigate to smali/com/android/systemui/statusbar/BaseStatusbar.smali
Find the following method "setAreThereNotifications()V"
Add the following complete method directly after...
Code:
.method protected setStatusBarParams(Landroid/view/View;)V
.locals 4
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "status_bar_transparency"
const/16 v3, 0x64
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
invoke-virtual {p1}, Landroid/view/View;->getBackground()Landroid/graphics/drawable/Drawable;
move-result-object v1
mul-int/lit16 v2, v0, 0xff
div-int/lit8 v2, v2, 0x64
int-to-float v2, v2
invoke-static {v2}, Ljava/lang/Math;->round(F)I
move-result v2
invoke-virtual {v1, v2}, Landroid/graphics/drawable/Drawable;->setAlpha(I)V
return-void
.end method
Navigate to smali/com/android/systemui/statusbar/phone/PhoneStatusbar.smali
Add the following code in RED
Code:
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BrightnessEnableObserver;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$FastColorDrawable;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;,
[COLOR="red"]Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;,[/COLOR]
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$NotificationClicker;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$H;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$ExpandedDialog;
Find method "makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;"
Towards the end of this method, add the following code in RED
Code:
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/policy/NotificationRowLayout;->setLongPressListener(Landroid/view/View$OnLongClickListener;)V
iget-object v9, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mPile:Lcom/android/systemui/statusbar/policy/NotificationRowLayout;
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedContents:Landroid/view/View;
[COLOR="red"]new-instance v9, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
new-instance v10, Landroid/os/Handler;
invoke-direct {v10}, Landroid/os/Handler;-><init>()V
invoke-direct {v9, p0, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/os/Handler;)V
invoke-virtual {v9}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->observe()V
[/COLOR]
goto/16 :goto_5
:cond_f
const/16 v9, 0x8
goto/16 :goto_6
Find method "public start()V"
Towards the end of that method add the following code in RED
Code:
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mWindowManager:Landroid/view/IWindowManager;
invoke-super {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->start()V
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->addNavigationBar()V
[COLOR="red"]new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHandler:Lcom/android/systemui/statusbar/BaseStatusBar$H;
invoke-direct {v0, p0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/os/Handler;)V
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->observe()V
[/COLOR]
new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;
iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-direct {v0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;-><init>(Landroid/content/Context;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIconPolicy:Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;
return-void
.end method
That's it! Compile and push to /system/app and enjoy your new MOD!
Multi-Mod Flashable Add-On
I will be adding this MOD to the new Multi-Mod update shortly.
I will add a flashable zip to this thread that will allow you to add this to my Multi-Mod if you are currently running it.
Hit the thanks....buy me a coke!
Another one!!!? Such a boss! Thanks as always for sharing!!
Great Work as always Didact, and happy Easter!
Thanks, Are you the XDA Easter Bunny?!!
Sent from my SCH-I535 using XDA Premium HD app
Making stock roms just as customizable as AOSP roms.... thanks!
Im liking this and a lot of your other roms. But what is Rom control for settings controls. What do i need, i would like to port this over to my Sprint GS3.
Didact74 said:
Find method "makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;"
Towards the end of this method, add the following code in RED
Code:
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->getNotificationLongClicker()Landroid/view/View$OnLongClickListener;
move-result-object v14
invoke-virtual {v13, v14}, Lcom/android/systemui/statusbar/policy/NotificationRowLayout;->setLongPressListener(Landroid/view/View$OnLongClickListener;)V
[COLOR="red"]move-object/from16 v0, p0[/COLOR]
iget-object v[COLOR="red"]13[/COLOR], v0, Lcom/android/systemui/statusbar/BaseStatusBar;->mPile:Lcom/android/systemui/statusbar/policy/NotificationRowLayout;
move-object/from16 v0, p0
iput-object v[COLOR="red"]13[/COLOR], v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedContents:Landroid/view/View;
new-instance v[COLOR="red"]13[/COLOR], Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
new-instance v[COLOR="red"]14[/COLOR], Landroid/os/Handler;
invoke-direct {v[COLOR="red"]14[/COLOR]}, Landroid/os/Handler;-><init>()V
[COLOR="Red"]invoke-direct {v13, [COLOR="Blue"]v0[/COLOR], v14}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/os/Handler;)V[/COLOR]
invoke-virtual {v[COLOR="Red"]13[/COLOR]}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->observe()V
goto/16 :goto_5
:cond_e
const/16 v13, 0x8
goto/16 :goto_6
Click to expand...
Click to collapse
On the SGS3 International GT-i9300 it becomes the above
Thanks Didact74
EDIT:
You're missing:
Code:
.method static synthetic access$3400(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
.locals 1
invoke-direct {p0, p1, p2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadAnim(ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
move-result-object v0
return-object v0
.end method
[COLOR="Red"].method static synthetic access$3401(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/view/View;)V
.locals 0
invoke-virtual {p0, p1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setStatusBarParams(Landroid/view/View;)V
return-void
.end method[/COLOR]
.method static synthetic access$3500(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
.locals 0
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->playTraySound()V
return-void
.end method
and
Code:
invoke-virtual {v0, v3}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/view/View;->setContentDescription(Ljava/lang/CharSequence;)V
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadDimens()V
[COLOR="red"]iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {p0, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setStatusBarParams(Landroid/view/View;)V[/COLOR]
return-void
.end method
.method protected updateSearchPanel()V
.locals 2
Adding to PhoneStatusBar.smali
And
Code:
.method public setMaxBrightness(I)V
.locals 0
return-void
.end method
[COLOR="red"].method protected setStatusBarParams(Landroid/view/View;)V
.locals 4
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "status_bar_transparency"
const/16 v3, 0x64
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
invoke-virtual {p1}, Landroid/view/View;->getBackground()Landroid/graphics/drawable/Drawable;
move-result-object v1
mul-int/lit16 v2, v0, 0xff
div-int/lit8 v2, v2, 0x64
int-to-float v2, v2
invoke-static {v2}, Ljava/lang/Math;->round(F)I
move-result v2
invoke-virtual {v1, v2}, Landroid/graphics/drawable/Drawable;->setAlpha(I)V
return-void
.end method[/COLOR]
to BaseStatusBar.smali
Or maybe those things are missing on the GT-i9300. I dunno
EDIT 2:
And, just in case:
Code:
<string-array name="entries_status_bar_transparency">
<item>0%</item>
<item>10%</item>
<item>20%</item>
<item>30%</item>
<item>40%</item>
<item>50%</item>
<item>60%</item>
<item>70%</item>
<item>80%</item>
<item>90%</item>
<item>100%</item>
</string-array>
<string-array name="values_status_bar_transparency">
<item>100</item>
<item>95</item>
<item>90</item>
<item>85</item>
<item>80</item>
<item>75</item>
<item>70</item>
<item>65</item>
<item>60</item>
<item>55</item>
<item>50</item>
</string-array>
For 0 to 100%
Though, I'm not sure I understand... why is 50 "0% "transparency and 100% is "100%"?
For the colour codes edits in drawables, you change the first colour code number hex value base don 0 to 255... so 255 = ff, 0 = 00... 50% therefore being 127 (255/2), or 7F in hexadecimal.
I added color selection to this mod.
http://forum.xda-developers.com/showthread.php?p=40250902
loserskater said:
I added color selection to this mod.
http://forum.xda-developers.com/showthread.php?p=40250902
Click to expand...
Click to collapse
Ha, you stinker......I was getting ready to do that. :silly:
Didact74 said:
Ha, you stinker......I was getting ready to do that. :silly:
Click to expand...
Click to collapse
Haha, my bad. I was wondering if you were going to. Just got too excited!
Kryten2k35 said:
On the SGS3 International GT-i9300 it becomes the above
Thanks Didact74
EDIT:
You're missing:
Adding to PhoneStatusBar.smali
And
to BaseStatusBar.smali
Or maybe those things are missing on the GT-i9300. I dunno
Click to expand...
Click to collapse
I can confirm the added edits for PhoneStatusBar.smali and BaseStatusBar.smali are required. Thanks!
Kryten2k35 said:
EDIT 2:
Though, I'm not sure I understand... why is 50 "0% "transparency and 100% is "100%"?
For the colour codes edits in drawables, you change the first colour code number hex value base don 0 to 255... so 255 = ff, 0 = 00... 50% therefore being 127 (255/2), or 7F in hexadecimal.
Click to expand...
Click to collapse
The transparency values don't make sense because the ones in the OP are actually for 0%, 25%, and 50%.
Change this...
Code:
<string-array name="entries_status_bar_transparency">
<item>0%</item>
<item>50%</item>
<item>100%</item>
</string-array>
<string-array name="values_status_bar_transparency">
<item>[COLOR="Red"]100[/COLOR]</item>
<item>[COLOR="Red"]75[/COLOR]</item>
<item>[COLOR="Red"]50[/COLOR]</item>
</string-array>
...to this for 0%, 50%, and 100% transparency.
Code:
<string-array name="entries_status_bar_transparency">
<item>0%</item>
<item>50%</item>
<item>100%</item>
</string-array>
<string-array name="values_status_bar_transparency">
<item>[COLOR="Red"]100[/COLOR]</item>
<item>[COLOR="Red"]50[/COLOR]</item>
<item>[COLOR="Red"]0[/COLOR]</item>
</string-array>
Im running stock 4.1.2 with your multi mod and when i get to the last 2 sets of smali code where it says
Find method "makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;" and
Find method "public start()V" I can't find any of that code at all. Im still searching in smali/com/android/systemui/statusbar/phone/PhoneStatusbar.smal am I in the wrong spot Everything else was fine no problems finding or adding just those last 2.
mikeman45 said:
Im running stock 4.1.2 with your multi mod and when i get to the last 2 sets of smali code where it says
Find method "makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;" and
Find method "public start()V" I can't find any of that code at all. Im still searching in smali/com/android/systemui/statusbar/phone/PhoneStatusbar.smal am I in the wrong spot Everything else was fine no problems finding or adding just those last 2.
Click to expand...
Click to collapse
Find method "makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;"
PhoneStatusBarView.smali ..
not PhoneStatusbar.smali
andybones said:
Find method "makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;"
PhoneStatusBarView.smali ..
not PhoneStatusbar.smali
Click to expand...
Click to collapse
Thank you i was in the wrong smali but even going to the right one i get no occurence found when i search those 2 methods
mikeman45 said:
Thank you i was in the wrong smali but even going to the right one i get no occurence found when i search those 2 methods
Click to expand...
Click to collapse
Oh that's weird sorry about that.
Thanks! Does this status bar mod look proper in landscape mode for launchers that allow it?
Any chance this guide will work on universal guide? Or on sensation xe? I wanted to try it out
great mod, thanks!!
i want this to try out on my note2 (N7100)
could someone explain this to me?
@SecSettings
since we dont have didacts multi mod on N7100 im planning to make the changes at display_settings.xml file and DisplaySettings.smali
Code:
onst-string v1, "status_bar_transparency"
invoke-virtual {p0, v1}, Lcom/android[COLOR="red"]/settings/didact/RomSettings;-[/COLOR]>findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/ListPreference;
iput-object v1, p0, Lcom/android[COLOR="red"]/settings/didact/RomSettings;-[/COLOR]>mStatusbarTransparency:Landroid/preference/ListPreference;
iget-object v1, p0, Lcom/android/[COLOR="red"]settings/didact/RomSettings;-[/COLOR]>mStatusbarTransparency:Landroid/preference/ListPreference;
invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
iget-object v1, p0, Lcom/android[COLOR="Red"]/settings/didact/RomSettings;[/COLOR]->mStatusbarTransparency:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/[COLOR="red"]didact/RomSettings[/COLOR];->getActivity()Landroid/app/Activity;
move-result-object v4
invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "status_bar_transparency"
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object v4
invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
AskinSavascisi said:
great mod, thanks!!
i want this to try out on my note2 (N7100)
could someone explain this to me?
@SecSettings
since we dont have didacts multi mod on N7100 im planning to make the changes at display_settings.xml file and DisplaySettings.smali
Code:
onst-string v1, "status_bar_transparency"
invoke-virtual {p0, v1}, Lcom/android[COLOR="red"]/settings/didact/RomSettings;-[/COLOR]>findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/ListPreference;
iput-object v1, p0, Lcom/android[COLOR="red"]/settings/didact/RomSettings;-[/COLOR]>mStatusbarTransparency:Landroid/preference/ListPreference;
iget-object v1, p0, Lcom/android/[COLOR="red"]settings/didact/RomSettings;-[/COLOR]>mStatusbarTransparency:Landroid/preference/ListPreference;
invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
iget-object v1, p0, Lcom/android[COLOR="Red"]/settings/didact/RomSettings;[/COLOR]->mStatusbarTransparency:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/[COLOR="red"]didact/RomSettings[/COLOR];->getActivity()Landroid/app/Activity;
move-result-object v4
invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "status_bar_transparency"
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object v4
invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
Click to expand...
Click to collapse
You could always port his multimod over

[MOD][Guide] Power Menu Safe Mode Reboot Addon (Toggles guide added - 15/10/2013)

<< Power Menu Safe Mode Reboot Addon >>
{
"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"
}
Hi xda mates,,
Have anyone of you heard about the android safe mode and for what it is used?
Well the safe mode does exist in android device to help you to uninstall any third party application that causes lag or trouble in your android OS or even boot loop that prevents you from uninstalling that app which causes the problem by the normal way.. This should be your first attempt to fix your phone before doing a full wipe..!!
To get into Safe Mode, you need to power off your phone then turn it on and then hold volume up and down until it boots completely,, You will find a little black babble in the left lower side of the phone that indicates that you are in safe mode.
To boot into safe mode using adb shell, you can try these commands:
Code:
setprop persist.sys.safemode 1
reboot
The following video will show how is the buttons combination done..
OK, I know the buttons combination could be like a pain in a$$, and because most of manufactures had disabled the long press way to boot into safe mode (thanks Samsung..!!!), so I thought of integrating it into power menu as in above screenshots using the shell commands as a source of my smali codes.. So here we go :laugh:
The Guide:
Needed Tools:
1) APK Tool. You can use APK Multi-Tool from here.
2) Baksmali Tool. You can use my manager from here.
3) Notepad++ for editing xml and smali from here.
4) And of course little amount of patience..!!!
The procedure:
The procedure will not be different from the usual integrating addons into power menu..!!
First of all, download the resources [View attachment PM_SafeMode_Resources.rar].
1) framework-res.apk
- Decompile framework-res.apk
- Go to res\drawable-xhdpi folder and put the image resources there [tw_ic_lock_safemode.png]
- Go to res\values folder and open strings.xml file and add the following line at the end before </resources> and save:
Code:
<string name="global_action_safemode_txt">Reboot to safe mode</string>
- Now Recompile your framework-res.apk to create new ids.. Now DECOMPILE the NEW framework-res.apk and go to res\values and open public.xml file and locate these 2 ids:
Code:
<public type="drawable" name="tw_ic_lock_safemode" id="0x01080a98" />
<public type="string" name="global_action_safemode_txt" id="0x01040785" />
N.B: You might have different id numbers, but don't wary, the principle will be the same..!!
Click to expand...
Click to collapse
Keep the public.xml file opened for the moment and let's go to the next step.
2) android.policy.jar
- Baksmali android.policy.jar
- Go to classout\com\android\internal\policy\impl folder and paste the smali resource there [GlobalActions$SafeMode.smali]
- Now in the same folder find GlobalActions.smali and open it.
- In GlobalActions.smali, find the instance fields section and go to its end and add the following blue line just after ".field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;":
Code:
.field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[B][COLOR="Blue"].field private mSafeMode:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR][/B]
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
- Now, Search for "[Lcom/android/internal/policy/impl/GlobalActions$Action;" for power menu arrays and increase the number of arrays (the line above it) to accommodate the total number of new arrays:
Code:
.line 418
const/4 v1, 0x[B][COLOR="Red"]5[/COLOR][/B] [B][COLOR="Green"]<!--- You need to increase the arrays number here[/COLOR][/B]
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
so it will be:
Code:
.line 418
const/4 v1, 0x[B][COLOR="Blue"]6[/COLOR][/B]
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
- Now, above the newly modified "const/4 v1, 0x6" add these action lines:
Code:
new-instance [B][COLOR="Red"]v1[/COLOR][/B], Lcom/android/internal/policy/impl/GlobalActions$99;
const [B][COLOR="Red"]v2[/COLOR][/B], 0x10808ad
const [B][COLOR="Red"]v3[/COLOR][/B], 0x1040193
move-object/from16 [B][COLOR="Red"]v0, p0[/COLOR][/B]
invoke-direct {[B][COLOR="Red"]v1, v0, v2, v3[/COLOR][/B]}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 [B][COLOR="Red"]v0, p0[/COLOR][/B]
iput-object [B][COLOR="Red"]v1, v0[/COLOR][/B], Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[B][COLOR="Blue"]new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$SafeMode;
const v2, [COLOR="SeaGreen"]0x1080a98[/COLOR]
const v3, [COLOR="SeaGreen"]0x1040785[/COLOR]
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$SafeMode;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSafeMode:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR][/B]
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/GlobalActions;->onAirplaneModeChanged()V
.line 418
const/4 v1, 0x6
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
Here, the ids above are obtained from public.xml file from framework-res.apk. The first id will represent the image resource and the second id will represent the string resource (don't forget to omit the first 0).
Also pay attention to variables and parameters, it should be matched (the red v and p)
- Now we will add new array to show in power menu. So bellow modified "const/4 v1, 0x6" add new arrays to show after the last array:
Code:
.line 418
const/4 v1, 0x6
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
...
...
const/4 [B][COLOR="Red"]v2[/COLOR][/B], 0x4
move-object/from16 [B][COLOR="Red"]v0, p0[/COLOR][/B]
iget-object [B][COLOR="Red"]v3, v0[/COLOR][/B], Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object [B][COLOR="Red"]v3, v1, v2[/COLOR][/B]
[B][COLOR="Blue"]const/4 v2, 0x5
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSafeMode:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2[/COLOR][/B]
Again, you should match all variables and parameters (v and p values)
- Save changes.. smali (recompile)
Now push the finished framework-res.apk and android.policy.jar to framework folder in your device, fix permissions to 644 and reboot and viola you made it,,,
Pre-made mod:
You don't have technical skills to do all these complicated things..!! Here you can download the mod and flash it in your GT-N7000 device..
The mod is based on LT9 firmware and I suppose it will work on any LTx firmware increment number.
I have included:
- PM ScreenShot mod
- PM Safe mode reboot mod
- PM Fixed Hot reboot mod
- Volume rocker mod
All in one flashable file,, so what you are waiting for,, backup your phone and give it a try
Download
(md5 sum: 8f764c74e8ec63fc6072015668811fac)
Any ROM's developer can include this mod in his/her ROM without asking for permission, although small credit in the OP will be nice.. :good:
N.B: For toggle on and off of Power Menu addons, see post #3
Cheers,,
This is great
Adding Setting Toggle For Power Menu Addons
<< Adding Setting Toggle For Power Menu Addons >>​​
Let's increase the heat little bit..!! Do you want to add toggle to switch on and off the extra power menu addons like these pictures bellow:
OK let's start this extra step tutorial.. :victory:
I will assume you already add Safe Mode and Screenshot extra power menu addons..
1) android.policy.jar:
- Baksmali android.policy.jar
- Go to classout\com\android\internal\policy\impl folder
- Now, the truth is I didn't invent any new codes here, I traced one toggle-able power menu addon which is "accessibility", the tracing will take you into GlobalActions$3.smali, I opened it and I found this code in ".method public showConditional()Z"
Code:
.method public showConditional()Z
.registers 5
const/4 v0, 0x1
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/[B][COLOR="Red"]GlobalActions$3[/COLOR][/B];->this$0:Lcom/android/internal/policy/impl/GlobalActions;
# getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
move-result-object v2
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "[B][COLOR="Red"]power_key_hold[/COLOR][/B]"
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-ne v2, v0, :cond_15
:goto_14
return v0
:cond_15
move v0, v1
goto :goto_14
.end method
- So what you need to do is to open GlobalActions$SafeMode.smali and GlobalActions$ScreenCap.smali and change the method ".method public showConditional()Z" to the previous method mentioned above.
Note:
Don't forget to change GlobalActions$3 to the name of smali you are using (i.e, GlobalActions$SafeMode.smali or GlobalActions$ScreenCap.smali).
You need to put new key for referral in your modified smali instead of "power_key_hold"
Click to expand...
Click to collapse
So by the end, GlobalActions$SafeMode.smali method will be:
Code:
.method public showConditional()Z
.registers 5
const/4 v0, 0x1
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/[B][COLOR="Blue"]GlobalActions$SafeMode[/COLOR][/B];->this$0:Lcom/android/internal/policy/impl/GlobalActions;
# getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
move-result-object v2
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, [B][COLOR="Blue"]"pm_safe_mode"[/COLOR][/B]
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-ne v2, v0, :cond_15
:goto_14
return v0
:cond_15
move v0, v1
goto :goto_14
.end method
.method public showDuringKeyguard()Z
.registers 2
.prologue
.line 389
const/4 v0, 0x1
return v0
.end method
And GlobalActions$ScreenCap.smali method will be:
Code:
.method public showConditional()Z
.registers 5
const/4 v0, 0x1
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/[B][COLOR="Blue"]GlobalActions$ScreenCap[/COLOR][/B];->this$0:Lcom/android/internal/policy/impl/GlobalActions;
# getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
move-result-object v2
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, [B][COLOR="Blue"]"pm_screenshot"[/COLOR][/B]
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-ne v2, v0, :cond_15
:goto_14
return v0
:cond_15
move v0, v1
goto :goto_14
.end method
- Save changes .. and that's for android.policy.jar
2) SecSettings.apk:
- Decompile SecSettings.apk
- Go to res\values folder and open strings.xml file and add these new resources at the end before </resources>:
Code:
<string name="PM_Glory_addons">GloryROM Power Menu Addons</string>
<string name="pm_safe_mode_title">Safe Mode Reboot</string>
<string name="pm_screenshot_title">Take Screenshot</string>
<string name="pm_on">Toggle is Enabled</string>
<string name="pm_off">Toggle is Disabled</string>
- Go to res\xml and open display_settings.xml and add these lines on the place you your addon to appear later on on the device:
Code:
<PreferenceCategory android:title="@string/PM_Glory_addons" android:key="PM_Glory_settings" />
<CheckBoxPreference android:title="@string/pm_safe_mode_title" android:key="pm_safe_mode" android:defaultValue="true" android:summaryOn="@string/pm_on" android:summaryOff="@string/pm_off" />
<CheckBoxPreference android:title="@string/pm_screenshot_title" android:key="pm_screenshot" android:defaultValue="true" android:summaryOn="@string/pm_on" android:summaryOff="@string/pm_off" />
- Now for the smali source, go to classout\com\android\settings folder and open DisplaySettings.smali.. Also here, I didn't invent new codes, I used mult-windows toggle codes as reference..!! I will use Blue color for Safe Mode toggle codes and Green color for Screenshot toggle codes. Add these lines to [# instance fields] section:
Code:
[B][COLOR="Blue"].field private mSafeModePref:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Green"].field private mScreenShotPref:Landroid/preference/CheckBoxPreference;[/COLOR][/B]
- 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, "pm_safe_mode"
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;->mSafeModePref:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Green"]const-string v11, "pm_screenshot"
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;->mScreenShotPref:Landroid/preference/CheckBoxPreference;[/COLOR][/B]
- Now search for the method ".method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z" and search for ""multi_window_enabled"" to locate this part at the end:
Code:
.line 1021
: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_1c[/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 :goto_1c
:cond_177
move v1, v2
goto :goto_172
.end method
Add new codes before [.end method] in the previous section, so that section will be like this:
Code:
.line 1021
: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_SafeM[/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 :goto_1c
:cond_177
move v1, v2
goto :goto_172
[B][COLOR="Blue"]:cond_SafeM
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_ScSh
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref: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, "pm_safe_mode"
if-eqz v0, :cond_majdiSafe
:goto_njsafe
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1c
:cond_majdiSafe
move v1, v2
goto :goto_njsafe[/COLOR]
[B][COLOR="Green"]:cond_ScSh
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, [COLOR="Red"]:cond_1c[/COLOR]
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref: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, "pm_screenshot"
if-eqz v0, :cond_majdiSS
:goto_njSS
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1c
:cond_majdiSS
move v1, v2
goto :goto_njSS[/COLOR][/B][/B]
.end method
- Pay attention to the red color condition..!!!
- Now go to the next method ".method public onResume()V" and search for ""multi_window_enabled"" and locate this part:
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 this modification:
Code:
:cond_9d
sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z
if-eqz v0, [B][COLOR="Blue"]:cond_Safemajdi[/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"].line 1000
:cond_Safemajdi
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;
if-eqz v0, :cond_NewScSh
.line 1001
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "pm_safe_mode"
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_noSafe
const/4 v1, 0x1
goto :goto_yesSafe
:cond_noSafe
const/4 v1, 0x0
:goto_yesSafe
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR]
[COLOR="Green"].line 2000
:cond_NewScSh
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;
if-eqz v0, [COLOR="Red"]:cond_c1[/COLOR]
.line 2001
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "pm_screenshot"
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_noShot
const/4 v1, 0x1
goto :goto_yesShot
:cond_noShot
const/4 v1, 0x0
:goto_yesShot
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR][/B]
.line 850
:cond_c1
return-void
:cond_c2
move v0, v2
- Also pay attention to the red color condition..!!!
- Save changes.. and that's all
For DisplaySettings.smali, I will attach the smali before and after, so you could use it to understand well
Also, I will attach the modified GlobalActions$SafeMode.smali and GlobalActions$ScreenCap.smali
Have fun,,, :good:
Another great mod from u brother.
Thanks for your efforr
Sent from my GT-N7000 using xda premium
Thank you!!!!!!!! Very very great Mod! Thanks bro!
mjrifath said:
Another great mod from u brother.
Thanks for your efforr
Sent from my GT-N7000 using xda premium
Click to expand...
Click to collapse
BVB-Fan said:
Thank you!!!!!!!! Very very great Mod! Thanks bro!
Click to expand...
Click to collapse
Thanks for testing mates
Now my phone sometimes reboot is that a bug ?
BVB-Fan said:
Now my phone sometimes reboot is that a bug ?
Click to expand...
Click to collapse
It is fine here,,,
could you tell me how it gets reboot? Is it after opening the power menu, or opening any other application, so I can reproduce it if it is a bug to fix it.
Try wiping cache and dalvik cache in the moment..
This comes when I opened an application then my Note freeze for a moment and it restarts. I wiped the Cache but the same problem.
Now I flashed my Rom (LTA) again and the problem is solved :thumbup:
BVB-Fan said:
This comes when I opened an application then my Note freeze for a moment and it restarts. I wiped the Cache but the same problem.
Now I flashed my Rom (LTA) again and the problem is solved :thumbup:
Click to expand...
Click to collapse
I think the mod is working fine isn't it??
Thanks God,, I didn't sleep well since last time,, you just save me bro,, :good:
thank you majdinj great job (as usual). on xxlta works fine
asmanao said:
thank you majdinj great job (as usual). on xxlta works fine
Click to expand...
Click to collapse
Thanks for testing bro
Toggle on and off of Power Menu addons, see post #3
Yeh! Now I feel bad about using up the 2nd post.
majdinj said:
Toggle on and off of Power Menu addons, see post #3
Click to expand...
Click to collapse
Great work thanks for tutorials. Just one idea, is it possible to get other toggles on power menu like wifi?
Sent from my GT-N7000 using Tapatalk 4
nokiamodeln91 said:
Yeh! Now I feel bad about using up the 2nd post.
Click to expand...
Click to collapse
No Problem mate,, It is good like this,, I have no complain about it since I already have post #3,, I hope it is clear guide (I spent the whole day to do it, a lot of bootloop happened but I got it to work at the end..!!!! and finally it is here :laugh
kmokhtar79 said:
Great work thanks for tutorials. Just one idea, is it possible to get other toggles on power menu like wifi?
Sent from my GT-N7000 using Tapatalk 4
Click to expand...
Click to collapse
If you have smali resource then yes,,, The good thing about safe mode smali is, it is made by shell commands and if you look at power off GlobalAction smali, you will see it is done by shell command too,,, So here is the trick that I used to create safe mode smali.
I don't think the wifi is going to be the same,, but we have already the quick toggle for that (on the moment..!!)... I will see if I can locate the wifi onClick / onPress method
Yes Perfect! as always.
Nice Mod!!!
Is it possible to create an icon on the home screen to invoke power menu instead of long press on power button?
Thank You
can it works backwards?
hi i'm actually stuck on safe mode on mi S3 (i know this isn't the right site for my model) but i think that this may be a solution, is anyway posible that we can disable the safe mode from de ROM itself?
EMSpilot said:
Is it possible to create an icon on the home screen to invoke power menu instead of long press on power button?
Thank You
Click to expand...
Click to collapse
There is a way to add the lock button to the status bar or the pull down menu.. Search for it..

[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

Categories

Resources