Related
First of all, a big thanks to one_love_420 for doing this modification for our EVO LTEs. Now, of course I had to pick apart the mod and figure out how to do it for myself for future reference and low and behold, it worked.
I have attached a flashable zip to make this easier. It also includes the advanced power menu and long press home for recent apps. If you use Titanium Backup to odex the system apps, you must remove odex files before flashing OR before rebooting after flashing or you will get FCs.
Another Team XPOSED exclusive!
Step 1: grab android.policy.jar and decompile it OR extract classes.dex from it and use baksmali to decompile.
Step 2: navigate to com\android\internal\policy\impl\PhoneWindowManager.smali and open that.
Before we begin, let me add a legend so that you know what commands mean what.
Command Legend
FIND: This means search for
AFTER-ADD: This means after the line you've searched for, add the following below it. You can press enter to make a few lines. I would do 3 so that you can add whatever you need to in the middle, keeping the code looking the same.
FIND-AROUND: This means that you search around the previous FIND. Somewhere in the vicinity that's not really searchable for the first time because of multiple instances. Most of the time you can search with your eyes instead of with the actual search command.
REPLACE: You completely replace whatever you are told to replace with what comes after the REPLACE command.
REPLACE-WITH: This is roughly the same as REPLACE, but is used when there is nothing to FIND-AROUND.
REMOVE: You completely remove what is said below the REMOVE command.
ADD-BEFORE: This means after the line you've searched for, add the following above it. You can press enter to make a few lines. I would do 3 so that you can add whatever you need to in the middle, keeping the code looking the same.
Let us begin with actual smali code modifications.
Step 3: FIND
Code:
.field mIsHtcDockScreenAsHome:Z
AFTER-ADD
Code:
.field mIsLongPress:Z
FIND
Code:
.field private mVolumeDownKeyTriggered:Z
AFTER-ADD
Code:
.field mVolumeDownLongPress:Ljava/lang/Runnable;
FIND
Code:
.field private mVolumeUpKeyTriggered:Z
AFTER-ADD
Code:
.field mVolumeUpLongPress:Ljava/lang/Runnable;
.field mWakeAcquired:Z
FIND
Code:
iput-boolean v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsGuestMode:Z
AFTER-ADD
Code:
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressF;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressF;-><init>
(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mVolumeUpLongPress:Ljava/lang/Runnable;
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressR;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressR;-><init>
(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mVolumeDownLongPress:Ljava/lang/Runnable;
iput-boolean v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWakeAcquired:Z
FIND
Code:
iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
FIND-AROUND
Code:
throw v2
.end method
ADD-AFTER
Code:
.method handleVolumeLongPress(I)V
.locals 4
const/16 v1, 0x18
if-ne p1, v1, :cond_11
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mVolumeUpLongPress:Ljava/lang/Runnable;
:goto_6
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mHandler:Landroid/os/Handler;
invoke-static {}, Landroid/view/ViewConfiguration;->getLongPressTimeout()I
move-result v2
int-to-long v2, v2
invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
:cond_11
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mVolumeDownLongPress:Ljava/lang/Runnable;
goto :goto_6
.end method
.method handleVolumeLongPressAbort()V
.locals 2
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mVolumeUpLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mVolumeDownLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
return-void
.end method
FIND
Code:
:cond_215
const/16 v20, 0x0
goto :goto_201
:sswitch_218
const/16 v20, 0x19
FIND-AROUND
Code:
:sswitch_218
ADD-AFTER
Code:
if-nez v7, :cond_245
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWakeAcquired:Z
if-eqz v1, :cond_232
const-string v1, "lyapota"
const-string v2, "media_key WakeLock release"
invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
iget-object v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v1}, Landroid/os/PowerManager$WakeLock;->release()V
const/4 v2, 0x0
iput-boolean v2, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWakeAcquired:Z
:cond_232
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsLongPress:Z
if-nez v0, :cond_245
and-int/lit8 v20, v18, 0x1
if-nez v20, :cond_245
const/16 v20, 0x3
move-object/from16 v0, p0
move/from16 v1, v20
invoke-virtual {v0, v1, v14}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_245
FIND
Code:
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
FIND-AROUND
Code:
if-eqz v20, :cond_2c
ADD-AFTER
Code:
move-object/from16 v0, p0
iget-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWakeAcquired:Z
if-nez v1, :cond_320
const-string v1, "lyapota"
const-string v2, "media_key WakeLock acquire"
invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
iget-object v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v1}, Landroid/os/PowerManager$WakeLock;->acquire()V
const/4 v2, 0x1
iput-boolean v2, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWakeAcquired:Z
:cond_320
FIND
Code:
and-int/lit8 v20, v18, 0x1
if-nez v20, :cond_2c
FIND-AROUND
Code:
const/16 v20, 0x3
REPLACE
Code:
const/16 v20, 0x3
WITH
Code:
const/4 v1, 0x0
FIND
Code:
move-object/from16 v0, p0
move/from16 v1, v20
REMOVE
Code:
move/from16 v1, v20
FIND
Code:
invoke-virtual {v0, v1, v14}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
REPLACE-WITH
Code:
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsLongPress:Z
invoke-virtual {v0, v14}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress
(I)V
FIND
Code:
.method setAttachedWindowFrames(Landroid/view/WindowManagerPolicy
$WindowState;IILandroid/view/WindowManagerPolicy
$WindowState;ZLandroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
ADD-BEFORE
Code:
.method protected sendMediaButtonEvent(I)V
.locals 13
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v1
new-instance v11, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v11, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
new-instance v0, Landroid/view/KeyEvent;
const/4 v5, 0x0
const/4 v7, 0x0
move-wide v3, v1
move v6, p1
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;-><init>(JJIII)V
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v11, v4, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)
Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v11, v5}, Landroid/content/Context;->sendOrderedBroadcast
(Landroid/content/Intent;Ljava/lang/String;)V
new-instance v12, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v12, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
new-instance v3, Landroid/view/KeyEvent;
const/4 v8, 0x1
const/4 v10, 0x0
move-wide v4, v1
move-wide v6, v1
move v9, p1
invoke-direct/range {v3 .. v10}, Landroid/view/KeyEvent;-><init>(JJIII)V
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v12, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)
Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v12, v5}, Landroid/content/Context;->sendOrderedBroadcast
(Landroid/content/Intent;Ljava/lang/String;)V
return-void
.end method
Step 4: Save file and compile android.policy.jar or use smali to compile classes.dex and replace inside of android.policy.jar
Step 5: Reboot into recovery and push to phone, clear Dalvik and if you use Titanium Backup to odex, you will have to remove the odex files from /system/app/ in adb by doing "adb shell rm /system/app/*.odex"
Step 6: Reboot and prosper!
freeza said:
First of all, a big thanks to one_love_420 for doing this modification for our EVO LTEs. Now, of course I had to pick apart the mod and figure out how to do it for myself for future reference and low and behold, it worked.
Another Team XPOSED exclusive!
Step 1: grab android.policy.jar and decompile it OR extract classes.dex from it and use baksmali to decompile.
Step 2: navigate to com\android\internal\policy\impl\PhoneWindowManager.smali and open that.
Before we begin, let me add a legend so that you know what commands mean what.
Command Legend
FIND: This means search for
AFTER-ADD: This means after the line you've searched for, add the following below it. You can press enter to make a few lines. I would do 3 so that you can add whatever you need to in the middle, keeping the code looking the same.
FIND-AROUND: This means that you search around the previous FIND. Somewhere in the vicinity that's not really searchable for the first time because of multiple instances. Most of the time you can search with your eyes instead of with the actual search command.
REPLACE: You completely replace whatever you are told to replace with what comes after the REPLACE command.
REPLACE-WITH: This is roughly the same as REPLACE, but is used when there is nothing to FIND-AROUND.
REMOVE: You completely remove what is said below the REMOVE command.
ADD-BEFORE: This means after the line you've searched for, add the following above it. You can press enter to make a few lines. I would do 3 so that you can add whatever you need to in the middle, keeping the code looking the same.
Let us begin with actual smali code modifications.
Step 3: FIND
Code:
.field mIsHtcDockScreenAsHome:Z
AFTER-ADD
Code:
.field mIsLongPress:Z
FIND
Code:
.field private mVolumeDownKeyTriggered:Z
AFTER-ADD
Code:
.field mVolumeDownLongPress:Ljava/lang/Runnable;
FIND
Code:
.field private mVolumeUpKeyTriggered:Z
AFTER-ADD
Code:
.field mVolumeUpLongPress:Ljava/lang/Runnable;
.field mWakeAcquired:Z
FIND
Code:
iput-boolean v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsGuestMode:Z
AFTER-ADD
Code:
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressF;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressF;-><init>
(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mVolumeUpLongPress:Ljava/lang/Runnable;
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressR;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressR;-><init>
(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mVolumeDownLongPress:Ljava/lang/Runnable;
iput-boolean v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWakeAcquired:Z
FIND
Code:
iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
FIND-AROUND
Code:
throw v2
.end method
ADD-AFTER
Code:
.method handleVolumeLongPress(I)V
.locals 4
const/16 v1, 0x18
if-ne p1, v1, :cond_11
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mVolumeUpLongPress:Ljava/lang/Runnable;
:goto_6
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mHandler:Landroid/os/Handler;
invoke-static {}, Landroid/view/ViewConfiguration;->getLongPressTimeout()I
move-result v2
int-to-long v2, v2
invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
:cond_11
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mVolumeDownLongPress:Ljava/lang/Runnable;
goto :goto_6
.end method
.method handleVolumeLongPressAbort()V
.locals 2
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mVolumeUpLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mVolumeDownLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
return-void
.end method
FIND
Code:
:cond_215
const/16 v20, 0x0
goto :goto_201
:sswitch_218
const/16 v20, 0x19
FIND-AROUND
Code:
:sswitch_218
ADD-AFTER
Code:
if-nez v7, :cond_245
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWakeAcquired:Z
if-eqz v1, :cond_232
const-string v1, "lyapota"
const-string v2, "media_key WakeLock release"
invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
iget-object v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v1}, Landroid/os/PowerManager$WakeLock;->release()V
const/4 v2, 0x0
iput-boolean v2, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWakeAcquired:Z
:cond_232
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsLongPress:Z
if-nez v0, :cond_245
and-int/lit8 v20, v18, 0x1
if-nez v20, :cond_245
const/16 v20, 0x3
move-object/from16 v0, p0
move/from16 v1, v20
invoke-virtual {v0, v1, v14}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_245
FIND
Code:
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
FIND-AROUND
Code:
if-eqz v20, :cond_2c
ADD-AFTER
Code:
move-object/from16 v0, p0
iget-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWakeAcquired:Z
if-nez v1, :cond_320
const-string v1, "lyapota"
const-string v2, "media_key WakeLock acquire"
invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
iget-object v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v1}, Landroid/os/PowerManager$WakeLock;->acquire()V
const/4 v2, 0x1
iput-boolean v2, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWakeAcquired:Z
:cond_320
FIND
Code:
and-int/lit8 v20, v18, 0x1
if-nez v20, :cond_2c
FIND-AROUND
Code:
const/16 v20, 0x3
REPLACE
Code:
const/16 v20, 0x3
WITH
Code:
const/4 v1, 0x0
FIND
Code:
move-object/from16 v0, p0
move/from16 v1, v20
REMOVE
Code:
move/from16 v1, v20
FIND
Code:
invoke-virtual {v0, v1, v14}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
REPLACE-WITH
Code:
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsLongPress:Z
invoke-virtual {v0, v14}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress
(I)V
FIND
Code:
.method setAttachedWindowFrames(Landroid/view/WindowManagerPolicy
$WindowState;IILandroid/view/WindowManagerPolicy
$WindowState;ZLandroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
ADD-BEFORE
Code:
.method protected sendMediaButtonEvent(I)V
.locals 13
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v1
new-instance v11, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v11, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
new-instance v0, Landroid/view/KeyEvent;
const/4 v5, 0x0
const/4 v7, 0x0
move-wide v3, v1
move v6, p1
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;-><init>(JJIII)V
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v11, v4, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)
Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v11, v5}, Landroid/content/Context;->sendOrderedBroadcast
(Landroid/content/Intent;Ljava/lang/String;)V
new-instance v12, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v12, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
new-instance v3, Landroid/view/KeyEvent;
const/4 v8, 0x1
const/4 v10, 0x0
move-wide v4, v1
move-wide v6, v1
move v9, p1
invoke-direct/range {v3 .. v10}, Landroid/view/KeyEvent;-><init>(JJIII)V
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v12, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)
Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;-
>mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v12, v5}, Landroid/content/Context;->sendOrderedBroadcast
(Landroid/content/Intent;Ljava/lang/String;)V
return-void
.end method
Step 4: Save file and compile android.policy.jar or use smali to compile classes.dex and replace inside of android.policy.jar
Step 5: Reboot into recovery and push to phone, clear Dalvik and if you use Titanium Backup to odex, you will have to remove the odex files from /system/app/ in adb by doing "adb shell rm /system/app/*.odex"
Step 6: Reboot and prosper!
I have attached a flashable zip to make this easier. It also includes the advanced power menu and long press home for recent apps.
Click to expand...
Click to collapse
You guys are at it again! Good work!
Sent from my EVO using Tapatalk 2
Nice Job freeza!
Yay freeza!
Way to Go!
People appreciate when mods are broken down, and can see what's happening underneath it all.
-Zanzibar
(Happy 4:20!)
Freeza yur the best man. Love this MOD. Gonna play with it now
Sent from my EVO using Tapatalk 2
Nice write up!
Sent from my EVO using Tapatalk 2
According to a few posts in flex360's rom thread it appears this mod causes the volume control in 3rd party apps such as pandora to act strangely. Some of the details are here http://forum.xda-developers.com/showpost.php?p=27789582&postcount=952 Is there any way to resolve this issue?
njfoses said:
According to a few posts in flex360's rom thread it appears this mod causes the volume control in 3rd party apps such as pandora to act strangely. Some of the details are here http://forum.xda-developers.com/showpost.php?p=27789582&postcount=952 Is there any way to resolve this issue?
Click to expand...
Click to collapse
Does it happen in Pandora? Because I just read that thread, and tried the volume keys in Pandora with screen on and off and they functioned as expected.
freeza said:
Does it happen in Pandora? Because I just read that thread, and tried the volume keys in pandora with screen on and off and they functioned as expected.
Click to expand...
Click to collapse
To be honest im not using the mod or that rom personally (only rooted not unlocked yet) i was just passing along information. Here is another post in that thread that says the issue happens in google play music http://forum.xda-developers.com/showpost.php?p=27776939&postcount=931
Thanks Freeza, I love this mod!
njfoses said:
To be honest im not using the mod or that rom personally (only rooted not unlocked yet) i was just passing along information. Here is another post in that thread that says the issue happens in google play music http://forum.xda-developers.com/showpost.php?p=27776939&postcount=931
Click to expand...
Click to collapse
Thanks for the heads-up! It appears as though my Google Play Music and Pandora are functioning as expected in regards to the volume keys. If anyone else can chime in and give their feedback, that would be awesome.
If you are going to post feedback, please do so with the following criteria:
-Do the volume keys work as expected in various music apps?
-What ROM are you using?
-Are you using the prepackaged flashable from this thread?
-If not, did you mod it yourself?
-If you did mod it, does yours also include longpress home for recent apps and advanced power menu?
-Any other information you think would be relevant
ZanzDroid said:
Yay freeza!
Way to Go!
People appreciate when mods are broken down, and can see what's happening underneath it all.
-Zanzibar
(Happy 4:20!)
Click to expand...
Click to collapse
lol it's always 420 some where zanzibar
Definitely appreciated just one thing what does, line then some # mean
Sent from my PC36100 using Tapatalk 2
Hi
Could U please help me do the same in htc wildfire s? I tried but this keywords cant be found in wfs PhoneWindowManager.smali.
Please help a little. I dont understand codes.
rename to remove .c
It gives me this after modification
Code:
C:\A>apktool b out
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:222)
at brut.androlib.Androlib.buildSources(Androlib.java:179)
at brut.androlib.Androlib.build(Androlib.java:170)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Hey freeza , thanks for all your stuff .
zozor said:
Hey freeza , thanks for all your stuff .
Click to expand...
Click to collapse
did it work for you? or are you just saying thanks
All Swagged Out Project
The goal of ASOP is to provide every user with the chance to tweak their phones exactly how they like. At the same time, ASOP gives up and coming devs a place to learn how to get their hands dirty and add mods the old fashioned way.
Background
android.policy.jar is a framework file that controls a lot of things. The three mods that will be covered today include the Advanced Power Menu, Volume Rocker Mod (to skip tracks) and Long-press Back to Kill. These mods were created a long time ago and have been used on many devices. A big props does have to be given to mikmik user one_love_420 for bringing this to the HTC EVO 4G LTE's latest OTA.
Remember
This is for the HTC EVO 4G LTE running OTA 3.15, Android 4.1.1, Sense 4+ and nothing else. We are assuming you are starting with a stock android.policy.jar.
ADVANCED POWER MENU
The Mod
Long-press the Power button and be met with an advanced menu. Including, 4-in-1 Reboot Menu, sound profiles, airplane mode.
Decompile
You gotta figure this one out! Learn how to use apktool, baksmali or VTS. It is HIGHLY recommended that if you are decompiling with apktool or baksmali to add "-b" modifier. If using VTS, uncheck the smali debug code. This will make your smali code MUCH smaller - less system space = MORE RAM.
What Needs to Be Added
This mod requires two smali files that do not exist in the stock android.policy.jar you will find them attached at the bottom of this post.
GlobalActions$5$1.smali
GlobalActions$5$2.smali
They go in \com\android\internal\policy\impl\
What needs to Be Changed [The long part]
Using Notepad++ or a similar text editor (ie not Notepad) navigate to \com\android\internal\policy\impl\GlobalActions.smali
SEARCH FOR:
Code:
.method private changeAirplaneModeSystemSetting(Z)V
AFTER THIS METHOD ENDS, ADD THE FOLLOWING METHODS IN GREEN
Code:
.end method
[COLOR="SeaGreen"].method private createDialog()Lcom/htc/widget/HtcAlertDialog;
.locals 24
move-object/from16 v0, p0
iget-boolean v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mHasVibrator:Z
if-nez v3, :cond_14c
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$SilentModeToggleAction;
move-object/from16 v0, p0
invoke-direct {v3, v0}, Lcom/android/internal/policy/impl/GlobalActions$SilentModeToggleAction;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$Action;
:goto_11
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$1;
const v5, 0x402002a
const v6, 0x402002a
const v7, 0x104013e
const v8, 0x104013f
const v9, 0x1040140
const/4 v10, 0x0
move-object/from16 v4, p0
invoke-direct/range {v3 .. v10}, Lcom/android/internal/policy/impl/GlobalActions$1;-><init>(Lcom/android/internal/policy/impl/GlobalActions;IIIIIZ)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/GlobalActions;->onAirplaneModeChanged()V
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$2;
const v5, 0x402003f
const v6, 0x402003f
const v7, 0x4070029
const v8, 0x4070028
const v9, 0x4070027
const/4 v10, 0x1
move-object/from16 v4, p0
invoke-direct/range {v3 .. v10}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;IIIIIZ)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mVibrationModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$3;
const v5, 0x402003d
const v6, 0x402003d
const v7, 0x407002a
const v8, 0x407002c
const v9, 0x407002b
const/4 v10, 0x1
move-object/from16 v4, p0
invoke-direct/range {v3 .. v10}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;IIIIIZ)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mMobileNetworkModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
new-instance v3, Ljava/util/ArrayList;
invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/GlobalActions;->isSense2Mode()Z
move-result v3
if-eqz v3, :cond_163
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const-string v4, "powerOptions_power_off_status"
const-string v5, "string"
const-string v6, "com.htc.framework"
invoke-virtual {v3, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v17
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const-string v4, "powerOptions_restart"
const-string v5, "string"
const-string v6, "com.htc.framework"
invoke-virtual {v3, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v20
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const-string v4, "powerOptions_restart_status"
const-string v5, "string"
const-string v6, "com.htc.framework"
invoke-virtual {v3, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v19
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$4;
const v5, 0x402003e
const v6, 0x104013a
move-object/from16 v0, p0
move/from16 v1, v17
invoke-direct {v4, v0, v5, v6, v1}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$5;
const v5, 0x4020044
move-object/from16 v0, p0
move/from16 v1, v20
move/from16 v2, v19
invoke-direct {v4, v0, v5, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$5;-><init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
:goto_e0
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v3
invoke-virtual {v3}, Landroid/content/pm/PackageManager;->getUsers()Ljava/util/List;
move-result-object v23
invoke-interface/range {v23 .. v23}, Ljava/util/List;->size()I
move-result v3
const/4 v4, 0x1
if-le v3, v4, :cond_1fd
:try_start_f3
invoke-static {}, Landroid/app/ActivityManagerNative;->getDefault()Landroid/app/IActivityManager;
move-result-object v3
invoke-interface {v3}, Landroid/app/IActivityManager;->getCurrentUser()Landroid/content/pm/UserInfo;
:try_end_fa
.catch Landroid/os/RemoteException; {:try_start_f3 .. :try_end_fa} :catch_1dd
move-result-object v12
:goto_fb
invoke-interface/range {v23 .. v23}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v14
:goto_ff
invoke-interface {v14}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_1fd
invoke-interface {v14}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v22
check-cast v22, Landroid/content/pm/UserInfo;
if-nez v12, :cond_1e5
move-object/from16 v0, v22
iget v3, v0, Landroid/content/pm/UserInfo;->id:I
if-nez v3, :cond_1e1
const/16 v16, 0x1
:goto_115
new-instance v21, Lcom/android/internal/policy/impl/GlobalActions$8;
const v4, 0x108031d
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
move-object/from16 v0, v22
iget-object v3, v0, Landroid/content/pm/UserInfo;->name:Ljava/lang/String;
if-eqz v3, :cond_1f5
move-object/from16 v0, v22
iget-object v3, v0, Landroid/content/pm/UserInfo;->name:Ljava/lang/String;
:goto_129
invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
if-eqz v16, :cond_1f9
const-string v3, " \u2714"
:goto_131
invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
move-object/from16 v0, v21
move-object/from16 v1, p0
move-object/from16 v2, v22
invoke-direct {v0, v1, v4, v3, v2}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;ILjava/lang/CharSequence;Landroid/content/pm/UserInfo;)V
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, v21
invoke-virtual {v3, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_ff
:cond_14c
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$SilentModeTriStateAction;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAudioManager:Landroid/media/AudioManager;
move-object/from16 v0, p0
iget-object v6, v0, Lcom/android/internal/policy/impl/GlobalActions;->mHandler:Landroid/os/Handler;
invoke-direct {v3, v4, v5, v6}, Lcom/android/internal/policy/impl/GlobalActions$SilentModeTriStateAction;-><init>(Landroid/content/Context;Landroid/media/AudioManager;Landroid/os/Handler;)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$Action;
goto/16 :goto_11
:cond_163
sget-short v3, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S
const/16 v4, 0x9
if-ne v3, v4, :cond_1a6
sget-short v3, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_PROJECT_flag:S
const/16 v4, 0xd1
if-ne v3, v4, :cond_1a6
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$6;
const v5, 0x402003d
const v6, 0x104013a
move-object/from16 v0, p0
invoke-direct {v4, v0, v5, v6}, Lcom/android/internal/policy/impl/GlobalActions$6;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$Action;
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mVibrationModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mMobileNetworkModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto/16 :goto_e0
:cond_1a6
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$7;
const v5, 0x402003d
const v6, 0x104013a
move-object/from16 v0, p0
invoke-direct {v4, v0, v5, v6}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$Action;
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mVibrationModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto/16 :goto_e0
:catch_1dd
move-exception v18
const/4 v12, 0x0
goto/16 :goto_fb
:cond_1e1
const/16 v16, 0x0
goto/16 :goto_115
:cond_1e5
iget v3, v12, Landroid/content/pm/UserInfo;->id:I
move-object/from16 v0, v22
iget v4, v0, Landroid/content/pm/UserInfo;->id:I
if-ne v3, v4, :cond_1f1
const/16 v16, 0x1
goto/16 :goto_115
:cond_1f1
const/16 v16, 0x0
goto/16 :goto_115
:cond_1f5
const-string v3, "Primary"
goto/16 :goto_129
:cond_1f9
const-string v3, ""
goto/16 :goto_131
:cond_1fd
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;
const/4 v4, 0x0
move-object/from16 v0, p0
invoke-direct {v3, v0, v4}, Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAdapter:Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;
new-instance v11, Lcom/htc/widget/HtcAlertDialog$Builder;
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-direct {v11, v3}, Lcom/htc/widget/HtcAlertDialog$Builder;-><init>(Landroid/content/Context;)V
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/GlobalActions;->isSense2Mode()Z
move-result v3
if-eqz v3, :cond_278
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const-string v4, "global_actions"
const-string v5, "string"
const-string v6, "android"
invoke-virtual {v3, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v15
:goto_22a
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAdapter:Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;
move-object/from16 v0, p0
invoke-virtual {v11, v3, v0}, Lcom/htc/widget/HtcAlertDialog$Builder;->setAdapter(Landroid/widget/ListAdapter;Landroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;
move-result-object v3
const/4 v4, 0x1
invoke-virtual {v3, v4}, Lcom/htc/widget/HtcAlertDialog$Builder;->setInverseBackgroundForced(Z)Lcom/htc/widget/HtcAlertDialog$Builder;
move-result-object v3
invoke-virtual {v3, v15}, Lcom/htc/widget/HtcAlertDialog$Builder;->setTitle(I)Lcom/htc/widget/HtcAlertDialog$Builder;
invoke-virtual {v11}, Lcom/htc/widget/HtcAlertDialog$Builder;->create()Lcom/htc/widget/HtcAlertDialog;
move-result-object v13
invoke-virtual {v13}, Lcom/htc/widget/HtcAlertDialog;->getListView()Landroid/widget/ListView;
move-result-object v3
const/4 v4, 0x1
invoke-virtual {v3, v4}, Landroid/widget/ListView;->setItemsCanFocus(Z)V
invoke-virtual {v13}, Lcom/htc/widget/HtcAlertDialog;->getListView()Landroid/widget/ListView;
move-result-object v3
const/4 v4, 0x1
invoke-virtual {v3, v4}, Landroid/widget/ListView;->setLongClickable(Z)V
invoke-virtual {v13}, Lcom/htc/widget/HtcAlertDialog;->getListView()Landroid/widget/ListView;
move-result-object v3
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$9;
move-object/from16 v0, p0
invoke-direct {v4, v0}, Lcom/android/internal/policy/impl/GlobalActions$9;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
invoke-virtual {v3, v4}, Landroid/widget/ListView;->setOnItemLongClickListener(Landroid/widget/AdapterView$OnItemLongClickListener;)V
invoke-virtual {v13}, Lcom/htc/widget/HtcAlertDialog;->getWindow()Landroid/view/Window;
move-result-object v3
const/16 v4, 0x7d8
invoke-virtual {v3, v4}, Landroid/view/Window;->setType(I)V
move-object/from16 v0, p0
invoke-virtual {v13, v0}, Lcom/htc/widget/HtcAlertDialog;->setOnDismissListener(Landroid/content/DialogInterface$OnDismissListener;)V
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/GlobalActions;->isSense2Mode()Z
move-result v3
if-eqz v3, :cond_277
move-object/from16 v0, p0
invoke-virtual {v13, v0}, Lcom/htc/widget/HtcAlertDialog;->setOnKeyListener(Landroid/content/DialogInterface$OnKeyListener;)V
:cond_277
return-object v13
:cond_278
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const-string v4, "global_actions"
const-string v5, "string"
const-string v6, "android"
invoke-virtual {v3, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v15
goto :goto_22a
.end method[/COLOR]
.method private getWindowManager()Landroid/view/IWindowManager;
Navigate to \com\android\internal\policy\impl\GlobalActions$5.smali
SEARCH FOR:
Code:
.method public onPress()V
AFTER REPLACE THE REST OF THE FILE WITH
Code:
.locals 6
const/4 v5, 0x4
new-instance v1, Lcom/htc/widget/HtcAlertDialog$Builder;
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions$5;->this$0:Lcom/android/internal/policy/impl/GlobalActions;
#getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
move-result-object v2
invoke-direct {v1, v2}, Lcom/htc/widget/HtcAlertDialog$Builder;-><init>(Landroid/content/Context;)V
const v2, 0x1080027
invoke-virtual {v1, v2}, Lcom/htc/widget/HtcAlertDialog$Builder;->setIcon(I)Lcom/htc/widget/HtcAlertDialog$Builder;
move-result-object v1
const v2, 0x20400cd
invoke-virtual {v1, v2}, Lcom/htc/widget/HtcAlertDialog$Builder;->setTitle(I)Lcom/htc/widget/HtcAlertDialog$Builder;
move-result-object v1
sget-object v2, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
const/4 v3, 0x0
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$5$2;
invoke-direct {v4, p0}, Lcom/android/internal/policy/impl/GlobalActions$5$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions$5;)V
invoke-virtual {v1, v2, v3, v4}, Lcom/htc/widget/HtcAlertDialog$Builder;->setSingleChoiceItems([Ljava/lang/CharSequence;ILandroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;
move-result-object v1
const v2, 0x2040151
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$5$1;
invoke-direct {v3, p0}, Lcom/android/internal/policy/impl/GlobalActions$5$1;-><init>(Lcom/android/internal/policy/impl/GlobalActions$5;)V
invoke-virtual {v1, v2, v3}, Lcom/htc/widget/HtcAlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;
move-result-object v1
const/high16 v2, 0x104
const/4 v3, 0x0
invoke-virtual {v1, v2, v3}, Lcom/htc/widget/HtcAlertDialog$Builder;->setNegativeButton(ILandroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;
move-result-object v1
invoke-virtual {v1}, Lcom/htc/widget/HtcAlertDialog$Builder;->create()Lcom/htc/widget/HtcAlertDialog;
move-result-object v0
invoke-virtual {v0}, Lcom/htc/widget/HtcAlertDialog;->getWindow()Landroid/view/Window;
move-result-object v1
const/16 v2, 0x7d8
invoke-virtual {v1, v2}, Landroid/view/Window;->setType(I)V
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions$5;->this$0:Lcom/android/internal/policy/impl/GlobalActions;
#getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v1}, Lcom/android/internal/policy/impl/GlobalActions;->access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
move-result-object v1
invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v1
const v2, 0x1110009
invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getBoolean(I)Z
move-result v1
if-nez v1, :cond_60
invoke-virtual {v0}, Lcom/htc/widget/HtcAlertDialog;->getWindow()Landroid/view/Window;
move-result-object v1
invoke-virtual {v1, v5, v5}, Landroid/view/Window;->setFlags(II)V
:cond_60
invoke-virtual {v0}, Lcom/htc/widget/HtcAlertDialog;->show()V
return-void
.end method
.method public showBeforeProvisioning()Z
.locals 1
const/4 v0, 0x1
return v0
.end method
.method public showDuringKeyguard()Z
.locals 1
const/4 v0, 0x1
return v0
.end method
Navigate to \com\android\internal\policy\impl\GlobalActions$6.smali
REPLACE
Code:
.method constructor <init>(Lcom/android/internal/policy/impl/GlobalActions;[COLOR="Red"]II[/COLOR])V
WITH
Code:
.method constructor <init>(Lcom/android/internal/policy/impl/GlobalActions;[COLOR="red"]III[/COLOR])V
REPLACE
Code:
invoke-direct {[COLOR="red"]p0, p2, p3[/COLOR]}, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;-><init>([COLOR="red"]II[/COLOR])V
WITH
Code:
invoke-direct {[COLOR="red"]p0, p2, p3, p4[/COLOR]}, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;-><init>([COLOR="red"]III[/COLOR])V
REPLACE
Code:
const/4 v1, 0x[COLOR="red"]1[/COLOR]
invoke-static {v0, v1}, Lcom/htc/app/HtcShutdownThread;->[COLOR="red"]shutdown[/COLOR](Landroid/content/Context;Z)V
WITH
Code:
const/4 v1, 0x[COLOR="red"]0[/COLOR]
invoke-static {v0, v1}, Lcom/htc/app/HtcShutdownThread;->[COLOR="red"]hibernate[/COLOR](Landroid/content/Context;Z)V
Navigate to \com\android\internal\policy\impl\GlobalActions$SinglePressAction.smali
ADD GREEN TEXT
Code:
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/GlobalActions;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x40a
name = "SinglePressAction"
.end annotation
[COLOR="SeaGreen"]# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;[/COLOR]
# instance fields
.field private final mIconResId:I
.field private final mMessage:Ljava/lang/CharSequence;
.field private final mMessageResId:I
.field private final mStatusResId:I
SEARCH FOR
Code:
# direct methods
ADD AFTER
Code:
.method static constructor <clinit>()V
.locals 3
const/4 v0, 0x4
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Normal"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Hot restart"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Bootloader"
aput-object v2, v0, v1
const/4 v1, 0x3
const-string v2, "Recovery"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method
The Final Step
Now that all the smali files have been edited, recompile your .jar, rename your file to android.policy.jar and push to /system/framework/android.policy.jar. Smali files are stored in classes.dex inside of .apks and .jars, I have uploaded some classes.dexs that include the other mods listed here as well as modified/unmodified smalis. Enjoy!
EXTRA FILES
GlobalActions$5$1.smali
GlobalActions$5$2.smali
STOCK FILES
GlobalActions.smali
GlobalActions$5.smali
GlobalActions$6.smali
GlobalActions$SinglePressAction.smali
classes.dex
android.policy.jar
APM FILES
GlobalActions.smali
GlobalActions$5.smali
GlobalActions$6.smali
GlobalActions$SinglePressAction.smali
classes.dex
android.policy.jar
APM + VOL-TRACK + BACK-KILL FILES
classes.dex
android.policy.jar
#ASOP
VOLUME ROCKER MOD
The Mod
When listening to music, with the screen off, long-press the VOL+ key to change tracks forward and long-press the VOL- key to change tracks backwards.
Decompile
You gotta figure this one out! Learn how to use apktool, baksmali or VTS. It is HIGHLY recommended that if you are decompiling with apktool or baksmali to add "-b" modifier. If using VTS, uncheck the smali debug code. This will make your smali code MUCH smaller - less system space = MORE RAM.
What Needs to Be Added
This mod requires two smali files that do not exist in the stock android.policy.jar you will find them attached at the bottom of this post.
PhoneWindowManager$VolumeLongPressF.smali
PhoneWindowManager$VolumeLongPressR.smali
They go in \com\android\internal\policy\impl\
What needs to Be Changed [The long part]
Using Notepad++ or a similar text editor (ie not Notepad) navigate to \com\android\internal\policy\impl\PhoneWindowManager.smali
SEARCH FOR
Code:
.field mIsGuestMode:Z
ADD TEXT IN GREEN
Code:
.field mIsGuestMode:Z
.field mIsHtcDockScreenAsHome:Z
[COLOR="SeaGreen"].field mIsLongPress:Z[/COLOR]
.field mKeyEventsBlocked:Z
.field mKeyboardTapVibePattern:[J
SEARCH FOR
Code:
.field private mVolumeDownKeyTime:J
ADD TEXT IN GREEN
Code:
.field private mVolumeDownKeyTime:J
.field private mVolumeDownKeyTriggered:Z
[COLOR="SeaGreen"].field mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR]
.field private mVolumeUpKeyTriggered:Z
[COLOR="SeaGreen"].field mVolumeUpLongPress:Ljava/lang/Runnable;
.field mWakeAcquired:Z[/COLOR]
.field mWindowManager:Landroid/view/IWindowManager;
.field mWindowManagerFuncs:Landroid/view/WindowManagerPolicy$WindowManagerFuncs;
SEARCH FOR:
.method public constructor <init>()V
NOW SCROLL UNTIL YOU FIND THIS TEXT, ADD TEXT IN GREEN
Code:
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$27;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$27;-><init> Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSetLastUserActivity:Ljava/lang/Runnable;
[COLOR="SeaGreen"]new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressF;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressF;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressR;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressR;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR]
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$28;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$28;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPowerLongPress_Toast:Ljava/lang/Runnable;
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$29;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$29;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mEndCallLongPress:Ljava/lang/Runnable;
return-void
.end method
SEARCH FOR
Code:
.method handleVolumeKey(II)V
SCROLL TO THE END OF THIS METHOD AND ADD NEW METHODS IN GREEN
Code:
.end method
[COLOR="SeaGreen"].method handleVolumeLongPress(I)V
.locals 4
const/16 v1, 0x18
if-ne p1, v1, :cond_11
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
:goto_6
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
invoke-static {}, Landroid/view/ViewConfiguration;->getLongPressTimeout()I
move-result v2
int-to-long v2, v2
invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
:cond_11
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
goto :goto_6
.end method
.method handleVolumeLongPressAbort()V
.locals 2
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
return-void
.end method[/COLOR]
.method public hasNavigationBar()Z
SEARCH FOR
Code:
sparse-switch v13, :sswitch_data_6[COLOR="red"]82[/COLOR]
CHANGE TO
Code:
sparse-switch v13, :sswitch_data_6[COLOR="Red"]c4[/COLOR]
SEARCH FOR
Code:
:sswitch_274
BELOW THIS, YOU WILL NEED TO REPLACE EVERYTHING UNTIL AND INCLUDING
Code:
:sswitch_data_6c4
.sparse-switch
0x5 -> :sswitch_699
0x6 -> :sswitch_38a
0x18 -> :sswitch_274
0x19 -> :sswitch_274
0x1a -> :sswitch_49b
0x4f -> :sswitch_65c
0x55 -> :sswitch_64e
0x56 -> :sswitch_65c
0x57 -> :sswitch_65c
0x58 -> :sswitch_65c
0x59 -> :sswitch_65c
0x5a -> :sswitch_65c
0x5b -> :sswitch_65c
0x7e -> :sswitch_64e
0x7f -> :sswitch_64e
0x82 -> :sswitch_65c
0xa4 -> :sswitch_274
.end sparse-switch
.end method
THE CODE TO ADD CAN BE FOUND HERE:
http://goo.gl/1SfRm
IT'S TOO BIG FOR XDA
SEARCH FOR
Code:
.method sendEvent(IIIJ)V
SCROLL TO THE END OF THIS METHOD AND ADD NEW METHOD IN GREEN
Code:
.end method
[COLOR="SeaGreen"].method protected sendMediaButtonEvent(I)V
.locals 13
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v1
new-instance v11, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v11, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
new-instance v0, Landroid/view/KeyEvent;
const/4 v5, 0x0
const/4 v7, 0x0
move-wide v3, v1
move v6, p1
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;-><init>(JJIII)V
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v11, v4, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v11, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
new-instance v12, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v12, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
new-instance v3, Landroid/view/KeyEvent;
const/4 v8, 0x1
const/4 v10, 0x0
move-wide v4, v1
move-wide v6, v1
move v9, p1
invoke-direct/range {v3 .. v10}, Landroid/view/KeyEvent;-><init>(JJIII)V
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v12, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v12, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
return-void
.end method[/COLOR]
.method setAttachedWindowFrames(Landroid/view/WindowManagerPolicy$WindowState;IILandroid/view/WindowManagerPolicy$WindowState;ZLandroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
The Final Step
Now that all the smali files have been edited, recompile your .jar, rename your file to android.policy.jar and push to /system/framework/android.policy.jar. Smali files are stored in classes.dex inside of .apks and .jars, I have uploaded some classes.dexs that include the other mods listed here as well as modified/unmodified smalis. Enjoy!
EXTRA FILES
PhoneWindowManager$VolumeLongPressF.smali
PhoneWindowManager$VolumeLongPressR.smali
STOCK FILES
PhoneWindowManager.smali
classes.dex
android.policy.jar
VOL-TRACK FILES
PhoneWindowManager.smali
classes.dex
android.policy.jar
APM + VOL-TRACK FILES
classes.dex
android.policy.jar
APM + VOL-TRACK + BACK-KILL FILES
classes.dex
android.policy.jar
#ASOP
LONG-PRESS BACK TO KILL THIRD-PARTY APPS
The Mod
By long-pressing the Back capacitive button, any third-party app will be killed. This is very handy for when apps become unresponsive.
Decompile
You gotta figure this one out! Learn how to use apktool, baksmali or VTS. It is HIGHLY recommended that if you are decompiling with apktool or baksmali to add "-b" modifier. If using VTS, uncheck the smali debug code. This will make your smali code MUCH smaller - less system space = MORE RAM.
What needs to Be Changed [The long part]
Using Notepad++ or a similar text editor (ie not Notepad) navigate to \com\android\internal\policy\impl\PhoneWindowManager.smali
SEARCH FOR
Code:
.field mAutoMotiveReceiver:Landroid/content/BroadcastReceiver;
ADD TEXT IN GREEN
Code:
.field mAutoMotiveReceiver:Landroid/content/BroadcastReceiver;
[COLOR="SeaGreen"].field mBackKeyLongPressed:Z[/COLOR]
.field mBootCompleted:Z
SEARCH FOR
Code:
.method private launchAssistLongPressAction()V
SCROLL TO THE END OF THIS METHOD AND ADD NEW METHOD IN GREEN
Code:
.end method
[COLOR="SeaGreen"].method private launchBackLongPressAction()V
.locals 18
:try_start_0
invoke-static {}, Landroid/app/ActivityManagerNative;->getDefault()Landroid/app/IActivityManager;
move-result-object v9
invoke-interface {v9}, Landroid/app/IActivityManager;->getRunningAppProcesses()Ljava/util/List;
move-result-object v5
move-object/from16 v0, p0
iget-object v14, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const-string v15, "activity"
invoke-virtual {v14, v15}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/app/ActivityManager;
const/4 v14, 0x1
invoke-virtual {v2, v14}, Landroid/app/ActivityManager;->getRunningTasks(I)Ljava/util/List;
move-result-object v12
const/4 v14, 0x0
invoke-interface {v12, v14}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v14
check-cast v14, Landroid/app/ActivityManager$RunningTaskInfo;
iget-object v6, v14, Landroid/app/ActivityManager$RunningTaskInfo;->topActivity:Landroid/content/ComponentName;
invoke-interface {v5}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v14
:cond_26
:goto_26
invoke-interface {v14}, Ljava/util/Iterator;->hasNext()Z
move-result v15
if-nez v15, :cond_2d
:cond_2c
:goto_2c
return-void
:cond_2d
invoke-interface {v14}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
check-cast v3, Landroid/app/ActivityManager$RunningAppProcessInfo;
iget v13, v3, Landroid/app/ActivityManager$RunningAppProcessInfo;->uid:I
const/16 v15, 0x2710
if-lt v13, v15, :cond_26
const v15, 0x1869f
if-gt v13, v15, :cond_26
iget v15, v3, Landroid/app/ActivityManager$RunningAppProcessInfo;->importance:I
const/16 v16, 0x64
move/from16 v0, v16
if-ne v15, v0, :cond_26
iget-object v15, v3, Landroid/app/ActivityManager$RunningAppProcessInfo;->pkgList:[Ljava/lang/String;
if-eqz v15, :cond_26
invoke-interface {v5}, Ljava/util/List;->size()I
move-result v15
if-lez v15, :cond_26
iget-object v15, v3, Landroid/app/ActivityManager$RunningAppProcessInfo;->processName:Ljava/lang/String;
invoke-virtual {v6}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;
move-result-object v16
invoke-virtual/range {v15 .. v16}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v15
if-eqz v15, :cond_26
new-instance v8, Landroid/content/Intent;
const-string v15, "android.intent.action.MAIN"
invoke-direct {v8, v15}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
const-string v15, "android.intent.category.HOME"
invoke-virtual {v8, v15}, Landroid/content/Intent;->addCategory(Ljava/lang/String;)Landroid/content/Intent;
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;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v15
const/16 v16, 0x0
move/from16 v0, v16
invoke-virtual {v15, v8, v0}, Landroid/content/pm/PackageManager;->resolveActivity(Landroid/content/Intent;I)Landroid/content/pm/ResolveInfo;
move-result-object v11
iget-object v15, v11, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;
iget-object v15, v15, Landroid/content/pm/ActivityInfo;->processName:Ljava/lang/String;
iget-object v0, v3, Landroid/app/ActivityManager$RunningAppProcessInfo;->processName:Ljava/lang/String;
move-object/from16 v16, v0
invoke-virtual/range {v15 .. v16}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v15
if-nez v15, :cond_2c
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;->getPackageManager()Landroid/content/pm/PackageManager;
:try_end_8d
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_8d} :catch_d8
move-result-object v10
:try_start_8e
invoke-virtual {v6}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;
move-result-object v15
const/16 v16, 0x0
move/from16 v0, v16
invoke-virtual {v10, v15, v0}, Landroid/content/pm/PackageManager;->getApplicationInfo(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;
:try_end_99
.catch Ljava/lang/Exception; {:try_start_8e .. :try_end_99} :catch_db
move-result-object v1
:goto_9a
if-eqz v1, :cond_de
:try_start_9c
invoke-virtual {v10, v1}, Landroid/content/pm/PackageManager;->getApplicationLabel(Landroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;
move-result-object v4
:goto_a0
check-cast v4, Ljava/lang/String;
invoke-virtual {v6}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;
move-result-object v15
invoke-interface {v9, v15}, Landroid/app/IActivityManager;->forceStopPackage(Ljava/lang/String;)V
iget v15, v3, Landroid/app/ActivityManager$RunningAppProcessInfo;->pid:I
invoke-static {v15}, Landroid/os/Process;->killProcess(I)V
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
new-instance v16, Ljava/lang/StringBuilder;
invoke-static {v4}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v17
invoke-direct/range {v16 .. v17}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
const-string v17, " killed."
invoke-virtual/range {v16 .. v17}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v16
invoke-virtual/range {v16 .. v16}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v16
const-string v0, "lyapota"
move-object/from16 v2, v15
move-object/from16 v3, v16
invoke-static {v0, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
const/4 v4, 0x0
invoke-static {v2, v3, v4}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object v15
invoke-virtual {v15}, Landroid/widget/Toast;->show()V
goto/16 :goto_26
:catch_d8
move-exception v14
goto/16 :goto_2c
:catch_db
move-exception v7
const/4 v1, 0x0
goto :goto_9a
:cond_de
const-string v4, "(unknown)"
:try_end_e0
.catch Ljava/lang/Exception; {:try_start_9c .. :try_end_e0} :catch_d8
goto :goto_a0
.end method[/COLOR]
.method static makeFnState(IIZIZ)V
(To make life easy) SEARCH FOR
Code:
const-string v40, "ignore handleLongPressOnHome when hasRingingCall or it\'s in GuestMode"
BELOW THIS, YOU WILL NEED TO REPLACE EVERYTHING UNTIL AND INCLUDING
Code:
:pswitch_data_8a4
.packed-switch 0x0
:pswitch_4bd
:pswitch_4c1
:pswitch_4bd
.end packed-switch
:pswitch_data_8ae
.packed-switch 0x1
:pswitch_527
:pswitch_545
.end packed-switch
.end method
NOTE: This last section WILL change with the new data.
THE CODE TO ADD CAN BE FOUND HERE:
http://goo.gl/NA8KI
IT'S TOO BIG FOR XDA
The Final Step
Now that all the smali files have been edited, recompile your .jar, rename your file to android.policy.jar and push to /system/framework/android.policy.jar. Smali files are stored in classes.dex inside of .apks and .jars, I have uploaded some classes.dexs that include the other mods listed here as well as modified/unmodified smalis. Enjoy!
STOCK FILES
PhoneWindowManager.smali
classes.dex
android.policy.jar
BACK-KILL FILES
PhoneWindowManager.smali
classes.dex
android.policy.jar
APM + BACK-KILL FILES
classes.dex
android.policy.jar
APM + VOL-TRACK + BACK-KILL FILES
classes.dex
android.policy.jar
#ASOP
Just in case there are more...
Awesome. /reserved
Sent from my EVO using Tapatalk 2
Reserved
Sent from my EVO using Xparent Red Tapatalk 2
can anyone see if this is updated? i cant seem to download the extra files.
Sup joe. It's not updated lol
Sent from my EVO using Tapatalk
Trying to dig around for those files
Sent from my EVO using Tapatalk now Free
ssojyeti2 said:
Sup joe. It's not updated lol
Sent from my EVO using Tapatalk
Click to expand...
Click to collapse
Sup bro! You been hiding around here?
Sent from my EVO using xda premium
Okay, alot of dev's/themers been looking for this one...
If you use, please give credit, I spent many hours finding this Mod... Don't take credit for someone else's work...
This Mod will allow you to change the Samsung KeyBoard Swipe Color..(SamsungIME.apk)
Look for:
smali\com\diotek\ime\framework\view\AbstractKeyBoardView.smali
Search for -> .method private setTracePaintOptionsWithSettings()V
Click to see Org Code
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
.prologue
const/16 v4, 0xff
const/4 v1, 0x1
const/4 v3, 0x0
.line 9829
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 9830
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
.line 9832
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 9833
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 9835
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 9836
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 9837
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 9838
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0xa5
const/16 v2, 0xf3
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
Click to see what to change:
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
.prologue
const/16 v4, [B][U][COLOR="Blue"]0xff[/COLOR][/U][/B] [B][COLOR="seagreen"]Change for Alpha Value - "0xff" [/COLOR][/B]
const/4 v1, 0x1
const/4 v3, [B][U][COLOR="Blue"]0x0[/COLOR][/U][/B] [B][COLOR="seaGreen"] - Change for Red Value - "0x0"[/COLOR][/B]
.line 9829
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 9830
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
.line 9832
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 9833
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 9835
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 9836
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 9837
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 9838
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, [B][U][COLOR="Blue"]0xa5[/COLOR][/U][/B] [COLOR="seagreen"]- Change for Green Value - "0xa5"[/COLOR]
const/16 v2, [B][U][COLOR="Blue"]0xf3[/COLOR][/U][/B] [COLOR="seagreen"] - Change for Blue Value - "0xf3"[/COLOR]
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
So what it boils down to is that the Swipe Color is what we call RGB color coding. I suggest a site like this to see values you can use:
Hex to RGB Color converter
Thats it folks.. swipe color squashed!!!!
A Little clarification on Instructions.
I was swamped with questions on how to edit and such.. So with @strongsteve help we dug more and here is an easier way to get your colors instead of trying to use RGB values..
Note III - Edits
change code:
Code:
const/16 v1, 0xa5
const/16 v2, 0xf3
to
Code:
const v3, 0x33
const v1, 0x66
const v2, 0xcc
Note II - Edits
change code:
Code:
const/16 v1, 0xff
const/16 v2, 0xa5
const/16 v3, 0xf3
change to:
Code:
const/16 v1, 0xff
const v2, 0x66
const v3, 0xcc
const v4, 0x33
Then just use any normal Hex Color code you would normally use!!!
In the above example I used 3366cc which is DarkHorse Blue..
I hope that helps
Text Color in Text Editor(Second Screen Shot)
Note III
Search for
Code:
constructor <init>(Lcom/visionobjects/textwidget/e/a;Landroid/util/DisplayMetrics;)V
and then look for:
Code:
const/high16 v1, -0x100 <--- Black Text Color Previous Typed Word
const v2, -0xcc4a1b <--- Last Typed Word
Change Black Text to a Smali Color Code
Change Last Typed Word to Smali Color code (-0xcc4a1b)
For example:
3366cc converts to -0xCC9934 for smali color codes
Thx to @EMSpilot for pointing out the Black Text Line... Thank you!!!
Nice work my friend, :highfive:
Please and to all users, lets make sure credit and permission are handled when using these awesome mods! :victory:
You are a master of theming sir. Nice job as always...
[email protected]'$ [email protected]@XY- Team Average Joe's Official beta tester
Great find and Thank you for sharing, I know many people were searching for this little bugger.:good:
Nice Work!
Great Work Buddy...
I can confirm this also works on Note 2 keyboards as well...
thread here.
Full credit given, in addition, I made you a contributor., so if you need to change anything, feel free.
On the note 2, the V is different for each classification... but I corrected for that thread already.
Nice Work!
OP Updated with more changes..
how would i go about changing this? im new to mods like this.
stafly17 said:
how would i go about changing this? im new to mods like this.
Click to expand...
Click to collapse
Decompile the apk.
Follow the instructions in the OP.
It's a step by step guide.
Can't go wrong.
Slithering from the nether regions of a twisted mind and tarnished soul
@Gunthermic
Found an even easier way to do this...
Original code:
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
const/16 v4, 0xff
const/4 v1, 0x1
const/4 v3, 0x0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0xa5
const/16 v2, 0xf3
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
move-result v1
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setColor(I)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Join;->ROUND:Landroid/graphics/Paint$Join;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeJoin(Landroid/graphics/Paint$Join;)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Cap;->ROUND:Landroid/graphics/Paint$Cap;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeCap(Landroid/graphics/Paint$Cap;)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v4}, Landroid/graphics/Paint;->setAlpha(I)V
New code:
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
const/16 v4, 0xff
const/4 v1, 0x1
const/4 v3, 0x0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0xa5
const/16 v2, 0xf3
[COLOR="Red"]const-string v2, "#AARRGGBB" [COLOR="blue"]<--this is your color hex, AA is the alpha, RR is the red value, GG is the green value, and BB is the blue value[/COLOR]
#invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
invoke-static {v2}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I
move-result v1
invoke-static {v1}, Landroid/graphics/Color;->alpha(I)I
move-result v4[/COLOR]
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setColor(I)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Join;->ROUND:Landroid/graphics/Paint$Join;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeJoin(Landroid/graphics/Paint$Join;)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
sget-object v1, Landroid/graphics/Paint$Cap;->ROUND:Landroid/graphics/Paint$Cap;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeCap(Landroid/graphics/Paint$Cap;)V
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v4}, Landroid/graphics/Paint;->setAlpha(I)V
This way you can just write out your hex code in one line
Double Tap Statusbar to Sleep​
In the spirit of open source, i would like to share my HarshJelly ROM's new feature backported from CM11.
What it does : Double tap statusbar anywhere to sleep device.
Requirements :
SystemUI.apk
Apktool
Notepad++
So let's begin
Decompile SystemUI.apk
Open com\android\systemui\statusbar\phone\PhoneStatusBarView.smali
Add following code after #static fields
Code:
.field static c:Landroid/content/Context;
Add this after #instance fields
Code:
.field private mDoubleTapGesture:Landroid/view/GestureDetector;
Now search for .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSetV and delete
Code:
[COLOR="Red"]const/4 v2, 0x0[/COLOR]
which comes in beginning of this method.
Now after invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSetV add following code
Code:
sput-object p1, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->c:Landroid/content/Context;
new-instance v0, Landroid/view/GestureDetector;
sget-object v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->c:Landroid/content/Context;
new-instance v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;
invoke-direct {v2, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)V
invoke-direct {v0, v1, v2}, Landroid/view/GestureDetector;-><init>(Landroid/content/Context;Landroid/view/GestureDetector$OnGestureListener;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mDoubleTapGesture:Landroid/view/GestureDetector;
const/4 v2, 0x0
Now search for .method public onTouchEvent(Landroid/view/MotionEventZ at the starting of this method add
Code:
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mDoubleTapGesture:Landroid/view/GestureDetector;
invoke-virtual {v0, p1}, Landroid/view/GestureDetector;->onTouchEvent(Landroid/view/MotionEvent;)Z
Download attached file, extract it & put PhoneStatusBarView$1.smali to com\android\systemui\statusbar\phone
Compile back, it is done...
Click to expand...
Click to collapse
And yeah a big thanks goes to CyanogenMod Team...
I tested this on Touchwiz JB 4.1.2 but it should work on any device with 4.1.2 or any device > 4.1 with some modification (if necessary)...
If you found any error then report here along with FULL LOG. I'll ignore posts without logs.
Updated method. Now there won't be FC (i forget to add one line)
BOOTMGR said:
Updated method. Now there won't be FC (i forget to add one line)
Click to expand...
Click to collapse
Working GR8
Thanx
Can you do one zip file , in which we just to flash this zip to have this mod?
Gesendet von meinem GT-I9070 mit Tapatalk
You are really a great developer... @BOOTMGR
Sent from my GT-I9070 using Tapatalk
Thanks, this works on my device JB 4.1.2. Keep on sharing your mods Sir :good:
BOOTMGR said:
Updated method. Now there won't be FC (i forget to add one line)
Click to expand...
Click to collapse
i try this on 4.2.2 rom. it original have the PhoneStatusBarView$1.smali can u help me...
Code:
.class Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;
.super Landroid/content/BroadcastReceiver;
.source "PhoneStatusBarView.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
# direct methods
.method constructor <init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)V
.locals 0
.parameter
.prologue
.line 120
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
return-void
.end method
# virtual methods
[COLOR="Red"].method public onDoubleTap(Landroid/view/MotionEvent;)Z
.locals 3
.parameter "e"
.prologue
.line 24
sget-object v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->c:Landroid/content/Context;
const-string v2, "power"
invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
.line 119
.local v0, pm:Landroid/os/PowerManager;
.line 120
if-eqz v0, :cond_0
.line 121
invoke-virtual {p1}, Landroid/view/MotionEvent;->getEventTime()J
move-result-wide v1
invoke-virtual {v0, v1, v2}, Landroid/os/PowerManager;->goToSleep(J)V
.line 122
:cond_0
const/4 v1, 0x1
return v1
.end method[/COLOR]
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.locals 8
.parameter "context"
.parameter "intent"
.prologue
const/4 v7, 0x1
const/4 v3, 0x0
.line 123
invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v0
.line 124
.local v0, action:Ljava/lang/String;
const-string v2, "com.samsung.cover.OPEN"
invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_0
.line 125
const-string v2, "coverOpen"
invoke-virtual {p2, v2, v3}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v2
if-ne v7, v2, :cond_1
.line 126
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$002(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;I)I
.line 127
const-string v2, "PhoneStatusBarView"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "clear cover opened : "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 128
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTicker:Landroid/view/ViewGroup;
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingLeft:I
invoke-static {v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$100(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v3
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
add-int/2addr v3, v4
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingTop:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$200(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingRight:I
invoke-static {v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$300(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v5
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v6
add-int/2addr v5, v6
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingBottom:I
invoke-static {v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$400(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v6
invoke-virtual {v2, v3, v4, v5, v6}, Landroid/view/ViewGroup;->setPadding(IIII)V
.line 134
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v2, v7}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->showClockByClearCover(Z)V
.line 135
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBlackBGView:Landroid/view/View;
const/16 v3, 0x8
invoke-virtual {v2, v3}, Landroid/view/View;->setVisibility(I)V
.line 137
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->marqueeStatusBar()V
.line 162
:cond_0
:goto_0
return-void
.line 139
:cond_1
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mIndent1:I
invoke-static {v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$500(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v3
mul-int/lit8 v3, v3, 0x11
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$002(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;I)I
.line 140
new-instance v1, Landroid/os/Handler;
invoke-direct {v1}, Landroid/os/Handler;-><init>()V
.line 141
.local v1, mHandler:Landroid/os/Handler;
new-instance v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1$1;
invoke-direct {v2, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1$1;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;)V
const-wide/16 v3, 0xaa
invoke-virtual {v1, v2, v3, v4}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
goto :goto_0
.end method
Now after invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSetV add following code i cant fine it, can you show where shukd chuld it edit it
It looked a bit complicated at first, but IT WORKS.
You just saved my power button!
shazzl said:
i try this on 4.2.2 rom. it original have the PhoneStatusBarView$1.smali can u help me...
Code:
.class Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;
.super Landroid/content/BroadcastReceiver;
.source "PhoneStatusBarView.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
# direct methods
.method constructor <init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)V
.locals 0
.parameter
.prologue
.line 120
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
return-void
.end method
# virtual methods
[COLOR="Red"].method public onDoubleTap(Landroid/view/MotionEvent;)Z
.locals 3
.parameter "e"
.prologue
.line 24
sget-object v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->c:Landroid/content/Context;
const-string v2, "power"
invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
.line 119
.local v0, pm:Landroid/os/PowerManager;
.line 120
if-eqz v0, :cond_0
.line 121
invoke-virtual {p1}, Landroid/view/MotionEvent;->getEventTime()J
move-result-wide v1
invoke-virtual {v0, v1, v2}, Landroid/os/PowerManager;->goToSleep(J)V
.line 122
:cond_0
const/4 v1, 0x1
return v1
.end method[/COLOR]
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.locals 8
.parameter "context"
.parameter "intent"
.prologue
const/4 v7, 0x1
const/4 v3, 0x0
.line 123
invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v0
.line 124
.local v0, action:Ljava/lang/String;
const-string v2, "com.samsung.cover.OPEN"
invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_0
.line 125
const-string v2, "coverOpen"
invoke-virtual {p2, v2, v3}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v2
if-ne v7, v2, :cond_1
.line 126
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$002(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;I)I
.line 127
const-string v2, "PhoneStatusBarView"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "clear cover opened : "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 128
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTicker:Landroid/view/ViewGroup;
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingLeft:I
invoke-static {v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$100(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v3
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
add-int/2addr v3, v4
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingTop:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$200(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingRight:I
invoke-static {v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$300(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v5
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v6
add-int/2addr v5, v6
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingBottom:I
invoke-static {v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$400(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v6
invoke-virtual {v2, v3, v4, v5, v6}, Landroid/view/ViewGroup;->setPadding(IIII)V
.line 134
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v2, v7}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->showClockByClearCover(Z)V
.line 135
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBlackBGView:Landroid/view/View;
const/16 v3, 0x8
invoke-virtual {v2, v3}, Landroid/view/View;->setVisibility(I)V
.line 137
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->marqueeStatusBar()V
.line 162
:cond_0
:goto_0
return-void
.line 139
:cond_1
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mIndent1:I
invoke-static {v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$500(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v3
mul-int/lit8 v3, v3, 0x11
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$002(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;I)I
.line 140
new-instance v1, Landroid/os/Handler;
invoke-direct {v1}, Landroid/os/Handler;-><init>()V
.line 141
.local v1, mHandler:Landroid/os/Handler;
new-instance v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1$1;
invoke-direct {v2, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1$1;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;)V
const-wide/16 v3, 0xaa
invoke-virtual {v1, v2, v3, v4}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
goto :goto_0
.end method
Now after invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSetV add following code i cant fine it, can you show where shukd chuld it edit it
Click to expand...
Click to collapse
If you already have PhoneStatusBarView$1 then don't merge changes. Just rename my file to PhoneStatusBarView$2 & replace all other occurences of PhoneStatusBarView$1 with PhoneStatusBarView$2 apperaring on this tutorial.
Hello BOOTMGR,
I try on 4.2.1 ROM, but my PhoneStatusBarView.smali doesn't have "invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-...". Can you show me how to integrate? My Rom has only PhoneStatusBarView.smali file
Code:
.class public Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.super Lcom/android/systemui/statusbar/phone/PanelBar;
.source "PhoneStatusBarView.java"
# static fields
.field private static final DEBUG:Z = false
.field private static final TAG:Ljava/lang/String; = "PhoneStatusBarView"
# instance fields
.field mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
.field mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.field mFullWidthNotifications:Z
.field mLastFullyOpenedPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.field mNotificationPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.field mScrimColor:I
.field mSettingsPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.field mSettingsPanelDragzoneFrac:F
.field mSettingsPanelDragzoneMin:F
.field private mShouldFade:Z
# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals 7
.parameter "context"
.parameter "attrs"
.prologue
const/4 v3, 0x0
const/4 v6, 0x0
const/4 v2, 0x1
.line 47
invoke-direct {p0, p1, p2}, Lcom/android/systemui/statusbar/phone/PanelBar;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.line 41
iput-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 42
iput-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mLastFullyOpenedPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 49
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->getContext()Landroid/content/Context;
move-result-object v3
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v1
.line 50
.local v1, res:Landroid/content/res/Resources;
const v3, 0x7f0a0003
invoke-virtual {v1, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
iput v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mScrimColor:I
.line 51
const v3, 0x7f0e003c
invoke-virtual {v1, v3}, Landroid/content/res/Resources;->getDimension(I)F
move-result v3
iput v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanelDragzoneMin:F
.line 53
const v3, 0x7f0e003b
const/4 v4, 0x1
const/4 v5, 0x1
:try_start_0
invoke-virtual {v1, v3, v4, v5}, Landroid/content/res/Resources;->getFraction(III)F
move-result v3
iput v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanelDragzoneFrac:F
:try_end_0
.catch Landroid/content/res/Resources$NotFoundException; {:try_start_0 .. :try_end_0} :catch_0
.line 57
:goto_0
iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanelDragzoneFrac:F
cmpg-float v3, v3, v6
if-gtz v3, :cond_0
:goto_1
iput-boolean v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFullWidthNotifications:Z
.line 58
return-void
.line 54
:catch_0
move-exception v0
.line 55
.local v0, ex:Landroid/content/res/Resources$NotFoundException;
iput v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanelDragzoneFrac:F
goto :goto_0
.line 57
.end local v0 #ex:Landroid/content/res/Resources$NotFoundException;
:cond_0
const/4 v2, 0x0
goto :goto_1
.end method
# virtual methods
.method public addPanel(Lcom/android/systemui/statusbar/phone/PanelView;)V
.locals 2
.parameter "pv"
.prologue
.line 77
invoke-super {p0, p1}, Lcom/android/systemui/statusbar/phone/PanelBar;->addPanel(Lcom/android/systemui/statusbar/phone/PanelView;)V
.line 78
invoke-virtual {p1}, Lcom/android/systemui/statusbar/phone/PanelView;->getId()I
move-result v0
const v1, 0x7f090042
if-ne v0, v1, :cond_1
.line 79
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 83
:cond_0
:goto_0
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFullWidthNotifications:Z
if-nez v0, :cond_2
const/4 v0, 0x1
:goto_1
invoke-virtual {p1, v0}, Lcom/android/systemui/statusbar/phone/PanelView;->setRubberbandingEnabled(Z)V
.line 84
return-void
.line 80
:cond_1
invoke-virtual {p1}, Lcom/android/systemui/statusbar/phone/PanelView;->getId()I
move-result v0
const v1, 0x7f090071
if-ne v0, v1, :cond_0
.line 81
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanel:Lcom/android/systemui/statusbar/phone/PanelView;
goto :goto_0
.line 83
:cond_2
const/4 v0, 0x0
goto :goto_1
.end method
.method public hasFullWidthNotifications()Z
.locals 1
.prologue
.line 65
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFullWidthNotifications:Z
return v0
.end method
.method public onAllPanelsCollapsed()V
.locals 2
.prologue
const/4 v1, 0x0
.line 156
invoke-super {p0}, Lcom/android/systemui/statusbar/phone/PanelBar;->onAllPanelsCollapsed()V
.line 158
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->makeExpandedInvisibleSoon()V
.line 159
iput-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 160
iput-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mLastFullyOpenedPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 161
return-void
.end method
.method public onAttachedToWindow()V
.locals 3
.prologue
.line 70
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PanelBar;->mPanels:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->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_1
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/android/systemui/statusbar/phone/PanelView;
.line 71
.local v1, pv:Lcom/android/systemui/statusbar/phone/PanelView;
iget-boolean v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFullWidthNotifications:Z
if-nez v2, :cond_0
const/4 v2, 0x1
:goto_1
invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/phone/PanelView;->setRubberbandingEnabled(Z)V
goto :goto_0
:cond_0
const/4 v2, 0x0
goto :goto_1
.line 73
.end local v1 #pv:Lcom/android/systemui/statusbar/phone/PanelView;
:cond_1
return-void
.end method
.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
.locals 1
.parameter "event"
.prologue
.line 181
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v0, p1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->interceptTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
if-nez v0, :cond_0
invoke-super {p0, p1}, Lcom/android/systemui/statusbar/phone/PanelBar;->onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
if-eqz v0, :cond_1
:cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_1
const/4 v0, 0x0
goto :goto_0
.end method
.method public onPanelFullyOpened(Lcom/android/systemui/statusbar/phone/PanelView;)V
.locals 1
.parameter "openPanel"
.prologue
.line 165
invoke-super {p0, p1}, Lcom/android/systemui/statusbar/phone/PanelBar;->onPanelFullyOpened(Lcom/android/systemui/statusbar/phone/PanelView;)V
.line 166
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mLastFullyOpenedPanel:Lcom/android/systemui/statusbar/phone/PanelView;
if-eq p1, v0, :cond_0
.line 167
const/16 v0, 0x20
invoke-virtual {p1, v0}, Lcom/android/systemui/statusbar/phone/PanelView;->sendAccessibilityEvent(I)V
.line 169
:cond_0
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 170
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mLastFullyOpenedPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 171
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mShouldFade:Z
.line 172
return-void
.end method
.method public onPanelPeeked()V
.locals 2
.prologue
.line 138
invoke-super {p0}, Lcom/android/systemui/statusbar/phone/PanelBar;->onPanelPeeked()V
.line 139
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
const/4 v1, 0x1
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->makeExpandedVisible(Z)V
.line 140
return-void
.end method
.method public onRequestSendAccessibilityEvent(Landroid/view/View;Landroid/view/accessibility/AccessibilityEvent;)Z
.locals 2
.parameter "child"
.parameter "event"
.prologue
.line 93
invoke-super {p0, p1, p2}, Lcom/android/systemui/statusbar/phone/PanelBar;->onRequestSendAccessibilityEvent(Landroid/view/View;Landroid/view/accessibility/AccessibilityEvent;)Z
move-result v1
if-eqz v1, :cond_0
.line 97
invoke-static {}, Landroid/view/accessibility/AccessibilityEvent;->obtain()Landroid/view/accessibility/AccessibilityEvent;
move-result-object v0
.line 98
.local v0, record:Landroid/view/accessibility/AccessibilityEvent;
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->onInitializeAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V
.line 99
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->dispatchPopulateAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)Z
.line 100
invoke-virtual {p2, v0}, Landroid/view/accessibility/AccessibilityEvent;->appendRecord(Landroid/view/accessibility/AccessibilityRecord;)V
.line 101
const/4 v1, 0x1
.line 103
.end local v0 #record:Landroid/view/accessibility/AccessibilityEvent;
:goto_0
return v1
:cond_0
const/4 v1, 0x0
goto :goto_0
.end method
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.locals 1
.parameter "event"
.prologue
.line 176
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v0, p1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->interceptTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
if-nez v0, :cond_0
invoke-super {p0, p1}, Lcom/android/systemui/statusbar/phone/PanelBar;->onTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
if-eqz v0, :cond_1
:cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_1
const/4 v0, 0x0
goto :goto_0
.end method
.method public panelExpansionChanged(Lcom/android/systemui/statusbar/phone/PanelView;F)V
.locals 17
.parameter "panel"
.parameter "frac"
.prologue
.line 186
invoke-super/range {p0 .. p2}, Lcom/android/systemui/statusbar/phone/PanelBar;->panelExpansionChanged(Lcom/android/systemui/statusbar/phone/PanelView;F)V
.line 192
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
move-object/from16 v0, p1
if-ne v0, v5, :cond_0
move-object/from16 v0, p0
iget v5, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mScrimColor:I
if-eqz v5, :cond_0
invoke-static {}, Landroid/app/ActivityManager;->isHighEndGfx()Z
move-result v5
if-eqz v5, :cond_0
.line 193
move-object/from16 v0, p0
iget-boolean v5, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mShouldFade:Z
if-eqz v5, :cond_0
.line 194
move-object/from16 v0, p0
iget v0, v0, Lcom/android/systemui/statusbar/phone/PanelBar;->mPanelExpandedFractionSum:F
move/from16 p2, v0
.line 196
const v5, 0x3f99999a
mul-float v5, v5, p2
const v6, 0x3e4ccccd
sub-float p2, v5, v6
.line 197
const/4 v5, 0x0
cmpg-float v5, p2, v5
if-gtz v5, :cond_3
.line 215
:cond_0
:goto_0
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->getStatusBarHeight()I
move-result v1
.line 216
.local v1, H:I
invoke-virtual/range {p1 .. p1}, Lcom/android/systemui/statusbar/phone/PanelView;->getExpandedHeight()F
move-result v5
invoke-virtual/range {p1 .. p1}, Lcom/android/systemui/statusbar/phone/PanelView;->getPaddingBottom()I
move-result v6
int-to-float v6, v6
add-float v4, v5, v6
.line 217
.local v4, ph:F
const/high16 v2, 0x3f80
.line 218
.local v2, alpha:F
mul-int/lit8 v5, v1, 0x2
int-to-float v5, v5
cmpg-float v5, v4, v5
if-gez v5, :cond_1
.line 219
int-to-float v5, v1
cmpg-float v5, v4, v5
if-gez v5, :cond_4
const/4 v2, 0x0
.line 221
:goto_1
mul-float/2addr v2, v2
.line 223
:cond_1
invoke-virtual/range {p1 .. p1}, Lcom/android/systemui/statusbar/phone/PanelView;->getAlpha()F
move-result v5
cmpl-float v5, v5, v2
if-eqz v5, :cond_2
.line 224
move-object/from16 v0, p1
invoke-virtual {v0, v2}, Lcom/android/systemui/statusbar/phone/PanelView;->setAlpha(F)V
.line 227
:cond_2
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
const/4 v6, 0x0
invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateCarrierLabelVisibility(Z)V
.line 228
return-void
.line 203
.end local v1 #H:I
.end local v2 #alpha:F
.end local v4 #ph:F
:cond_3
const-wide/high16 v5, 0x3ff0
const-wide/high16 v7, 0x3fe0
const-wide/high16 v9, 0x3ff0
const-wide v11, 0x400921fa00000000L
const/high16 v13, 0x3f80
sub-float v13, v13, p2
float-to-double v13, v13
const-wide/high16 v15, 0x4000
invoke-static/range {v13 .. v16}, Ljava/lang/Math;->pow(DD)D
move-result-wide v13
mul-double/2addr v11, v13
invoke-static {v11, v12}, Ljava/lang/Math;->cos(D)D
move-result-wide v11
sub-double/2addr v9, v11
mul-double/2addr v7, v9
sub-double/2addr v5, v7
double-to-float v3, v5
.line 205
.local v3, k:F
move-object/from16 v0, p0
iget v5, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mScrimColor:I
ushr-int/lit8 v5, v5, 0x18
int-to-float v5, v5
mul-float/2addr v5, v3
float-to-int v5, v5
shl-int/lit8 v5, v5, 0x18
move-object/from16 v0, p0
iget v6, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mScrimColor:I
const v7, 0xffffff
and-int/2addr v6, v7
or-int/2addr v5, v6
goto :goto_0
.line 220
.end local v3 #k:F
.restart local v1 #H:I
.restart local v2 #alpha:F
.restart local v4 #ph:F
:cond_4
int-to-float v5, v1
sub-float v5, v4, v5
int-to-float v6, v1
div-float v2, v5, v6
goto :goto_1
.end method
.method public panelsEnabled()Z
.locals 2
.prologue
.line 88
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisabled:I
const/high16 v1, 0x1
and-int/2addr v0, v1
if-nez v0, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method public selectPanelForTouch(Landroid/view/MotionEvent;)Lcom/android/systemui/statusbar/phone/PanelView;
.locals 6
.parameter "touch"
.prologue
const/4 v4, 0x0
.line 108
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v2
.line 110
.local v2, x:F
iget-boolean v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFullWidthNotifications:Z
if-eqz v3, :cond_2
.line 112
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanel:Lcom/android/systemui/statusbar/phone/PanelView;
if-nez v3, :cond_0
move v3, v4
:goto_0
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/PanelView;
invoke-virtual {v5}, Lcom/android/systemui/statusbar/phone/PanelView;->getExpandedHeight()F
move-result v5
add-float/2addr v3, v5
cmpl-float v3, v3, v4
if-lez v3, :cond_1
const/4 v3, 0x0
.line 133
:goto_1
return-object v3
.line 112
:cond_0
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanel:Lcom/android/systemui/statusbar/phone/PanelView;
invoke-virtual {v3}, Lcom/android/systemui/statusbar/phone/PanelView;->getExpandedHeight()F
move-result v3
goto :goto_0
:cond_1
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/PanelView;
goto :goto_1
.line 122
:cond_2
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->getMeasuredWidth()I
move-result v3
int-to-float v1, v3
.line 123
.local v1, w:F
iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanelDragzoneFrac:F
mul-float v0, v1, v3
.line 131
.local v0, region:F
iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanelDragzoneMin:F
cmpg-float v3, v0, v3
if-gez v3, :cond_3
iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanelDragzoneMin:F
.line 133
:cond_3
sub-float v3, v1, v2
cmpg-float v3, v3, v0
if-gez v3, :cond_4
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanel:Lcom/android/systemui/statusbar/phone/PanelView;
goto :goto_1
:cond_4
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/PanelView;
goto :goto_1
.end method
.method public setBar(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
.locals 0
.parameter "bar"
.prologue
.line 61
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
.line 62
return-void
.end method
.method public startOpeningPanel(Lcom/android/systemui/statusbar/phone/PanelView;)V
.locals 1
.parameter "panel"
.prologue
.line 144
invoke-super {p0, p1}, Lcom/android/systemui/statusbar/phone/PanelBar;->startOpeningPanel(Lcom/android/systemui/statusbar/phone/PanelView;)V
.line 147
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PanelView;->isFullyExpanded()Z
move-result v0
if-eqz v0, :cond_1
:cond_0
const/4 v0, 0x1
:goto_0
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mShouldFade:Z
.line 151
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 152
return-void
.line 147
:cond_1
const/4 v0, 0x0
goto :goto_0
.end method
BOOTMGR said:
Double Tap Statusbar to Sleep​
In the spirit of open source, i would like to share my HarshJelly ROM's new feature backported from CM11.
What it does : Double tap statusbar anywhere to sleep device.
Requirements :
SystemUI.apk
Apktool
Notepad++
And yeah a big thanks goes to CyanogenMod Team...
I tested this on Touchwiz JB 4.1.2 but it should work on any device with 4.1.2 or any device > 4.1 with some modification (if necessary)...
If you found any error then report here along with FULL LOG. I'll ignore posts without logs.
Click to expand...
Click to collapse
will this work on stock roms?
yeshwanthvshenoy said:
will this work on stock roms?
Click to expand...
Click to collapse
If you read whole post you will find this at the end:
"I tested this on Touchwiz JB 4.1.2 but it should work on any device with 4.1.2 or any device > 4.1 with some modification (if necessary)..."
shut_down said:
If you read whole post you will find this at the end:
"I tested this on Touchwiz JB 4.1.2 but it should work on any device with 4.1.2 or any device > 4.1 with some modification (if necessary)..."
Click to expand...
Click to collapse
had this doubt thatz why asked coz some stock roms dont support this feature
BOOTMGR said:
Double Tap Statusbar to Sleep​
In the spirit of open source, i would like to share my HarshJelly ROM's new feature backported from CM11.
What it does : Double tap statusbar anywhere to sleep device.
Requirements :
SystemUI.apk
Apktool
Notepad++
And yeah a big thanks goes to CyanogenMod Team...
I tested this on Touchwiz JB 4.1.2 but it should work on any device with 4.1.2 or any device > 4.1 with some modification (if necessary)...
If you found any error then report here along with FULL LOG. I'll ignore posts without logs.
Click to expand...
Click to collapse
Sir can you help me im using a dual sim phone and it has no phonestatusbarview.smali and I already have phonestatusbarview1.smali
Hope you can help me in this mod thank you sir
shazzl said:
i try this on 4.2.2 rom. it original have the PhoneStatusBarView$1.smali can u help me...
Code:
.class Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;
.super Landroid/content/BroadcastReceiver;
.source "PhoneStatusBarView.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
# direct methods
.method constructor <init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)V
.locals 0
.parameter
.prologue
.line 120
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
return-void
.end method
# virtual methods
[COLOR="Red"].method public onDoubleTap(Landroid/view/MotionEvent;)Z
.locals 3
.parameter "e"
.prologue
.line 24
sget-object v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->c:Landroid/content/Context;
const-string v2, "power"
invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
.line 119
.local v0, pm:Landroid/os/PowerManager;
.line 120
if-eqz v0, :cond_0
.line 121
invoke-virtual {p1}, Landroid/view/MotionEvent;->getEventTime()J
move-result-wide v1
invoke-virtual {v0, v1, v2}, Landroid/os/PowerManager;->goToSleep(J)V
.line 122
:cond_0
const/4 v1, 0x1
return v1
.end method[/COLOR]
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.locals 8
.parameter "context"
.parameter "intent"
.prologue
const/4 v7, 0x1
const/4 v3, 0x0
.line 123
invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v0
.line 124
.local v0, action:Ljava/lang/String;
const-string v2, "com.samsung.cover.OPEN"
invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_0
.line 125
const-string v2, "coverOpen"
invoke-virtual {p2, v2, v3}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v2
if-ne v7, v2, :cond_1
.line 126
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$002(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;I)I
.line 127
const-string v2, "PhoneStatusBarView"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "clear cover opened : "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 128
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTicker:Landroid/view/ViewGroup;
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingLeft:I
invoke-static {v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$100(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v3
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
add-int/2addr v3, v4
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingTop:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$200(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingRight:I
invoke-static {v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$300(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v5
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v6
add-int/2addr v5, v6
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingBottom:I
invoke-static {v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$400(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v6
invoke-virtual {v2, v3, v4, v5, v6}, Landroid/view/ViewGroup;->setPadding(IIII)V
.line 134
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v2, v7}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->showClockByClearCover(Z)V
.line 135
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBlackBGView:Landroid/view/View;
const/16 v3, 0x8
invoke-virtual {v2, v3}, Landroid/view/View;->setVisibility(I)V
.line 137
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->marqueeStatusBar()V
.line 162
:cond_0
:goto_0
return-void
.line 139
:cond_1
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mIndent1:I
invoke-static {v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$500(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v3
mul-int/lit8 v3, v3, 0x11
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$002(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;I)I
.line 140
new-instance v1, Landroid/os/Handler;
invoke-direct {v1}, Landroid/os/Handler;-><init>()V
.line 141
.local v1, mHandler:Landroid/os/Handler;
new-instance v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1$1;
invoke-direct {v2, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1$1;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;)V
const-wide/16 v3, 0xaa
invoke-virtual {v1, v2, v3, v4}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
goto :goto_0
.end method
Now after invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSetV add following code i cant fine it, can you show where shukd chuld it edit it
Click to expand...
Click to collapse
Hi sir i have the same problm w/ u Im also using 4.2 and i have already phone status view 1 up to 34 .smali what did you do can you help me? hmmm
Does this still work, or is there any updated guide?
shwise said:
Does this still work, or is there any updated guide?
Click to expand...
Click to collapse
It works (at least on my i9070 running Samsung's 4.1.2 firmware).
I added this to my ROM (about a week ago) and it works just like it should.
There is an alternate guide for this too, but I never tried it..
In case you're interested, here's a link to it.
is there any easiest way to install double tap status bar to sleep for JB 4.1.2
masud0869 said:
is there any easiest way to install double tap status bar to sleep for JB 4.1.2
Click to expand...
Click to collapse
Yes. There is.
You can install this Xposed Module: http://forum.xda-developers.com/xposed/modules/mod-doubletaptosleep-v1-0-t2667177
The only requirement is that you need to have Xposed Installer installed on your phone.
Sami Kabir said:
Yes. There is.
You can install this Xposed Module: http://forum.xda-developers.com/xposed/modules/mod-doubletaptosleep-v1-0-t2667177
The only requirement is that you need to have Xposed Installer installed on your phone.
Click to expand...
Click to collapse
Is there required root first?
GUIDE TO CHANGE QUICKSETTING TOGGLES ICON THEME
work perfectly in my JB rom 4.1.2 xwlsd based
Before modding do a Nandroid Backup
thanks and credit to Goldie for his help to achieve this mod:good:
thanks and credit to Didact74 for how to add a listpreference:good:
thanks and credit to CNexus for his shared observer code:good:
To achieve you need:
SecSettings.apk
SystemUI.apk
tool for decompile and compile like apktool 1.5.2;
tool for text edit like notepad++:
Start with SecSettings.apk:
Decompile SecSettings.apk ,go in res/xml ,open with text editor display_settings.xml and add the red line
Code:
<CheckBoxPreference android:persistent="false" android:title="@string/display_saving" android:key="power_saving_mode" android:summary="@string/display_saving_mode_summary" />
<CheckBoxPreference android:persistent="false" android:title="@string/notification_pulse_title" android:key="notification_pulse" />
[COLOR="Red"]<PreferenceCategory android:title="@string/statusbar_options" android:key="statusbar_options">
<ListPreference android:persistent="false" android:entries="@array/toggles_chooser_entries" android:title="@string/icon_toggles_chooser" android:key="toggles_chooser" android:summary="@string/icon_toggles_chooser_summary" android:entryValues="@array/toggles_chooser_values" />
</PreferenceCategory>[/COLOR]
Go in res/value open with text editor arrays.xml and add at the end the red line
Code:
[COLOR="Red"]<string-array name="toggles_chooser_entries">
<item>S2 Stock Toggles</item>
<item>S5 Stock Toggles</item>
<item>Green Toggles</item>
</string-array>
<string-array name="toggles_chooser_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>[/COLOR]
</resources>
Go in res/value open with text editor strings.xml and add at the end this line
Code:
<string name="statusbar_options">Statusbar Options</string>
<string name="icon_toggles_chooser">Toggles Theme</string>
<string name="icon_toggles_chooser_summary">Select toggles\'s icons theme</string>
</resources>
Go in smali\com\android\settings\DisplaySettings.smal i and add the following lines in RED
Code:
.field mSupportFolderType:Z
[COLOR="Red"].field private mTogglesTheme:Landroid/preference/ListPreference;[/COLOR]
.field private mTouchKeyLight:Landroid/preference/ListPreference;
In the same file find .method public onCreate and add the following lines in RED
Code:
iput-object v12, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;
.line 424
iget-object v12, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;
invoke-virtual {v12, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[COLOR="Red"]
const-string v12, "toggles_chooser"
invoke-virtual {p0, v12}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v12
check-cast v12, Landroid/preference/ListPreference;
iput-object v12, p0, Lcom/android/settings/DisplaySettings;->mTogglesTheme:Landroid/preference/ListPreference;
const-string v12, "toggles_chooser"
const/4 v13, 0x0
invoke-static {v8, v12, v13}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mTogglesTheme:Landroid/preference/ListPreference;
invoke-static {v12}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v12
invoke-virtual {v13, v12}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mTogglesTheme:Landroid/preference/ListPreference;
invoke-virtual {v13, p0}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V[/COLOR]
.line 426
In the same file find .method public onPreferenceChange then find this code and add the red lines ,in blue line some explanation
Code:
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :[COLOR="Red"]cond_togglestheme[/COLOR] [COLOR="Blue"]change this from cond_2 to cond_togglestheme[/COLOR]
.line 1089
check-cast p2, Ljava/lang/Boolean;
invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z
move-result v0
if-eqz v0, :cond_e
Code:
.line 1100
const-string v1, "DisplaySettings"
const-string v3, "CONTEXTUALPAGE_SWITCH_CHANGED changed = false"
invoke-static {v1, v3}, Landroid/util/Log;->secD(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_7
:cond_11
move-wide v0, v4
goto/16 :goto_3
[COLOR="Red"]:cond_togglestheme
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mTogglesTheme:Landroid/preference/ListPreference;
if-ne p1, v1, :cond_2
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_4[/COLOR]
.end method
Save all changes and compile SecSettings
SystemUI part
Decompile SystemUI.apk ,download this zip View attachment togglestheme.zip and put the drawable png in res\drawable-hdpi
Compile SystemUI and decompile the new SystemUI.apk to obtain the new ids of the new pngs
So open SystemUI\res\value\public and leave it open
Go in SystemUI\smali\com\android\systemui\statusbar\policy\quicksetting and open AirplaneModeQuickSettingButton,smali and add the following red lines, in blue lines some explanation
find .method public constructor <init>(Landroid/content/ContextV and change the code from this
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"
.prologue
const/4 v7, 0x0
.line 112
const/4 v2, 0x0
const v3, 0x7f0a00f5
const v4, 0x7f0201ba
const v5, 0x7f0201b9
const v6, 0x7f0201b8
move-object v0, p0
move-object v1, p1
move v8, v7
invoke-direct/range {v0 .. v8}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;IIIIII)V
.line 53
to this
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"
.prologue
[COLOR="Red"] invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const v2, 0x2
if-eq v2, v1, :cond_green
const v3, 0x7f0a00f5 [COLOR="Blue"] <--this is id of text show under the icon, this remain the same in each theme[/COLOR]
const v4, 0x7f0201ba[COLOR="Blue"] <--this id is of stock tw_quick_panel_icon_airplane_on, check if it's the same of you public[/COLOR]
const v5, 0x7f0201b9[COLOR="Blue"] <--this id is of stock tw_quick_panel_icon_airplane_off, check if it's the same of you public[/COLOR]
const v6, 0x7f0201b8[COLOR="Blue"] <--this id is of stock tw_quick_panel_icon_airplane_dim, check if it's the same of you public[/COLOR]
goto :goto_new
:cond_themes5
const v3, 0x7f0a00f5
const v4, 0x7f021104[COLOR="Blue"] <--this id is of s5tw_quick_panel_icon_airplane_on, check if it's the same of you public[/COLOR]
const v5, 0x7f021103[COLOR="Blue"] <--this id is of s5tw_quick_panel_icon_airplane_off, check if it's the same of you public[/COLOR]
const v6, 0x7f021102[COLOR="Blue"] <--this id is of s5tw_quick_panel_icon_airplane_dim, check if it's the same of you public[/COLOR]
goto :goto_new
:cond_green
const v3, 0x7f0a00f5
const v4, 0x7f0210d2[COLOR="Blue"] <--this id is of greentw_quick_panel_icon_airplane_on, check if it's the same of you public[/COLOR]
const v5, 0x7f0210d1[COLOR="Blue"] <--this id is of greentw_quick_panel_icon_airplane_off, check if it's the same of you public[/COLOR]
const v6, 0x7f0210d0[COLOR="Blue"] <--this id is of greentw_quick_panel_icon_airplane_dim, check if it's the same of you public[/COLOR]
:goto_new[/COLOR]
const/4 v7, 0x0
.line 112
const/4 v2, 0x0
move-object v0, p0
move-object v1, p1
move v8, v7
invoke-direct/range {v0 .. v8}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;IIIIII)V
.line 53
then apply the same code for these others smali file:
AllShareCastQuickSettingButton
AutoRotateQuickSettingButton
BluetoothQuickSettingButton
DoNotDisturbQuickSettingButton
DormantModeQuickSettingButton
DrivingModeQuickSettingButton
LocationQuickSettingButton
MobileDataQuickSettingButton
MultiWindowQuickSettingButton
NfcP2pQuickSettingButton
PowerSavingQuickSettingButton
SBeamQuickSettingButton
SilentModeQuickSettingButton
SmartStayQuickSettingButton
SyncQuickSettingButton
WifiQuickSettingButton
In the SilentModeQuickSettingButton.smali change code from this
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"
.prologue
const/4 v2, 0x0
const v5, 0x7f0201ed
.line 53
const v3, 0x7f0a00ed
const v4, 0x7f0201ec
const/4 v6, 0x0
const v7, 0x7f0201eb
move-object v0, p0
move-object v1, p1
move v8, v5
invoke-direct/range {v0 .. v8}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;IIIIII)V
.line 36
iput-object v2, p0, Lcom/android/systemui/statusbar/policy/quicksetting/SilentModeQuickSettingButton;->mAudioManager:Landroid/media/AudioManager;
to this
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"
.prologue
[COLOR="Red"] invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const v2, 0x2
if-eq v2, v1, :cond_green
const v5, 0x7f0201ed [COLOR="Blue"] this id is stock tw_quick_panel_icon_silent_on [/COLOR]
const v3, 0x7f0a00ed[COLOR="Blue"] this id is for the text[/COLOR]
const v4, 0x7f0201ec[COLOR="Blue"] this id is stock tw_quick_panel_icon_silent_off [/COLOR]
const v7, 0x7f0201eb[COLOR="Blue"] this id is stock tw_quick_panel_icon_silent_on_on [/COLOR]
goto :goto_new
:cond_themes5
const v5, 0x7f02112a[COLOR="Blue"] this id is s5tw_quick_panel_icon_silent_on [/COLOR]
const v3, 0x7f0a00ed
const v4, 0x7f021128[COLOR="Blue"] this id is s5tw_quick_panel_icon_silent_on [/COLOR]
const v7, 0x7f021127[COLOR="Blue"] this id is s5tw_quick_panel_icon_silent_on [/COLOR]
goto :goto_new
:cond_green
const v5, 0x7f0210f8[COLOR="Blue"] this id is greentw_quick_panel_icon_silent_on [/COLOR]
const v3, 0x7f0a00ed
const v4, 0x7f0210f7[COLOR="Blue"] this id is greentw_quick_panel_icon_silent_on [/COLOR]
const v7, 0x7f0210f6[COLOR="Blue"] this id is greentw_quick_panel_icon_silent_on [/COLOR]
:goto_new[/COLOR]
const/4 v2, 0x0
.line 53
const/4 v6, 0x0
move-object v0, p0
move-object v1, p1
move v8, v5
invoke-direct/range {v0 .. v8}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;IIIIII)V
.line 36
iput-object v2, p0, Lcom/android/systemui/statusbar/policy/quicksetting/SilentModeQuickSettingButton;->mAudioManager:Landroid/media/AudioManager;
For each smali files check each ids with yours in your public.xml
This part add the observer, is to change the icons theme in real time, whitout this part you need to restart device to show the changes
Go in SystemUI\smali\com\android\systemui\statusbar\policy\quicksetting and open QuickSettingPanel
find .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V and add the following red lines at the end
Code:
.line 99
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;->update()V
.line 100
[COLOR="Red"]iget-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;->regObserver(Landroid/content/ContentResolver;)V[/COLOR]
return-void
.end method
then add this entire in red method like this
Code:
.method static synthetic access$100(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;)I
.locals 1
.parameter "x0"
.prologue
.line 51
iget v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;->mButtonCnt:I
return v0
.end method
[COLOR="Red"].method static synthetic access$500(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;)V
.locals 0
.parameter
.prologue
.line 83
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;->refreshView()V
return-void
.end method[/COLOR]
.method private disableQuickSettingButton([Ljava/lang/String;)[Ljava/lang/String;
.locals 3
then add this entire in red method like this
Code:
:cond_2
invoke-virtual {p0, v11}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;->prepareTranslationX(Z)V
.line 345
return-void
.end method
[COLOR="Red"].method private regObserver(Landroid/content/ContentResolver;)V
.locals 3
.parameter "cs"
.prologue
const/4 v2, 0x0
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel$SettingsObserver;
new-instance v1, Landroid/os/Handler;
invoke-direct {v1}, Landroid/os/Handler;-><init>()V
invoke-direct {v0, p0, p0, v1}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel$SettingsObserver;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;Landroid/os/Handler;)V
.local v0, ob:Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel$SettingsObserver;
const-string v1, "toggles_chooser"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {p1, v1, v2, v0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
return-void
.end method[/COLOR]
.method private setViewWidth()I
.locals 5
then add this smali file View attachment QuickSettingPanel$SettingsObserver.zip in SystemUI\smali\com\android\systemui\statusbar\policy\quicksetting
Save all changes and compile SystemUI, the put SecSettings.apk and SystemUI.apk in your device.
reserved
hey buddy.
been trying to do this mod this morning but having problems.
my code doesn't match yours as im using android4.4 so its alittle different.
can you see from the below how I should change mine?
Code:
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
const v1, 0x7f0a00e5
const/4 v7, 0x1
const/4 v5, 0x0
.line 145
const/4 v2, 0x0
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-nez v0, :cond_0
move v0, v7
:goto_0
invoke-direct {p0, p1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.line 64
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOn:Z
.line 65
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOff:Z
.line 68
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsWaitingForEcmExit:Z
.line 79
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 117
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mPhoneStateListener:Landroid/telephony/PhoneStateListener;
.line 147
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-eqz v0, :cond_1
.line 148
const v2, 0x7f0201ac
const v3, 0x7f0201ab
const v4, 0x7f0201aa
move-object v0, p0
move v6, v5
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIII)V
maskerwsk said:
hey buddy.
been trying to do this mod this morning but having problems.
my code doesn't match yours as im using android4.4 so its alittle different.
can you see from the below how I should change mine?
Code:
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
const v1, 0x7f0a00e5
const/4 v7, 0x1
const/4 v5, 0x0
.line 145
const/4 v2, 0x0
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-nez v0, :cond_0
move v0, v7
:goto_0
invoke-direct {p0, p1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.line 64
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOn:Z
.line 65
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOff:Z
.line 68
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsWaitingForEcmExit:Z
.line 79
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 117
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mPhoneStateListener:Landroid/telephony/PhoneStateListener;
.line 147
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-eqz v0, :cond_1
.line 148
const v2, 0x7f0201ac
const v3, 0x7f0201ab
const v4, 0x7f0201aa
move-object v0, p0
move v6, v5
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIII)V
Click to expand...
Click to collapse
what are refer those three ids in your constructor?
const v2, 0x7f0201ac --> tw_quick_panel_icon_airplane_on
const v3, 0x7f0201ab --> tw_quick_panel_icon_airplane_off
const v4, 0x7f0201aa --> tw_quick_panel_icon_airplane_dim
maskerwsk said:
const v2, 0x7f0201ac --> tw_quick_panel_icon_airplane_on
const v3, 0x7f0201ab --> tw_quick_panel_icon_airplane_off
const v4, 0x7f0201aa --> tw_quick_panel_icon_airplane_dim
Click to expand...
Click to collapse
try with this
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
const v1, 0x7f0a00e5
const/4 v7, 0x1
const/4 v5, 0x0
.line 145
const/4 v2, 0x0
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-nez v0, :cond_0
move v0, v7
:goto_0
invoke-direct {p0, p1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.line 64
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOn:Z
.line 65
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOff:Z
.line 68
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsWaitingForEcmExit:Z
.line 79
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 117
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mPhoneStateListener:Landroid/telephony/PhoneStateListener;
.line 147
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-eqz v0, :cond_1
.line 148
[COLOR="Red"] invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const v2, 0x2
if-eq v2, v1, :cond_green
const v2, 0x7f0201ac --> tw_quick_panel_icon_airplane_on
const v3, 0x7f0201ab --> tw_quick_panel_icon_airplane_off
const v4, 0x7f0201aa --> tw_quick_panel_icon_airplane_dim
goto :goto_new
:cond_themes5
const v2, 0xxxxxxxx <--this id is of s5tw_quick_panel_icon_airplane_on, check if it's the same of you public
const v3, 0xxxxxxxx <--this id is of s5tw_quick_panel_icon_airplane_off, check if it's the same of you public
const v4, 0xxxxxxxx <--this id is of s5tw_quick_panel_icon_airplane_dim, check if it's the same of you public
goto :goto_new
:cond_green
const v2, 0xxxxxxxx <--this id is of greentw_quick_panel_icon_airplane_on, check if it's the same of you public
const v3, 0xxxxxxxx <--this id is of greentw_quick_panel_icon_airplane_off, check if it's the same of you public
const v4, 0xxxxxxxx <--this id is of greentw_quick_panel_icon_airplane_dim, check if it's the same of you public
:goto_new[/COLOR]
move-object v0, p0
move v6, v5
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIII)V
instead of 0xxxxxxxx you need to check your ids,if this not work try to concact Goldie , now he is with 4.4 with his galaxy s5
thanks buddy, I've tried what you posted but still having issues.
when icon list is set to S2 Stock toggles, the airplane mode toggle is there but has no text.
when set to S5/Green toggles the airplane mode toggle disappears completely.
maskerwsk said:
thanks buddy, I've tried what you posted but still having issues.
when icon list is set to S2 Stock toggles, the airplane mode toggle is there but has no text.
when set to S5/Green toggles the airplane mode toggle disappears completely.
Click to expand...
Click to collapse
i suppose your const v1, 0x7f0a00e5 is for text, try with this
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
[COLOR="Red"] invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const v2, 0x2
if-eq v2, v1, :cond_green
const v1, 0x7f0a00e5
const v2, 0x7f0201ac --> tw_quick_panel_icon_airplane_on
const v3, 0x7f0201ab --> tw_quick_panel_icon_airplane_off
const v4, 0x7f0201aa --> tw_quick_panel_icon_airplane_dim
goto :goto_new
:cond_themes5
const v1, 0x7f0a00e5
const v2, 0xxxxxxxx <--this id is of s5tw_quick_panel_icon_airplane_on, check if it's the same of you public
const v3, 0xxxxxxxx <--this id is of s5tw_quick_panel_icon_airplane_off, check if it's the same of you public
const v4, 0xxxxxxxx <--this id is of s5tw_quick_panel_icon_airplane_dim, check if it's the same of you public
goto :goto_new
:cond_green
const v1, 0x7f0a00e5
const v2, 0xxxxxxxx <--this id is of greentw_quick_panel_icon_airplane_on, check if it's the same of you public
const v3, 0xxxxxxxx <--this id is of greentw_quick_panel_icon_airplane_off, check if it's the same of you public
const v4, 0xxxxxxxx <--this id is of greentw_quick_panel_icon_airplane_dim, check if it's the same of you public
:goto_new[/COLOR]
const/4 v7, 0x1
const/4 v5, 0x0
.line 145
const/4 v2, 0x0
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-nez v0, :cond_0
move v0, v7
:goto_0
invoke-direct {p0, p1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.line 64
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOn:Z
.line 65
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOff:Z
.line 68
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsWaitingForEcmExit:Z
.line 79
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 117
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mPhoneStateListener:Landroid/telephony/PhoneStateListener;
.line 147
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-eqz v0, :cond_1
move-object v0, p0
move v6, v5
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIII)V
PERFECT!!!!!
thanks a lot mate, works great!! well done!!!
now for all the other toggles lol
maskerwsk said:
PERFECT!!!!!
thanks a lot mate, works great!! well done!!!
now for all the other toggles lol
Click to expand...
Click to collapse
You are welcome
Inviato dal mio GT-I9100 utilizzando Tapatalk
remuntada78 said:
You are welcome
Inviato dal mio GT-I9100 utilizzando Tapatalk
Click to expand...
Click to collapse
Hi again buddy.
just found a little issue with the mod.
When the toggle is turned off, the icons show as they should,
however when I turn on the toggle the icon disappears.
the toggle still works etc, just no icon.
any ideas
EDIT - here is the code im using in red (I removed one set of icons, only want stock and s5)
Code:
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
[COLOR="Red"]invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const v1, 0x7f0a00e1
const v2, 0x7f0201ef #tw_quick_panel_icon_airplane_on
const v3, 0x7f0201ee #tw_quick_panel_icon_airplane_off
goto :goto_new
:cond_themes5
const v1, 0x7f0a00e1
const v2, 0x7f0202fd #s5tw_quick_panel_icon_airplane_on
const v3, 0x7f0202fc #s5tw_quick_panel_icon_airplane_off
:goto_new[/COLOR]
const/4 v4, 0x0
.line 98
const/4 v2, 0x0
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-nez v0, :cond_0
const/4 v0, 0x1
:goto_0
invoke-direct {p0, p1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.line 57
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mAutoRotationObserver:Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;
.line 65
iput-boolean v4, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mSupportFolderType:Z
.line 68
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 100
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-eqz v0, :cond_1
move-object v0, p0
move v5, v4
move v6, v4
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIII)V
.line 111
:goto_1
invoke-virtual {p0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->setListener(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton$Listener;)V
.line 112
return-void
:cond_0
move v0, v4
.line 98
goto :goto_0
.line 108
:cond_1
const v0, 0x7f0201f0
invoke-virtual {p0, v1, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(II)V
goto :goto_1
.end method
maskerwsk said:
Hi again buddy.
just found a little issue with the mod.
When the toggle is turned off, the icons show as they should,
however when I turn on the toggle the icon disappears.
the toggle still works etc, just no icon.
any ideas
Click to expand...
Click to collapse
have you added the right ids of the toggles on?
Inviato dal mio GT-I9100 utilizzando Tapatalk
remuntada78 said:
have you added the right ids of the toggles on?
Inviato dal mio GT-I9100 utilizzando Tapatalk
Click to expand...
Click to collapse
yeah ids are correct, checked them several times.
I edited my post above btw incase you missed it
maskerwsk said:
Hi again buddy.
just found a little issue with the mod.
When the toggle is turned off, the icons show as they should,
however when I turn on the toggle the icon disappears.
the toggle still works etc, just no icon.
any ideas
EDIT - here is the code im using in red (I removed one set of icons, only want stock and s5)
Code:
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
[COLOR="Red"]invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const v1, 0x7f0a00e1
const v2, 0x7f0201ef #tw_quick_panel_icon_airplane_on
const v3, 0x7f0201ee #tw_quick_panel_icon_airplane_off
goto :goto_new
:cond_themes5
const v1, 0x7f0a00e1
const v2, 0x7f0202fd #s5tw_quick_panel_icon_airplane_on
const v3, 0x7f0202fc #s5tw_quick_panel_icon_airplane_off
:goto_new[/COLOR]
const/4 v4, 0x0
.line 98
const/4 v2, 0x0
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-nez v0, :cond_0
const/4 v0, 0x1
:goto_0
invoke-direct {p0, p1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.line 57
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mAutoRotationObserver:Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;
.line 65
iput-boolean v4, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mSupportFolderType:Z
.line 68
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 100
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-eqz v0, :cond_1
move-object v0, p0
move v5, v4
move v6, v4
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIII)V
.line 111
:goto_1
invoke-virtual {p0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->setListener(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton$Listener;)V
.line 112
return-void
:cond_0
move v0, v4
.line 98
goto :goto_0
.line 108
:cond_1
const v0, 0x7f0201f0
invoke-virtual {p0, v1, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(II)V
goto :goto_1
.end method
Click to expand...
Click to collapse
try to change your code like this, in blue what i changed
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
[COLOR="Red"]invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const[COLOR="Blue"] v3[/COLOR], 0x7f0a00e1
const[COLOR="Blue"] v4[/COLOR], 0x7f0201ef #tw_quick_panel_icon_airplane_on
const[COLOR="Blue"] v5[/COLOR], 0x7f0201ee #tw_quick_panel_icon_airplane_off
goto :goto_new
:cond_themes5
const[COLOR="Blue"] v3[/COLOR], 0x7f0a00e1
const[COLOR="Blue"] v4[/COLOR], 0x7f0202fd #s5tw_quick_panel_icon_airplane_on
const[COLOR="Blue"] v5[/COLOR], 0x7f0202fc #s5tw_quick_panel_icon_airplane_off
:goto_new[/COLOR]
const/4 v4, 0x0
.line 98
const/4 v2, 0x0
maskerwsk said:
Hi again buddy.
just found a little issue with the mod.
When the toggle is turned off, the icons show as they should,
however when I turn on the toggle the icon disappears.
the toggle still works etc, just no icon.
any ideas
EDIT - here is the code im using in red (I removed one set of icons, only want stock and s5)
Code:
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
[COLOR="Red"]invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const v1, 0x7f0a00e1
const v2, 0x7f0201ef #tw_quick_panel_icon_airplane_on
const v3, 0x7f0201ee #tw_quick_panel_icon_airplane_off
goto :goto_new
:cond_themes5
const v1, 0x7f0a00e1
const v2, 0x7f0202fd #s5tw_quick_panel_icon_airplane_on
const v3, 0x7f0202fc #s5tw_quick_panel_icon_airplane_off
:goto_new[/COLOR]
const/4 v4, 0x0
.line 98
const/4 v2, 0x0
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-nez v0, :cond_0
const/4 v0, 0x1
:goto_0
invoke-direct {p0, p1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.line 57
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mAutoRotationObserver:Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;
.line 65
iput-boolean v4, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mSupportFolderType:Z
.line 68
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 100
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-eqz v0, :cond_1
move-object v0, p0
move v5, v4
move v6, v4
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIII)V
.line 111
:goto_1
invoke-virtual {p0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->setListener(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton$Listener;)V
.line 112
return-void
:cond_0
move v0, v4
.line 98
goto :goto_0
.line 108
:cond_1
const v0, 0x7f0201f0
invoke-virtual {p0, v1, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(II)V
goto :goto_1
.end method
Click to expand...
Click to collapse
are you sure you are doing in the right way?, because in your code you talk about tw_quick_panel_icon_airplane but the file is for AutoRotateQuickSettingButton
Yeah i just left those # values to show me which ones relate to on, off, and dim. The ids are definatly right plus i would get airplane icon when toggle is off if it was wrong. Which i dont
Sent from my SM-N9005 using XDA Premium 4 mobile app
---------- Post added at 07:01 PM ---------- Previous post was at 06:59 PM ----------
And thanks ill try those new v values
Sent from my SM-N9005 using XDA Premium 4 mobile app
Didnt work with the new values. Lost toggle completly. Wondering if theres an easier way to do it using quickbutton smali rather than having to mod every toggle. Maybe setvisibility on exsisting s5 toggle files the note 3 has
Sent from my SM-N9005 using XDA Premium 4 mobile app
maskerwsk said:
Didnt work with the new values. Lost toggle completly. Wondering if theres an easier way to do it using quickbutton smali rather than having to mod every toggle. Maybe setvisibility on exsisting s5 toggle files the note 3 has
Sent from my SM-N9005 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
yes my was just an attempt
you lost your toggles because the original toggles are set with v1, v2, v3 registers so you need tu use this value
i don't understand why your code doesn't work it's right
Im wondering if it has something to do with another mod i have. I can color the toggle icons, text and background so maybe its something to do with that.
Sent from my SM-N9005 using XDA Premium 4 mobile app
maskerwsk said:
Im wondering if it has something to do with another mod i have. I can color the toggle icons, text and background so maybe its something to do with that.
Sent from my SM-N9005 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
maybe yes if the added code is in the same file where you want add the code for change the toggles