[MOD][HOW-TO] Display/Hide Alarm icon in real time - AT&T, Rogers, Bell, Telus Samsung Galaxy S III

This will allow you to hide/display the alarm icon in real time. Useful for users that always have an alarm and don't want the icon constantly in the statusbar.
We're going to be working with the following two files:
SecSettings.apk
SystemUI.apk
KEY
REMOVE what's in BLUE
ADD what's in RED
SecSettings.apk
Navigate to /res/values/strings.xml
Add the following to the end of the file
Code:
<string name="alarm_icon_title">Alarm icon</string>
<string name="alarm_icon_summary">Change alarm in order for it to take effect</string>
Navigate to /xml/display_settings.xml
Add the following line wherever you would like it to show in the menu
Code:
<CheckBoxPreference android:title="@string/alarm_icon_title" android:key="alarm_icon" android:summary="@string/alarm_icon_summary" />
Navigate to /smali/com/android/settings/DisplaySettings.smali
Code:
.field private mAccelerometerSecond:Landroid/preference/CheckBoxPreference;
[COLOR="Red"].field private mAlarmIcon:Landroid/preference/CheckBoxPreference;[/COLOR]
.field private mAnimationHandler:Landroid/os/Handler;
.method private updateState()V
Code:
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v4, "display_battery_percentage"
invoke-static {v0, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-eqz v0, :cond_4
move v0, v1
:goto_1
invoke-virtual {v3, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[COLOR="red"]iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mAlarmIcon:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v4, "alarm_icon"
invoke-static {v0, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-eqz v0, :cond_alarm
move v0, v1
:goto_alarm
invoke-virtual {v3, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR]
Code:
[COLOR="red"]:cond_alarm
move v0, v2
goto/16 :goto_alarm[/COLOR]
:cond_b
move v0, v2
goto :goto_8
:cond_c
move v1, v2
.line 856
goto :goto_9
.end method
.method public onCreate(Landroid/os/BundleV
Code:
const-string v11, "display_battery_level"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
[COLOR="red"]const-string v11, "alarm_icon"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mAlarmIcon:Landroid/preference/CheckBoxPreference;[/COLOR]
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getActivity()Landroid/app/Activity;
move-result-object v11
invoke-static {v11}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z
move-result v11
if-eqz v11, :cond_6
.method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/PreferenceZ
Code:
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 920
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "display_battery_percentage"
if-eqz v0, :cond_5
move v2, v1
:cond_5
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_2
:cond_6
[COLOR="red"]iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mAlarmIcon:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_next
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mAlarmIcon:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "alarm_icon"
if-eqz v0, :cond_alarm
move v2, v1
:cond_alarm
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_2
:cond_next[/COLOR]
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mNotificationPulse:Landroid/preference/CheckBoxPreference;
if-ne p2, v0, :cond_10
.line 923
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mNotificationPulse:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
Compile and test!

Now for SystemUI.apk
Navigate to /smali/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.smali
.method private final updateAlarm(Landroid/content/IntentV
Code:
.method private final updateAlarm(Landroid/content/Intent;)V
[COLOR="Red"].locals 5[/COLOR]
.parameter "intent"
.prologue
.line 194
[COLOR="Red"]const/4 v3, 0x0[/COLOR]
const-string v1, "alarmSet"
const/4 v2, 0x0
invoke-virtual {p1, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v0
[COLOR="red"]iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "alarm_icon"
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-nez v1, :cond_0
move v0, v3[/COLOR]
.line 195
.local v0, alarmSet:Z
[COLOR="red"]:cond_0[/COLOR]
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v2, "alarm_clock"
invoke-virtual {v1, v2, v0}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
.line 196
return-void
.end method
That's it. Compile and test!

On a roll I see. Thanks Loserskater
Worked. Thank you
Sent from my SAMSUNG-SGH-I747 using xda premium

Great mod boss, and very useful!!! :good::highfive:

This works perfectly on my Sprint GS3. Thanks for another great tutorial loserskater. By any chance do you have one for the bluetooth icon?

THX works for me with a hot boot, not in real time (I9100)
Perhaps any solutions for this ?
Thx

If you change, add, or delete an alarm this mod should take effect without a reboot.

metalfan78 said:
If you change, add, or delete an alarm this mod should take effect without a reboot.
Click to expand...
Click to collapse
You´re right THX

You're welcome

Related

[MOD][HOW-TO] Long press volume mod 3.0 (updated for 4.3)

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

[GUIDE] [HOW-TO] Disable Screen Wake Plugged/Unplugged State Android 4.3

Power Wake Mod Guide Android 4.3
This completely disables screen wake for both power plugged and unplugged states.
Note: There is a bools entry for the unplugged state but this was written for those devs that want to add toggles for the mods later.
Services.jar edits:
smali\com\android\server\power\PowerManagerService.smali
These edits are in .method private updateIsPoweredLocked(I)V
Red - Remove
Blue - New Code
Remove line in Red:
Code:
const-string v4, "power"
invoke-virtual {v0, v4}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v8
check-cast v8, Landroid/os/PowerManager;
const v0, 0x1000000a
const-string v4, "charger plug"
invoke-virtual {v8, v0, v4}, Landroid/os/PowerManager;->newWakeLock(ILjava/lang/String;)Landroid/os/PowerManager$WakeLock;
move-result-object v7
invoke-virtual {v7, v3}, Landroid/os/PowerManager$WakeLock;->setReferenceCounted(Z)V
const-wide/16 v4, 0x2710
[COLOR="Red"]invoke-virtual {v7, v4, v5}, Landroid/os/PowerManager$WakeLock;->acquire(J)V
[/COLOR]
:cond_1
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v1
iget v0, p0, Lcom/android/server/power/PowerManagerService;->mAutoPowerOffTimeoutSetting:I
if-lez v0, :cond_2
invoke-direct {p0, v1, v2}, Lcom/android/server/power/PowerManagerService;->resetAutoPowerOffTimerNoUpdateLocked(J)Z
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/server/power/PowerManagerService;->mPowerIsChanged:Z
A couple additional edits just a few lines lower.
Code:
:cond_2
invoke-direct {p0, v10, v9, v6}, Lcom/android/server/power/PowerManagerService;->shouldWakeUpWhenPluggedOrUnpluggedLocked(ZIZ)Z
move-result v0
[COLOR="Blue"] goto :goto_td ### No Wake Unplug[/COLOR]
if-eqz v0, :cond_3
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
iget-object v4, p0, Lcom/android/server/power/PowerManagerService;->mScreenOnReason:Ljava/lang/String;
invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v4, " powered change"
invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/android/server/power/PowerManagerService;->mScreenOnReason:Ljava/lang/String;
invoke-direct {p0, v1, v2}, Lcom/android/server/power/PowerManagerService;->wakeUpNoUpdateLocked(J)Z
[COLOR="Blue"]:goto_td ### No Wake Unplug[/COLOR]
:cond_3
const/16 v5, 0x3e8

[GUIDE] [SMALI] Theme Accent Colored SystemUI.apk - v1.0 - 08/02/2015

Here is simple smali editing guide showing you how to give your SystemUI.apk runtime theme accent color change!​
Changes that you will get by this guide was originally implemented by me here and later on my Xperia™ Xposed (KK) module, also brilliantly ported by:
- 4.3: @kongaz2 (here)
- 4.2.2: @STRYDER~007 (here)
Screenshot:
{
"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"
}
Requirements:
- Original Xperia™ stock SystemUI.apk
- Read lines below carefully
- Not to be afraid of FCs you will probably face
TRY IT AT YOUR OWN RISK
Here we go...
- Decompile SystemUI.apk v1.2 from my thread.
- Decompile KK one (yours)
I´m gonna show you where exactly I put accent color related code and you compare both decompiled smali files to get diffs (in red) ok!!
ToolsMain.smali
Code:
# instance fields
[COLOR="Red"].field private mAccentColorId:I[/COLOR]
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/view/ViewGroup;)V
.locals 4
.parameter "context"
.parameter "parent"
.
.
[COLOR="red"].line 105
iget-object v0, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const-string v1, "somc_accent_color_neutral"
const-string v2, "color"
const-string v3, "com.sonyericsson.uxp"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v0
iput v0, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;->mAccentColorId:I[/COLOR]
Code:
[COLOR="red"].method static synthetic access$1000(Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;)V
.locals 0
.parameter "x0"
.prologue
.line 47
invoke-direct {p0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;->colorize()V
return-void
.end method[/COLOR]
Code:
[COLOR="red"].method private colorize()V
.locals 4
.prologue
.line 749
iget v2, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;->mAccentColorId:I
if-eqz v2, :cond_0
.line 750
iget-object v2, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;->mButtons:Ljava/util/LinkedList;
invoke-virtual {v2}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;
move-result-object v0
.local v0, i$:Ljava/util/Iterator;
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_0
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;
.line 751
.local v1, toolButton:Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;
iget-object v2, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
iget v3, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;->mAccentColorId:I
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v2
invoke-virtual {v1, v2}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->colorize(I)V
goto :goto_0
.line 754
.end local v0 #i$:Ljava/util/Iterator;
.end local v1 #toolButton:Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;
:cond_0
return-void
.end method[/COLOR]
Code:
.method public configurationChanged(Landroid/content/res/Configuration;)V
.locals 5
.parameter "newConfig"
.
.
.line 1020
:cond_1
[COLOR="red"]invoke-direct {p0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;->colorize()V[/COLOR]
.line 1021
return-void
Code:
.method public start()V
.locals 5
.
.
[COLOR="red"].line 162
invoke-direct {p0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;->colorize()V[/COLOR]
.line 163
return-void
.end method
Code:
.method private reCreateButtons()V
.locals 17
.
.
.line 200
.end local v7 #i:I
:cond_4
[COLOR="red"]invoke-direct {p0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;->colorize()V
.line 201[/COLOR]
return-void
.end method
ToolsMain$1.smali
Code:
# virtual methods
.method public onChange(Z)V
.locals 4
.parameter "selfChange"
.
.
.line 124
iget-object v3, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsMain$1;->this$0:Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;
#calls: Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;->startServices()V
invoke-static {v3}, Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;->access$400(Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;)V
[COLOR="Red"] .line 125
iget-object v3, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsMain$1;->this$0:Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;
#calls: Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;->colorize()V
invoke-static {v3}, Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;->access$1000(Lcom/sonymobile/systemui/statusbar/tools/ToolsMain;)V[/COLOR]
ToolsButton.smali
Code:
[COLOR="Red"].method public colorize(I)V
.locals 1
.parameter "color"
.prologue
.line 447
iput p1, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mAccentColor:I
.line 450
iget-object v0, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mIcon:Landroid/widget/ImageView;
invoke-direct {p0, v0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->colorize(Landroid/widget/ImageView;)V
.line 451
iget-object v0, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mLabel:Landroid/widget/TextView;
invoke-direct {p0, v0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->colorize(Landroid/widget/TextView;)V
.line 452
iget-object v0, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->mAnimationView:Landroid/widget/ImageView;
invoke-direct {p0, v0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsButton;->colorize(Landroid/widget/ImageView;)V
.line 453
return-void
.end method[/COLOR]
ToolsTabWidget.smali
Code:
.method public setCurrentTab(I)V
.locals 2
.parameter "index"
.prologue
.line 101
invoke-super {p0, p1}, Landroid/widget/TabWidget;->setCurrentTab(I)V
.line 102
if-ltz p1, :cond_0
invoke-virtual {p0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsTabWidget;->getTabCount()I
move-result v0
if-ge p1, v0, :cond_0
iget v0, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsTabWidget;->mCurrentTab:I
if-ne p1, v0, :cond_1
.line 106
:cond_0
:goto_0
[COLOR="Red"]invoke-virtual {p0, p1}, Lcom/sonymobile/systemui/statusbar/tools/ToolsTabWidget;->getChildTabViewAt(I)Landroid/view/View;
move-result-object v0
invoke-virtual {p0}, Lcom/sonymobile/systemui/statusbar/tools/ToolsTabWidget;->getTabCount()I
move-result v1
invoke-direct {p0, v0, p1, v1}, Lcom/sonymobile/systemui/statusbar/tools/ToolsTabWidget;->setActiveTabColorFilter(Landroid/view/View;II)V[/COLOR]
.line 107
return-void
.line 105
:cond_1
iput p1, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsTabWidget;->mCurrentTab:I
goto :goto_0
.end method
Code:
[COLOR="Red"].method private setActiveTabColorFilter(Landroid/view/View;II)V
.locals 10
.parameter "view"
.parameter "activeTab"
.parameter "tabCount"
.prologue
.line 43
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v7
invoke-virtual {v7}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
.line 44
.local v3, res:Landroid/content/res/Resources;
const-string v7, "somc_accent_color_neutral"
const-string v8, "color"
const-string v9, "com.sonyericsson.uxp"
invoke-virtual {v3, v7, v8, v9}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v1
.line 46
.local v1, accentNeutralResId:I
if-nez v1, :cond_1
.line 74
:cond_0
:goto_0
return-void
.line 51
:cond_1
:try_start_0
invoke-virtual {v3, v1}, Landroid/content/res/Resources;->getColor(I)I
move-result v0
.line 53
.local v0, accentNeutralColor:I
const/4 v4, 0x0
.local v4, tabIndex:I
:goto_1
if-ge v4, p3, :cond_0
.line 55
invoke-virtual {p0, v4}, Lcom/sonymobile/systemui/statusbar/tools/ToolsTabWidget;->getChildTabViewAt(I)Landroid/view/View;
move-result-object v5
.line 56
.local v5, tabView:Landroid/view/View;
const-string v7, "title"
const-string v8, "id"
const-string v9, "android"
invoke-virtual {v3, v7, v8, v9}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v7
invoke-virtual {v5, v7}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v6
check-cast v6, Landroid/widget/TextView;
.line 58
.local v6, titleView:Landroid/widget/TextView;
invoke-virtual {v5}, Landroid/view/View;->getBackground()Landroid/graphics/drawable/Drawable;
move-result-object v7
invoke-virtual {v7}, Landroid/graphics/drawable/Drawable;->clearColorFilter()V
.line 59
iget-object v7, p0, Lcom/sonymobile/systemui/statusbar/tools/ToolsTabWidget;->mTabTextColor:Landroid/content/res/ColorStateList;
invoke-virtual {v6, v7}, Landroid/widget/TextView;->setTextColor(Landroid/content/res/ColorStateList;)V
.line 61
if-ne v4, p2, :cond_2
.line 63
invoke-virtual {v5}, Landroid/view/View;->getBackground()Landroid/graphics/drawable/Drawable;
move-result-object v7
new-instance v8, Landroid/graphics/PorterDuffColorFilter;
sget-object v9, Landroid/graphics/PorterDuff$Mode;->MULTIPLY:Landroid/graphics/PorterDuff$Mode;
invoke-direct {v8, v0, v9}, Landroid/graphics/PorterDuffColorFilter;-><init>(ILandroid/graphics/PorterDuff$Mode;)V
invoke-virtual {v7, v8}, Landroid/graphics/drawable/Drawable;->setColorFilter(Landroid/graphics/ColorFilter;)V
.line 64
invoke-virtual {v6, v0}, Landroid/widget/TextView;->setTextColor(I)V
:try_end_0
.catch Landroid/content/res/Resources$NotFoundException; {:try_start_0 .. :try_end_0} :catch_0
.line 53
:cond_2
add-int/lit8 v4, v4, 0x1
goto :goto_1
.line 69
.end local v0 #accentNeutralColor:I
.end local v4 #tabIndex:I
.end local v5 #tabView:Landroid/view/View;
.end local v6 #titleView:Landroid/widget/TextView;
:catch_0
move-exception v2
.line 71
.local v2, e:Landroid/content/res/Resources$NotFoundException;
invoke-virtual {v2}, Landroid/content/res/Resources$NotFoundException;->printStackTrace()V
goto :goto_0
.end method[/COLOR]
SomcTabsNotificationPanelView.smali
Code:
# instance fields
[COLOR="Red"].field private mExpanded:Z[/COLOR]
Code:
# virtual methods
.method public onConfigurationChanged()V
.locals 3
.
.
.line 102
:cond_0
[COLOR="Red"] iget-boolean v0, p0, Lcom/sonymobile/systemui/statusbar/tools/SomcTabsNotificationPanelView;->mExpanded:Z
if-nez v0, :cond_1
.line 104
iget-object v2, p0, Lcom/sonymobile/systemui/statusbar/tools/SomcTabsNotificationPanelView;->mTabHost:Landroid/widget/TabHost;
if-eqz v2, :cond_1
.line 106
iget-object v2, p0, Lcom/sonymobile/systemui/statusbar/tools/SomcTabsNotificationPanelView;->mTabHost:Landroid/widget/TabHost;
invoke-virtual {v2}, Landroid/widget/TabHost;->clearAllTabs()V
.line 107
const/4 v2, 0x0
iput-object v2, p0, Lcom/sonymobile/systemui/statusbar/tools/SomcTabsNotificationPanelView;->mTabHost:Landroid/widget/TabHost;
.line 109
invoke-direct {p0}, Lcom/sonymobile/systemui/statusbar/tools/SomcTabsNotificationPanelView;->initTabs()V
.line 111
:cond_1[/COLOR]
return-void
.end method
Code:
.method public onExpandedChanged(Z)V
.locals 2
.parameter "expanded"
.prologue
[COLOR="Red"].line 292
iput-boolean p1, p0, Lcom/sonymobile/systemui/statusbar/tools/SomcTabsNotificationPanelView;->mExpanded:Z
.line 293[/COLOR]
if-eqz p1, :cond_0
RecentsPanelView.smali
Code:
.method private showImpl(Z)V
.locals 5
.parameter "show"
.prologue
const/4 v2, 0x0
const/4 v1, 0x1
[COLOR="Red"].line 364
invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->setRecentsNoAppsTextColor()V[/COLOR]
.line 365
iget-object v3, p0, Lcom/android/systemui/recent/RecentsPanelView;->mContext:Landroid/content/Context;
const-string v4, "recentapps"
invoke-static {v3, v4}, Lcom/android/systemui/recent/RecentsPanelView;->sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V
Code:
[COLOR="Red"].method private setRecentsNoAppsTextColor()V
.locals 8
.prologue
.line 86
iget-object v5, p0, Lcom/android/systemui/recent/RecentsPanelView;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v4
.line 87
.local v4, res:Landroid/content/res/Resources;
const-string v5, "somc_accent_color_neutral"
const-string v6, "color"
const-string v7, "com.sonyericsson.uxp"
invoke-virtual {v4, v5, v6, v7}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v1
.line 89
.local v1, accentNeutralResId:I
if-nez v1, :cond_0
.line 104
:goto_0
return-void
.line 94
:cond_0
:try_start_0
invoke-virtual {v4, v1}, Landroid/content/res/Resources;->getColor(I)I
move-result v0
.line 96
.local v0, accentNeutralColor:I
const v5, 0x7f0800a5
invoke-virtual {p0, v5}, Lcom/android/systemui/recent/RecentsPanelView;->findViewById(I)Landroid/view/View;
move-result-object v3
check-cast v3, Landroid/widget/TextView;
.line 97
.local v3, recentsNoAppsText:Landroid/widget/TextView;
invoke-virtual {v3, v0}, Landroid/widget/TextView;->setTextColor(I)V
:try_end_0
.catch Landroid/content/res/Resources$NotFoundException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
.line 99
.end local v0 #accentNeutralColor:I
.end local v3 #recentsNoAppsText:Landroid/widget/TextView;
:catch_0
move-exception v2
.line 101
.local v2, e:Landroid/content/res/Resources$NotFoundException;
invoke-virtual {v2}, Landroid/content/res/Resources$NotFoundException;->printStackTrace()V
goto :goto_0
.end method[/COLOR]
PhoneStatusBar.smali
Code:
.method makeExpandedVisible()V
.locals 5
.prologue
const/4 v3, 0x1
.line 1995
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z
if-nez v0, :cond_0
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->panelsEnabled()Z
move-result v0
if-nez v0, :cond_1
.line 2027
:cond_0
:goto_0
return-void
.line 1999
:cond_1
iput-boolean v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z
.line 2000
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPile:Lcom/android/systemui/statusbar/policy/NotificationRowLayout;
invoke-virtual {v0, v3}, Lcom/android/systemui/statusbar/policy/NotificationRowLayout;->setLayoutTransitionsEnabled(Z)V
.line 2001
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNavigationBarView:Lcom/android/systemui/statusbar/phone/NavigationBarView;
if-eqz v0, :cond_2
.line 2002
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNavigationBarView:Lcom/android/systemui/statusbar/phone/NavigationBarView;
invoke-virtual {v0, v3}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->setSlippery(Z)V
.line 2004
:cond_2
invoke-virtual {p0, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateCarrierLabelVisibility(Z)V
.line 2006
const/16 v0, -0x2710
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateExpandedViewPos(I)V
[COLOR="red"].line 2007
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const-string v1, "somc_accent_color_neutral"
const-string v2, "color"
const-string v4, "com.sonyericsson.uxp"
invoke-virtual {v0, v1, v2, v4}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v1
.line 2008
if-eqz v1, :cond_3
.line 2009
:try_start_0
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getColor(I)I
move-result v2
.line 2010
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanelHeader:Landroid/view/View;
const v4, 0x7f08007b
invoke-virtual {v0, v4}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/TextView;
invoke-virtual {v0, v2}, Landroid/widget/TextView;->setTextColor(I)V
.line 2012
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v4, 0x7f08007e
invoke-virtual {v0, v4}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/Button;
invoke-virtual {v0, v2}, Landroid/widget/Button;->setTextColor(I)V
.line 2013
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v4, 0x7f08007f
invoke-virtual {v0, v4}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/Button;
invoke-virtual {v0, v2}, Landroid/widget/Button;->setTextColor(I)V
:try_end_0
.catch Landroid/content/res/Resources$NotFoundException; {:try_start_0 .. :try_end_0} :catch_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
.line 2016
:cond_3
:goto_1[/COLOR]
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
move-result-object v0
check-cast v0, Landroid/view/WindowManager$LayoutParams;
.line 2017
iget v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
and-int/lit8 v1, v1, -0x9
iput v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
.line 2018
iget v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
const/high16 v2, 0x2
or-int/2addr v1, v2
iput v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
.line 2019
const/4 v1, -0x1
iput v1, v0, Landroid/view/WindowManager$LayoutParams;->height:I
.line 2020
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mWindowManager:Landroid/view/WindowManager;
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
invoke-interface {v1, v2, v0}, Landroid/view/WindowManager;->updateViewLayout(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
.line 2021
invoke-virtual {p0, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->visibilityChanged(Z)V
.line 2022
invoke-virtual {p0, v3, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setInteracting(IZ)V
.line 2023
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/NotificationPanelView;
instance-of v0, v0, Lcom/sonymobile/systemui/statusbar/tools/SomcTabsNotificationPanelView;
if-eqz v0, :cond_0
.line 2024
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/NotificationPanelView;
check-cast v0, Lcom/sonymobile/systemui/statusbar/tools/SomcTabsNotificationPanelView;
invoke-virtual {v0, v3}, Lcom/sonymobile/systemui/statusbar/tools/SomcTabsNotificationPanelView;->onExpandedChanged(Z)V
.line 2025
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->isAccessibilityEnabled()Z
move-result v0
if-eqz v0, :cond_0
.line 2026
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const/4 v1, 0x4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->setVisibility(I)V
goto/16 :goto_0
[COLOR="red"].line 1854
:catch_0
move-exception v0
.line 1855
const-string v0, "PhoneStatusBar"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "Can not find color resource "
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
move-result-object v1
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_1
.line 1856
:catch_1
move-exception v0
.line 1857
const-string v0, "PhoneStatusBar"
const-string v1, "Can not colorize the clock"
invoke-static {v0, v1}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_1[/COLOR]
.end method
Pay attention on every method, in some cases I have needed to increase .locals value (underneath method name)
That´s it!! Good luck... \m/
Changelog
v1.0 - 08/02/2015:
- Initial release
@serajr thanks you
I needed a lot
Keep good work
Nice tut blood bro @serajr
Keep it up, very usefull for new people
Sent From Somewhere On Earth With My Z2 ^^
Amazing guide sir!! Thanks a lot.. :highfive::good:
omg !!!!
Amazing
Thanks :good::good::good:
Nice
It looks good and possible! However im just lazy and it looks scary to me!
WoW
well done :good:
Congratulations!!
Congratulations sir!! Your fantastic guide is on portal!! :good:
STRYDER~007 said:
Congratulations sir!! Your fantastic guide is on portal!! :good:
Click to expand...
Click to collapse
Wow... xda guys are faster than never!
Thank you bro!!!
thanks @serajr ^^ nice tut ^^
@serajr awesome.
Thanks Bro. Greats! Regards ?✌
Sent from my Sony Xperia Z3 Sensation - D6643 by Ogunja ??✌
serajr said:
v1.0 - 08/02/2015:
- Initial release
Click to expand...
Click to collapse
Nice work @serajr :highfive:
The Master did it again!!Thanks Master of smali coding----->@serajr :good:
This guide blows my mind
Any simpler guide or something else like that?
MT27i said:
This guide blows my mind
Any simpler guide or something else like that?
Click to expand...
Click to collapse
There's a way to get theme accent without editing any smali.
idid idamrep said:
There's a way to get theme accent without editing any smali.
Click to expand...
Click to collapse
Exactly!
I'm gonna try updating this guide with Lollipop SystemUI.apk.
No ETA, please!
Awesome guide!

[Guide][tut] HeadsUp timeOut settings

Hello guys here go a simple tut
all you need is Deodexed Systemui.apk
1. Decompile SystemUI.apk
2. Open Systemui.apk/smali/com/android/statusbar/phone/PhoneStatusBar.smali
and find this Method
Code:
.method public resetHeadsUpDecayTimer()V
and completely replace with this method
Code:
.method public resetHeadsUpDecayTimer()V
.locals 5
.prologue
const/16 v4, 0x407
.line 1756
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHandler:Lcom/android/systemui/statusbar/BaseStatusBar$H;
invoke-virtual {v0, v4}, Lcom/android/systemui/statusbar/BaseStatusBar$H;->removeMessages(I)V
.line 1757
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mUseHeadsUp:Z
if-eqz v0, :cond_0
iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHeadsUpNotificationDecay:I
if-lez v0, :cond_0
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHeadsUpNotificationView:Lcom/android/systemui/statusbar/policy/HeadsUpNotificationView;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/policy/HeadsUpNotificationView;->isClearable()Z
move-result v0
if-eqz v0, :cond_0
.line 1759
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHandler:Lcom/android/systemui/statusbar/BaseStatusBar$H;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "heads_up_timeout"
const/16 v3, 0xbb8
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
int-to-long v2, v1
invoke-virtual {v0, v4, v2, v3}, Lcom/android/systemui/statusbar/BaseStatusBar$H;->sendEmptyMessageDelayed(IJ)Z
.line 1761
:cond_0
return-void
.end method
Done...!
save it and close
Now compile/sign it and replace the systemui.apk
Control with my app (Click here)
Have fun....
Dont forgot to tag me if you use my work
Thank u very much bro works fine

[Guide][tut] Volume keys move cursor control

hello guys
after very day
i am presenting you new tut
so this is very easy tut
all you need is patience
you need
1. Framework.jar
2. Decompile framework.jar
3. open framework.jar\smali\android\inputmethodservice\InputMethodService.smali
find this
Code:
.field mToken:Landroid/os/IBinder;
after that add this
Code:
.field mVolumeKeyCursorControl:I
Now look for this method
Code:
.method public onKeyDown(ILandroid/view/KeyEvent;)Z
and completely replace this method with this
Code:
.method public onKeyDown(ILandroid/view/KeyEvent;)Z
.locals 7
const/16 v0, 0x16
const/16 v1, 0x15
const/4 v6, 0x2
const/4 v2, 0x1
const/4 v3, 0x0
invoke-virtual {p2}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v4
const/4 v5, 0x4
if-ne v4, v5, :cond_1
invoke-direct {p0, v3}, Landroid/inputmethodservice/InputMethodService;->handleBack(Z)Z
move-result v0
if-eqz v0, :cond_0
invoke-virtual {p2}, Landroid/view/KeyEvent;->startTracking()V
move v0, v2
:goto_0
return v0
:cond_0
move v0, v3
goto :goto_0
:cond_1
invoke-virtual {p2}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v4
const/16 v5, 0x18
if-ne v4, v5, :cond_4
invoke-virtual {p0}, Landroid/inputmethodservice/InputMethodService;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string/jumbo v5, "krypton_keyboard_volume_control"
invoke-static {v4, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
iput v4, p0, Landroid/inputmethodservice/InputMethodService;->mVolumeKeyCursorControl:I
invoke-virtual {p0}, Landroid/inputmethodservice/InputMethodService;->isInputViewShown()Z
move-result v4
if-eqz v4, :cond_3
iget v4, p0, Landroid/inputmethodservice/InputMethodService;->mVolumeKeyCursorControl:I
if-eqz v4, :cond_3
iget v3, p0, Landroid/inputmethodservice/InputMethodService;->mVolumeKeyCursorControl:I
if-ne v3, v6, :cond_2
:goto_1
invoke-virtual {p0, v0}, Landroid/inputmethodservice/InputMethodService;->sendDownUpKeyEvents(I)V
move v0, v2
goto :goto_0
:cond_2
move v0, v1
goto :goto_1
:cond_3
move v0, v3
goto :goto_0
:cond_4
invoke-virtual {p2}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v4
const/16 v5, 0x19
if-ne v4, v5, :cond_7
invoke-virtual {p0}, Landroid/inputmethodservice/InputMethodService;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string/jumbo v5, "krypton_keyboard_volume_control"
invoke-static {v4, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
iput v4, p0, Landroid/inputmethodservice/InputMethodService;->mVolumeKeyCursorControl:I
invoke-virtual {p0}, Landroid/inputmethodservice/InputMethodService;->isInputViewShown()Z
move-result v4
if-eqz v4, :cond_6
iget v4, p0, Landroid/inputmethodservice/InputMethodService;->mVolumeKeyCursorControl:I
if-eqz v4, :cond_6
iget v3, p0, Landroid/inputmethodservice/InputMethodService;->mVolumeKeyCursorControl:I
if-ne v3, v6, :cond_5
:goto_2
invoke-virtual {p0, v1}, Landroid/inputmethodservice/InputMethodService;->sendDownUpKeyEvents(I)V
move v0, v2
goto :goto_0
:cond_5
move v1, v0
goto :goto_2
:cond_6
move v0, v3
goto :goto_0
:cond_7
const/4 v0, -0x1
invoke-virtual {p0, p1, p2, v0}, Landroid/inputmethodservice/InputMethodService;->doMovementKey(ILandroid/view/KeyEvent;I)Z
move-result v0
goto :goto_0
.end method
Now look for this method
Code:
.method public onKeyUp(ILandroid/view/KeyEvent;)Z
and completely replace with this method
Code:
.method public onKeyUp(ILandroid/view/KeyEvent;)Z
.locals 4
const/4 v0, 0x1
const/4 v1, 0x0
invoke-virtual {p2}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v2
const/4 v3, 0x4
if-ne v2, v3, :cond_1
invoke-virtual {p2}, Landroid/view/KeyEvent;->isTracking()Z
move-result v2
if-eqz v2, :cond_1
invoke-virtual {p2}, Landroid/view/KeyEvent;->isCanceled()Z
move-result v2
if-nez v2, :cond_1
invoke-direct {p0, v0}, Landroid/inputmethodservice/InputMethodService;->handleBack(Z)Z
move-result v0
:cond_0
:goto_0
return v0
:cond_1
invoke-virtual {p2}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v2
const/16 v3, 0x18
if-eq v2, v3, :cond_2
const/16 v2, 0x19
if-ne p1, v2, :cond_4
:cond_2
invoke-virtual {p0}, Landroid/inputmethodservice/InputMethodService;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string/jumbo v3, "krypton_keyboard_volume_control"
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
iput v2, p0, Landroid/inputmethodservice/InputMethodService;->mVolumeKeyCursorControl:I
invoke-virtual {p0}, Landroid/inputmethodservice/InputMethodService;->isInputViewShown()Z
move-result v2
if-eqz v2, :cond_3
iget v2, p0, Landroid/inputmethodservice/InputMethodService;->mVolumeKeyCursorControl:I
if-nez v2, :cond_0
:cond_3
move v0, v1
goto :goto_0
:cond_4
const/4 v0, -0x2
invoke-virtual {p0, p1, p2, v0}, Landroid/inputmethodservice/InputMethodService;->doMovementKey(ILandroid/view/KeyEvent;I)Z
move-result v0
goto :goto_0
.end method
Done save and compile and replace
Now for settings look for post #2
settings.apk final part
Download this settings app
Install it and apply
Reboot is required to take action
View attachment app-release.apk
a part of my rom
Dont forgot to mention me if you use my work
that feels me good
screenshot bro?
Need deodex rom to work or it was safe for odex rom?
@venkat kamesh
Could you please make this as an xposed app! Thank you very much!
Really appreciate for sharing this sir. I confirm that this mod works on Samsung Galaxy Note 3 running TW android 5.0 :good:
Hello! I do not have a smali folder in my framework.jar decopmiled . Any ideas>
Thanks
@venkat kamesh If I copy the smalis and xmls from your file to settings and merge xmls, and ofc, replace public ids, will I get the options in settings ?
Thanks!
My new app Cursor Control lets you use the volume keys to easily move the cursor in text fields and works without Root.
mrYoussef135 said:
My new app Cursor Control lets you use the volume keys to easily move the cursor in text fields and works without Root.
Click to expand...
Click to collapse
What's the fun in that? :laugh:

Categories

Resources