hello guys
After long day
i got free time [emoji14]
Today i am going to share Switch settings and adv Dashboard customization
{
"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"
}
This mods Contain
Dashboard Settings
Dashboard Columns
Dashboard Title View
Dashboard Dividers
Dashboard Switches
Dashboard Custom Styles
Icon color
Title color
sub text color
catagory and title text resize
Click to expand...
Click to collapse
Firstly Follow this Guide Implement it ( post 1 and 2 )
If you failed to Implement the about Instructions... then dont try this too [emoji14]
Ok now come to point guys
1. Decompile Settings.apk
2. Open settings.apk/res/layout_land/dashboard_tile.xml
select all the code lines and replace with this
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:minHeight="@dimen/dashboard_tile_minimum_height"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="0.0dip" android:layout_weight="1.0">
<ImageView android:id="@+id/icon" android:layout_width="@dimen/dashboard_tile_image_size" android:layout_height="@dimen/dashboard_tile_image_size" android:scaleType="centerInside" android:layout_marginStart="@dimen/dashboard_tile_image_margin_start" android:layout_marginEnd="@dimen/dashboard_tile_image_margin_end" />
<RelativeLayout android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
<TextView android:textAppearance="@style/TextAppearance.TileTitle" android:ellipsize="marquee" android:id="@+id/title" android:fadingEdge="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" />
<TextView android:textAppearance="@style/TextAppearance.Small" android:textColor="?android:textColorSecondary" android:id="@+id/status" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/title" android:layout_alignStart="@android:id/title" />
</RelativeLayout>
<Switch android:id="@+id/dashboard_switch" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingEnd="@dimen/action_bar_switch_padding" />
</LinearLayout>
<View android:id="@+id/tile_divider" android:background="?android:dividerVertical" android:layout_width="fill_parent" android:layout_height="1.0dip" />
</LinearLayout>
</LinearLayout>
3. Open settings.apk/res/layout/dashboard_tile.xml
select all the code and replace with this code
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:minHeight="@dimen/dashboard_tile_minimum_height"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:id="@+id/icon" android:layout_width="@dimen/dashboard_tile_image_size" android:layout_height="@dimen/dashboard_tile_image_size" android:scaleType="centerInside" android:layout_marginStart="@dimen/dashboard_tile_image_margin_start" android:layout_marginEnd="@dimen/dashboard_tile_image_margin_end" />
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:gravity="center_vertical" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="0.0dip" android:layout_weight="1.0">
<RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
<Switch android:id="@+id/dashboard_switch" android:paddingRight="@dimen/action_bar_switch_padding" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" />
<TextView android:textAppearance="@style/TextAppearance.TileTitle" android:ellipsize="marquee" android:id="@+id/title" android:fadingEdge="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:layout_toStartOf="@+id/dashboard_switch" android:layout_alignParentStart="true" android:layout_alignParentEnd="false" />
<TextView android:textAppearance="@style/TextAppearance.Small" android:textColor="?android:textColorSecondary" android:id="@+id/status" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/title" android:layout_toStartOf="@+id/dashboard_switch" android:layout_alignStart="@android:id/title" android:layout_alignParentStart="true" />
</RelativeLayout>
</LinearLayout>
<View android:id="@+id/tile_divider" android:background="?android:dividerVertical" android:layout_width="fill_parent" android:layout_height="1.0dip" />
</LinearLayout>
</LinearLayout>
4. Open settings.apk/res/xml/dashboard_categories.xml
find this code
Code:
xmlns:android="http://schemas.android.com/apk/res/android" >
Replace with this
Code:
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
in the same xml find the lines with the id's wifi_settings and bluetooth_settings ( those lines will be one after other )
Replace those lines with this
Code:
<dashboard-tile android:icon="@drawable/ic_settings_wireless" android:id="@+id/wifi_settings" android:title="@string/wifi_settings_title" android:fragment="com.android.settings.wifi.WifiSettings" settings:switchClass="com.android.settings.wifi.WifiEnabler" />
<dashboard-tile android:icon="@drawable/ic_settings_bluetooth2" android:id="@+id/bluetooth_settings" android:title="@string/bluetooth_settings_title" android:fragment="com.android.settings.bluetooth.BluetoothSettings" settings:switchClass="com.android.settings.bluetooth.BluetoothEnabler" />
<dashboard-tile android:icon="@drawable/ic_settings_cellular" android:id="@+id/mobile_networks" android:title="@string/network_settings_title" settings:switchClass="com.android.settings.dashboard.MobileNetworksEnabler">
<intent android:targetPackage="com.android.phone" android:action="android.intent.action.MAIN" android:targetClass="com.android.phone.MobileNetworkSettings" />
</dashboard-tile>
5. Now Download this View attachment settings.apk.zip Merge into your settings
6. Compile and Decompile
Continued in Next post
Final
Time for Coding Part
1. After compile and Decompile
2. open Open Settings.apk\smali\com\android\settings\R$styleable.smali
look for
Code:
.field public static final CheckBoxPreference:[I
after that add this
Code:
.field public static final DashboardTile:[I
now look for this
Code:
sput-object v0, Lcom/android/settings/R$styleable;->IconPreferenceScreen:[I
after that add this
Code:
new-array v0, v3, [I
const v1, 0x7f010060 # compare with my id
aput v1, v0, v2
sput-object v0, Lcom/android/settings/R$styleable;->DashboardTile:[I
save and Close
3. Now open Settings.apk\smali\com\android\settings\settings.activity.smali
find this method
Code:
.method public static loadCategoriesFromResource(ILjava/util/List;Landroid/content/Context;)V
replace with this method
Code:
.method public static loadCategoriesFromResource(ILjava/util/List;Landroid/content/Context;)V
.locals 21
.annotation system Ldalvik/annotation/Signature;
value = {
"(I",
"Ljava/util/List",
"<",
"Lcom/android/settings/dashboard/DashboardCategory;",
">;",
"Landroid/content/Context;",
")V"
}
.end annotation
const/4 v13, 0x0
:try_start_0
invoke-virtual/range {p2 .. p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v18
move-object/from16 v0, v18
move/from16 v1, p0
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getXml(I)Landroid/content/res/XmlResourceParser;
move-result-object v13
invoke-static {v13}, Landroid/util/Xml;->asAttributeSet(Lorg/xmlpull/v1/XmlPullParser;)Landroid/util/AttributeSet;
move-result-object v2
:cond_0
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->next()I
move-result v17
const/16 v18, 0x1
move/from16 v0, v17
move/from16 v1, v18
if-eq v0, v1, :cond_1
const/16 v18, 0x2
move/from16 v0, v17
move/from16 v1, v18
if-ne v0, v1, :cond_0
:cond_1
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->getName()Ljava/lang/String;
move-result-object v11
const-string/jumbo v18, "dashboard-categories"
move-object/from16 v0, v18
invoke-virtual {v0, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v18
if-nez v18, :cond_3
new-instance v18, Ljava/lang/RuntimeException;
new-instance v19, Ljava/lang/StringBuilder;
invoke-direct/range {v19 .. v19}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v20, "XML document must start with <preference-categories> tag; found"
invoke-virtual/range {v19 .. v20}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v19
move-object/from16 v0, v19
invoke-virtual {v0, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v19
const-string/jumbo v20, " at "
invoke-virtual/range {v19 .. v20}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v19
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->getPositionDescription()Ljava/lang/String;
move-result-object v20
invoke-virtual/range {v19 .. v20}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v19
invoke-virtual/range {v19 .. v19}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v19
invoke-direct/range {v18 .. v19}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
throw v18
:try_end_0
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_0 .. :try_end_0} :catch_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:catch_0
move-exception v6
:try_start_1
new-instance v18, Ljava/lang/RuntimeException;
const-string/jumbo v19, "Error parsing categories"
move-object/from16 v0, v18
move-object/from16 v1, v19
invoke-direct {v0, v1, v6}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v18
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
:catchall_0
move-exception v18
if-eqz v13, :cond_2
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->close()V
:cond_2
throw v18
:cond_3
const/4 v4, 0x0
:try_start_2
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->getDepth()I
move-result v12
:cond_4
:goto_0
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->next()I
move-result v17
const/16 v18, 0x1
move/from16 v0, v17
move/from16 v1, v18
if-eq v0, v1, :cond_1b
const/16 v18, 0x3
move/from16 v0, v17
move/from16 v1, v18
if-ne v0, v1, :cond_5
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->getDepth()I
move-result v18
move/from16 v0, v18
if-le v0, v12, :cond_1b
:cond_5
const/16 v18, 0x3
move/from16 v0, v17
move/from16 v1, v18
if-eq v0, v1, :cond_4
const/16 v18, 0x4
move/from16 v0, v17
move/from16 v1, v18
if-eq v0, v1, :cond_4
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->getName()Ljava/lang/String;
move-result-object v11
const-string/jumbo v18, "dashboard-category"
move-object/from16 v0, v18
invoke-virtual {v0, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v18
if-eqz v18, :cond_1a
new-instance v3, Lcom/android/settings/dashboard/DashboardCategory;
invoke-direct {v3}, Lcom/android/settings/dashboard/DashboardCategory;-><init>()V
sget-object v18, Lcom/android/internal/R$styleable;->PreferenceHeader:[I
move-object/from16 v0, p2
move-object/from16 v1, v18
invoke-virtual {v0, v2, v1}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
move-result-object v14
const/16 v18, 0x1
const/16 v19, -0x1
move/from16 v0, v18
move/from16 v1, v19
invoke-virtual {v14, v0, v1}, Landroid/content/res/TypedArray;->getResourceId(II)I
move-result v18
move/from16 v0, v18
int-to-long v0, v0
move-wide/from16 v18, v0
move-wide/from16 v0, v18
iput-wide v0, v3, Lcom/android/settings/dashboard/DashboardCategory;->id:J
const/16 v18, 0x2
move/from16 v0, v18
invoke-virtual {v14, v0}, Landroid/content/res/TypedArray;->peekValue(I)Landroid/util/TypedValue;
move-result-object v16
if-eqz v16, :cond_6
move-object/from16 v0, v16
iget v0, v0, Landroid/util/TypedValue;->type:I
move/from16 v18, v0
const/16 v19, 0x3
move/from16 v0, v18
move/from16 v1, v19
if-ne v0, v1, :cond_6
move-object/from16 v0, v16
iget v0, v0, Landroid/util/TypedValue;->resourceId:I
move/from16 v18, v0
if-eqz v18, :cond_f
move-object/from16 v0, v16
iget v0, v0, Landroid/util/TypedValue;->resourceId:I
move/from16 v18, v0
move/from16 v0, v18
iput v0, v3, Lcom/android/settings/dashboard/DashboardCategory;->titleRes:I
:cond_6
:goto_1
invoke-virtual {v14}, Landroid/content/res/TypedArray;->recycle()V
sget-object v18, Lcom/android/internal/R$styleable;->Preference:[I
move-object/from16 v0, p2
move-object/from16 v1, v18
invoke-virtual {v0, v2, v1}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
move-result-object v14
const/16 v18, 0x6
move/from16 v0, v18
invoke-virtual {v14, v0}, Landroid/content/res/TypedArray;->peekValue(I)Landroid/util/TypedValue;
move-result-object v16
if-eqz v16, :cond_7
move-object/from16 v0, v16
iget v0, v0, Landroid/util/TypedValue;->type:I
move/from16 v18, v0
const/16 v19, 0x3
move/from16 v0, v18
move/from16 v1, v19
if-ne v0, v1, :cond_7
move-object/from16 v0, v16
iget v0, v0, Landroid/util/TypedValue;->resourceId:I
move/from16 v18, v0
if-eqz v18, :cond_10
move-object/from16 v0, v16
iget v0, v0, Landroid/util/TypedValue;->resourceId:I
move/from16 v18, v0
move-object/from16 v0, p2
move/from16 v1, v18
invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v18
move-object/from16 v0, v18
iput-object v0, v3, Lcom/android/settings/dashboard/DashboardCategory;->key:Ljava/lang/String;
:cond_7
:goto_2
invoke-virtual {v14}, Landroid/content/res/TypedArray;->recycle()V
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->getDepth()I
move-result v7
:cond_8
:goto_3
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->next()I
move-result v17
const/16 v18, 0x1
move/from16 v0, v17
move/from16 v1, v18
if-eq v0, v1, :cond_19
const/16 v18, 0x3
move/from16 v0, v17
move/from16 v1, v18
if-ne v0, v1, :cond_9
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->getDepth()I
move-result v18
move/from16 v0, v18
if-le v0, v7, :cond_19
:cond_9
const/16 v18, 0x3
move/from16 v0, v17
move/from16 v1, v18
if-eq v0, v1, :cond_8
const/16 v18, 0x4
move/from16 v0, v17
move/from16 v1, v18
if-eq v0, v1, :cond_8
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->getName()Ljava/lang/String;
move-result-object v9
const-string/jumbo v18, "dashboard-tile"
move-object/from16 v0, v18
invoke-virtual {v9, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v18
if-eqz v18, :cond_17
new-instance v15, Lcom/android/settings/dashboard/DashboardTile;
invoke-direct {v15}, Lcom/android/settings/dashboard/DashboardTile;-><init>()V
sget-object v18, Lcom/android/internal/R$styleable;->PreferenceHeader:[I
move-object/from16 v0, p2
move-object/from16 v1, v18
invoke-virtual {v0, v2, v1}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
move-result-object v14
const/16 v18, 0x1
const/16 v19, -0x1
move/from16 v0, v18
move/from16 v1, v19
invoke-virtual {v14, v0, v1}, Landroid/content/res/TypedArray;->getResourceId(II)I
move-result v18
move/from16 v0, v18
int-to-long v0, v0
move-wide/from16 v18, v0
move-wide/from16 v0, v18
iput-wide v0, v15, Lcom/android/settings/dashboard/DashboardTile;->id:J
const/16 v18, 0x2
move/from16 v0, v18
invoke-virtual {v14, v0}, Landroid/content/res/TypedArray;->peekValue(I)Landroid/util/TypedValue;
move-result-object v16
if-eqz v16, :cond_a
move-object/from16 v0, v16
iget v0, v0, Landroid/util/TypedValue;->type:I
move/from16 v18, v0
const/16 v19, 0x3
move/from16 v0, v18
move/from16 v1, v19
if-ne v0, v1, :cond_a
move-object/from16 v0, v16
iget v0, v0, Landroid/util/TypedValue;->resourceId:I
move/from16 v18, v0
if-eqz v18, :cond_11
move-object/from16 v0, v16
iget v0, v0, Landroid/util/TypedValue;->resourceId:I
move/from16 v18, v0
move/from16 v0, v18
iput v0, v15, Lcom/android/settings/dashboard/DashboardTile;->titleRes:I
:cond_a
:goto_4
const/16 v18, 0x3
move/from16 v0, v18
invoke-virtual {v14, v0}, Landroid/content/res/TypedArray;->peekValue(I)Landroid/util/TypedValue;
move-result-object v16
if-eqz v16, :cond_b
move-object/from16 v0, v16
iget v0, v0, Landroid/util/TypedValue;->type:I
move/from16 v18, v0
const/16 v19, 0x3
move/from16 v0, v18
move/from16 v1, v19
if-ne v0, v1, :cond_b
move-object/from16 v0, v16
iget v0, v0, Landroid/util/TypedValue;->resourceId:I
move/from16 v18, v0
if-eqz v18, :cond_12
move-object/from16 v0, v16
iget v0, v0, Landroid/util/TypedValue;->resourceId:I
move/from16 v18, v0
move/from16 v0, v18
iput v0, v15, Lcom/android/settings/dashboard/DashboardTile;->summaryRes:I
:cond_b
:goto_5
const/16 v18, 0x0
const/16 v19, 0x0
move/from16 v0, v18
move/from16 v1, v19
invoke-virtual {v14, v0, v1}, Landroid/content/res/TypedArray;->getResourceId(II)I
move-result v18
move/from16 v0, v18
iput v0, v15, Lcom/android/settings/dashboard/DashboardTile;->iconRes:I
const/16 v18, 0x4
move/from16 v0, v18
invoke-virtual {v14, v0}, Landroid/content/res/TypedArray;->getString(I)Ljava/lang/String;
move-result-object v18
move-object/from16 v0, v18
iput-object v0, v15, Lcom/android/settings/dashboard/DashboardTile;->fragment:Ljava/lang/String;
invoke-virtual {v14}, Landroid/content/res/TypedArray;->recycle()V
sget-object v18, Lcom/android/settings/R$styleable;->DashboardTile:[I
move-object/from16 v0, p2
move-object/from16 v1, v18
invoke-virtual {v0, v2, v1}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
move-result-object v14
const/16 v18, 0x0
move/from16 v0, v18
invoke-virtual {v14, v0}, Landroid/content/res/TypedArray;->getString(I)Ljava/lang/String;
move-result-object v18
move-object/from16 v0, v18
iput-object v0, v15, Lcom/android/settings/dashboard/DashboardTile;->switchControl:Ljava/lang/String;
invoke-virtual {v14}, Landroid/content/res/TypedArray;->recycle()V
if-nez v4, :cond_c
new-instance v4, Landroid/os/Bundle;
invoke-direct {v4}, Landroid/os/Bundle;-><init>()V
:cond_c
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->getDepth()I
move-result v8
:cond_d
:goto_6
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->next()I
move-result v17
const/16 v18, 0x1
move/from16 v0, v17
move/from16 v1, v18
if-eq v0, v1, :cond_15
const/16 v18, 0x3
move/from16 v0, v17
move/from16 v1, v18
if-ne v0, v1, :cond_e
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->getDepth()I
move-result v18
move/from16 v0, v18
if-le v0, v8, :cond_15
:cond_e
const/16 v18, 0x3
move/from16 v0, v17
move/from16 v1, v18
if-eq v0, v1, :cond_d
const/16 v18, 0x4
move/from16 v0, v17
move/from16 v1, v18
if-eq v0, v1, :cond_d
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->getName()Ljava/lang/String;
move-result-object v10
const-string/jumbo v18, "extra"
move-object/from16 v0, v18
invoke-virtual {v10, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v18
if-eqz v18, :cond_13
invoke-virtual/range {p2 .. p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v18
const-string/jumbo v19, "extra"
move-object/from16 v0, v18
move-object/from16 v1, v19
invoke-virtual {v0, v1, v2, v4}, Landroid/content/res/Resources;->parseBundleExtra(Ljava/lang/String;Landroid/util/AttributeSet;Landroid/os/Bundle;)V
invoke-static {v13}, Lcom/android/internal/util/XmlUtils;->skipCurrentTag(Lorg/xmlpull/v1/XmlPullParser;)V
:try_end_2
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_2 .. :try_end_2} :catch_0
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_1
.catchall {:try_start_2 .. :try_end_2} :catchall_0
goto :goto_6
:catch_1
move-exception v5
:try_start_3
new-instance v18, Ljava/lang/RuntimeException;
const-string/jumbo v19, "Error parsing categories"
move-object/from16 v0, v18
move-object/from16 v1, v19
invoke-direct {v0, v1, v5}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v18
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
:cond_f
:try_start_4
move-object/from16 v0, v16
iget-object v0, v0, Landroid/util/TypedValue;->string:Ljava/lang/CharSequence;
move-object/from16 v18, v0
move-object/from16 v0, v18
iput-object v0, v3, Lcom/android/settings/dashboard/DashboardCategory;->title:Ljava/lang/CharSequence;
goto/16 :goto_1
:cond_10
move-object/from16 v0, v16
iget-object v0, v0, Landroid/util/TypedValue;->string:Ljava/lang/CharSequence;
move-object/from16 v18, v0
invoke-interface/range {v18 .. v18}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;
move-result-object v18
move-object/from16 v0, v18
iput-object v0, v3, Lcom/android/settings/dashboard/DashboardCategory;->key:Ljava/lang/String;
goto/16 :goto_2
:cond_11
move-object/from16 v0, v16
iget-object v0, v0, Landroid/util/TypedValue;->string:Ljava/lang/CharSequence;
move-object/from16 v18, v0
move-object/from16 v0, v18
iput-object v0, v15, Lcom/android/settings/dashboard/DashboardTile;->title:Ljava/lang/CharSequence;
goto/16 :goto_4
:cond_12
move-object/from16 v0, v16
iget-object v0, v0, Landroid/util/TypedValue;->string:Ljava/lang/CharSequence;
move-object/from16 v18, v0
move-object/from16 v0, v18
iput-object v0, v15, Lcom/android/settings/dashboard/DashboardTile;->summary:Ljava/lang/CharSequence;
goto/16 :goto_5
:cond_13
const-string/jumbo v18, "intent"
move-object/from16 v0, v18
invoke-virtual {v10, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v18
if-eqz v18, :cond_14
invoke-virtual/range {p2 .. p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v18
move-object/from16 v0, v18
invoke-static {v0, v13, v2}, Landroid/content/Intent;->parseIntent(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;)Landroid/content/Intent;
move-result-object v18
move-object/from16 v0, v18
iput-object v0, v15, Lcom/android/settings/dashboard/DashboardTile;->intent:Landroid/content/Intent;
goto/16 :goto_6
:cond_14
invoke-static {v13}, Lcom/android/internal/util/XmlUtils;->skipCurrentTag(Lorg/xmlpull/v1/XmlPullParser;)V
goto/16 :goto_6
:cond_15
invoke-virtual {v4}, Landroid/os/Bundle;->size()I
move-result v18
if-lez v18, :cond_16
iput-object v4, v15, Lcom/android/settings/dashboard/DashboardTile;->fragmentArguments:Landroid/os/Bundle;
const/4 v4, 0x0
:cond_16
invoke-virtual {v3, v15}, Lcom/android/settings/dashboard/DashboardCategory;->addTile(Lcom/android/settings/dashboard/DashboardTile;)V
goto/16 :goto_3
:cond_17
const-string/jumbo v18, "external-tiles"
move-object/from16 v0, v18
invoke-virtual {v9, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v18
if-eqz v18, :cond_18
invoke-virtual {v3}, Lcom/android/settings/dashboard/DashboardCategory;->getTilesCount()I
move-result v18
move/from16 v0, v18
iput v0, v3, Lcom/android/settings/dashboard/DashboardCategory;->externalIndex:I
goto/16 :goto_3
:cond_18
invoke-static {v13}, Lcom/android/internal/util/XmlUtils;->skipCurrentTag(Lorg/xmlpull/v1/XmlPullParser;)V
goto/16 :goto_3
:cond_19
move-object/from16 v0, p1
invoke-interface {v0, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto/16 :goto_0
:cond_1a
invoke-static {v13}, Lcom/android/internal/util/XmlUtils;->skipCurrentTag(Lorg/xmlpull/v1/XmlPullParser;)V
:try_end_4
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_4 .. :try_end_4} :catch_0
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_1
.catchall {:try_start_4 .. :try_end_4} :catchall_0
goto/16 :goto_0
:cond_1b
if-eqz v13, :cond_1c
invoke-interface {v13}, Landroid/content/res/XmlResourceParser;->close()V
:cond_1c
return-void
.end method
Now compare IDS and replace or Use this Tool to replace by @loserskater
Compile and replace
Tada done.. ! easy than LP lol
Thanks to RR
Dont Forget to Mention me if you use my work
Good luck
Bro has some blank codes ... fixed please
Marília de Oliveira said:
Bro has some blank codes ... fixed please
Click to expand...
Click to collapse
Screenshot and logcat
Verstuurd vanaf mijn F8331 met Tapatalk
Pandemic said:
Screenshot and logcat
Verstuurd vanaf mijn F8331 met Tapatalk
Click to expand...
Click to collapse
Ghost code ???
Help me
Errors in compilation
Work on LP ROMs???
This mod was only working for me on my xperia m4 without the Switch for mobile Network, before i got fc.
In the first part Point 4 (Dashboard_categories.xml) i only used the first two rows of five (without ...Settings_cellular...).
Really great Mod, i love it.
venkat kamesh said:
Time for Coding Part
...
Good luck
Click to expand...
Click to collapse
@venkat kamesh (or anyone) - Don't know if anyone else even cares about MM anymore, but I wanted to try this mod on stock Settings for Z3c Mm, 291. I did the first part, (which is linked in op to a different thread to enable advanced rom control), and everything good. Kryptonian tile shows up in settings with example sub-settings, etc. So I decompile, change values in layout and xml, etc, recompile OK, then decompile and add small stuff, and use public id converter to create new SettingsActivity smali file. Replace file, recompile, everything OK, but settings fc. I don't know what I'm missing, but one thing I noticed is a reference in SettingsActivity code to an xml called 'security_settings_unencrypted_sdcrypt_support', id is 0x7f080046 in your public xml. This file doesn't exist in my stock Settings. Do you think that could be the problem? Should I just try to create a file, or maybe remove the lines that refer to it? Any other ideas?
If anyone's willing to debug a log, I'll post it. Thanks
Also, I wondered - the only thing changed in SettingsActivity is the one method, and there's no id references in there, (I don't think), so why the need for converting?
________
Tried again from scratch, just to make sure, and same result. I tried with converted and unconverted settingsactivity file...
________
Oh, nvm, I get it... Trying again...
venkat kamesh said:
Time for Coding Part
Good luck
Click to expand...
Click to collapse
OK, tried again and still fc. I converted all id's in smali files in settings apk zip manually, to make sure, (not sure if converting tool working right), and didn't convert anything in SettingsActivity smali, since nothing was added that had any I'd references, (sound right?). There were 2 references in dashboard smali files that I don't have in my public xml, so I added the lines in public xml, and made corresponding entries in ids xml, (sound right?).
Not sure what else to try. Any ideas?
levone1 said:
OK, tried again and still fc. I converted all id's in smali files in settings apk zip manually, to make sure, (not sure if converting tool working right), and didn't convert anything in SettingsActivity smali, since nothing was added that had any I'd references, (sound right?). There were 2 references in dashboard smali files that I don't have in my public xml, so I added the lines in public xml, and made corresponding entries in ids xml, (sound right?).
Not sure what else to try. Any ideas?
Click to expand...
Click to collapse
sorry just seen
for device and for what version you did this mod bro ?
venkat kamesh said:
sorry just seen
for device and for what version you did this mod bro ?
Click to expand...
Click to collapse
You missed me by 2 days. My Z3c just broke, and I'm using Xc now. As for your mod, was trying to get it going on my Z3c, (stock MM 6.0.1), but always fc. I've attempted 5 times, and I've double and triple checked the public ids and made sure all code is copied right. Compiles without error, but won't open. First part of the tut works fine, and kryp settings with example settings shows up in dashboard. Anyway, maybe I'll have a new Z3c sometime, and get back to you.
Thanks
Related
This has been updated. Check out the new thread: http://forum.xda-developers.com/showthread.php?t=2254022
Now includes checkbox in settings to enable and disable!
Thanks to jakubklos for his diff file and getting me in the right direction.
And a HUGE thanks to the CM team.
CODE IN RED IS NEW!
CODE IN BLUE IS MODIFIED!
Some of your lines/variables may be different.
I've attached the original and modified files so you can diff them yourself!
First, decompile SecSettings.apk. If you're unsure how to do that you're going to have some pretty big issues ahead.
Navigate to res/values/strings.xml
and add the following to the end:
Code:
<string name="volbtn_music_controls_title">Volume rocker music controls</string>
<string name="volbtn_music_controls_summary">When screen off, long-pressing the volume rockers will seek music tracks</string>
Next navigate to res/xml/sound_settings.xml
and add the section in red:
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/sound_settings" android:key="sound_settings"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<com.android.settings.RingerVolumePreference android:persistent="false" android:title="@string/all_volume_title" android:key="ring_volume" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/all_volume_title" android:streamType="ring" />
<com.android.settings.VibrationFeedbackPreference android:title="@string/vibration_intensity" android:key="vibration_feedback_intensity" android:summary="" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/vibration_intensity" />
<PreferenceScreen android:title="@string/phone_profile" android:key="phone_profile" android:summary="@string/normal" android:fragment="com.android.settings.phoneprofile.PhoneProfileSettings" />
<Preference android:title="@string/musicfx_title" android:key="musicfx">
<intent android:targetPackage="com.android.musicfx" android:targetClass="com.android.musicfx.ControlPanelPicker" />
</Preference>
<PreferenceCategory android:title="@string/sound_category_calls_and_notification_title" android:key="category_calls_and_notification" />
<PreferenceScreen android:title="@string/download_ringtones" android:key="download_ringtone" android:summary="">
<intent android:action="android.intent.action.VIEW" android:data="http://waprd.telstra.com/redirect?target=3glatesttones" />
</PreferenceScreen>
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/ringtone_title" android:key="ringtone" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/ringtone_title" android:ringtoneType="ringtone" />
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/voice_call_ringtone2" android:key="ringtone2" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/voice_call_ringtone2" android:ringtoneType="ringtone2" />
<PreferenceScreen android:title="@string/phone_vibration_title" android:key="phone_vibration" android:summary="@string/phone_vibration_summary" android:widgetLayout="@layout/round_more_icon">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.personalvibration.SelectPatternDialog" />
</PreferenceScreen>
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/notification_sound_title" android:key="notification_sound" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/notification_sound_dialog_title" android:ringtoneType="notification" />
<CheckBoxPreference android:persistent="false" android:title="@string/vibrate_on_ring_title" android:key="vibrate_when_ringing" />
<PreferenceCategory android:title="@string/sound_category_system_title" />
<CheckBoxPreference android:title="@string/dtmf_tone_enable_title" android:key="dtmf_tone" android:defaultValue="true" android:summaryOn="@string/dtmf_tone_enable_summary_on" android:summaryOff="@string/dtmf_tone_enable_summary_off" />
<CheckBoxPreference android:title="@string/sound_effects_enable_title" android:key="sound_effects" android:defaultValue="true" android:summaryOn="@string/sound_effects_enable_summary_on" android:summaryOff="@string/sound_effects_enable_summary_off" />
<CheckBoxPreference android:title="@string/lock_sounds_enable_title" android:key="lock_sounds" android:defaultValue="true" android:summaryOn="@string/lock_sounds_enable_summary_on" android:summaryOff="@string/lock_sounds_enable_summary_off" />
<CheckBoxPreference android:title="@string/gps_notification_sounds_title" android:key="gps_notification_sounds" />
<CheckBoxPreference android:title="@string/haptic_feedback_enable_title" android:key="haptic_feedback" android:defaultValue="true" android:summaryOn="@string/haptic_feedback_enable_summary_on" android:summaryOff="@string/haptic_feedback_enable_summary_off" />
<SwitchPreferenceScreen android:title="@string/auto_haptic" android:key="autohaptic_settings" android:fragment="com.android.settings.autohaptic.AutoHapticSettings" />
<ListPreference android:entries="@array/emergency_tone_entries" android:title="@string/emergency_tone_title" android:key="emergency_tone" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/emergency_tone_values" />
[COLOR="Red"]<CheckBoxPreference android:persistent="false" android:title="@string/volbtn_music_controls_title" android:key="volbtn_music_controls" android:summary="@string/volbtn_music_controls_summary" />[/COLOR]
</PreferenceScreen>
Now let's get into some smail.
Open up com/android/settings/SoundSettings.smali
Code:
.field private mSoundSettings:Landroid/preference/PreferenceGroup;
.field private mUnloadSoundEffectRunnable:Ljava/lang/Runnable;
.field private mVibrateWhenRinging:Landroid/preference/CheckBoxPreference;
[COLOR="red"].field private mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;[/COLOR]
.field private mVolume:Lcom/android/settings/RingerVolumePreference;
method onCreate:
Code:
const-string v18, "lockscreen_sounds_enabled"
const/16 v20, 0x1
move-object/from16 v0, v18
move/from16 v1, v20
invoke-static {v15, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v18
if-eqz v18, :cond_f
const/16 v18, 0x1
:goto_6
move-object/from16 v0, v19
move/from16 v1, v18
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 291
[COLOR="red"]const-string v18, "volbtn_music_controls"
move-object/from16 v0, p0
move-object/from16 v1, v18
invoke-virtual {v0, v1}, Lcom/android/settings/SoundSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v18
check-cast v18, Landroid/preference/CheckBoxPreference;
move-object/from16 v0, v18
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
move-object/from16 v18, v0
const/16 v19, 0x0
invoke-virtual/range {v18 .. v19}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
move-object/from16 v19, v0
const-string v18, "volbtn_music_controls"
const/16 v20, 0x1
move-object/from16 v0, v18
move/from16 v1, v20
invoke-static {v15, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v18
if-eqz v18, :cond_long
const/16 v18, 0x1
:goto_long
move-object/from16 v0, v19
move/from16 v1, v18
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR]
const-string v18, "ringtone"
move-object/from16 v0, p0
move-object/from16 v1, v18
invoke-virtual {v0, v1}, Lcom/android/settings/SoundSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
Code:
:cond_d
const/16 v18, 0x0
goto/16 :goto_4
.line 280
:cond_e
const/16 v18, 0x0
goto/16 :goto_5
.line 288
:cond_f
const/16 v18, 0x0
goto/16 :goto_6
[COLOR="red"]:cond_long
const/16 v18, 0x0
goto/16 :goto_long[/COLOR]
.line 315
.restart local v17 #vibrator:Landroid/os/Vibrator;
:cond_11
invoke-virtual/range {p0 .. p0}, Lcom/android/settings/SoundSettings;->getActivity()Landroid/app/Activity;
move-result-object v18
invoke-static/range {v18 .. v18}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z
method onPreferenceTreeClick:
Code:
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mLockSounds:Landroid/preference/CheckBoxPreference;
invoke-virtual {v4}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_e
:goto_8
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1
:cond_e
move v0, v1
goto :goto_8
.line 640
:cond_f
[COLOR="red"]iget-object v2, p0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
if-ne p2, v2, :cond_next
.line 637
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "volbtn_music_controls"
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
invoke-virtual {v4}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_long
:goto_long
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1
:cond_long
move v0, v1
goto :goto_long
:cond_next[/COLOR]
iget-object v0, p0, Lcom/android/settings/SoundSettings;->mMusicFx:Landroid/preference/Preference;
if-ne p2, v0, :cond_0
goto/16 :goto_2
.end method
Now recompile SecSettings and the setting should be there. It won't do anything though.
Next we need to decompile android.policy.jar.
First file is com\android\internal\policy\impl\PhoneWindowManager$PolicyHandler.smali
Add another switch statement:
Code:
:pswitch_4
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
#calls: Lcom/android/internal/policy/impl/PhoneWindowManager;->enableSPenGesture()V
invoke-static {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->access$300(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
goto :goto_0
[COLOR="red"]:pswitch_5
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;
check-cast v0, Landroid/view/KeyEvent;
invoke-virtual {v1, v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->dispatchMediaKeyWithWakeLockToAudioService(Landroid/view/KeyEvent;)V
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;
check-cast v0, Landroid/view/KeyEvent;
const/16 v3, 0x01
invoke-static {v0, v3}, Landroid/view/KeyEvent;->changeAction(Landroid/view/KeyEvent;I)Landroid/view/KeyEvent;
move-result-object v0
invoke-virtual {v1, v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->dispatchMediaKeyWithWakeLockToAudioService(Landroid/view/KeyEvent;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
const/4 v2, 0x1
iput-boolean v2, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
goto :goto_0[/COLOR]
.line 828
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
:pswitch_1
:pswitch_2
:pswitch_3
:pswitch_4
[COLOR="red"]:pswitch_5[/COLOR]
.end packed-switch
.end method
Next: com\android\internal\policy\impl\PhoneWindowManager$SettingsObserver.smali
method observe:
Code:
const-string v1, "incall_power_button_behavior"
invoke-static {v1}, Landroid/provider/Settings$Secure;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
[COLOR="red"]const-string v1, "volbtn_music_controls"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V[/COLOR]
.line 878
const-string v1, "accelerometer_rotation"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
Next: com\android\internal\policy\impl\PhoneWindowManager.smali
Code:
.field static final LONG_PRESS_POWER_NOTHING:I = 0x0
.field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2
[COLOR="Red"].field private static final LONG_PRESS_TIMEOUT:I = 0x190[/COLOR]
.field static final MINI_APP_DIALOG_LAYER:I = 0x5
.field static final MINI_APP_LAYER:I = 0x3
Code:
.field private mIsSensorhubEnabled:Z
.field private mIsVisibleSPenGestureView:Z
[COLOR="red"].field mIsVolumeAction:Z
.field mIsVolumeBlocking:Z[/COLOR]
.field mKeyboardTapVibePattern:[J
.field mKeyguard:Landroid/view/WindowManagerPolicy$WindowState;
Code:
.field mVoiceTalkDefaultLaunch:Z
.field mVoiceTalkIntent:Landroid/content/Intent;
[COLOR="red"].field mVolBtnMusicControls:I[/COLOR]
.field private mVolumeDownKeyConsumedByScreenshotChord:Z
method handleVolumeKey:
Code:
.method handleVolumeKey(II)V
.locals 5
[COLOR="red"]move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-nez v0, :cond_vc[/COLOR]
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getAudioService()Landroid/media/IAudioService;
move-result-object v0
if-nez v0, :cond_0
.line 4898
[COLOR="Red"]:cond_vc[/COLOR]
:goto_0
return-void
.line 4875
:cond_0
Add the following after the above method handleVolumeKey
Code:
[COLOR="Red"].method handleVolumeLongPress(Landroid/view/KeyEvent;)V
.locals 11
.parameter "event"
.prologue
const/4 v7, 0x0
.line 26
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
.line 27
iput-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
.line 28
invoke-virtual {p1}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v0
const/16 v1, 0x18
if-ne v0, v1, :cond_0
.line 29
const/16 v6, 0x57
.line 30
.local v6, newKeyCode:I
:goto_0
iget-object v9, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
const/4 v10, 0x6
.line 31
new-instance v0, Landroid/view/KeyEvent;
invoke-virtual {p1}, Landroid/view/KeyEvent;->getDownTime()J
move-result-wide v1
invoke-virtual {p1}, Landroid/view/KeyEvent;->getEventTime()J
move-result-wide v3
invoke-virtual {p1}, Landroid/view/KeyEvent;->getAction()I
move-result v5
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;->(JJIII)V
.line 30
invoke-virtual {v9, v10, v0}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;
move-result-object v8
.line 32
.local v8, msg:Landroid/os/Message;
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
sget v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->LONG_PRESS_TIMEOUT:I
int-to-long v1, v1
invoke-virtual {v0, v8, v1, v2}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z
.line 33
return-void
.line 29
.end local v6 #newKeyCode:I
.end local v8 #msg:Landroid/os/Message;
:cond_0
const/16 v6, 0x58
goto :goto_0
.end method
.method handleVolumeLongPressAbort()V
.locals 2
.prologue
.line 36
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
.line 37
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
const/4 v1, 0x6
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V
.line 38
return-void
.end method[/COLOR]
method interceptKeyBeforeQueueing:
This one's kind of hard to find so here's some extra lines before and after:
Code:
.line 5201
const/16 v23, 0x0
move/from16 v0, v23
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownKeyConsumedByScreenshotChord:Z
.line 5202
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingPowerKeyAction()V
.line 5203
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingScreenrecordChordAction()V
.line 5204
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->interceptScreenshotChord()V
.line 5246
:cond_1a
:goto_8
if-eqz v5, [COLOR="Blue"]:cond_long[/COLOR]
.line 5247
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getTelephonyService()Lcom/android/internal/telephony/ITelephony;
move-result-object v22
.line 5248
.local v22, telephonyService:Lcom/android/internal/telephony/ITelephony;
if-eqz v22, :cond_20
.line 5250
:try_start_0
invoke-interface/range {v22 .. v22}, Lcom/android/internal/telephony/ITelephony;->isRinging()Z
Code:
const-string v23, "WindowManager"
const-string v24, "ITelephony threw RemoteException"
move-object/from16 v0, v23
move-object/from16 v1, v24
invoke-static {v0, v1, v6}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
.line 5333
.end local v6 #ex:Landroid/os/RemoteException;
:cond_20
move-object/from16 v0, p0
[COLOR="Red"]iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenOnEarly:Z
if-nez v0, :cond_reg
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
move-result v21
if-eqz v21, :cond_reg
const/16 v1, 0x1
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
if-ne v0, v1, :cond_reg
move-object/from16 v0, p0
move-object/from16 v1, p1
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(Landroid/view/KeyEvent;)V
:cond_reg
move-object/from16 v0, p0[/COLOR]
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-nez v23, :cond_1
and a couple lines down:
Code:
move-object/from16 v23, v0
invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_2
.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Blue"]:cond_long[/COLOR]
[COLOR="Red"]if-nez v5, :cond_vc
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_vc
const/16 v1, 0x1
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
if-ne v0, v1, :cond_vc
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_vc
move-object/from16 v0, p0
const/4 v3, 0x0
invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_vc[/COLOR]
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-eqz v23, :cond_1
method updateSettings:
Code:
const-string v19, "incall_power_button_behavior"
const/16 v20, 0x1
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v9
[COLOR="red"]const-string v19, "volbtn_music_controls"
const/16 v20, 0x0
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3[/COLOR]
.line 2006
const-string v19, "user_rotation"
Code:
iput v6, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mEndcallBehavior:I
.line 2028
move-object/from16 v0, p0
iput v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIncallPowerBehavior:I
[COLOR="red"]move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I[/COLOR]
.line 2030
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUserRotation:I
Newer Firmwares:(Sprint 4.1.2 MR2, etc.)
com\android\internal\policy\impl\PhoneWindowManager.smali
We need to edit one of the sections in method interceptKeyBeforeQueueing.
Remove the code in purple and add the code in green.
Code:
move-object/from16 v23, v0
invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_2
.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Blue"]:cond_long[/COLOR]
[COLOR="Red"]if-nez v5, :cond_vc
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_vc
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_vc
move-object/from16 v0, p0
const/4 v3, 0x0
[COLOR="Purple"]invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V[/COLOR]
[COLOR="Green"]iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
move-object/from16 v0, v23
invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->handleVolume(II)V[/COLOR]
:cond_vc[/COLOR]
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-eqz v23, :cond_1
com\android\internal\policy\impl\PhoneWindowManager$SamsungVolumeControlThread.smali
method handleVolume:
Code:
.method handleVolume(II)V
.locals 6
[COLOR="Red"]iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-nez v0, :cond_vc[/COLOR]
iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-object v3, v3, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const-string v4, "audio"
invoke-virtual {v3, v4}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/media/AudioManager;
if-nez v0, :cond_0
[COLOR="red"]:cond_vc[/COLOR]
:goto_0
return-void
:cond_0
:try_start_0
invoke-virtual {v0}, Landroid/media/AudioManager;->dismissVolumePanel()V
sparse-switch p2, :sswitch_data_0
goto :goto_0
ISSUES:
Pressing volume up or down both turn the volume down(or up):
Looking at a little bit more from the last entry:
Code:
move-object/from16 v23, v0
invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_2
.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Blue"]:cond_long[/COLOR]
[COLOR="Red"]if-nez v5, :cond_vc
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_vc
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_vc
move-object/from16 v0, p0
const/4 v3, 0x0
invoke-virtual {v0, v3, [COLOR="orange"]v15[/COLOR]}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_vc[/COLOR]
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-eqz v23, :cond_1
.line 5342
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
move-object/from16 v0, v23
invoke-virtual {v0, [COLOR="Orange"]v15[/COLOR], v5, v4}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->updateInfo(IZZ)V
Pull the variable in orange from the last line and replace the variable in line
Code:
invoke-virtual {v0, v3, [COLOR="orange"]v15[/COLOR]}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
Make sure you're not replacing the last line with anything, but using it as reference.
Cool
Sent from my SAMSUNG-SGH-I747 using xda app-developers app
This is great! made the changes and everything is running great.
Sent you a donation, Cheers! have a beer on me *Happy New Year!*
Thanks for all your hard work it is much appreciated
enewman17 said:
This is great! made the changes and everything is running great.
Sent you a donation, Cheers! have a beer on me *Happy New Year!*
Thanks for all your hard work it is much appreciated
Click to expand...
Click to collapse
Did you use the cond's in green? Or did you just replace the file?
loserskater said:
Did you use the cond's in green? Or did you just replace the file?
Click to expand...
Click to collapse
I did not use the cond's in green, I manually made the changes excluding them.
I am curious now if it will work using those cond's I will try it later. I'm just so happy you were able to get it working! and well!
I had problems compiling it with apktool after I made the changes, but doing it manually worked and now apktool will compile and decompile without error. I don't get it.
I've only tested it with the stock player and google play music and it works perfectly. I don't use anything else so i didn't test.
enewman17 said:
I did not use the cond's in green, I manually made the changes excluding them.
I am curious now if it will work using those cond's I will try it later. I'm just so happy you were able to get it working! and well!
I had problems compiling it with apktool after I made the changes, but doing it manually worked and now apktool will compile and decompile without error. I don't get it.
I've only tested it with the stock player and google play music and it works perfectly. I don't use anything else so i didn't test.
Click to expand...
Click to collapse
What showed up with apktool? It's possible you missed a cond somewhere...
loserskater said:
What showed up with apktool? It's possible you missed a cond somewhere...
Click to expand...
Click to collapse
I don't remember, something like false value blah blah...
I diff'ed the the files using win merge and they are exactly the same. It's not the first time it's happened to me seem's like it's the way notepad++ saves the file... maybe.... I had more problems using getdiz as a text editor. I don't know maybe it's me. But I do know it works.
When I changed the sound file in the SecContacts to get rid of the water drop sound from the dial pad I could not get apktool to compile it for the life of me, If I put the original sound back, apktool worked. Used manual commands and poof it worked like some sort of fairy magic. It was really starting to annoy me, but persistence pays off. Now apktool will decompile and compile my modded SecContacts with no problem. Also had the same problem when editing the SecPhone to get rid of the increasing ringtone. Same false value error. did it manually and it worked but I kind of figured it would happen cause that mod is kind of hacky to begin with, I didn't delete the lines for that mod, but rather omitted those lines with a #
Thanks for sharing man. Works great with both att and tmo!:good:
Thanks! Will be trying this soon.
First of all, thank you for this Tutorial. I'll try it now since a few hours, but it won't recompile. I'll tried it with the green ones and without it. Apktool gives me this errors:
I: Checking whether sources has changed...
I: Smaling...
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
: [email protected]
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:64)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:48)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:35)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:243)
at brut.androlib.Androlib.buildSources(Androlib.java:200)
at brut.androlib.Androlib.build(Androlib.java:191)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
Drücken Sie eine beliebige Taste . . .
Maybe someone have an idea. Thank you (=
hells
hellsgod said:
First of all, thank you for this Tutorial. I'll try it now since a few hours, but it won't recompile. I'll tried it with the green ones and without it. Apktool gives me this errors:
I: Checking whether sources has changed...
I: Smaling...
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
: [email protected]
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:64)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:48)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:35)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:243)
at brut.androlib.Androlib.buildSources(Androlib.java:200)
at brut.androlib.Androlib.build(Androlib.java:191)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
Drücken Sie eine beliebige Taste . . .
Maybe someone have an idea. Thank you (=
hells
Click to expand...
Click to collapse
I had trouble too, if your sure the changes you made are right you'll have to take the android.policy and manually decompile the dex file make the changes and recompile it again using smali commands. It should work and not give you any errors just using smali and baksmali
noob question here, Will this be avaliable in a flashable form? Im not familiar with decompiling but would really love this feature on my current rom
best thing to do when working with smalis is to drag the classes.dex out of the apk file such as systemui.apk & secsettings.apk and so forth and use a baksmali/smali tool and it'll decompile just the smalis rather then the whole apk and then causing a fuss later when compiling it.. Once thats done compile the classes.dex with ur edits done and then drag it back to apk & push to system and profit ..
svfreddy said:
noob question here, Will this be avaliable in a flashable form? Im not familiar with decompiling but would really love this feature on my current rom
Click to expand...
Click to collapse
I'll make a couple flashable zips for lk4 and lk3
loserskater said:
I'll make a couple flashable zips for lk4 and lk3
Click to expand...
Click to collapse
Thanks!!
Sent from my SPH-L710 using xda app-developers app
Thanks, I fixed ours using this in the Sprint section (here).
But just an FYI, I used WinMerge to check diff's between your org and mod, and it looks like you changed a bunch of :cond's towards the end which was unnecessary.
Here is the last part that is needed to change:
http://i16.photobucket.com/albums/b38/Migs351/first_zps538afb44.jpg
And here is where some of the unnecessary changes are:
http://i16.photobucket.com/albums/b38/Migs351/second_zps05e5de7c.jpg
For some reason you increased all the :cond's by 2, which doesn't actually change anything, as this is just a "label" for the if statements to goto if the statement returns true.
Just thought I'd point that out.
But other than that, nice job! No more need for those extra files. Simple code modification.
I'm curious though, for my own sanity anyways, what's the main difference here between the this mod and the original mod. (which didn't work, properly, in JB) I know the original one sent the MEDIA_NEXT and MEDIA_PREVIOUS keys to the system, and this was getting interpreted incorrectly and being sent to the default Media Player, regardless of what currently had Audio Focus.
What does this one use as it's method of changing the tracks, something more direct, or does it tap into another type of Media key?
I could go through the code and figure it out, but I'm too lazy right now.
Unknownforce said:
Thanks, I fixed ours using this in the Sprint section (here).
But just an FYI, I used WinMerge to check diff's between your org and mod, and it looks like you changed a bunch of :cond's towards the end which was unnecessary.
Here is the last part that is needed to change:
http://i16.photobucket.com/albums/b38/Migs351/first_zps538afb44.jpg
And here is where some of the unnecessary changes are:
http://i16.photobucket.com/albums/b38/Migs351/second_zps05e5de7c.jpg
For some reason you increased all the :cond's by 2, which doesn't actually change anything, as this is just a "label" for the if statements to goto if the statement returns true.
Just thought I'd point that out.
But other than that, nice job! No more need for those extra files. Simple code modification.
I'm curious though, for my own sanity anyways, what's the main difference here between the this mod and the original mod. (which didn't work, properly, in JB) I know the original one sent the MEDIA_NEXT and MEDIA_PREVIOUS keys to the system, and this was getting interpreted incorrectly and being sent to the default Media Player, regardless of what currently had Audio Focus.
What does this one use as it's method of changing the tracks, something more direct, or does it tap into another type of Media key?
I could go through the code and figure it out, but I'm too lazy right now.
Click to expand...
Click to collapse
Here from the Sprint GS III forums as unknownforce was able to convert your work to function for us Sprint folks. Just wanted to say thank you loserskater for your hard work on this and for getting this working. I have been waiting for this forever since upgrading to 4.1
Thanks loserskater and also thanks unknownforce,
Whiteice
Unknownforce said:
Thanks, I fixed ours using this in the Sprint section (here).
But just an FYI, I used WinMerge to check diff's between your org and mod, and it looks like you changed a bunch of :cond's towards the end which was unnecessary.
Here is the last part that is needed to change:
http://i16.photobucket.com/albums/b38/Migs351/first_zps538afb44.jpg
And here is where some of the unnecessary changes are:
http://i16.photobucket.com/albums/b38/Migs351/second_zps05e5de7c.jpg
For some reason you increased all the :cond's by 2, which doesn't actually change anything, as this is just a "label" for the if statements to goto if the statement returns true.
Just thought I'd point that out.
But other than that, nice job! No more need for those extra files. Simple code modification.
I'm curious though, for my own sanity anyways, what's the main difference here between the this mod and the original mod. (which didn't work, properly, in JB) I know the original one sent the MEDIA_NEXT and MEDIA_PREVIOUS keys to the system, and this was getting interpreted incorrectly and being sent to the default Media Player, regardless of what currently had Audio Focus.
What does this one use as it's method of changing the tracks, something more direct, or does it tap into another type of Media key?
I could go through the code and figure it out, but I'm too lazy right now.
Click to expand...
Click to collapse
That's why I added the conds in green so you don't have to change all of the ones after. But if you add the 21 and 22 you'll have multiple instances which throws errors when trying to compile.
The difference between this and the previous mod is that sending the media button presses would send an ordered broadcast and the app with the highest priority would take the broadcast and see if it needed it and then pass it along if it didn't. Well must audio apps haven't been updated to use this method. And if you changed it to just broadcast instead of offered all media players would get the broadcast do you'd have a bunch of apps trying to all play music. This uses private apis that that only the system can use and it's the same method the lockscreen controls use which is controlled by the audio service instead of broadcasts. I hope that all makes sense
loserskater said:
That's why I added the conds in green so you don't have to change all of the ones after. But if you add the 21 and 22 you'll have multiple instances which throws errors when trying to compile.
The difference between this and the previous mod is that sending the media button presses would send an ordered broadcast and the app with the highest priority would take the broadcast and see if it needed it and then pass it along if it didn't. Well must audio apps haven't been updated to use this method. And if you changed it to just broadcast instead of offered all media players would get the broadcast do you'd have a bunch of apps trying to all play music. This uses private apis that that only the system can use and it's the same method the lockscreen controls use which is controlled by the audio service instead of broadcasts. I hope that all makes sense
Click to expand...
Click to collapse
Oh! Yeah, the "named" method should work for most compilers, I don't see why it wouldn't, but I got it now.
Makes perfect sense, thanks for explaining. This makes for a much cleaner and friendlier method of doing it too, nice.
Is this only for Touchwiz?
This new version will allow users to select timeout and what each volume button can do.
We're going to be working with the following two files:
SecSettings.apk
android.policy.jar
KEY
REMOVE what's in BLUE
ADD what's in RED
Issues
Play will not work if the device is in deep sleep.
I'm looking into a way to allow volume buttons to wake the device from deep sleep but at the moment the only way is a custom kernel.
SecSettings.apk
Navigate to /res/values/arrays.xml
Add the following to the end of the file
Code:
<string-array name="volbtn_action_entries">
<item>Next</item>
<item>Pause</item>
<item>Play</item>
<item>Play/Pause</item>
<item>Previous</item>
<item>Stop</item>
</string-array>
<string-array name="volbtn_action_values">
<item>87</item>
<item>127</item>
<item>126</item>
<item>85</item>
<item>88</item>
<item>86</item>
</string-array>
<string-array name="volbtn_timeout_entries">
<item>100ms</item>
<item>150ms</item>
<item>200ms</item>
<item>250ms</item>
<item>300ms</item>
<item>350ms</item>
<item>400ms</item>
<item>450ms</item>
<item>500ms</item>
</string-array>
<string-array name="volbtn_timeout_values">
<item>100</item>
<item>150</item>
<item>200</item>
<item>250</item>
<item>300</item>
<item>350</item>
<item>400</item>
<item>450</item>
<item>500</item>
</string-array>
Navigate to /res/values/strings.xml
Add the following to the end of the file
Code:
<string name="volbtn_toggle_title">Music Control</string>
<string name="volbtn_vol_up_title">Volume Up action</string>
<string name="volbtn_vol_up_summary">%s</string>
<string name="volbtn_vol_down_title">Volume Down action</string>
<string name="volbtn_vol_down_summary">%s</string>
Navigate to /xml/sound_settings.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/sound_settings" android:key="sound_settings"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<com.android.settings.RingerVolumePreference android:persistent="false" android:title="@string/all_volume_title" android:key="ring_volume" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/all_volume_title" android:streamType="ring" />
<com.android.settings.VibrationFeedbackPreference android:title="@string/vibration_intensity" android:key="vibration_feedback_intensity" android:summary="" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/vibration_intensity" />
<PreferenceScreen android:title="@string/phone_profile" android:key="phone_profile" android:summary="@string/normal" android:fragment="com.android.settings.phoneprofile.PhoneProfileSettings" />
<Preference android:title="@string/musicfx_title" android:key="musicfx">
<intent android:targetPackage="com.android.musicfx" android:targetClass="com.android.musicfx.ControlPanelPicker" />
</Preference>
<PreferenceCategory android:title="@string/sound_category_calls_and_notification_title" android:key="category_calls_and_notification" />
<PreferenceScreen android:title="@string/download_ringtones" android:key="download_ringtone" android:summary="">
<intent android:action="android.intent.action.VIEW" android:data="http://waprd.telstra.com/redirect?target=3glatesttones" />
</PreferenceScreen>
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/ringtone_title" android:key="ringtone" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/ringtone_title" android:ringtoneType="ringtone" />
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/voice_call_ringtone2" android:key="ringtone2" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/voice_call_ringtone2" android:ringtoneType="ringtone2" />
<PreferenceScreen android:title="@string/phone_vibration_title" android:key="phone_vibration" android:summary="@string/phone_vibration_summary" android:widgetLayout="@layout/round_more_icon">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.personalvibration.SelectPatternDialog" />
</PreferenceScreen>
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/notification_sound_title" android:key="notification_sound" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/notification_sound_dialog_title" android:ringtoneType="notification" />
<CheckBoxPreference android:persistent="false" android:title="@string/vibrate_on_ring_title" android:key="vibrate_when_ringing" />
<PreferenceCategory android:title="@string/sound_category_system_title" />
<CheckBoxPreference android:title="@string/dtmf_tone_enable_title" android:key="dtmf_tone" android:defaultValue="true" android:summaryOn="@string/dtmf_tone_enable_summary_on" android:summaryOff="@string/dtmf_tone_enable_summary_off" />
<CheckBoxPreference android:title="@string/sound_effects_enable_title" android:key="sound_effects" android:defaultValue="true" android:summaryOn="@string/sound_effects_enable_summary_on" android:summaryOff="@string/sound_effects_enable_summary_off" />
<CheckBoxPreference android:title="@string/lock_sounds_enable_title" android:key="lock_sounds" android:defaultValue="true" android:summaryOn="@string/lock_sounds_enable_summary_on" android:summaryOff="@string/lock_sounds_enable_summary_off" />
<CheckBoxPreference android:title="@string/gps_notification_sounds_title" android:key="gps_notification_sounds" />
<CheckBoxPreference android:title="@string/haptic_feedback_enable_title" android:key="haptic_feedback" android:defaultValue="true" android:summaryOn="@string/haptic_feedback_enable_summary_on" android:summaryOff="@string/haptic_feedback_enable_summary_off" />
<SwitchPreferenceScreen android:title="@string/auto_haptic" android:key="autohaptic_settings" android:fragment="com.android.settings.autohaptic.AutoHapticSettings" />
<ListPreference android:entries="@array/emergency_tone_entries" android:title="@string/emergency_tone_title" android:key="emergency_tone" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/emergency_tone_values" />
[COLOR="Red"]<SwitchPreferenceScreen android:title="@string/volbtn_toggle_title" android:key="volbtn_music_controls" android:fragment="com.android.settings.VolBtnSettings" />[/COLOR]
</PreferenceScreen>
Navigate to /smali/com/android/settings/SoundSettings.smali
Code:
.field private mUnloadSoundEffectRunnable:Ljava/lang/Runnable;
.field private mVibrateWhenRinging:Landroid/preference/CheckBoxPreference;
[COLOR="red"].field private mVolBtnMusicCtrl:Landroid/preference/SwitchPreferenceScreen;[/COLOR]
.field private mVolume:Lcom/android/settings/RingerVolumePreference;
method private updateState(Z)V
Code:
:cond_0
:goto_0
return-void
.line 521
:cond_1
iget-object v1, p0, Lcom/android/settings/SoundSettings;->mAudioManager:Landroid/media/AudioManager;
invoke-virtual {v1}, Landroid/media/AudioManager;->getRingerMode()I
move-result v8
.line 522
.local v8, ringerMode:I
[COLOR="red"]iget-object v1, p0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/SwitchPreferenceScreen;
if-eqz v1, :cond_next
iget-object v2, p0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/SwitchPreferenceScreen;
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v9, "volbtn_music_controls"
invoke-static {v1, v9, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-eqz v1, :cond_vol
move v1, v3
:goto_vol
invoke-virtual {v2, v1}, Landroid/preference/SwitchPreferenceScreen;->setChecked(Z)V
:cond_next[/COLOR]
const-string v1, "CTC"
const-string v2, "ro.csc.sales_code"
invoke-static {v2}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;
move-result-object v2
invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
Code:
iget-object v1, p0, Lcom/android/settings/SoundSettings;->mPhoneProfile:Landroid/preference/Preference;
const-string v2, "profile_name"
invoke-interface {v7, v2}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
move-result v2
invoke-interface {v7, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;
move-result-object v2
invoke-virtual {v1, v2}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
.line 539
invoke-interface {v7}, Landroid/database/Cursor;->close()V
goto/16 :goto_2
[COLOR="red"]:cond_vol
move v1, v4
goto/16 :goto_vol[/COLOR]
.end method
method public onCreate(Landroid/os/BundleV
Code:
const-string v18, "autohaptic_settings"
move-object/from16 v0, p0
move-object/from16 v1, v18
invoke-virtual {v0, v1}, Lcom/android/settings/SoundSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v18
check-cast v18, Landroid/preference/SwitchPreferenceScreen;
move-object/from16 v0, v18
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/settings/SoundSettings;->mAutoHaptic:Landroid/preference/SwitchPreferenceScreen;
.line 296
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/settings/SoundSettings;->mAutoHaptic:Landroid/preference/SwitchPreferenceScreen;
move-object/from16 v18, v0
move-object/from16 v0, v18
move-object/from16 v1, p0
invoke-virtual {v0, v1}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[COLOR="red"]const-string v18, "volbtn_music_controls"
move-object/from16 v0, p0
move-object/from16 v1, v18
invoke-virtual {v0, v1}, Lcom/android/settings/SoundSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v18
check-cast v18, Landroid/preference/SwitchPreferenceScreen;
move-object/from16 v0, v18
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/SwitchPreferenceScreen;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/SwitchPreferenceScreen;
move-object/from16 v18, v0
move-object/from16 v0, v18
move-object/from16 v1, p0
invoke-virtual {v0, v1}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V[/COLOR]
.line 298
const-string v18, "phone_vibration"
move-object/from16 v0, p0
move-object/from16 v1, v18
invoke-virtual {v0, v1}, Lcom/android/settings/SoundSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v18
move-object/from16 v0, v18
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/settings/SoundSettings;->mPhoneVibration:Landroid/preference/Preference;
.method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/ObjectZ
Code:
const-string v9, "SoundSettings"
new-instance v10, Ljava/lang/StringBuilder;
invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V
const-string v11, "onPreferenceChange : "
invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v10
invoke-virtual {v10, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v10
invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v10
invoke-static {v9, v10}, Landroid/util/secutil/Log;->secV(Ljava/lang/String;Ljava/lang/String;)I
.line 653
[COLOR="red"]const-string v9, "volbtn_music_controls"
invoke-virtual {v9, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v9
if-eqz v9, :cond_next
check-cast p2, Ljava/lang/Boolean;
invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z
move-result v9
if-eqz v9, :cond_vol
const/4 v6, 0x1
:goto_vol
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v7
const-string v9, "volbtn_music_controls"
invoke-static {v7, v9, v6}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_1
:cond_vol
const/4 v6, 0x0
goto :goto_vol
:cond_next[/COLOR]
const-string v9, "emergency_tone"
invoke-virtual {v9, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v9
if-eqz v9, :cond_3
.line 655
:try_start_0
check-cast p2, Ljava/lang/String;
.end local p2
Now download the zip attached to this post and copy into your SecSettings folder.
You need compile and decompile so we can get some ID's.
Navigate to /smali/com/android/settings/VolBtnSettings.smali
And look for the commented (#) sections and replace the ID's with the ones in /res/values/public.xml
Now compile and move on to android.policy.jar.
android.policy.jar
4.3
See here: http://forum.xda-developers.com/showpost.php?p=49617297&postcount=49
<4.3
Navigate to /smali/com/android/internal/policy/impl/PhoneWindowManager$PolicyHandler.smali
Code:
:pswitch_4
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
#calls: Lcom/android/internal/policy/impl/PhoneWindowManager;->enableSPenGesture()V
invoke-static {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->access$300(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
goto :goto_0
[COLOR="red"]:pswitch_5
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;
check-cast v0, Landroid/view/KeyEvent;
invoke-virtual {v1, v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->dispatchMediaKeyWithWakeLockToAudioService(Landroid/view/KeyEvent;)V
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;
check-cast v0, Landroid/view/KeyEvent;
const/16 p1, 0x1
invoke-static {v0, p1}, Landroid/view/KeyEvent;->changeAction(Landroid/view/KeyEvent;I)Landroid/view/KeyEvent;
move-result-object v0
invoke-virtual {v1, v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->dispatchMediaKeyWithWakeLockToAudioService(Landroid/view/KeyEvent;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
const/4 p0, 0x1
iput-boolean p0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
goto :goto_0[/COLOR]
.line 828
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
:pswitch_1
:pswitch_2
:pswitch_3
:pswitch_4
[COLOR="Red"]:pswitch_5[/COLOR]
.end packed-switch
.end method
Navigate to /smali/com/android/internal/policy/impl/PhoneWindowManager$SettingsObserver.smali
.method observe()V
Code:
const-string v1, "incall_power_button_behavior"
invoke-static {v1}, Landroid/provider/Settings$Secure;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
[COLOR="red"]const-string v1, "volbtn_music_controls"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
const-string v1, "volbtn_timeout"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
const-string v1, "volbtn_vol_up"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
const-string v1, "volbtn_vol_down"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V[/COLOR]
.line 878
const-string v1, "accelerometer_rotation"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
Navigate to /smali/com/android/internal/policy/impl/PhoneWindowManager.smali
Code:
.field private mIsSensorhubEnabled:Z
.field private mIsVisibleSPenGestureView:Z
[COLOR="red"].field mIsVolumeAction:Z
.field mIsVolumeBlocking:Z[/COLOR]
.field mKeyboardTapVibePattern:[J
.field mKeyguard:Landroid/view/WindowManagerPolicy$WindowState;
Code:
.field mVoiceTalkDefaultLaunch:Z
.field mVoiceTalkIntent:Landroid/content/Intent;
[COLOR="red"].field mVolBtnMusicControls:I
.field mVolBtnTimeout:I
.field mVolBtnVolDown:I
.field mVolBtnVolUp:I[/COLOR]
.field private mVolumeDownKeyConsumedByScreenshotChord:Z
.field private mVolumeDownKeyTime:J
.method handleVolumeKey(II)V
Code:
.method handleVolumeKey(II)V
.locals 5
.parameter "stream"
.parameter "keycode"
.prologue
.line 4866
[COLOR="red"]move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-nez v0, :cond_vol[/COLOR]
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getAudioService()Landroid/media/IAudioService;
move-result-object v0
.line 4867
.local v0, audioService:Landroid/media/IAudioService;
if-nez v0, :cond_0
.line 4898
[COLOR="red"]:cond_vol[/COLOR]
:goto_0
return-void
.line 4875
:cond_0
:try_start_0
Add the following methods after handleVolumeKey
Code:
.method handleVolumeLongPress(Landroid/view/KeyEvent;)V
.locals 11
.parameter "event"
.prologue
const/4 v7, 0x0
.line 26
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
.line 27
iput-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
.line 28
invoke-virtual {p1}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v0
const/16 v1, 0x18
if-ne v0, v1, :cond_0
.line 29
iget v6, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnVolUp:I
.line 30
.local v6, newKeyCode:I
:goto_0
iget-object v9, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
const/4 v10, 0x6
.line 31
new-instance v0, Landroid/view/KeyEvent;
invoke-virtual {p1}, Landroid/view/KeyEvent;->getDownTime()J
move-result-wide v1
invoke-virtual {p1}, Landroid/view/KeyEvent;->getEventTime()J
move-result-wide v3
invoke-virtual {p1}, Landroid/view/KeyEvent;->getAction()I
move-result v5
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;-><init>(JJIII)V
.line 30
invoke-virtual {v9, v10, v0}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;
move-result-object v8
.line 32
.local v8, msg:Landroid/os/Message;
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnTimeout:I
int-to-long v1, v1
invoke-virtual {v0, v8, v1, v2}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z
.line 33
return-void
.line 29
.end local v6 #newKeyCode:I
.end local v8 #msg:Landroid/os/Message;
:cond_0
iget v6, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnVolDown:I
goto :goto_0
.end method
.method handleVolumeLongPressAbort()V
.locals 2
.prologue
.line 36
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
.line 37
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
const/4 v1, 0x6
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V
.line 38
return-void
.end method
.method public interceptKeyBeforeQueueing(Landroid/view/KeyEvent;IZ)I
Code:
const/16 v23, 0x1
move/from16 v0, v23
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownKeyTriggered:Z
.line 5200
invoke-virtual/range {p1 .. p1}, Landroid/view/KeyEvent;->getDownTime()J
move-result-wide v23
move-wide/from16 v0, v23
move-object/from16 v2, p0
iput-wide v0, v2, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownKeyTime:J
.line 5201
const/16 v23, 0x0
move/from16 v0, v23
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownKeyConsumedByScreenshotChord:Z
.line 5202
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingPowerKeyAction()V
.line 5203
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingScreenrecordChordAction()V
.line 5204
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->interceptScreenshotChord()V
.line 5246
:cond_1a
:goto_8
[COLOR="red"]if-eqz v5, :cond_long[/COLOR]
.line 5247
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getTelephonyService()Lcom/android/internal/telephony/ITelephony;
move-result-object v22
.line 5248
.local v22, telephonyService:Lcom/android/internal/telephony/ITelephony;
if-eqz v22, :cond_20
.line 5250
:try_start_0
invoke-interface/range {v22 .. v22}, Lcom/android/internal/telephony/ITelephony;->isRinging()Z
move-result v23
if-eqz v23, :cond_20
Code:
:catch_0
move-exception v6
.line 5283
.local v6, ex:Landroid/os/RemoteException;
const-string v23, "WindowManager"
const-string v24, "ITelephony threw RemoteException"
move-object/from16 v0, v23
move-object/from16 v1, v24
invoke-static {v0, v1, v6}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
.line 5333
.end local v6 #ex:Landroid/os/RemoteException;
:cond_20
move-object/from16 v0, p0
[COLOR="red"]iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenOnEarly:Z
if-nez v0, :cond_next
const/16 v1, 0x1
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
if-ne v0, v1, :cond_next
invoke-virtual/range {p1 .. p1}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v0
const/16 v1, 0x18
if-ne v0, v1, :cond_temp1
const/16 v1, 0x55
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnVolUp:I
if-eq v0, v1, :cond_temp
:cond_temp1
invoke-virtual/range {p1 .. p1}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v0
const/16 v1, 0x18
if-ne v0, v1, :cond_temp2
const/16 v1, 0x7E
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnVolUp:I
if-eq v0, v1, :cond_temp
:cond_temp2
invoke-virtual/range {p1 .. p1}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v0
const/16 v1, 0x19
if-ne v0, v1, :cond_temp3
const/16 v1, 0x55
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnVolDown:I
if-eq v0, v1, :cond_temp
:cond_temp3
invoke-virtual/range {p1 .. p1}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v0
const/16 v1, 0x19
if-ne v0, v1, :cond_temp4
const/16 v1, 0x7E
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnVolDown:I
if-eq v0, v1, :cond_temp
:cond_temp4
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
move-result v21
if-eqz v21, :cond_next
:cond_temp
move-object/from16 v0, p0
move-object/from16 v1, p1
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(Landroid/view/KeyEvent;)V
:cond_next
move-object/from16 v0, p0[/COLOR]
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-nez v23, :cond_1
.line 5334
new-instance v23, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
Code:
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_2
.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Red"]:cond_long
if-nez v5, :cond_next1
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_next1
const/16 v1, 0x1
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
if-ne v0, v1, :cond_next1
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_next1
move-object/from16 v0, p0
const/4 v3, 0x0
invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_next1[/COLOR]
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-eqz v23, :cond_1
.method public updateSettings()V
Code:
const-string v19, "incall_power_button_behavior"
const/16 v20, 0x1
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v9
[COLOR="red"]const-string v19, "volbtn_music_controls"
const/16 v20, 0x0
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
const-string v19, "volbtn_timeout"
const/16 v20, 0x190
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnTimeout:I
const-string v19, "volbtn_vol_up"
const/16 v20, 0x57
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnVolUp:I
const-string v19, "volbtn_vol_down"
const/16 v20, 0x58
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnVolDown:I[/COLOR]
.line 2006
.local v9, incallPowerBehavior:I
const-string v19, "user_rotation"
const/16 v20, 0x0
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v17
That's it. Compile and test!
Newer Firmwares:(Sprint 4.1.2 MR2, etc.)
com\android\internal\policy\impl\PhoneWindowManager.smali
We need to edit one of the sections in method interceptKeyBeforeQueueing.
Remove the code in purple and add the code in green.
Code:
move-object/from16 v23, v0
invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_2
.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Red"]:cond_long
if-nez v5, :cond_next1
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_next1
const/16 v1, 0x1
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
if-ne v0, v1, :cond_next1
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_next1
move-object/from16 v0, p0
const/4 v3, 0x0
[COLOR="Purple"]invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V[/COLOR]
[COLOR="Green"]iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
move-object/from16 v0, v23
invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->handleVolume(II)V[/COLOR]
:cond_vc[/COLOR]
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-eqz v23, :cond_1
com\android\internal\policy\impl\PhoneWindowManager$SamsungVolumeControlThread.smali
method handleVolume:
Code:
.method handleVolume(II)V
.locals 6
[COLOR="Red"]iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-nez v0, :cond_vc[/COLOR]
iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-object v3, v3, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const-string v4, "audio"
invoke-virtual {v3, v4}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/media/AudioManager;
if-nez v0, :cond_0
[COLOR="red"]:cond_vc[/COLOR]
:goto_0
return-void
:cond_0
:try_start_0
invoke-virtual {v0}, Landroid/media/AudioManager;->dismissVolumePanel()V
sparse-switch p2, :sswitch_data_0
goto :goto_0
Very nice!
You're on fire bro!
upndwn4par said:
Very nice!
You're on fire bro!
Click to expand...
Click to collapse
Thanks. Got one more how-to coming up and then time to figure out what else I can tweak.
C:\apktool>apktool b SecSettings
I: Checking whether sources has changed...
I: Smaling...
[996,4] Label cond_2 has multiple defintions.
[935,16] Label "cond_next" is not defined.
[939,4] mismatched tree node: I_STATEMENT_FORMAT35c_METHOD expecting I_CATCHES
[941,4] mismatched tree node: I_STATEMENT_FORMAT11x expecting <UP>
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
: C:\apktool\SecSettings\smali\com\android\settings\SoundSettings.smali
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:66)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:257)
at brut.androlib.Androlib.buildSources(Androlib.java:214)
at brut.androlib.Androlib.build(Androlib.java:205)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Which cond i missing.....
Mr0lala said:
C:\apktool>apktool b SecSettings
I: Checking whether sources has changed...
I: Smaling...
[996,4] Label cond_2 has multiple defintions.
[935,16] Label "cond_next" is not defined.
[939,4] mismatched tree node: I_STATEMENT_FORMAT35c_METHOD expecting I_CATCHES
[941,4] mismatched tree node: I_STATEMENT_FORMAT11x expecting <UP>
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
: C:\apktool\SecSettings\smali\com\android\settings\SoundSettings.smali
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:66)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:257)
at brut.androlib.Androlib.buildSources(Androlib.java:214)
at brut.androlib.Androlib.build(Androlib.java:205)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Which cond i missing.....
Click to expand...
Click to collapse
I fixed the first two issues. You just have to change the :cond_2 at the bottom of the first section under udpateState to :cond_next
The code above the ".method public updateSettings()V" code tags doesn't have any red markers... It's hard to tell what to use and where it goes
EDIT:
This code:
Code:
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_2
.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
:cond_long
if-nez v5, :cond_next1
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_next1
const/16 v1, 0x1
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
if-ne v0, v1, :cond_next1
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_next1
move-object/from16 v0, p0
const/4 v3, 0x0
invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_next1
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-eqz v23, :cond_1
Without this in the right place, the volume buttons do nothing.
Kryten2k35 said:
The code above the ".method public updateSettings()V" code tags doesn't have any red markers... It's hard to tell what to use and where it goes
EDIT:
This code:
Code:
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_2
.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
:cond_long
if-nez v5, :cond_next1
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_next1
const/16 v1, 0x1
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
if-ne v0, v1, :cond_next1
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_next1
move-object/from16 v0, p0
const/4 v3, 0x0
invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_next1
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-eqz v23, :cond_1
Without this in the right place, the volume buttons do nothing.
Click to expand...
Click to collapse
Sorry, it's supposed to be from :cond_long to :cond_next1, but now that I think about it, I believe you're supposed to take the :cond_xx that you replace with long and use that instead of next1. Totally goofed that section. I'll check when I get to my computer.
Sent from my SAMSUNG-SGH-I747
Good stuff anyways mate
I've got the long kill stuff working how I want it. Take your time with this stuff, you do a great job!
On .method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/ObjectZ: seem you have some wrong with goto :goto_1
And in VolBtnSettings.smali file, type="xml" name="volbtn_settings" seem you forgot it in strings.xml
Kryten2k35 said:
Good stuff anyways mate
I've got the long kill stuff working how I want it. Take your time with this stuff, you do a great job!
Click to expand...
Click to collapse
Alright, fixed that section. It was that part that I said and you can use it how it is.
Mr0lala said:
On .method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/ObjectZ: seem you have some wrong with goto :goto_1
And in VolBtnSettings.smali file, type="xml" name="volbtn_settings" seem you forgot it in strings.xml
Click to expand...
Click to collapse
the goto :goto_1 is supposed to be there. It's supposed to go to the return statement. Look through onPreferenceChange for something like this:
Code:
:cond_2
:goto_1
return v8
Your value may be different. Like v7, v16, etc. just look for "return".
You can change the goto :goto_1 to whatever is directly above return v8.
I totally forgot a file. I updated the zip in the OP, but you can just add the file attached to /res/xml. Make sure you rename the extension to volbtn_settings.xml
Then compile and decompile and you should see it in the public.xml.
I'm trying to add this to the AllianceROM ROM Control, but when I tap the Switch Preference it doesn't do anything
I've changed the package name inside the smali file form com.android.settings to com.ficeto.customsettings.VoltBtnSettings and also adjusted the ID's in the smali as per the guide, but it doesn't execute :/
Any ideas would be appreciated
I abandoned the diea of using the smali file provided and just used the xml.
So far, it works, but it doesn't want to turn off. The vol up and down and timeout stuff works and changes nicely, but the switch for on/off doesn't have any affect.
I've tried redoing this a number of times and it simply doesn't want to work for me.
In it's current state, it no longer even uses pause or play... just skip.
I'm uploading two files...
One is my final attempt at v3.0 (I'm starting to go crazy looking at these files) I did have pause and so on working. But now it's just not.
One is the v2.0 that works ok for me right now.
Kryten2k35 said:
I've tried redoing this a number of times and it simply doesn't want to work for me.
In it's current state, it no longer even uses pause or play... just skip.
I'm uploading two files...
One is my final attempt at v3.0 (I'm starting to go crazy looking at these files) I did have pause and so on working. But now it's just not.
One is the v2.0 that works ok for me right now.
Click to expand...
Click to collapse
First, replace your handleVolumeLongPress method with the one in the OP. It's different.
Look at around line 20980 of PhoneWindowManager.smali and remove the lines in red
Code:
move-object/from16 v0, p0
iput v7, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mEndcallBehavior:I
move-object/from16 v0, p0
iput v10, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIncallPowerBehavior:I
[COLOR="Red"]move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I[/COLOR]
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUserRotation:I
move/from16 v20, v0
Let me know if that fixes the toggle setting not having any effect. If it doesn't fix it, post your settings and I'll see if I can find anything.
Thanks I'll give that a crack now. As I said, been at this all night. Think my eyes are crossing
EDIT:
That was exactly what I needed
The handleVolumeLongPress will be why pause stopped working for me ( ) and it looks like removing that last line was also the problem with the on/off setting!
Do you think that was because I was moving from v2.0?
Thanks for taking the time to check out my files and come up with something!
Kryten2k35 said:
Thanks I'll give that a crack now. As I said, been at this all night. Think my eyes are crossing
EDIT:
That was exactly what I needed
The handleVolumeLongPress will be why pause stopped working for me ( ) and it looks like removing that last line was also the problem with the on/off setting!
Do you think that was because I was moving from v2.0?
Thanks for taking the time to check out my files and come up with something!
Click to expand...
Click to collapse
Yeah, I moved those lines to make things easier. Glad you got everything working! Make sure you read the note about using play when the device is in deep sleep
Sent from my SAMSUNG-SGH-I747
i got it working great mostly on the verizon note2. only thing that seems to be kinda buggy for me is it seems the volume is still attached to the skipping of tracks ex. if u go backwards it lowers volume and if u go forwards it makes volume higher. also the standalone play and pause dont work but the dual play/pause do work. play and stop work as well though soo its kinda weird. if u get a chance would u mind taking a peek at my files in android.policy? im pretty certain the settings.apk is 100% correct.
ps sorry for the pm's i just saw your signature
here are my phonewindowmanager files for version3
https://dl.dropboxusercontent.com/u/59757245/PhoneWindowManager.zip
beanstown106 said:
i got it working great mostly on the verizon note2. only thing that seems to be kinda buggy for me is it seems the volume is still attached to the skipping of tracks ex. if u go backwards it lowers volume and if u go forwards it makes volume higher. also the standalone play and pause dont work but the dual play/pause do work. play and stop work as well though soo its kinda weird. if u get a chance would u mind taking a peek at my files in android.policy? im pretty certain the settings.apk is 100% correct.
ps sorry for the pm's i just saw your signature
here are my phonewindowmanager files for version3
https://dl.dropboxusercontent.com/u/59757245/PhoneWindowManager.zip
Click to expand...
Click to collapse
I added a section to the 2nd post regarding newer firmwares. I believe that should fix your issue.
loserskater said:
I added a section to the 2nd post regarding newer firmwares. I believe that should fix your issue.
Click to expand...
Click to collapse
thanks bud appreciate it a bunch
hello guys
Here go i come with new tut today
which i got from awesome cataclysm rom and cyanogenmod
So i dont want to kill all your time
i will explain you very simple way
For MM version of Tut Click here
All you need is
android.policy.jar ( deodexed )
settings.apk (deodexed )
1. Decompile android.policy.jar
2. open com/android/internal/policy/impl/PhoneWindowManager.smali
3. look for this method
Code:
.method public updateSettings()V
completely replace with this method
Code:
.method public updateSettings()V
.locals 24
.prologue
.line 1923
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v10
.line 1924
.local v10, "resolver":Landroid/content/ContentResolver;
const/4 v11, 0x0
.line 1925
.local v11, "updateRotation":Z
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLock:Ljava/lang/Object;
move-object/from16 v16, v0
monitor-enter v16
.line 1926
:try_start_0
const-string v15, "end_button_behavior"
const/16 v17, 0x2
const/16 v18, -0x2
move/from16 v0, v17
move/from16 v1, v18
invoke-static {v10, v15, v0, v1}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v15
move-object/from16 v0, p0
iput v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mEndcallBehavior:I
.line 1553
const-string v15, "incall_power_button_behavior"
const/16 v17, 0x1
const/16 v18, -0x2
move/from16 v0, v17
move/from16 v1, v18
invoke-static {v10, v15, v0, v1}, Landroid/provider/Settings$Secure;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v15
move-object/from16 v0, p0
iput v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIncallPowerBehavior:I
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v15
const v17, 0x1050012
move/from16 v0, v17
invoke-virtual {v15, v0}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v4
.line 1936
.local v4, "navBarDefaultHeight":I
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v15
const v17, 0x1050014
move/from16 v0, v17
invoke-virtual {v15, v0}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v5
.local v5, "navBarDefaultWidth":I
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v15
const-string v17, "navigation_bar_height"
const/16 v18, 0x64
move-object/from16 v0, v17
move/from16 v1, v18
invoke-static {v15, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v15
mul-int/2addr v15, v4
div-int/lit8 v6, v15, 0x64
.local v6, "navBarHeight":I
sub-int v15, v4, v5
sub-int v7, v6, v15
.local v7, "navBarWidth":I
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v15
const-string v17, "resize_only_portrait"
const/16 v18, 0x0
move-object/from16 v0, v17
move/from16 v1, v18
invoke-static {v15, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v15
const/16 v17, 0x1
move/from16 v0, v17
if-ne v15, v0, :cond_7
const/4 v9, 0x1
.line 1939
.local v9, "resizeOnlyPortrait":Z
:goto_0
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarHeightForRotation:[I
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPortraitRotation:I
move/from16 v17, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarHeightForRotation:[I
move-object/from16 v18, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUpsideDownRotation:I
move/from16 v19, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarHeightForRotation:[I
move-object/from16 v20, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLandscapeRotation:I
move/from16 v21, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarHeightForRotation:[I
move-object/from16 v22, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSeascapeRotation:I
move/from16 v23, v0
aput v6, v22, v23
aput v6, v20, v21
aput v6, v18, v19
aput v6, v15, v17
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPortraitRotation:I
move/from16 v17, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v18, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUpsideDownRotation:I
move/from16 v19, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v20, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLandscapeRotation:I
move/from16 v21, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v22, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSeascapeRotation:I
move/from16 v23, v0
if-eqz v9, :cond_8
.end local v5 # "navBarDefaultWidth":I
:goto_1
aput v5, v22, v23
aput v5, v20, v21
aput v5, v18, v19
aput v5, v15, v17
.line 1588
const-string v15, "wake_gesture_enabled"
const/16 v17, 0x0
const/16 v18, -0x2
move/from16 v0, v17
move/from16 v1, v18
invoke-static {v10, v15, v0, v1}, Landroid/provider/Settings$Secure;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v15
if-eqz v15, :cond_b
const/4 v14, 0x1
.line 1591
.local v14, "wakeGestureEnabledSetting":Z
:goto_2
move-object/from16 v0, p0
iget-boolean v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWakeGestureEnabledSetting:Z
if-eq v15, v14, :cond_0
.line 1940
move-object/from16 v0, p0
iput-boolean v14, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWakeGestureEnabledSetting:Z
.line 1941
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->updateWakeGestureListenerLp()V
.line 1945
:cond_0
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v17
const-string v15, "user_rotation"
const/16 v17, 0x0
const/16 v18, -0x2
move/from16 v0, v17
move/from16 v1, v18
invoke-static {v10, v15, v0, v1}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v12
.line 1948
.local v12, "userRotation":I
move-object/from16 v0, p0
iget v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUserRotation:I
if-eq v15, v12, :cond_1
.line 1949
move-object/from16 v0, p0
iput v12, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUserRotation:I
.line 1950
const/4 v11, 0x1
.line 1952
:cond_1
const-string v15, "accelerometer_rotation"
const/16 v17, 0x0
const/16 v18, -0x2
move/from16 v0, v17
move/from16 v1, v18
invoke-static {v10, v15, v0, v1}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v15
if-eqz v15, :cond_e
const/4 v13, 0x0
.line 1956
.local v13, "userRotationMode":I
:goto_3
move-object/from16 v0, p0
iget v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUserRotationMode:I
if-eq v15, v13, :cond_2
.line 1957
move-object/from16 v0, p0
iput v13, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUserRotationMode:I
.line 1958
const/4 v11, 0x1
.line 1959
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->updateOrientationListenerLp()V
.line 1962
:cond_2
move-object/from16 v0, p0
iget-boolean v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemReady:Z
if-eqz v15, :cond_3
.line 1963
const-string v15, "pointer_location"
const/16 v17, 0x0
const/16 v18, -0x2
move/from16 v0, v17
move/from16 v1, v18
invoke-static {v10, v15, v0, v1}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v8
.line 1965
.local v8, "pointerLocation":I
move-object/from16 v0, p0
iget v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPointerLocationMode:I
if-eq v15, v8, :cond_3
.line 1966
move-object/from16 v0, p0
iput v8, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPointerLocationMode:I
.line 1967
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
move-object/from16 v17, v0
if-eqz v8, :cond_f
const/4 v15, 0x1
:goto_4
move-object/from16 v0, v17
invoke-virtual {v0, v15}, Landroid/os/Handler;->sendEmptyMessage(I)Z
.end local v8 # "pointerLocation":I
:cond_3
const-string v15, "screen_off_timeout"
const/16 v17, 0x0
const/16 v18, -0x2
move/from16 v0, v17
move/from16 v1, v18
invoke-static {v10, v15, v0, v1}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v15
move-object/from16 v0, p0
iput v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLockScreenTimeout:I
.line 1974
const-string v15, "default_input_method"
const/16 v17, -0x2
move/from16 v0, v17
invoke-static {v10, v15, v0}, Landroid/provider/Settings$Secure;->getStringForUser(Landroid/content/ContentResolver;Ljava/lang/String;I)Ljava/lang/String;
move-result-object v3
.line 1976
.local v3, "imId":Ljava/lang/String;
if-eqz v3, :cond_10
invoke-virtual {v3}, Ljava/lang/String;->length()I
move-result v15
if-lez v15, :cond_10
const/4 v2, 0x1
.line 1977
.local v2, "hasSoftInput":Z
:goto_5
move-object/from16 v0, p0
iget-boolean v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHasSoftInput:Z
if-eq v15, v2, :cond_4
.line 1978
move-object/from16 v0, p0
iput-boolean v2, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHasSoftInput:Z
.line 1979
const/4 v11, 0x1
.line 1981
:cond_4
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mImmersiveModeConfirmation:Lcom/android/internal/policy/impl/ImmersiveModeConfirmation;
if-eqz v15, :cond_5
.line 1982
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mImmersiveModeConfirmation:Lcom/android/internal/policy/impl/ImmersiveModeConfirmation;
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mCurrentUserId:I
move/from16 v17, v0
move/from16 v0, v17
invoke-virtual {v15, v0}, Lcom/android/internal/policy/impl/ImmersiveModeConfirmation;->loadSetting(I)V
.line 1984
:cond_5
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-static {v15}, Lcom/android/internal/policy/impl/PolicyControl;->reloadFromSetting(Landroid/content/Context;)V
.line 1985
monitor-exit v16
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 1986
if-eqz v11, :cond_6
.line 1987
const/4 v15, 0x1
move-object/from16 v0, p0
invoke-virtual {v0, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->updateRotation(Z)V
.line 1989
:cond_6
return-void
.line 1565
.end local v2 # "hasSoftInput":Z
.end local v3 # "imId":Ljava/lang/String;
.end local v9 # "resizeOnlyPortrait":Z
.end local v12 # "userRotation":I
.end local v13 # "userRotationMode":I
.end local v14 # "wakeGestureEnabledSetting":Z
.restart local v5 # "navBarDefaultWidth":I
:cond_7
const/4 v9, 0x0
goto/16 :goto_0
.restart local v9 # "resizeOnlyPortrait":Z
:cond_8
move v5, v7
.line 1573
goto/16 :goto_1
.line 1581
.end local v5 # "navBarDefaultWidth":I
.line 1952
:cond_b
const/4 v14, 0x0
goto/16 :goto_2
.line 1596
.restart local v14 # "wakeGestureEnabledSetting":Z
.line 1608
.restart local v12 # "userRotation":I
:cond_e
const/4 v13, 0x1
goto/16 :goto_3
.line 1623
.restart local v8 # "pointerLocation":I
.restart local v13 # "userRotationMode":I
:cond_f
const/4 v15, 0x2
goto :goto_4
.line 1632
.end local v8 # "pointerLocation":I
.restart local v3 # "imId":Ljava/lang/String;
:cond_10
const/4 v2, 0x0
goto :goto_5
.line 1641
.end local v3 # "imId":Ljava/lang/String;
.end local v4 # "navBarDefaultHeight":I
.end local v6 # "navBarHeight":I
.end local v7 # "navBarWidth":I
.end local v9 # "resizeOnlyPortrait":Z
.end local v12 # "userRotation":I
.end local v13 # "userRotationMode":I
.end local v14 # "wakeGestureEnabledSetting":Z
:catchall_0
move-exception v15
:try_start_1
monitor-exit v16
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw v15
.end method
3. open android.policy.jar/smali/com/android/internal/policy/impl/PhoneWindowManager$SettingsObserver
look for this method
Code:
.method observe()V
in this method
after look for this
Code:
const-string v1, "pointer_location"
Before that
add these lines
Code:
.line 874
const-string v1, "navigation_bar_height"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual [COLOR="Red"]{v0, v1, v3, p0, v2}[/COLOR], Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 875
const-string v1, "resize_only_portrait"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual [COLOR="Red"]{v0, v1, v3, p0, v2}[/COLOR], Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
the above red codes should match the one in smali
example
my code look like this
Code:
const-string v1, "wake_gesture_enabled"
invoke-static {v1}, Landroid/provider/Settings$Secure;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual [COLOR="red"]{v0, v1, v3, p0, v2}[/COLOR], Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
so here my red line code matched the above ( this is must part )
done and compile
For settings look for the
settings
Before entering to the settings part
you should be having this mod (seekbar preferences)
If you have now you can enter to the settings part
1. Decompile the settings.apk
2. Download this View attachment Settings.zip and merge to your settings
3. Add the below code to your settings ( i had added to my own settings ) and your wish
Code:
<PreferenceScreen android:title="Navigationbar Resize" android:key="navigationr" android:fragment="com.android.settings.rz.Navigationr" />
4. Compile and decompile
in Navigationr.smlai
0x7f060092 #navigarion_resize xml public key
If you have any problem with seekbar preference ( like not working )
then look for this post
http://forum.xda-developers.com/showpost.php?p=65076770&postcount=22
Thanks to cyanogenmod and cataclysm
Have fun
Dont forget to mention me if you use my work
Bro i got bootloop after Replace policy.jar and
Settings works fine how can i solve this im super user and deodex
raziel zarafan said:
Bro i got bootloop after Replace policy.jar and
Settings works fine how can i solve this im super user and deodex
Click to expand...
Click to collapse
impossible bro
until you do mistake
please recheck it
Awsom tutorial bro @venkat kamesh . Waiting for this tutorial for a long time. Will try this today ..
venkat kamesh said:
impossible bro
until you do mistake
please recheck it
Click to expand...
Click to collapse
Maybe I don't understand very well bro the part of add the lines above the other, u mean that add the lines above of each of the 4 lines of above the first line?
@venkat kamesh bro.. Is it possible to add some screens with tutorial? I mean for comparing ? This tutorial is Little confusing..
---------- Post added at 07:17 AM ---------- Previous post was at 07:13 AM ----------
raziel zarafan said:
Maybe I don't understand very well bro the part of add the lines above the other, u mean that add the lines above of each of the 4 lines of above the first line?
Click to expand...
Click to collapse
I am getting error in jar recompile. Which tool u using to decompile android.policy.jar ?
Rajeev said:
@venkat kamesh bro.. Is it possible to add some screens with tutorial? I mean for comparing ? This tutorial is Little confusing..
---------- Post added at 07:17 AM ---------- Previous post was at 07:13 AM ----------
I am getting error in jar recompile. Which tool u using to decompile android.policy.jar ?
Click to expand...
Click to collapse
why bro confusion
its easy
what i did is
from android.policy.jar i had extracted the classes and moved to dummy app
(mean in any app as you wish.. open apk using winrar and delete the classes and place the android.policy.jar class to it )
decompile add changes and recompile
done
the other thing is the code example i gave was cannot be edited from baksmali
the Apk tool ( advanced apktool ) had problem of editing jar file
so i did this way
hope this will help you brother
@venkat kamesh bro.. I have done all things u mentioned in ur OP correctly.. 200% i am sure.. But got bootloop.. U know i never made mistakes while trying tutorials.. Can u pls recheck?
Bro use apk tool
Not baksmali.
Then every thing works bro
Also recheck ids bro I think you do mistake with settings observations
venkat kamesh said:
Bro use apk tool
Not baksmali.
Then every thing works bro
Also recheck ids bro I think you do mistake with settings observations
Click to expand...
Click to collapse
Bro. I am not using baksmali. I have followed ur trick. Its not a Settings.apk problem. Because Settings works fine.. And i am using Apktool..
Rajeev said:
Bro. I am not using baksmali. I have followed ur trick. Its not a Settings.apk problem. Because Settings works fine.. And i am using Apktool..
Click to expand...
Click to collapse
ok bro got it
as i said this had included with Enable rorations
i forgot to define
this
.field private mAllowUpsideDownRotation:Z
i will update the tut on by deleting the enable all rotations
in 5 minutes bro
venkat kamesh said:
ok bro got it
as i said this had included with Enable rorations
i forgot to define
this
.field private mAllowUpsideDownRotation:Z
i will update the tut on by deleting the enable all rotations
in 5 minutes bro
Click to expand...
Click to collapse
There u go.. Like i said i never do mistakes while trying tutorials.. Thanks for the quick fix bro.. Enable all rotation is useless..
Rajeev said:
There u go.. Like i said i never do mistakes while trying tutorials.. Thanks for the quick fix bro.. Enable all rotation is useless..
Click to expand...
Click to collapse
yes may be useless bro
its a wrathful thing for me bro
cause when i drive car
this all rotation helps me to receive device ( i use to charge device while i drive )
and bro
the tut updated
have fun
sorry
link77kz said:
3. open framework.jar/smali/com/android/internal/policy/impl/PhoneWindowManager$SettingsObserver?
:laugh::laugh::laugh:
Click to expand...
Click to collapse
Its just a typing mistake.. We can use our commonsense
ups
link77kz said:
3. open framework.jar/smali/com/android/internal/policy/impl/PhoneWindowManager$SettingsObserver?
:laugh::laugh::laugh:
Click to expand...
Click to collapse
Yeah mr complainer also arrived again here -__-"
:facepalm:
“Sent From MWE V8.0.0 On My Z3”
Rajeev said:
@venkat kamesh bro.. Is it possible to add some screens with tutorial? I mean for comparing ? This tutorial is Little confusing..
---------- Post added at 07:17 AM ---------- Previous post was at 07:13 AM ----------
I am getting error in jar recompile. Which tool u using to decompile android.policy.jar ?
Click to expand...
Click to collapse
I'm using advance apktool bro
raziel zarafan said:
I'm using advance apktool bro
Click to expand...
Click to collapse
Hmm.. I have tried the fixed tutorial and no bootloops.. What about u?
Hello i'm doing work on Xperia X's Settings app
Well progress is at 30%
Right now I only able to add Custom Entries like "Xperia Connection" In Dashboard.
The way of port is using "only" Xperia's stock files , not other stuff...
All Dashboard entries work perfectly ....
Right now cant share guide but ScreenShots are here ....
As a time i got ... it will take a month to port it fully...
{
"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"
}
Orignal Port is coming.... well right now exams running .... So I'm taking break
Exams over in 6 june... Stay Connected..
@Ben Ling well i got untouched Settings.apk from Xperia X ... I'm working on it....
You uploaded on your thread was not real one or it is real one then it influence by someone ....
thanks for sharing everything with us
love ya... hahaha...
Guide:
Changes in SettingsActivity.smali
add line below [ invoke-static {p0, v0, p1}, Lcom/android/settings/SettingsActivity;->loadCategoriesFromResource(ILjava/util/ListV ]
PHP:
.line 1030
const v0, 0x7f080065
invoke-static {p0, v0, p1}, Lcom/sonymobile/settings/SomcDashboardTiles;->loadTilesFromResource(Lcom/android/settings/SettingsActivity;ILjava/util/List;)V
above 0x7f080065 is public.xml id of [ somc_add_dashboard_tiles ]
PHP:
<public type="xml" name="somc_add_dashboard_tiles" id="0x7f080065" />
------------------
change [ invoke-static to invoke-virtual ]
PHP:
invoke-virtual {p0, v0, p1}, Lcom/android/settings/SettingsActivity;->loadCategoriesFromResource(ILjava/util/List;)V
--------------------------
Replace this code with full method [ .method public loadCategoriesFromResource(ILjava/util/ListV ]
PHP:
.method public loadCategoriesFromResource(ILjava/util/List;)V
.locals 22
.param p1, "resid" # I
.annotation system Ldalvik/annotation/Signature;
value = {
"(I",
"Ljava/util/List",
"<",
"Lcom/android/settings/dashboard/DashboardCategory;",
">;)V"
}
.end annotation
.prologue
.line 990
.local p2, "target":Ljava/util/List;, "Ljava/util/List<Lcom/android/settings/dashboard/DashboardCategory;>;"
const/4 v12, 0x0
.line 992
.local v12, "parser":Landroid/content/res/XmlResourceParser;
:try_start_0
invoke-virtual/range {p0 .. p0}, Lcom/android/settings/SettingsActivity;->getResources()Landroid/content/res/Resources;
move-result-object v17
move-object/from16 v0, v17
move/from16 v1, p1
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getXml(I)Landroid/content/res/XmlResourceParser;
move-result-object v12
.line 993
invoke-static {v12}, Landroid/util/Xml;->asAttributeSet(Lorg/xmlpull/v1/XmlPullParser;)Landroid/util/AttributeSet;
move-result-object v2
.line 997
.local v2, "attrs":Landroid/util/AttributeSet;
:cond_0
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->next()I
move-result v16
.local v16, "type":I
const/16 v17, 0x1
move/from16 v0, v16
move/from16 v1, v17
if-eq v0, v1, :cond_1
const/16 v17, 0x2
move/from16 v0, v16
move/from16 v1, v17
if-ne v0, v1, :cond_0
.line 1001
:cond_1
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->getName()Ljava/lang/String;
move-result-object v10
.line 1002
.local v10, "nodeName":Ljava/lang/String;
const-string v17, "dashboard-categories"
move-object/from16 v0, v17
invoke-virtual {v0, v10}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v17
if-nez v17, :cond_3
.line 1003
new-instance v17, Ljava/lang/RuntimeException;
new-instance v18, Ljava/lang/StringBuilder;
invoke-direct/range {v18 .. v18}, Ljava/lang/StringBuilder;-><init>()V
const-string v19, "XML document must start with <preference-categories> tag; found"
invoke-virtual/range {v18 .. v19}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v18
move-object/from16 v0, v18
invoke-virtual {v0, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v18
const-string v19, " at "
invoke-virtual/range {v18 .. v19}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v18
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->getPositionDescription()Ljava/lang/String;
move-result-object v19
invoke-virtual/range {v18 .. v19}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v18
invoke-virtual/range {v18 .. v18}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v18
invoke-direct/range {v17 .. v18}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
throw v17
:try_end_0
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_0 .. :try_end_0} :catch_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 1123
.end local v2 # "attrs":Landroid/util/AttributeSet;
.end local v10 # "nodeName":Ljava/lang/String;
.end local v16 # "type":I
:catch_0
move-exception v5
.line 1124
.local v5, "e":Lorg/xmlpull/v1/XmlPullParserException;
:try_start_1
new-instance v17, Ljava/lang/RuntimeException;
const-string v18, "Error parsing categories"
move-object/from16 v0, v17
move-object/from16 v1, v18
invoke-direct {v0, v1, v5}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v17
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 1128
.end local v5 # "e":Lorg/xmlpull/v1/XmlPullParserException;
:catchall_0
move-exception v17
if-eqz v12, :cond_2
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->close()V
:cond_2
throw v17
.line 1008
.restart local v2 # "attrs":Landroid/util/AttributeSet;
.restart local v10 # "nodeName":Ljava/lang/String;
.restart local v16 # "type":I
:cond_3
const/4 v4, 0x0
.line 1010
.local v4, "curBundle":Landroid/os/Bundle;
:try_start_2
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->getDepth()I
move-result v11
.line 1012
.local v11, "outerDepth":I
:cond_4
:goto_0
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->next()I
move-result v16
const/16 v17, 0x1
move/from16 v0, v16
move/from16 v1, v17
if-eq v0, v1, :cond_19
const/16 v17, 0x3
move/from16 v0, v16
move/from16 v1, v17
if-ne v0, v1, :cond_5
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->getDepth()I
move-result v17
move/from16 v0, v17
if-le v0, v11, :cond_19
.line 1013
:cond_5
const/16 v17, 0x3
move/from16 v0, v16
move/from16 v1, v17
if-eq v0, v1, :cond_4
const/16 v17, 0x4
move/from16 v0, v16
move/from16 v1, v17
if-eq v0, v1, :cond_4
.line 1017
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->getName()Ljava/lang/String;
move-result-object v10
.line 1018
const-string v17, "dashboard-category"
move-object/from16 v0, v17
invoke-virtual {v0, v10}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v17
if-eqz v17, :cond_18
.line 1019
new-instance v3, Lcom/android/settings/dashboard/DashboardCategory;
invoke-direct {v3}, Lcom/android/settings/dashboard/DashboardCategory;-><init>()V
.line 1021
.local v3, "category":Lcom/android/settings/dashboard/DashboardCategory;
sget-object v17, Lcom/android/internal/R$styleable;->PreferenceHeader:[I
move-object/from16 v0, p0
move-object/from16 v1, v17
invoke-virtual {v0, v2, v1}, Lcom/android/settings/SettingsActivity;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
move-result-object v13
.line 1023
.local v13, "sa":Landroid/content/res/TypedArray;
const/16 v17, 0x1
const/16 v18, -0x1
move/from16 v0, v17
move/from16 v1, v18
invoke-virtual {v13, v0, v1}, Landroid/content/res/TypedArray;->getResourceId(II)I
move-result v17
move/from16 v0, v17
int-to-long v0, v0
move-wide/from16 v18, v0
move-wide/from16 v0, v18
iput-wide v0, v3, Lcom/android/settings/dashboard/DashboardCategory;->id:J
.line 1027
const/16 v17, 0x2
move/from16 v0, v17
invoke-virtual {v13, v0}, Landroid/content/res/TypedArray;->peekValue(I)Landroid/util/TypedValue;
move-result-object v15
.line 1029
.local v15, "tv":Landroid/util/TypedValue;
if-eqz v15, :cond_6
iget v0, v15, Landroid/util/TypedValue;->type:I
move/from16 v17, v0
const/16 v18, 0x3
move/from16 v0, v17
move/from16 v1, v18
if-ne v0, v1, :cond_6
.line 1030
iget v0, v15, Landroid/util/TypedValue;->resourceId:I
move/from16 v17, v0
if-eqz v17, :cond_e
.line 1031
iget v0, v15, Landroid/util/TypedValue;->resourceId:I
move/from16 v17, v0
move/from16 v0, v17
iput v0, v3, Lcom/android/settings/dashboard/DashboardCategory;->titleRes:I
.line 1036
:cond_6
:goto_1
invoke-virtual {v13}, Landroid/content/res/TypedArray;->recycle()V
.line 1038
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->getDepth()I
move-result v6
.line 1040
.local v6, "innerDepth":I
:cond_7
:goto_2
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->next()I
move-result v16
const/16 v17, 0x1
move/from16 v0, v16
move/from16 v1, v17
if-eq v0, v1, :cond_17
const/16 v17, 0x3
move/from16 v0, v16
move/from16 v1, v17
if-ne v0, v1, :cond_8
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->getDepth()I
move-result v17
move/from16 v0, v17
if-le v0, v6, :cond_17
.line 1041
:cond_8
const/16 v17, 0x3
move/from16 v0, v16
move/from16 v1, v17
if-eq v0, v1, :cond_7
const/16 v17, 0x4
move/from16 v0, v16
move/from16 v1, v17
if-eq v0, v1, :cond_7
.line 1045
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->getName()Ljava/lang/String;
move-result-object v8
.line 1046
.local v8, "innerNodeName":Ljava/lang/String;
const-string v17, "dashboard-tile"
move-object/from16 v0, v17
invoke-virtual {v8, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v17
if-eqz v17, :cond_16
.line 1047
new-instance v14, Lcom/android/settings/dashboard/DashboardTile;
invoke-direct {v14}, Lcom/android/settings/dashboard/DashboardTile;-><init>()V
.line 1049
.local v14, "tile":Lcom/android/settings/dashboard/DashboardTile;
sget-object v17, Lcom/android/internal/R$styleable;->PreferenceHeader:[I
move-object/from16 v0, p0
move-object/from16 v1, v17
invoke-virtual {v0, v2, v1}, Lcom/android/settings/SettingsActivity;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
move-result-object v13
.line 1051
const/16 v17, 0x1
const/16 v18, -0x1
move/from16 v0, v17
move/from16 v1, v18
invoke-virtual {v13, v0, v1}, Landroid/content/res/TypedArray;->getResourceId(II)I
move-result v17
move/from16 v0, v17
int-to-long v0, v0
move-wide/from16 v18, v0
move-wide/from16 v0, v18
iput-wide v0, v14, Lcom/android/settings/dashboard/DashboardTile;->id:J
.line 1054
const/16 v17, 0x2
move/from16 v0, v17
invoke-virtual {v13, v0}, Landroid/content/res/TypedArray;->peekValue(I)Landroid/util/TypedValue;
move-result-object v15
.line 1056
if-eqz v15, :cond_9
iget v0, v15, Landroid/util/TypedValue;->type:I
move/from16 v17, v0
const/16 v18, 0x3
move/from16 v0, v17
move/from16 v1, v18
if-ne v0, v1, :cond_9
.line 1057
iget v0, v15, Landroid/util/TypedValue;->resourceId:I
move/from16 v17, v0
if-eqz v17, :cond_f
.line 1058
iget v0, v15, Landroid/util/TypedValue;->resourceId:I
move/from16 v17, v0
move/from16 v0, v17
iput v0, v14, Lcom/android/settings/dashboard/DashboardTile;->titleRes:I
.line 1063
:cond_9
:goto_3
const/16 v17, 0x3
move/from16 v0, v17
invoke-virtual {v13, v0}, Landroid/content/res/TypedArray;->peekValue(I)Landroid/util/TypedValue;
move-result-object v15
.line 1065
if-eqz v15, :cond_a
iget v0, v15, Landroid/util/TypedValue;->type:I
move/from16 v17, v0
const/16 v18, 0x3
move/from16 v0, v17
move/from16 v1, v18
if-ne v0, v1, :cond_a
.line 1066
iget v0, v15, Landroid/util/TypedValue;->resourceId:I
move/from16 v17, v0
if-eqz v17, :cond_10
.line 1067
iget v0, v15, Landroid/util/TypedValue;->resourceId:I
move/from16 v17, v0
move/from16 v0, v17
iput v0, v14, Lcom/android/settings/dashboard/DashboardTile;->summaryRes:I
.line 1072
:cond_a
:goto_4
const/16 v17, 0x0
const/16 v18, 0x0
move/from16 v0, v17
move/from16 v1, v18
invoke-virtual {v13, v0, v1}, Landroid/content/res/TypedArray;->getResourceId(II)I
move-result v17
move/from16 v0, v17
iput v0, v14, Lcom/android/settings/dashboard/DashboardTile;->iconRes:I
.line 1074
const/16 v17, 0x4
move/from16 v0, v17
invoke-virtual {v13, v0}, Landroid/content/res/TypedArray;->getString(I)Ljava/lang/String;
move-result-object v17
move-object/from16 v0, v17
iput-object v0, v14, Lcom/android/settings/dashboard/DashboardTile;->fragment:Ljava/lang/String;
.line 1076
invoke-virtual {v13}, Landroid/content/res/TypedArray;->recycle()V
.line 1078
if-nez v4, :cond_b
.line 1079
new-instance v4, Landroid/os/Bundle;
.end local v4 # "curBundle":Landroid/os/Bundle;
invoke-direct {v4}, Landroid/os/Bundle;-><init>()V
.line 1082
.restart local v4 # "curBundle":Landroid/os/Bundle;
:cond_b
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->getDepth()I
move-result v7
.line 1084
.local v7, "innerDepth2":I
:cond_c
:goto_5
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->next()I
move-result v16
const/16 v17, 0x1
move/from16 v0, v16
move/from16 v1, v17
if-eq v0, v1, :cond_13
const/16 v17, 0x3
move/from16 v0, v16
move/from16 v1, v17
if-ne v0, v1, :cond_d
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->getDepth()I
move-result v17
move/from16 v0, v17
if-le v0, v7, :cond_13
.line 1085
:cond_d
const/16 v17, 0x3
move/from16 v0, v16
move/from16 v1, v17
if-eq v0, v1, :cond_c
const/16 v17, 0x4
move/from16 v0, v16
move/from16 v1, v17
if-eq v0, v1, :cond_c
.line 1089
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->getName()Ljava/lang/String;
move-result-object v9
.line 1090
.local v9, "innerNodeName2":Ljava/lang/String;
const-string v17, "extra"
move-object/from16 v0, v17
invoke-virtual {v9, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v17
if-eqz v17, :cond_11
.line 1091
invoke-virtual/range {p0 .. p0}, Lcom/android/settings/SettingsActivity;->getResources()Landroid/content/res/Resources;
move-result-object v17
const-string v18, "extra"
move-object/from16 v0, v17
move-object/from16 v1, v18
invoke-virtual {v0, v1, v2, v4}, Landroid/content/res/Resources;->parseBundleExtra(Ljava/lang/String;Landroid/util/AttributeSet;Landroid/os/Bundle;)V
.line 1092
invoke-static {v12}, Lcom/android/internal/util/XmlUtils;->skipCurrentTag(Lorg/xmlpull/v1/XmlPullParser;)V
:try_end_2
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_2 .. :try_end_2} :catch_0
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_1
.catchall {:try_start_2 .. :try_end_2} :catchall_0
goto :goto_5
.line 1125
.end local v2 # "attrs":Landroid/util/AttributeSet;
.end local v3 # "category":Lcom/android/settings/dashboard/DashboardCategory;
.end local v4 # "curBundle":Landroid/os/Bundle;
.end local v6 # "innerDepth":I
.end local v7 # "innerDepth2":I
.end local v8 # "innerNodeName":Ljava/lang/String;
.end local v9 # "innerNodeName2":Ljava/lang/String;
.end local v10 # "nodeName":Ljava/lang/String;
.end local v11 # "outerDepth":I
.end local v13 # "sa":Landroid/content/res/TypedArray;
.end local v14 # "tile":Lcom/android/settings/dashboard/DashboardTile;
.end local v15 # "tv":Landroid/util/TypedValue;
.end local v16 # "type":I
:catch_1
move-exception v5
.line 1126
.local v5, "e":Ljava/io/IOException;
:try_start_3
new-instance v17, Ljava/lang/RuntimeException;
const-string v18, "Error parsing categories"
move-object/from16 v0, v17
move-object/from16 v1, v18
invoke-direct {v0, v1, v5}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v17
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
.line 1033
.end local v5 # "e":Ljava/io/IOException;
.restart local v2 # "attrs":Landroid/util/AttributeSet;
.restart local v3 # "category":Lcom/android/settings/dashboard/DashboardCategory;
.restart local v4 # "curBundle":Landroid/os/Bundle;
.restart local v10 # "nodeName":Ljava/lang/String;
.restart local v11 # "outerDepth":I
.restart local v13 # "sa":Landroid/content/res/TypedArray;
.restart local v15 # "tv":Landroid/util/TypedValue;
.restart local v16 # "type":I
:cond_e
:try_start_4
iget-object v0, v15, Landroid/util/TypedValue;->string:Ljava/lang/CharSequence;
move-object/from16 v17, v0
move-object/from16 v0, v17
iput-object v0, v3, Lcom/android/settings/dashboard/DashboardCategory;->title:Ljava/lang/CharSequence;
goto/16 :goto_1
.line 1060
.restart local v6 # "innerDepth":I
.restart local v8 # "innerNodeName":Ljava/lang/String;
.restart local v14 # "tile":Lcom/android/settings/dashboard/DashboardTile;
:cond_f
iget-object v0, v15, Landroid/util/TypedValue;->string:Ljava/lang/CharSequence;
move-object/from16 v17, v0
move-object/from16 v0, v17
iput-object v0, v14, Lcom/android/settings/dashboard/DashboardTile;->title:Ljava/lang/CharSequence;
goto/16 :goto_3
.line 1069
:cond_10
iget-object v0, v15, Landroid/util/TypedValue;->string:Ljava/lang/CharSequence;
move-object/from16 v17, v0
move-object/from16 v0, v17
iput-object v0, v14, Lcom/android/settings/dashboard/DashboardTile;->summary:Ljava/lang/CharSequence;
goto/16 :goto_4
.line 1094
.restart local v7 # "innerDepth2":I
.restart local v9 # "innerNodeName2":Ljava/lang/String;
:cond_11
const-string v17, "intent"
move-object/from16 v0, v17
invoke-virtual {v9, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v17
if-eqz v17, :cond_12
.line 1095
invoke-virtual/range {p0 .. p0}, Lcom/android/settings/SettingsActivity;->getResources()Landroid/content/res/Resources;
move-result-object v17
move-object/from16 v0, v17
invoke-static {v0, v12, v2}, Landroid/content/Intent;->parseIntent(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;)Landroid/content/Intent;
move-result-object v17
move-object/from16 v0, v17
iput-object v0, v14, Lcom/android/settings/dashboard/DashboardTile;->intent:Landroid/content/Intent;
goto/16 :goto_5
.line 1098
:cond_12
invoke-static {v12}, Lcom/android/internal/util/XmlUtils;->skipCurrentTag(Lorg/xmlpull/v1/XmlPullParser;)V
goto/16 :goto_5
.line 1102
.end local v9 # "innerNodeName2":Ljava/lang/String;
:cond_13
invoke-virtual {v4}, Landroid/os/Bundle;->size()I
move-result v17
if-lez v17, :cond_14
.line 1103
iput-object v4, v14, Lcom/android/settings/dashboard/DashboardTile;->fragmentArguments:Landroid/os/Bundle;
.line 1104
const/4 v4, 0x0
.line 1108
:cond_14
iget-wide v0, v14, Lcom/android/settings/dashboard/DashboardTile;->id:J
move-wide/from16 v18, v0
const-wide/32 v20, 0x7f0f0241
cmp-long v17, v18, v20
if-nez v17, :cond_15
invoke-static/range {p0 .. p0}, Lcom/android/settings/Utils;->showSimCardTile(Landroid/content/Context;)Z
move-result v17
if-eqz v17, :cond_7
.line 1109
:cond_15
invoke-virtual {v3, v14}, Lcom/android/settings/dashboard/DashboardCategory;->addTile(Lcom/android/settings/dashboard/DashboardTile;)V
goto/16 :goto_2
.line 1113
.end local v7 # "innerDepth2":I
.end local v14 # "tile":Lcom/android/settings/dashboard/DashboardTile;
:cond_16
invoke-static {v12}, Lcom/android/internal/util/XmlUtils;->skipCurrentTag(Lorg/xmlpull/v1/XmlPullParser;)V
goto/16 :goto_2
.line 1117
.end local v8 # "innerNodeName":Ljava/lang/String;
:cond_17
move-object/from16 v0, p2
invoke-interface {v0, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto/16 :goto_0
.line 1119
.end local v3 # "category":Lcom/android/settings/dashboard/DashboardCategory;
.end local v6 # "innerDepth":I
.end local v13 # "sa":Landroid/content/res/TypedArray;
.end local v15 # "tv":Landroid/util/TypedValue;
:cond_18
invoke-static {v12}, Lcom/android/internal/util/XmlUtils;->skipCurrentTag(Lorg/xmlpull/v1/XmlPullParser;)V
:try_end_4
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_4 .. :try_end_4} :catch_0
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_1
.catchall {:try_start_4 .. :try_end_4} :catchall_0
goto/16 :goto_0
.line 1128
:cond_19
if-eqz v12, :cond_1a
invoke-interface {v12}, Landroid/content/res/XmlResourceParser;->close()V
.line 1130
:cond_1a
return-void
.end method
--------------------------------------------
add entry in public.xml
PHP:
<public type="xml" name="somc_add_dashboard_tiles" id="0x7f080065" />
--------------------------------------------
put somc_add_dashboard_tiles.xml to /res/xml/
========================
Changes in SettingsPreferenceFragment.smali
first line should be
PHP:
.class public Lcom/android/settings/SettingsPreferenceFragment;
remove "abstract" if it present in above line
---------------------------------------
Replace line like [ Lcom/android/settings/InstrumentedPreferenceFragment with Lcom/sonymobile/settings/preference/util/SomcSettingsPreferenceFragment; ]
it will after change look like this
PHP:
.super Lcom/sonymobile/settings/preference/util/SomcSettingsPreferenceFragment;
in whole file change every [ Lcom/android/settings/InstrumentedPreferenceFragment with Lcom/sonymobile/settings/preference/util/SomcSettingsPreferenceFragment; ]
================================================================================================
add icon file and strings and id in xml
it will show you new list of missing things in xmls
Download:
Settings.zip [Flashable Zip]
Attachments will soon....
Nice guide but where is the card view like in @Ben Ling his ported Xperia X settings ?
Pandemic said:
Nice guide but where is the card view like in @Ben Ling his ported Xperia X settings ?
Click to expand...
Click to collapse
I'm Putting Xperia X's Settings features to Xperia Consept rom
it will be one by one...
1) Adding extra entries in Dashboard [ DONE ]
2) all entries add automatically in Settings if its apk installed on phone like "SoundEnhancement entry" [ DONE ]
3) Combining Storage and Memory in one dashboard entry [ WORKING ON IT ]
4) All theme work.. [ PANDING ]
@Ben Ling has ported for Stock builds and on stock builds its works well thanks to him
I'm working for CM13 users so they also can use it..
Tried this port evrything working fine
But sound settings and lock screen settings was force closes always plz try to fix soon
yahh ... bro. its cause of CM's own 9x9 pattern view.. it will be fix after all work done. cause it require framework.jar editing..
wolfmannight said:
yahh ... bro. its cause of CM's own 9x9 pattern view.. it will be fix after all work done. cause it require framework.jar editing..
Click to expand...
Click to collapse
Work on Xperia SP CM13?
hello guys
Here go i come with new tut today
which i got from awesome cataclysm rom and cyanogenmod
So i dont want to kill all your time
i will explain you very simple way
For Lp version Click Here
All you need is
service.jar ( deodexed )
settings.apk (deodexed )
1. Decompile service.jar
2. open com/android/server/policy/PhoneWindowManager.smali
3. look for this method
Code:
.method public updateSettings()V
replace all the code with this
Code:
.method public updateSettings()V
.locals 20
.prologue
.line 1829
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v10
.line 1830
.local v10, "resolver":Landroid/content/ContentResolver;
const/4 v11, 0x0
.line 1831
.local v11, "updateRotation":Z
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mLock:Ljava/lang/Object;
move-object/from16 v16, v0
monitor-enter v16
.line 1833
:try_start_0
const-string/jumbo v15, "end_button_behavior"
.line 1834
const/16 v17, 0x2
.line 1835
const/16 v18, -0x2
.line 1832
move/from16 v0, v17
move/from16 v1, v18
invoke-static {v10, v15, v0, v1}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v15
move-object/from16 v0, p0
iput v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mEndcallBehavior:I
.line 1837
const-string/jumbo v15, "incall_power_button_behavior"
.line 1838
const/16 v17, 0x1
.line 1839
const/16 v18, -0x2
.line 1836
move/from16 v0, v17
move/from16 v1, v18
invoke-static {v10, v15, v0, v1}, Landroid/provider/Settings$Secure;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v15
move-object/from16 v0, p0
iput v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mIncallPowerBehavior:I
.line 1841
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v15
const v17, 0x1050018
move/from16 v0, v17
invoke-virtual {v15, v0}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v5
.line 1842
.local v5, "navBarDefaultHeight":I
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v15
const v17, 0x105001a
move/from16 v0, v17
invoke-virtual {v15, v0}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v6
.line 1844
.local v6, "navBarDefaultWidth":I
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v15
.line 1845
const-string/jumbo v17, "navigation_bar_height"
const/16 v18, 0x64
const/16 v19, -0x3
.line 1844
move-object/from16 v0, v17
move/from16 v1, v18
move/from16 v2, v19
invoke-static {v15, v0, v1, v2}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v15
mul-int/2addr v15, v5
div-int/lit8 v7, v15, 0x64
.line 1846
.local v7, "navBarHeight":I
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v15
.line 1847
const-string/jumbo v17, "navigation_bar_width"
const/16 v18, 0x64
const/16 v19, -0x3
.line 1846
move-object/from16 v0, v17
move/from16 v1, v18
move/from16 v2, v19
invoke-static {v15, v0, v1, v2}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v15
mul-int/2addr v15, v6
div-int/lit8 v8, v15, 0x64
.line 1849
.local v8, "navBarWidth":I
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mNavigationBarHeightForRotation:[I
move-object/from16 v0, p0
iget v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mPortraitRotation:I
move/from16 v17, v0
.line 1852
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mNavigationBarHeightForRotation:[I
move-object/from16 v18, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mSeascapeRotation:I
move/from16 v19, v0
aput v7, v18, v19
.line 1851
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mNavigationBarHeightForRotation:[I
move-object/from16 v18, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mLandscapeRotation:I
move/from16 v19, v0
aput v7, v18, v19
.line 1850
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mNavigationBarHeightForRotation:[I
move-object/from16 v18, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mUpsideDownRotation:I
move/from16 v19, v0
aput v7, v18, v19
.line 1849
aput v7, v15, v17
.line 1854
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v0, p0
iget v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mPortraitRotation:I
move/from16 v17, v0
.line 1857
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v18, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mSeascapeRotation:I
move/from16 v19, v0
aput v8, v18, v19
.line 1856
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v18, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mLandscapeRotation:I
move/from16 v19, v0
aput v8, v18, v19
.line 1855
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v18, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mUpsideDownRotation:I
move/from16 v19, v0
aput v8, v18, v19
.line 1854
aput v8, v15, v17
.line 1873
const-string/jumbo v15, "wake_gesture_enabled"
const/16 v17, 0x0
.line 1874
const/16 v18, -0x2
.line 1872
move/from16 v0, v17
move/from16 v1, v18
invoke-static {v10, v15, v0, v1}, Landroid/provider/Settings$Secure;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v15
if-eqz v15, :cond_7
const/4 v14, 0x1
.line 1875
.local v14, "wakeGestureEnabledSetting":Z
:goto_0
move-object/from16 v0, p0
iget-boolean v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mWakeGestureEnabledSetting:Z
if-eq v15, v14, :cond_0
.line 1876
move-object/from16 v0, p0
iput-boolean v14, v0, Lcom/android/server/policy/PhoneWindowManager;->mWakeGestureEnabledSetting:Z
.line 1877
invoke-direct/range {p0 .. p0}, Lcom/android/server/policy/PhoneWindowManager;->updateWakeGestureListenerLp()V
.line 1880
:cond_0
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v17
.line 1886
const-string/jumbo v15, "user_rotation"
const/16 v17, 0x0
.line 1887
const/16 v18, -0x2
.line 1885
move/from16 v0, v17
move/from16 v1, v18
invoke-static {v10, v15, v0, v1}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v12
.line 1888
.local v12, "userRotation":I
move-object/from16 v0, p0
iget v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mUserRotation:I
if-eq v15, v12, :cond_1
.line 1889
move-object/from16 v0, p0
iput v12, v0, Lcom/android/server/policy/PhoneWindowManager;->mUserRotation:I
.line 1890
const/4 v11, 0x1
.line 1893
:cond_1
const-string/jumbo v15, "accelerometer_rotation"
const/16 v17, 0x0
const/16 v18, -0x2
.line 1892
move/from16 v0, v17
move/from16 v1, v18
invoke-static {v10, v15, v0, v1}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v15
if-eqz v15, :cond_8
.line 1894
const/4 v13, 0x0
.line 1896
.local v13, "userRotationMode":I
:goto_1
move-object/from16 v0, p0
iget v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mUserRotationMode:I
if-eq v15, v13, :cond_2
.line 1897
move-object/from16 v0, p0
iput v13, v0, Lcom/android/server/policy/PhoneWindowManager;->mUserRotationMode:I
.line 1898
const/4 v11, 0x1
.line 1899
invoke-virtual/range {p0 .. p0}, Lcom/android/server/policy/PhoneWindowManager;->updateOrientationListenerLp()V
.line 1902
:cond_2
move-object/from16 v0, p0
iget-boolean v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mSystemReady:Z
if-eqz v15, :cond_3
.line 1904
const-string/jumbo v15, "pointer_location"
const/16 v17, 0x0
const/16 v18, -0x2
.line 1903
move/from16 v0, v17
move/from16 v1, v18
invoke-static {v10, v15, v0, v1}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v9
.line 1905
.local v9, "pointerLocation":I
move-object/from16 v0, p0
iget v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mPointerLocationMode:I
if-eq v15, v9, :cond_3
.line 1906
move-object/from16 v0, p0
iput v9, v0, Lcom/android/server/policy/PhoneWindowManager;->mPointerLocationMode:I
.line 1907
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mHandler:Landroid/os/Handler;
move-object/from16 v17, v0
if-eqz v9, :cond_9
.line 1908
const/4 v15, 0x1
.line 1907
:goto_2
move-object/from16 v0, v17
invoke-virtual {v0, v15}, Landroid/os/Handler;->sendEmptyMessage(I)Z
.line 1913
.end local v9 # "pointerLocation":I
:cond_3
const-string/jumbo v15, "screen_off_timeout"
const/16 v17, 0x0
const/16 v18, -0x2
.line 1912
move/from16 v0, v17
move/from16 v1, v18
invoke-static {v10, v15, v0, v1}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v15
move-object/from16 v0, p0
iput v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mLockScreenTimeout:I
.line 1915
const-string/jumbo v15, "default_input_method"
const/16 v17, -0x2
.line 1914
move/from16 v0, v17
invoke-static {v10, v15, v0}, Landroid/provider/Settings$Secure;->getStringForUser(Landroid/content/ContentResolver;Ljava/lang/String;I)Ljava/lang/String;
move-result-object v4
.line 1916
.local v4, "imId":Ljava/lang/String;
if-eqz v4, :cond_a
invoke-virtual {v4}, Ljava/lang/String;->length()I
move-result v15
if-lez v15, :cond_a
const/4 v3, 0x1
.line 1917
.local v3, "hasSoftInput":Z
:goto_3
move-object/from16 v0, p0
iget-boolean v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mHasSoftInput:Z
if-eq v15, v3, :cond_4
.line 1918
move-object/from16 v0, p0
iput-boolean v3, v0, Lcom/android/server/policy/PhoneWindowManager;->mHasSoftInput:Z
.line 1919
const/4 v11, 0x1
.line 1921
:cond_4
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mImmersiveModeConfirmation:Lcom/android/server/policy/ImmersiveModeConfirmation;
if-eqz v15, :cond_5
.line 1922
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mImmersiveModeConfirmation:Lcom/android/server/policy/ImmersiveModeConfirmation;
move-object/from16 v0, p0
iget v0, v0, Lcom/android/server/policy/PhoneWindowManager;->mCurrentUserId:I
move/from16 v17, v0
move/from16 v0, v17
invoke-virtual {v15, v0}, Lcom/android/server/policy/ImmersiveModeConfirmation;->loadSetting(I)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:cond_5
monitor-exit v16
.line 1925
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mWindowManagerFuncs:Landroid/view/WindowManagerPolicy$WindowManagerFuncs;
invoke-interface {v15}, Landroid/view/WindowManagerPolicy$WindowManagerFuncs;->getWindowManagerLock()Ljava/lang/Object;
move-result-object v16
monitor-enter v16
.line 1926
:try_start_1
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/server/policy/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-static {v15}, Lcom/android/server/policy/PolicyControl;->reloadFromSetting(Landroid/content/Context;)V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
monitor-exit v16
.line 1928
if-eqz v11, :cond_6
.line 1929
const/4 v15, 0x1
move-object/from16 v0, p0
invoke-virtual {v0, v15}, Lcom/android/server/policy/PhoneWindowManager;->updateRotation(Z)V
.line 1828
:cond_6
return-void
.line 1860
.end local v3 # "hasSoftInput":Z
.end local v4 # "imId":Ljava/lang/String;
.end local v12 # "userRotation":I
.end local v13 # "userRotationMode":I
.end local v14 # "wakeGestureEnabledSetting":Z
.line 1872
:cond_7
const/4 v14, 0x0
.restart local v14 # "wakeGestureEnabledSetting":Z
goto/16 :goto_0
.line 1895
.restart local v12 # "userRotation":I
:cond_8
const/4 v13, 0x1
.restart local v13 # "userRotationMode":I
goto/16 :goto_1
.line 1908
.restart local v9 # "pointerLocation":I
:cond_9
const/4 v15, 0x2
goto :goto_2
.line 1916
.end local v9 # "pointerLocation":I
.restart local v4 # "imId":Ljava/lang/String;
:cond_a
const/4 v3, 0x0
.restart local v3 # "hasSoftInput":Z
goto :goto_3
.line 1831
.end local v3 # "hasSoftInput":Z
.end local v4 # "imId":Ljava/lang/String;
.end local v5 # "navBarDefaultHeight":I
.end local v6 # "navBarDefaultWidth":I
.end local v7 # "navBarHeight":I
.end local v8 # "navBarWidth":I
.end local v12 # "userRotation":I
.end local v13 # "userRotationMode":I
.end local v14 # "wakeGestureEnabledSetting":Z
:catchall_0
move-exception v15
monitor-exit v16
throw v15
.line 1925
.restart local v3 # "hasSoftInput":Z
.restart local v4 # "imId":Ljava/lang/String;
.restart local v5 # "navBarDefaultHeight":I
.restart local v6 # "navBarDefaultWidth":I
.restart local v7 # "navBarHeight":I
.restart local v8 # "navBarWidth":I
.restart local v12 # "userRotation":I
.restart local v13 # "userRotationMode":I
.restart local v14 # "wakeGestureEnabledSetting":Z
:catchall_1
move-exception v15
monitor-exit v16
throw v15
.end method
in that find these and replace the public ids from framework-res.apk
find this 0x1050018 (replace as yours in framework-res.apk)
<public type="dimen" name="navigation_bar_height" id="0x01050018" />
find this 0x105001a (replace as yours in framework-res.apk)
<public type="dimen" name="navigation_bar_height_landscape" id="0x0105001a" />
Now save this and close
Continued in post #2
part 2
4. Now open com/android/server/policy/PhoneWindowManager$SettingsObserver
Find this method
Code:
.method observe()V
in that find this line
Code:
const-string/jumbo v1, "policy_control"
or
Code:
const-string v1, "policy_control"
and before this add these lines
Code:
.line 775
const-string/jumbo v1, "navigation_bar_height"
.line 774
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual [COLOR="red"]{v0, v1, v3, p0, v2}[/COLOR], Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 778
const-string/jumbo v1, "navigation_bar_width"
.line 777
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual [COLOR="Red"]{v0, v1, v3, p0, v2}[/COLOR], Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
the above red codes should match the one in smali
example
my code look like this
Code:
.line 772
const-string/jumbo v1, "policy_control"
.line 771
invoke-static {v1}, Landroid/provider/Settings$Global;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual [COLOR="red"]{v0, v1, v3, p0, v2}[/COLOR], Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
so here my red line code matched the above ( this is must )
done and compile
For settings look for the below post#3
settings.apk final part
well here come the final part which is need to control the navigation bar size
1. Decompile Settings.apk
2. Then add this seekbar preference ( follow this guide )
3. Now after you added the myseekbar preferences
open any xml you like ( example :- in display settings (settings.apk/res/xml/display_settings.xml)
in that add these lines before this </PreferenceScreen>
Code:
<com.android.settings.rz.MySeekBarPreference android:title="Resize portrait" android:key="navigation_bar_height" settings:type="15" />
<com.android.settings.rz.MySeekBarPreference android:title="Resize landscape" android:key="navigation_bar_width" settings:type="15" />
save and compile and sign it
replace these service.jar and Settings.apk files and reboot done....!
credits
My personal Rom and RR
No 1 ,great job bro
very nice share bro. Will try soon.. And for ur information please read this
http://en.mediamass.net/people/robert-downey-jr/deathhoax.html
The Iron man is still alive. So u can remove ur signature
Again... Awesome TUT bro @venkat kamesh \m/
Bro
Not working for me. Leave Settings part. Problems with services.jar part. I am getting bootloops after replacing services.jar. I have done it several times. No success.
This is ur code. u can see after "policy Control" again one extra line is specified.
{
"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"
}
\
here is mine, but i don't have that extra line.
Rajeev said:
very nice share bro. Will try soon.. And for ur information please read this
http://en.mediamass.net/people/robert-downey-jr/deathhoax.html
The Iron man is still alive. So u can remove ur signature
Click to expand...
Click to collapse
Tony stark was xda member bro
Not that iron man [emoji14]
Tony was one of my friend and xda moderator
Rajeev said:
Bro
Not working for me. Leave Settings part. Problems with services.jar part. I am getting bootloops after replacing services.jar. I have done it several times. No success.
This is ur code. u can see after "policy Control" again one extra line is specified.
\
here is mine, but i don't have that extra line.
Click to expand...
Click to collapse
Bro please recheck the code
The same used in mm krypton and jitz had it working
Sure he will help you bro
Don't forget to change public id by removing 0
1x0xxxxx
1x1xxxxx
I dnt understand tha tutorial.... Cos ow will one state tha exact size to be used or will it be in settings and one can select desire ones.... Cos i have reduced mine editing framework-res.apk only.
whalesplaho said:
I dnt understand tha tutorial.... Cos ow will one state tha exact size to be used or will it be in settings and one can select desire ones.... Cos i have reduced mine editing framework-res.apk only.
Click to expand...
Click to collapse
U can select ur desired one
Rajeev said:
U can select ur desired one
Click to expand...
Click to collapse
Dahs nice.... Av yhu been able to solve yur errors?
whalesplaho said:
Dahs nice.... Av yhu been able to solve yur errors?
Click to expand...
Click to collapse
Trying..
Rajeev said:
Trying..
Click to expand...
Click to collapse
Might try when i get home..... Keep trying brov
whalesplaho said:
Might try when i get home..... Keep trying brov
Click to expand...
Click to collapse
Tried several times. Not working for me. May be i am unlucky this time. I had problems with services.jar. Getting bootloop every time
Rajeev said:
Tried several times. Not working for me. May be i am unlucky this time. I had problems with services.jar. Getting bootloop every time
Click to expand...
Click to collapse
Deleted
Rajeev said:
Trying..
Click to expand...
Click to collapse
whalesplaho said:
Might try when i get home..... Keep trying brov
Click to expand...
Click to collapse
Rajeev said:
Tried several times. Not working for me. May be i am unlucky this time. I had problems with services.jar. Getting bootloop every time
Click to expand...
Click to collapse
jitz975 said:
Deleted
Click to expand...
Click to collapse
Oops sorry my mistake
Gonna edit
Small typo. And it will work bro [emoji14]
venkat kamesh said:
Oops sorry my mistake
Gonna edit
Small typo. And it will work bro [emoji14]
Click to expand...
Click to collapse
Thanks bro waiting...
@venkat kamesh - I've gotten everything working and no bootloops. However, my settings isn't working. I have the seekbars and everything showing I can slide them, but they do not have any effect on the navbar
Bloodlvst said:
@venkat kamesh - I've gotten everything working and no bootloops. However, my settings isn't working. I have the seekbars and everything showing I can slide them, but they do not have any effect on the navbar
Click to expand...
Click to collapse
Oops my mistake bro
A small typo again haha will correct it
venkat kamesh said:
Oops my mistake bro
A small typo again haha will correct it
Click to expand...
Click to collapse
Waiting bro