[mod]change statusbar clock color - XPERIA X8 Android Development

you need services.jar from your phone, and smali and baksmali.
because of the hard steps i only share my services.jar
it's fully working, and i did not do anything with it.
all of tutorials doesn't work because os se mod. but here is the code.
in original statusbaricon.smali you have this:
Code:
invoke-virtual {v0, v1, v2}, Landroid/widget/TextView;->setTextSize(IF)V
.line 66
invoke-virtual {v14, v15}, Landroid/widget/TextView;->setTextColor(I)V
.line 67
const/16 v18, 0x0
you only have to add this: const/high16 v15, -0x100 after .line 66
so you got this:
Code:
invoke-virtual {v0, v1, v2}, Landroid/widget/TextView;->setTextSize(IF)V
.line 66
const/high16 v15, -0x100
invoke-virtual {v14, v15}, Landroid/widget/TextView;->setTextColor(I)V
.line 67
const/16 v18, 0x0
i attached my services.jar, copy it to /system/framework/ via xrecovery adb shell and your clock will be black
enjoy

[Re] [mod]change statusbar clock color
Any screenshot?

Related

Can't figure out a few things. Rom Tweaks

I'm using android revolution right now as my current rom. It is missing a few things, that I'm used to from being on clean rom and infected for a while.
Can anyone help me figure these things out and add them to the rom myself.
Added camera settings - HDR, Panorama, sound on/off ~ http://forum.xda-developers.com/showthread.php?t=1263813
Dimmed Capacity Buttons with custom kernel ~ http://forum.xda-developers.com/showthread.php?t=1276936
Transparent Rosie
Transparent Pull down
Extended Quick Settings
Extended Power Options
I looked around for some flashable zips for these things but I couldnt find any. Thanks for your help.
faugnom1 said:
I'm using android revolution right now as my current rom. It is missing a few things, that I'm used to from being on clean rom and infected for a while.
Can anyone help me figure these things out and add them to the rom myself.
Added camera settings - HDR, Panorama, sound on/off ~ http://forum.xda-developers.com/showthread.php?t=1263813
Dimmed Capacity Buttons with custom kernel ~ http://forum.xda-developers.com/showthread.php?t=1276936
Transparent Rosie
Transparent Pull down
Extended Quick Settings
Extended Power Options
I looked around for some flashable zips for these things but I couldnt find any. Thanks for your help.
Click to expand...
Click to collapse
I don't know about the transparent things, but have done the last 2.
For extended settings, you just need to delete all of the following lines in quicksettings.smali inside of systemui.apk.
Code:
.line 79
iget-object v2, p0, Lcom/android/systemui/statusbar/preference/QuickSettings;->mSettingItems:[Lcom/android/systemui/statusbar/preference/StatusBarPreference;
aget-object v2, v2, v7
invoke-virtual {v2, v7}, Lcom/android/systemui/statusbar/preference/StatusBarPreference;->setEnable(Z)V
.line 80
iget-object v2, p0, Lcom/android/systemui/statusbar/preference/QuickSettings;->mSettingItems:[Lcom/android/systemui/statusbar/preference/StatusBarPreference;
aget-object v2, v2, v8
invoke-virtual {v2, v7}, Lcom/android/systemui/statusbar/preference/StatusBarPreference;->setEnable(Z)V
.line 85
sget-boolean v2, Lcom/android/systemui/statusbar/StatusBarFlag;->HTC_QS_TASK_MANAGER:Z
if-nez v2, :cond_0
.line 86
iget-object v2, p0, Lcom/android/systemui/statusbar/preference/QuickSettings;->mSettingItems:[Lcom/android/systemui/statusbar/preference/StatusBarPreference;
aget-object v2, v2, v10
invoke-virtual {v2, v7}, Lcom/android/systemui/statusbar/preference/StatusBarPreference;->setEnable(Z)V
.line 92
:cond_0
iget-object v2, p0, Lcom/android/systemui/statusbar/preference/QuickSettings;->mSettingItems:[Lcom/android/systemui/statusbar/preference/StatusBarPreference;
aget-object v2, v2, v11
invoke-virtual {v2, v7}, Lcom/android/systemui/statusbar/preference/StatusBarPreference;->setEnable(Z)V
Also change
Code:
.line 94
.local v0, cm:Landroid/net/ConnectivityManager;
if-eqz v0, :cond_2
.line 95
invoke-virtual {v0}, Landroid/net/ConnectivityManager;->getTetherableWifiRegexs()[Ljava/lang/String;
move-result-object v1
.line 96
.local v1, hotspotRegexs:[Ljava/lang/String;
array-length v2, v1
if-eqz v2, :cond_1
invoke-virtual {v0}, Landroid/net/ConnectivityManager;->isTetheringSupported()Z
move-result v2
if-nez v2, :cond_2
.line 97
:cond_1
to
Code:
.line 94
.local v0, cm:Landroid/net/ConnectivityManager;
if-eqz v0, :cond_[COLOR="Red"]1[/COLOR]
.line 95
invoke-virtual {v0}, Landroid/net/ConnectivityManager;->getTetherableWifiRegexs()[Ljava/lang/String;
move-result-object v1
.line 96
.local v1, hotspotRegexs:[Ljava/lang/String;
array-length v2, v1
if-eqz v2, :cond_[COLOR="Red"]0[/COLOR]
invoke-virtual {v0}, Landroid/net/ConnectivityManager;->isTetheringSupported()Z
move-result v2
if-nez v2, :cond_[COLOR="Red"]1[/COLOR]
.line 97
:cond_[COLOR="Red"]0[/COLOR]
For the extended power menu and reboot options, you need to edit android.policy.jar. Take one from a stock rom and compare the decompiled version to one from a custom rom (I usually use SteelH's ROM). I cannot remember exactly which files are changed.
Ty sir. I found some old transparency zips on my computer. Ill post them here in case anyone else wants them.

[Team XPOSED][HOW-TO/MOD] LongPress Volume to Skip tracks

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

[MOD] [GUIDE] AOSP Lockscreen vibration toggle

AOSP Lockscreen vibration toggle​
This will allow you to toggle on/off the vibration you feel when you touch the glow ring on the AOSP lockscreen.
We will work with two files:
SecSettings
framework2
Lets begin with SecSettings.
I use Rom Control for settings but you may not...you will need to use your own toggle code if you are not using Rom Control....
Navigate to res/values/strings and add the following
Code:
<string name="enable_aosp_vibrate">AOSP lockscreen vibration</string>
<string name="enable_aosp_vibrate_text">Vibrate selection on lockscreen</string>
Navigate to res/xnl/rom_settings and add the following:
Code:
<CheckBoxPreference android:title="@string/enable_aosp_vibrate" android:key="aosp_vibrate" android:summary="@string/enable_aosp_vibrate_text" />
Navigate to smali/com/android/settings/didact/RomSettings.smali
Add the following
Code:
.field mAospLockVibration:Landroid/preference/CheckBoxPreference;
The first line in the next two examples identifies the method to paste in, it will be in bold...dont copy that line in to your method
Code:
[B].method public onCreate(Landroid/os/Bundle;)V[/B]
:goto_0
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
const-string v1, "aosp_vibrate"
invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/CheckBoxPreference;
iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mAospLockVibration:Landroid/preference/CheckBoxPreference;
iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mAospLockVibration:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v1
invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v5, "aosp_vibrate"
invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v2, :cond_1
move v1, v2
:goto_1
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
Code:
[B].method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z[/B]
:cond_2
iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mAospLockVibration:Landroid/preference/CheckBoxPreference;
if-ne p2, v2, :cond_4
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v2
invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "aosp_vibrate"
check-cast p2, Landroid/preference/CheckBoxPreference;
invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_3
move v0, v1
:cond_3
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_0
Thats it for SecSettings. Next section will cover changes in framework2.jar.....
AOSP lockscreen vibration toggle part 2, framework2​
Navigate to smali/com/android/internal/widget/multiwaveview/GlowPadView.smali. .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSetV. Replace the code from :cond_8 to :goto_2 with the following
Code:
:cond_8
const/4 v7, 0x0
const/16 v8, 0x30
invoke-virtual {v0, v7, v8}, Landroid/content/res/TypedArray;->getInt(II)I
move-result v7
iput v7, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mGravity:I
invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V
iget-object v7, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mContext:Landroid/content/Context;
invoke-virtual {v7}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v7
const-string v8, "aosp_vibrate"
const/4 v9, 0x0
invoke-static {v7, v8, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v8
if-eqz v8, :cond_9
const/4 v7, 0x1
:goto_2
Thats it. Recompile and push to your phone.
Thanks Button!!

[GUIDE]4.2.2 Statusbar for Samsung 4.1.2 ROM with Live Tiles

4.2.2 Style Stausbar for Samsung 4.1.2 ROM​
(This tutorial is originally made for SGSA but it should work with all samsung 4.1.2 ROMs)
Before we begin let me give credit to original author of this mod @SpaceCaker i'm just gonna tell you how to port it to Samsung JB 4.1.2 ROM.
(SpaceCaker's original Thread here)
Note: Throughout the tutorial we'll travel sequentially, i mean when i ask you to search for something and you find more than two matches, then choose the immediate one which comes after previous modification.
So let's begin
- Decompile SystemUI.apk
- Navigate to res/layout
- tw_status_bar.xml
search for
Code:
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/status_bar_background" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
Add this below it
Code:
<com.android.systemui.statusbar.StatusBarServiceLRPull android:layout_width="fill_parent" android:layout_height="wrap_content">
- Now search for
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
Add this above it
Code:
</com.android.systemui.statusbar.StatusBarServiceLRPull>
- Save file
Click to expand...
Click to collapse
- tw_status_bar_expanded.xml
replace
Code:
<FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/tw_close_handle_underlap">
with
Code:
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
below it there will be <include /> clause add this line below it
Code:
</LinearLayout>
below it there'll be <TextView /> add these lines below it
Code:
<com.spacecaker.SpaceLayOut android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<include layout="@layout/quickpanel_quick_settings_space" />
</LinearLayout>
<FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/tw_close_handle_underlap">
- Now search for
Code:
<com.android.systemui.statusbar.phone.CloseDragHandle
and add this code above it
Code:
</com.spacecaker.SpaceLayOut>
- Save file
Click to expand...
Click to collapse
- tw_status_bar_expanded_header.xml
search for
Code:
<RelativeLayout android:id="@id/settings_button" android:background="@drawable/tw_quick_panel_setting_button_bg" android:focusable="true" android:visibility="visible" android:layout_width="@dimen/status_bar_expanded_setting_width" android:layout_height="39.0dip">
replace it with below code
Code:
<RelativeLayout android:id="@id/settings_button" android:background="@drawable/tw_quick_panel_setting_button_bg" android:focusable="true" android:visibility="invisible" android:layout_width="0.100000024dip" android:layout_height="0.100000024dip">
<ImageView android:id="@id/settings_button_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tw_quickpanel_icon_settings" android:scaleType="center" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:contentDescription="@string/accessibility_settings_button" />
</RelativeLayout>
<RelativeLayout android:background="@drawable/tw_quick_panel_setting_button_bg" android:focusable="true" android:visibility="visible" android:layout_width="@dimen/status_bar_expanded_setting_width" android:layout_height="39.0dip">
- Search below for
Code:
android:contentDescription="@string/accessibility_settings_button"
and add this above it
Code:
android:onClick="mOpenSettings"
- Below after </RelativeLayout> add this code
Code:
<com.spacecaker.ButtonBurst android:id="@id/spacebuttonburst" android:layout_width="31.0dip" android:layout_height="34.0dip" android:scaleType="center" />
- Save file.
Click to expand...
Click to collapse
- Navigate to /res/values and add these lines to ids.xml
Code:
<item type="id" name="spaceybeaneyheader">false</item>
<item type="id" name="jbclock">false</item>
<item type="id" name="spacebuttonburst">false</item>
<item type="id" name="recent_app_button">false</item>
Click to expand...
Click to collapse
- Add these lines to end of the file Styles.xml
Code:
<style name="S3.Clear" parent="@*android:style/Widget.Button">
<item name="android:textAppearance">?android:textAppearanceSmallInverse</item>
<item name="android:textColor">#ffffffff</item>
<item name="android:gravity">center</item>
<item name="android:background">@drawable/tw_btn_default_small</item>
<item name="android:focusable">true</item>
<item name="android:clickable">true</item>
</style>
- Save files
Click to expand...
Click to collapse
- Download attached files and extract them in the directory where apk is decompiled.Now compile and again decompile APK.
Click to expand...
Click to collapse
- Go to /res/values/public.xml and search these
Code:
<public type="drawable" name="btn_tg"
<public type="drawable" name="btn_toggles_normal"
- Open smali/com/spacecaker/ButtonBurst.smali and search this
Code:
const v3, 0x7f020180
replace red part with id you got from
Code:
<public type="drawable" name="btn_toggles_normal"
- Now find this
Code:
const v3, 0x7f02017f
replace red part with id you got from
Code:
<public type="drawable" name="btn_tg"
Click to expand...
Click to collapse
- Open smali/com/android/systemui/SystemUIService.smali and add this to end of file
Code:
.method public mOpenSettings(Landroid/view/View;)V
.locals 3
.parameter "v"
.prologue
.line 2431
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 2432
const-string v1, "com.android.settings"
const-string v2, "com.android.settings.Settings"
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 v2, 0x1000
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v0
.line 2433
invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
const-string v1, "statusbar"
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/StatusBarManager;
invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
.line 1720
return-void
.end method
.method public ProfileButton(Landroid/view/View;)V
.locals 3
.parameter "v"
.prologue
.line 2431
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 2432
const-string v1, "com.android.contacts"
const-string v2, "com.android.contacts.activities.PeopleActivity"
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 v2, 0x1000
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v0
.line 2433
invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
const-string v1, "statusbar"
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/StatusBarManager;
invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
.line 1720
return-void
.end method
.method public camera_tile(Landroid/view/View;)V
.locals 3
.parameter "v"
.prologue
.line 2431
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 2432
const-string v1, "com.sec.android.app.camera"
const-string v2, "com.sec.android.app.camera.Camera"
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 v2, 0x1000
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v0
.line 2433
invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
const-string v1, "statusbar"
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/StatusBarManager;
invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
.line 1720
return-void
.end method
.method public turn_off_light(Landroid/view/View;)V
.locals 3
.parameter "v"
.prologue
.line 2431
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 2432
const-string v1, "turn.off.the.lights"
const-string v2, "turn.off.the.lights.LockerActivity"
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 v2, 0x1000
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v0
.line 2433
invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
const-string v1, "statusbar"
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/StatusBarManager;
invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
.line 1720
return-void
.end method
.method public torch_toggle(Landroid/view/View;)V
.locals 3
.parameter "v"
.prologue
.line 2431
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 2432
const-string v1, "com.teslacoilsw.flashlight"
const-string v2, "com.teslacoilsw.flashlight.TeslaLEDToggle"
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 v2, 0x1000
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v0
.line 2433
invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
const-string v1, "statusbar"
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/StatusBarManager;
invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
.line 1720
return-void
.end method
.method public dormant_toggle(Landroid/view/View;)V
.locals 3
.parameter "v"
.prologue
.line 2431
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 2432
const-string v1, "com.android.settings"
const-string v2, "com.android.settings.dormantmode.DormantmodeSettings"
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 v2, 0x1000
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v0
.line 2433
invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
const-string v1, "statusbar"
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/StatusBarManager;
invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
.line 1720
return-void
.end method
.method public tether_toggle(Landroid/view/View;)V
.locals 3
.parameter "v"
.prologue
.line 2431
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 2432
const-string v1, "com.android.settings"
const-string v2, "com.android.settings.TetherSettings"
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 v2, 0x1000
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v0
.line 2433
invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
const-string v1, "statusbar"
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/StatusBarManager;
invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
.line 1720
return-void
.end method
.method public app_toggle(Landroid/view/View;)V
.locals 3
.parameter "v"
.prologue
.line 2431
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 2432
const-string v1, "com.android.settings"
const-string v2, "com.android.settings.RunningServices"
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 v2, 0x1000
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v0
.line 2433
invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
const-string v1, "statusbar"
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/StatusBarManager;
invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
.line 1720
return-void
.end method
.method public bat_toggle(Landroid/view/View;)V
.locals 3
.parameter "v"
.prologue
.line 2431
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 2432
const-string v1, "com.android.settings"
const-string v2, "com.android.settings.fuelgauge.PowerUsageSummary"
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 v2, 0x1000
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v0
.line 2433
invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
const-string v1, "statusbar"
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/StatusBarManager;
invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
.line 1720
return-void
.end method
.method public SpaceCakerButton(Landroid/view/View;)V
.locals 3
.parameter "v"
.prologue
.line 2431
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 2432
const-string v1, "com.android.settings"
const-string v2, "com.android.settings.Settings"
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 v2, 0x1000
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v0
.line 2433
invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
const-string v1, "statusbar"
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/StatusBarManager;
invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
.line 1720
return-void
.end method
Click to expand...
Click to collapse
That's all compile apk and push it to device.
(Torch and Sleep tiles won't work unless you install TeslaLED and Turn Off the Lights app from market)
You can refer to SpaceCaker's thread for more info and tutorial for how to add new tiles.
If you get any errors/FCs report here along with full log.
(i won't quote posts without logcat and ask for logcat, i'll simply ignore them)
How to add Live Tiles
So now you've setup layout for 4.2 statusbar.Now its time to add some live tiles here.
What you'll get
At the moment i've only created live tiles for Battery and WiFi (those are the only ones which are fairly noticeable and widely used).Live tile for battery shows battery level and WiFi tile shows AP name and signal level when connected.See below screenshot for more info.
(More tiles will be added later when i'll get some time)
So let's begin
- Add thses lines to res/values/ids.xml
Code:
<item type="id" name="harsh_batt">false</item>
<item type="id" name="harsh_wifi">false</item>
<item type="id" name="harsh_bat_img">false</item>
<item type="id" name="harsh_wifi_img">false</item>
Click to expand...
Click to collapse
- Now open \res\layout\quickpanel_quick_settings_space.xml
- Every tile here is wrapped up within <FrameLayout></FrameLayout>.So now select one of frameLayout which will be your battery tile.This framelayout will include one ImageView (for indication of battery tile) and one TextView (for showing battery in %).Create them if you haven't.
- Now remove
Code:
android:src="@drawable/set"
or whatever drawable you've associated to that ImageView.
- Add
Code:
android:id="@id/harsh_bat_img"
for same ImageView.
- We'll do the same for TextView.Remove
Code:
android:text="Battery"
and add
Code:
android:id="@id/harsh_batt"
for that TextView.
- Now let's do the same for WiFi tile.Select FrameLayout for that tile and do following changes for that FrameLayout
- Remove
Code:
android:src="@drawable/set"
for the <ImageView> and add
Code:
android:id="@id/harsh_wifi_img"
- Now for <TextView>, remove
Code:
android:text="xxx"
and add
Code:
android:id="@id/harsh_wifi"
- Thats all.Save the files.
Click to expand...
Click to collapse
- Download the attached file and extract it to decompiled directory.
- Compile APK and decompiled it back so that public ids get generated.
- Now keep you res/values/public.xml open.
Click to expand...
Click to collapse
- Open smali\com\spacecaker\SpaceLayOut.smali
- Add
Code:
.field draw:Landroid/graphics/drawable/Drawable;
.field iv:Landroid/widget/ImageView;
before .field private mContext:Landroid/content/Context;
- Add
Code:
.field res:Landroid/content/res/Resources;
.field t:Landroid/widget/TextView;
.field userName:Ljava/lang/String;
after .field private mUpdating:Z
- Now search for .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSetV and add following lines before return-void
Code:
invoke-virtual {p0}, Lcom/spacecaker/SpaceLayOut;->getResources()Landroid/content/res/Resources;
move-result-object v0
iput-object v0, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
- search for .method private update(Z)V and add this below .line 46 (i.e. at the starting of the method)
Code:
invoke-virtual {p0}, Lcom/spacecaker/SpaceLayOut;->getBatteryState()V
.line 256
invoke-virtual {p0}, Lcom/spacecaker/SpaceLayOut;->getWifiInfo()V
- Now add the following lines after # virtual methods.
Code:
.method public getBatteryState()V
.locals 13
.prologue
.line 31
const v10, 0x7f0d012c
invoke-virtual {p0, v10}, Lcom/spacecaker/SpaceLayOut;->findViewById(I)Landroid/view/View;
move-result-object v10
check-cast v10, Landroid/widget/TextView;
iput-object v10, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
.line 32
const v10, 0x7f0d012e
invoke-virtual {p0, v10}, Lcom/spacecaker/SpaceLayOut;->findViewById(I)Landroid/view/View;
move-result-object v10
check-cast v10, Landroid/widget/ImageView;
iput-object v10, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;
.line 33
new-instance v3, Landroid/content/IntentFilter;
const-string v10, "android.intent.action.BATTERY_CHANGED"
invoke-direct {v3, v10}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
.line 34
.local v3, ifilter:Landroid/content/IntentFilter;
iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->mContext:Landroid/content/Context;
const/4 v11, 0x0
invoke-virtual {v10, v11, v3}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
move-result-object v1
.line 35
.local v1, batteryStatus:Landroid/content/Intent;
const-string v10, "level"
const/4 v11, -0x1
invoke-virtual {v1, v10, v11}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v5
.line 36
.local v5, level:I
const-string v10, "scale"
const/4 v11, -0x1
invoke-virtual {v1, v10, v11}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v7
.line 37
.local v7, scale:I
const-string v10, "status"
const/4 v11, -0x1
invoke-virtual {v1, v10, v11}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v8
.line 38
.local v8, status:I
const/4 v10, 0x2
if-eq v8, v10, :cond_0
const/4 v10, 0x5
if-eq v8, v10, :cond_0
const/4 v4, 0x0
.line 39
.local v4, isCharging:Z
:goto_0
const-string v10, "plugged"
const/4 v11, -0x1
invoke-virtual {v1, v10, v11}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v2
.line 40
.local v2, chargePlug:I
const/4 v10, 0x2
if-ne v2, v10, :cond_1
const/4 v9, 0x1
.line 41
.local v9, usbCharge:Z
:goto_1
int-to-float v10, v5
int-to-float v11, v7
div-float v6, v10, v11
.line 42
.local v6, net_battery:F
const/high16 v10, 0x42c8
mul-float/2addr v10, v6
invoke-static {v10}, Ljava/lang/Math;->round(F)I
move-result v0
.line 43
.local v0, batteryPct:I
if-eqz v4, :cond_3
.line 44
if-eqz v9, :cond_2
.line 45
iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
new-instance v11, Ljava/lang/StringBuilder;
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v12
invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
const-string v12, "%"
invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v11
const-string v12, " (USB)"
invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v11
invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v11
invoke-virtual {v10, v11}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 52
:goto_2
:try_start_0
iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
iget-object v11, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
const v12, 0x7f0202ff
invoke-virtual {v11, v12}, Landroid/content/res/Resources;->getXml(I)Landroid/content/res/XmlResourceParser;
move-result-object v11
invoke-static {v10, v11}, Landroid/graphics/drawable/Drawable;->createFromXml(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;)Landroid/graphics/drawable/Drawable;
move-result-object v10
iput-object v10, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 55
:goto_3
iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
invoke-virtual {v10, v0}, Landroid/graphics/drawable/Drawable;->setLevel(I)Z
.line 56
iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;
iget-object v11, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
invoke-virtual {v10, v11}, Landroid/widget/ImageView;->setBackground(Landroid/graphics/drawable/Drawable;)V
.line 57
return-void
.line 38
.end local v0 #batteryPct:I
.end local v2 #chargePlug:I
.end local v4 #isCharging:Z
.end local v6 #net_battery:F
.end local v9 #usbCharge:Z
:cond_0
const/4 v4, 0x1
goto :goto_0
.line 40
.restart local v2 #chargePlug:I
.restart local v4 #isCharging:Z
:cond_1
const/4 v9, 0x0
goto :goto_1
.line 47
.restart local v0 #batteryPct:I
.restart local v6 #net_battery:F
.restart local v9 #usbCharge:Z
:cond_2
iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
new-instance v11, Ljava/lang/StringBuilder;
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v12
invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
const-string v12, "%"
invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v11
const-string v12, " (AC)"
invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v11
invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v11
invoke-virtual {v10, v11}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
goto :goto_2
.line 49
:cond_3
iget-object v10, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
new-instance v11, Ljava/lang/StringBuilder;
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v12
invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
const-string v12, "%"
invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v11
invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v11
invoke-virtual {v10, v11}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
goto :goto_2
.line 53
:catch_0
move-exception v10
goto :goto_3
.end method
.method public getWifiInfo()V
.locals 7
.prologue
.line 59
const v4, 0x7f0d012d
invoke-virtual {p0, v4}, Lcom/spacecaker/SpaceLayOut;->findViewById(I)Landroid/view/View;
move-result-object v4
check-cast v4, Landroid/widget/TextView;
iput-object v4, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
.line 60
const v4, 0x7f0d012f
invoke-virtual {p0, v4}, Lcom/spacecaker/SpaceLayOut;->findViewById(I)Landroid/view/View;
move-result-object v4
check-cast v4, Landroid/widget/ImageView;
iput-object v4, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;
.line 61
iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->mContext:Landroid/content/Context;
const-string v5, "wifi"
invoke-virtual {v4, v5}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v3
check-cast v3, Landroid/net/wifi/WifiManager;
.line 62
.local v3, wm:Landroid/net/wifi/WifiManager;
invoke-virtual {v3}, Landroid/net/wifi/WifiManager;->getWifiState()I
move-result v2
.line 63
.local v2, wifiState:I
packed-switch v2, :pswitch_data_0
.line 86
iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
const-string v5, "Error"
invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 89
:goto_0
return-void
.line 67
:pswitch_0
iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
const-string v5, "Wi-Fi"
invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 69
:try_start_0
iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
iget-object v5, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
const v6, 0x7f020322
invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getXml(I)Landroid/content/res/XmlResourceParser;
move-result-object v5
invoke-static {v4, v5}, Landroid/graphics/drawable/Drawable;->createFromXml(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;)Landroid/graphics/drawable/Drawable;
move-result-object v4
iput-object v4, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
.line 72
:goto_1
iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;
iget-object v5, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
invoke-virtual {v4, v5}, Landroid/widget/ImageView;->setBackground(Landroid/graphics/drawable/Drawable;)V
goto :goto_0
.line 75
:pswitch_1
invoke-virtual {v3}, Landroid/net/wifi/WifiManager;->getConnectionInfo()Landroid/net/wifi/WifiInfo;
move-result-object v1
.line 76
.local v1, wifiInfo:Landroid/net/wifi/WifiInfo;
iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->t:Landroid/widget/TextView;
invoke-virtual {v1}, Landroid/net/wifi/WifiInfo;->getSSID()Ljava/lang/String;
move-result-object v5
invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 77
invoke-virtual {v1}, Landroid/net/wifi/WifiInfo;->getRssi()I
move-result v4
const/4 v5, 0x5
invoke-static {v4, v5}, Landroid/net/wifi/WifiManager;->calculateSignalLevel(II)I
move-result v0
.line 79
.local v0, signalLevel:I
:try_start_1
iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
iget-object v5, p0, Lcom/spacecaker/SpaceLayOut;->res:Landroid/content/res/Resources;
const v6, 0x7f020300
invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getXml(I)Landroid/content/res/XmlResourceParser;
move-result-object v5
invoke-static {v4, v5}, Landroid/graphics/drawable/Drawable;->createFromXml(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;)Landroid/graphics/drawable/Drawable;
move-result-object v4
iput-object v4, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
:try_end_1
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
.line 82
:goto_2
iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
invoke-virtual {v4, v0}, Landroid/graphics/drawable/Drawable;->setLevel(I)Z
.line 83
iget-object v4, p0, Lcom/spacecaker/SpaceLayOut;->iv:Landroid/widget/ImageView;
iget-object v5, p0, Lcom/spacecaker/SpaceLayOut;->draw:Landroid/graphics/drawable/Drawable;
invoke-virtual {v4, v5}, Landroid/widget/ImageView;->setBackground(Landroid/graphics/drawable/Drawable;)V
goto :goto_0
.line 80
:catch_0
move-exception v4
goto :goto_2
.line 70
.end local v0 #signalLevel:I
.end local v1 #wifiInfo:Landroid/net/wifi/WifiInfo;
:catch_1
move-exception v4
goto :goto_1
.line 63
nop
:pswitch_data_0
.packed-switch 0x0
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_1
.end packed-switch
.end method
Click to expand...
Click to collapse
- Search for
Code:
const v15, 0x7f0d012c
change public id which you get from
Code:
<public type="id" name="harsh_batt"
in public.xml
- Search for
Code:
const v15, 0x7f0d012e
change public id which you get from
Code:
<public type="id" name="harsh_bat_img"
- Search for
Code:
const v15, 0x7f0202ff
change public id which you get from
Code:
<public type="drawable" name="harsh_stat_battery"
- Search for
Code:
const v8, 0x7f0d012d
change public id which you get from
Code:
<public type="id" name="harsh_wifi"
- Search for
Code:
const v8, 0x7f0d012f
change public id which you get from
Code:
<public type="id" name="harsh_wifi_img"
- Search for
Code:
const v8, 0x7f020322
change public id which you get from
Code:
<public type="drawable" name="wifi_tile"
- Search for
Code:
const v8, 0x7f020300
change public id which you get from
Code:
<public type="drawable" name="harsh_stat_wifi"
Click to expand...
Click to collapse
- Thats it.Now save your file and compile APK and push it to device.
Tips,Tricks & FAQs
Changelog:
13/12/13 --> Initial Release
27/12/13 --> Optimized code.Reduced lags when live tiles are implemented.Live tiles will update only when statusbar is pulled down.
Tips, Tricks & FAQs:
If battery indicator or any other image don't look in center, define paddings like android:layout_marginTop="30.0dip"
If you've added more than 3 rows, then you need to enclose it in <ScrollView> in order to make it scrollable.
Even though i've named them Live tiles, they're not actually live like original 4.2.2 statusbar. They'll update only when tile layout is drawn (i mean expanded).But this has one advantage that addition overhead to system is gone.
Associate android: onClick="foobar" attribute to FrameLayout instead of ImageView so that clicking anywhere on the tile can execute defined method.
Each <LinearLayout> shows one row which have 3 FrameLayout by default.If you'll add/remove FrameLayout then width of tiles will be set accordingly.
screenshot will be? I would like to see the final result
Status bar disappeared. What to do? Galaxy ace 2 android 4.1.2
ildar2099 said:
Status bar disappeared. What to do? Galaxy ace 2 android 4.1.2
Click to expand...
Click to collapse
First...read the OP. Especially the underlined line at the bottom
Nice guide btw
Sent from my GT-I9305 using Tapatalk
Code:
pkTools152\SystemUI\res; found: mk
aapt: warning: string 'month_shortest_july' has no default translation in C:\ApkT
ools152\SystemUI\res; found: mk
aapt: warning: string 'month_shortest_june' has no default translation in C:\ApkT
ools152\SystemUI\res; found: mk
aapt: warning: string 'month_shortest_march' has no default translation in C:\Apk
Tools152\SystemUI\res; found: mk
aapt: warning: string 'month_shortest_may' has no default translation in C:\ApkTo
ols152\SystemUI\res; found: mk
aapt: warning: string 'month_shortest_november' has no default translation in C:\
ApkTools152\SystemUI\res; found: mk
aapt: warning: string 'month_shortest_october' has no default translation in C:\A
pkTools152\SystemUI\res; found: mk
aapt: warning: string 'month_shortest_september' has no default translation in C:
\ApkTools152\SystemUI\res; found: mk
aapt: warning: string 'no_such_item' has no default translation in C:\ApkTools152
\SystemUI\res; found: bg cs da de el en_US es_ES es_US et fi fr ga hr hu is it kk
ko lt lv mk nb nl pl pt_PT ro ru sk sl sr sv tr uk
aapt: warning: string 'pm' has no default translation in C:\ApkTools152\SystemUI\
res; found: mk
aapt: warning: string 'quickpanel_data_roaming_disable_toast' has no default tran
slation in C:\ApkTools152\SystemUI\res; found: bg cs da de el en_US es_ES es_US e
t fi fr ga hr hu is it kk ko lt lv mk nb nl pl pt_PT ro ru sk sl sr sv tr uk
aapt: warning: string 'quickpanel_data_roaming_enable_toast' has no default trans
lation in C:\ApkTools152\SystemUI\res; found: bg cs da de el en_US es_ES es_US et
fi fr ga hr hu is it kk ko lt lv mk nb nl pl pt_PT ro ru sk sl sr sv tr uk
aapt: warning: string 'today' has no default translation in C:\ApkTools152\System
UI\res; found: mk
aapt: warning: string 'tomorrow' has no default translation in C:\ApkTools152\Sys
temUI\res; found: mk
aapt: warning: string 'twelve_hour_time_format' has no default translation in C:\
ApkTools152\SystemUI\res; found: mk
aapt: warning: string 'yesterday' has no default translation in C:\ApkTools152\Sy
stemUI\res; found: mk
I: Building apk file...
SystemUI - complete
All done!
My original SystemUI.apk
They're just apktool warnings. You need a logcat of the system ui fc not the compile log
Sent from my GT-I9305 using Tapatalk
Goldie said:
They're just apktool warnings. You need a logcat of the system ui fc not the compile log
Sent from my GT-I9305 using Tapatalk
Click to expand...
Click to collapse
where to find it?
ildar2099 said:
where to find it?
Click to expand...
Click to collapse
You should have a dumpstate_app_error.txt.gz in data/log. If not then you need to google how to take a logcat
Sent from my GT-I9305 using Tapatalk
Goldie said:
You should have a dumpstate_app_error.txt.gz in data/log. If not then you need to google how to take a logcat
Sent from my GT-I9305 using Tapatalk
Click to expand...
Click to collapse
can be more?
Sent from my GT-I8160 using xda app-developers app
Great tutorial, I would like to try this on Note but one question , is the zip file same for xhdpi phones?
nice tutorial thank you..
tommorow i will try it :good:
just awesome. Thank you for all Mr.Harsh
got it working, but there's 1 problem, when not charging, there's no icons in the statusbar, and i can only use the last used dropdown.
when it is charging, i can use both (left and right) and the statusbar looks normal. any idea what that could be? i'll upload the logcat later, unless you know what this problem is.
-edit- it seems that the statusbar and mod work like expected when in the lockscreen, and when there is a notification (when charging over usb there is a notification, so that's why it also works the way it should when charging, it also doesn't work when charging normally). because of this i can't upload a logcat, cause when using my pc (via usb) the statusbar works normally, and when using terminal emulator there is a notification, so then it also works normally.
---------- Post added at 11:47 PM ---------- Previous post was at 11:05 PM ----------
nevermind, i disabled the clock with some xml editing, and apparently that causes the disappearing of the icons and the functionality of the left/right pull.
so for anybody that for some reason removed the clock, it causes this bug (maybe it isn't a bug, i don't know yet) to happen.
ildar2099 said:
My original SystemUI.apk
Click to expand...
Click to collapse
Yep, as Goldie told they're just warnings, if statusbar has disappeared then you must have done something wrong.Post logcat here.
(Here is a tut about how to take logcat: http://forum.xda-developers.com/showthread.php?t=2303834 )
kmokhtar79 said:
Great tutorial, I would like to try this on Note but one question , is the zip file same for xhdpi phones?
Click to expand...
Click to collapse
You'll need to replace icons in drawable-hdpi folder else they'll look too small.But if you're gonna test it then try with those icons then you'll just need to replace those icons by better icons.
mjz2cool said:
got it working, but there's 1 problem, when not charging, there's no icons in the statusbar, and i can only use the last used dropdown.
when it is charging, i can use both (left and right) and the statusbar looks normal. any idea what that could be? i'll upload the logcat later, unless you know what this problem is.
-edit- it seems that the statusbar and mod work like expected when in the lockscreen, and when there is a notification (when charging over usb there is a notification, so that's why it also works the way it should when charging, it also doesn't work when charging normally). because of this i can't upload a logcat, cause when using my pc (via usb) the statusbar works normally, and when using terminal emulator there is a notification, so then it also works normally.
---------- Post added at 11:47 PM ---------- Previous post was at 11:05 PM ----------
nevermind, i disabled the clock with some xml editing, and apparently that causes the disappearing of the icons and the functionality of the left/right pull.
so for anybody that for some reason removed the clock, it causes this bug (maybe it isn't a bug, i don't know yet) to happen.
Click to expand...
Click to collapse
Have you modified statusbar before?
Anyways i'm glad that you got it working..
ildar2099 said:
can be more?
Sent from my GT-I8160 using xda app-developers app
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=2303834
mr.harsh said:
4.2.2 Style Stausbar for Samsung 4.1.2 ROM​
(This tutorial is originally made for SGSA but it should work with all samsung 4.1.2 ROMs)
Before we begin let me give credit to original author of this mod @SpaceCaker i'm just gonna tell you how to port it to Samsung JB 4.1.2 ROM.
(SpaceCaker's original Thread here)
Note: Throughout the tutorial we'll travel sequentially, i mean when i ask you to search for something and you find more than two matches, then choose the immediate one which comes after previous modification.
So let's begin
- Decompile SystemUI.apk
- Navigate to res/layout
That's all compile apk and push it to device.
(Torch and Sleep tiles won't work unless you install TeslaLED and Turn Off the Lights app from market)
You can refer to SpaceCaker's thread for more info and tutorial for how to add new tiles.
If you get any errors/FCs report here along with full log.
Click to expand...
Click to collapse
thanks b4 for your guide:good: but after i try this guide not work for me my systemUI FC i hope you help me.. (sorry for bad my English)
Edit: SOLVED my mistake incorrect one line to edit
is there a way to add actual toggles? i tried using the guides to add lidroid toggles, and then the guide to get them in a grid, but i can't seem to get the lidroid toggles to work.
abdoel_046 said:
thanks b4 for your guide:good: but after i try this guide not work for me my systemUI FC i hope you help me.. (sorry for bad my English)
Click to expand...
Click to collapse
No log = No help
mjz2cool said:
is there a way to add actual toggles? i tried using the guides to add lidroid toggles, and then the guide to get them in a grid, but i can't seem to get the lidroid toggles to work.
Click to expand...
Click to collapse
You need to override methods in such a way that they toggles the state of wifi/bluetooth etc instead of launching activity.I did it but problem was that tiles won't get updated after toggling state.SpaceCaker has made update() method private/ non-static (of course there was reason to do so) so we can't call is after changing state.To make it work in that i'll need to code whole things again but i don't have such time.May be in future i'll do that...
BTW, lidroid toggles are easy to port and arrange them in grid.
mr.harsh said:
No log = No help
You need to override methods in such a way that they toggles the state of wifi/bluetooth etc instead of launching activity.I did it but problem was that tiles won't get updated after toggling state.SpaceCaker has made update() method private/ non-static (of course there was reason to do so) so we can't call is after changing state.To make it work in that i'll need to code whole things again but i don't have such time.May be in future i'll do that...
BTW, lidroid toggles are easy to port and arrange them in grid.
Click to expand...
Click to collapse
already solved.. sorry mr.harsh i wrong edit one line it is make systemUI FC..

[TUTORIAL]How To Add Advance Power Menu[3/1/2014]

Happy New Year...
This is my first tutorial of 2014. Today I will teach
you how to add Reboot and Recovery option in Power Menu.
Make sure you have a basic knowledge on how to compile/decompile .apk/.jar files.
framework-res.apk
Decompile framework-res.apk
[*]Navigate to framework-res.apk\res\drawable-hdpi
[*]Extract all the files from PNG folder (Download From Attachment)
[*]Navigate to framework-res.apk\res\values
[*]Open strings.xml file in file editor
[*]Add these line at the end
Code:
<string name="reboot">Reboot</string>
<string name="reboot_progress">Rebooting…</string>
<string name="reboot_confirm">Your phone will reboot</string>
<string name="recovery">Recovery</string>
<string name="recovery_progress">Rebooting into recovery…</string>
<string name="recovery_confirm">Your phone will reboot into recovery</string>
[*]Save the file
[*]Recompile your framework-res.apk
[*]Decompile framework-res.apk which you have recompiled a moment ago
[*]Navigate to framework-res.apk\res\values
[*]Open public.xml file in file editor
framework.jar
Decompile framework.jar
[*]Navigate to framework.jar\smali\com\android\internal\app
[*]Open ShutdownThread.smali file in file editor
[*]Search for .field private static mReboot:Z and add the red line only
Code:
.field private static final TAG:Ljava/lang/String; = "ShutdownThread"
[COLOR="Red"].field public static mReboot:I[/COLOR]
.field private static mReboot:Z
[*]Search for .local v1, pd:Landroid/app/ProgressDialog; and add the red lines only
Code:
.line 184
.local v1, pd:Landroid/app/ProgressDialog;
[COLOR="Red"]sget v2, Lcom/android/internal/app/ShutdownThread;->mReboot:I
if-eq v2, v5, :cond_1
if-nez v2, :cond_2[/COLOR]
const v2, 0x104014a
[COLOR="Red"]goto :goto_1
:cond_1
const v2, name="reboot"
goto :goto_1
:cond_2
const v2, name="recovery"
:goto_1[/COLOR]
invoke-virtual {p0, v2}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;
move-result-object v2
[*]Search for invoke-virtual {v1, v2}, Landroid/app/ProgressDialog;->setTitle(Ljava/lang/CharSequenceV and add the red lines only
Code:
move-result-object v2
invoke-virtual {v1, v2}, Landroid/app/ProgressDialog;->setTitle(Ljava/lang/CharSequence;)V
.line 185
[COLOR="Red"]sget v2, Lcom/android/internal/app/ShutdownThread;->mReboot:I
if-eq v2, v5, :cond_3
if-nez v2, :cond_4[/COLOR]
const v2, 0x104014e
[COLOR="Red"]goto :goto_2
:cond_3
const v2, name="reboot_progress"
goto :goto_2
:cond_4
const v2, name="recovery_progress"
:goto_2[/COLOR]
invoke-virtual {p0, v2}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;
move-result-object v2
[*]Search for .catch Ljava/lang/SecurityException; {:try_start_1 .. :try_end_1} :catch_0 and change the blue lines only
Code:
invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->acquire()V
:try_end_1
.catch Ljava/lang/SecurityException; {:try_start_1 .. :try_end_1} :catch_0
.line 208
[COLOR="Blue"]:goto_3[/COLOR]
sget-object v2, Lcom/android/internal/app/ShutdownThread;->sInstance:Lcom/android/internal/app/ShutdownThread;
iput-object v6, v2, Lcom/android/internal/app/ShutdownThread;->mScreenWakeLock:Landroid/os/PowerManager$WakeLock;
.line 209
sget-object v2, Lcom/android/internal/app/ShutdownThread;->sInstance:Lcom/android/internal/app/ShutdownThread;
iget-object v2, v2, Lcom/android/internal/app/ShutdownThread;->mPowerManager:Landroid/os/PowerManager;
invoke-virtual {v2}, Landroid/os/PowerManager;->isScreenOn()Z
move-result v2
[COLOR="Blue"]if-eqz v2, :cond_5[/COLOR]
.line 211
:try_start_2
[*]Search for .catch Ljava/lang/SecurityException; {:try_start_2 .. :try_end_2} :catch_1 and change the blue lines only
Code:
:try_end_2
.catch Ljava/lang/SecurityException; {:try_start_2 .. :try_end_2} :catch_1
.line 222
[COLOR="Blue"]:cond_5
:goto_4[/COLOR]
sget-object v2, Lcom/android/internal/app/ShutdownThread;->sInstance:Lcom/android/internal/app/ShutdownThread;
new-instance v3, Lcom/android/internal/app/ShutdownThread$2;
[*]Search for .end local v0 #e:Ljava/lang/SecurityException; and change the blue lines only
Code:
iput-object v6, v2, Lcom/android/internal/app/ShutdownThread;->mCpuWakeLock:Landroid/os/PowerManager$WakeLock;
[COLOR="Blue"]goto :goto_3[/COLOR]
.line 215
.end local v0 #e:Ljava/lang/SecurityException;
:catch_1
move-exception v0
.line 216
.restart local v0 #e:Ljava/lang/SecurityException;
const-string v2, "ShutdownThread"
const-string v3, "No permission to acquire wake lock"
invoke-static {v2, v3, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
.line 217
sget-object v2, Lcom/android/internal/app/ShutdownThread;->sInstance:Lcom/android/internal/app/ShutdownThread;
iput-object v6, v2, Lcom/android/internal/app/ShutdownThread;->mScreenWakeLock:Landroid/os/PowerManager$WakeLock;
[COLOR="Blue"]goto :goto_4[/COLOR]
.end method
.method public static reboot(Landroid/content/Context;Ljava/lang/String;Z)V
[*]Search for .method public static rebootOrShutdown(ZLjava/lang/StringV and change the blue line only
Code:
.end method
.method public static rebootOrShutdown(ZLjava/lang/String;)V
.locals 5
.parameter "reboot"
.parameter "reason"
.prologue
.line 403
[COLOR="Blue"]if-eqz p0, :cond_3[/COLOR]
.line 404
const-string v2, "ShutdownThread"
[*]Search for invoke-static {p1}, Landroid/os/Power;->reboot(Ljava/lang/StringV and add the red lines and change the blue lines only
Code:
:try_start_0
invoke-static {p1}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
:try_end_0
[COLOR="Blue"].catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1[/COLOR]
.line 428
:goto_0
const-string v2, "ShutdownThread"
const-string v3, "Performing low-level shutdown..."
invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
[COLOR="Red"]sget v1, Lcom/android/internal/app/ShutdownThread;->mReboot:I
const/4 v2, 0x1
if-eq v1, v2, :cond_0
const/4 v2, 0x2
if-eq v1, v2, :cond_1[/COLOR]
.line 429
invoke-static {}, Landroid/os/Power;->shutdown()V
.line 430
return-void
[COLOR="Red"]:cond_0
const-string/jumbo v4, "now"
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
return-void
:cond_1
:try_start_1
new-instance v1, Ljava/io/File;
const-string v4, "/cache/recovery/boot"
invoke-direct {v1, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 442
.restart local v1
invoke-virtual {v1}, Ljava/io/File;->exists()Z
move-result v4
if-nez v4, :cond_2
.line 443
invoke-virtual {v1}, Ljava/io/File;->createNewFile()Z
:try_end_1
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
:catch_0
:cond_2
const-string/jumbo v4, "recovery"
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
return-void[/COLOR]
.line 407
[COLOR="Blue"]:catch_1[/COLOR]
move-exception v0
.line 408
.local v0, e:Ljava/lang/Exception;
const-string v2, "ShutdownThread"
[*]Search for .end local v0 #e:Ljava/lang/Exception; and change the blue lines only
Code:
.line 412
.end local v0 #e:Ljava/lang/Exception;
[COLOR="Blue"]:cond_3[/COLOR]
new-instance v1, Landroid/os/Vibrator;
invoke-direct {v1}, Landroid/os/Vibrator;-><init>()V
.line 414
.local v1, vibrator:Landroid/os/Vibrator;
const-wide/16 v2, 0x1f4
[COLOR="Blue"]:try_start_2[/COLOR]
invoke-virtual {v1, v2, v3}, Landroid/os/Vibrator;->vibrate(J)V
[COLOR="Blue"]:try_end_2
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_3[/COLOR]
.line 422
:goto_1
const-wide/16 v2, 0x1f4
[COLOR="Blue"]:try_start_3[/COLOR]
invoke-static {v2, v3}, Ljava/lang/Thread;->sleep(J)V
[COLOR="Blue"]:try_end_3
.catch Ljava/lang/InterruptedException; {:try_start_3 .. :try_end_3} :catch_2[/COLOR]
goto :goto_0
.line 423
[COLOR="Blue"]:catch_2[/COLOR]
move-exception v2
goto :goto_0
.line 415
[COLOR="Blue"]:catch_3[/COLOR]
move-exception v0
.line 417
.restart local v0 #e:Ljava/lang/Exception;
[*]Search for .local v1, longPressBehavior:I and change the blue lines only
Code:
.line 106
.local v1, longPressBehavior:I
const/4 v3, 0x2
[COLOR="Blue"]if-ne v1, v3, :cond_4[/COLOR]
const v2, 0x1040150
.line 110
.local v2, resourceId:I
:goto_1
const-string v3, "ShutdownThread"
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
const-string v5, "Notifying thread to start shutdown longPressBehavior="
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 112
[COLOR="Blue"]if-eqz p1, :cond_7[/COLOR]
.line 113
new-instance v0, Lcom/android/internal/app/ShutdownThread$CloseDialogReceiver;
[*]Search for invoke-direct {v3, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/ContextV and add the red lines only
Code:
new-instance v3, Landroid/app/AlertDialog$Builder;
invoke-direct {v3, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V
[COLOR="Red"]const v5, 0x1
sget v4, Lcom/android/internal/app/ShutdownThread;->mReboot:I
if-eq v4, v5, :cond_2
if-nez v4, :cond_3[/COLOR]
const v4, 0x104014a
[COLOR="Red"]goto :goto_2
:cond_2
const v4, name="reboot"
goto :goto_2
:cond_3
const v4, name="recovery"
:goto_2[/COLOR]
invoke-virtual {v3, v4}, Landroid/app/AlertDialog$Builder;->setTitle(I)Landroid/app/AlertDialog$Builder;
move-result-object v3
[*]Search for invoke-virtual {v3}, Landroid/app/AlertDialog;->show()V and add the red lines and change the blue lines only
Code:
sget-object v3, Lcom/android/internal/app/ShutdownThread;->sConfirmDialog:Landroid/app/AlertDialog;
invoke-virtual {v3}, Landroid/app/AlertDialog;->show()V
[COLOR="Blue"]goto/16 :goto_0[/COLOR]
.line 102
.end local v0 #closer:Lcom/android/internal/app/ShutdownThread$CloseDialogReceiver;
.end local v1 #longPressBehavior:I
.end local v2 #resourceId:I
:catchall_0
move-exception v3
:try_start_1
monitor-exit v4
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw v3
.line 106
.restart local v1 #longPressBehavior:I
[COLOR="Blue"]:cond_4[/COLOR]
[COLOR="Red"]const v3, 0x1
sget v2, Lcom/android/internal/app/ShutdownThread;->mReboot:I
if-eq v2, v3, :cond_5
if-nez v2, :cond_6[/COLOR]
const v2, 0x104014f
[COLOR="Blue"]goto/16 :goto_1[/COLOR]
[COLOR="Red"]:cond_5
const v2, name="reboot_confirm"
goto/16 :goto_1
:cond_6
const v2, name="recovery_confirm"
goto/16 :goto_1[/COLOR]
.line 132
.restart local v2 #resourceId:I
[COLOR="Blue"]:cond_7[/COLOR]
invoke-static {p0}, Lcom/android/internal/app/ShutdownThread;->beginShutdownSequence(Landroid/content/Context;)V
goto/16 :goto_0
.end method
[*]Now you have to find the names below
Code:
name="reboot"
name="recovery"
name="reboot_progress"
name="recovery_progress"
name="reboot_confirm"
name="recovery_confirm"
[*]You have to replace these name with hex ids from public.xml which is already opened in file editor
[*]For example search for name="reboot" in public.xml file
[*]In my case I have got
Code:
<public type="string" name="reboot" id="[COLOR="Blue"]0x01040548[/COLOR]" />
[*]The blue marked part is hex. Copy the hex and remove the 3rd digit. So 0x01040548 will be 0x1040548
[*]Now search for name="reboot" in ShutdownThread.smali file and replace name="reboot" with 0x1040548
[*]Do the same for other names too
[*]Save the file
[*]Recompile your framework.jar
android.policy.jar
Decompile android.policy.jar
[*]Navigate to android.policy.jar\smali\com\android\internal\policy\impl
[*]Extract all the files from SMALI folder (Download From Attachment)
[*]Open GlobalActions$2.smali file in file editor
[*]Search for invoke-static {v0}, Lcom/android/internal/policy/impl/GlobalActions;->access$100(Lcom/android/internal/policy/impl/GlobalActionsLandroid/content/Context; and add the red lines only
Code:
#getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v0}, Lcom/android/internal/policy/impl/GlobalActions;->access$100(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
move-result-object v0
const/4 v1, 0x1
[COLOR="Red"]const/4 p0, 0x0
sput p0, Lcom/android/internal/app/ShutdownThread;->mReboot:I[/COLOR]
invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V
.line 171
return-void
.end method
[*]Save the file
[*]Open GlobalActions.smali file in file editor
[*]Search for .method private createDialog()Landroid/app/AlertDialog; and change the blue lines only
Code:
.end method
.method private createDialog()Landroid/app/AlertDialog;
[COLOR="Blue"].locals 12[/COLOR]
.prologue
const/4 v9, 0x1
[*]Search for invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V and add the red lines only
Code:
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[COLOR="Red"]iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const-string v1, "reboot"
const-string v2, "string"
const-string v3, "android"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v10
if-nez v10, :cond_0
const-string v1, "reboot_system"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v10
if-eqz v10, :cond_1
:cond_0
const-string v1, "ic_lock_reboot"
const-string v2, "drawable"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v11
if-eqz v11, :cond_1
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$7;
invoke-direct {v1, p0, v11, v10}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
:cond_1
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const-string v1, "recovery"
const-string v2, "string"
const-string v3, "android"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v10
if-nez v10, :cond_2
const-string v1, "recovery_system"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v10
if-eqz v10, :cond_3
:cond_2
const-string v1, "ic_lock_recovery"
const-string v2, "drawable"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v11
if-eqz v11, :cond_3
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$8;
invoke-direct {v1, p0, v11, v10}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z[/COLOR]
.line 183
[COLOR="Red"]:cond_3[/COLOR]
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
[*]Save the file
[*]Recompile your android.policy.jar
Please Note :
Take backup before doing anything.
Use Notepad++ to edit files.
Please read the tutorial properly befor editing files.
If you found any mistake in this tutorial then please let me know.
this is the one thing our xperia community was lacking of. Now it's fulfilled thanks for this :good:
Good Job bro
Thank u
WOW, really a nice guide, perfectly explained & noob Friendly
keep it coming
Great guide, will really help many people, not just to Arc owners but to all Xperia family
saqib nazm said:
this is the one thing our xperia community was lacking of. Now it's fulfilled thanks for this :good:
Click to expand...
Click to collapse
3andala said:
Good Job bro
Thank u
Click to expand...
Click to collapse
stanlin salu said:
WOW, really a nice guide, perfectly explained & noob Friendly
keep it coming
Click to expand...
Click to collapse
Ayush Singh said:
Great guide, will really help many people, not just to Arc owners but to all Xperia family
Click to expand...
Click to collapse
Thanks for these encouraging comments. You all are cordially welcome...
Awesome Guide
This is how its done!
Understanding that smali was a pain in the a**.
You just made this simpler to copy paste
Thank you!
Wonderful work man..
You ll soon be a great themer. Thanks for keeping 2011 xperias forum alive..:thumbup:
Cheers,
Vatsal
Nice work mate.. Nice write up. Way to go. Keep it up and hoping to see more of your works
Sent from my GT-P3110 using Tapatalk
Nice tutorial @BDFreak ...
Can you tell which apktool is recommended for use in this tutorial ?
karandpr said:
Nice tutorial @BDFreak ...
Can you tell which apktool is recommended for use in this tutorial ?
Click to expand...
Click to collapse
I am using THIS one. But I think you can use old versions too...
Ayush Singh said:
Great guide, will really help many people, not just to Arc owners but to all Xperia family
Click to expand...
Click to collapse
this is for Arc only, another xperia phone will be different .
in my TX, framework.jar dont have ShutdownThread.smali but it in services.jar
devilmaycry2020 said:
this is for Arc only, another xperia phone will be different .
in my TX, framework.jar dont have ShutdownThread.smali but it in services.jar
Click to expand...
Click to collapse
I meant all Xperia 2011 family
devilmaycry2020 said:
this is for Arc only, another xperia phone will be different .
in my TX, framework.jar dont have ShutdownThread.smali but it in services.jar
Click to expand...
Click to collapse
Would be the same for atleast the 2011 Xperia Line up
devilmaycry2020 said:
this is for Arc only, another xperia phone will be different .
in my TX, framework.jar dont have ShutdownThread.smali but it in services.jar
Click to expand...
Click to collapse
It's obvious that this will be different in 2012-13 xperias. But the main idea is quite same, like if you know where you have to look for
Nice tut! Its also not very complicated
i dont understand about "change the blue lines only" .what does it mean ? if my own different change it to same as yours ?
devilmaycry2020 said:
i dont understand about "change the blue lines only" .what does it mean ? if my own different change it to same as yours ?
Click to expand...
Click to collapse
Exactly. I mean yes...
BDFreak said:
Exactly. I mean yes...
Click to expand...
Click to collapse
i dont think so because i've modded this before and it work great but the only i missed was when i choose reboot or recovery it didn't show "Reboot" or "Recovery" tittle but only Power off. could you help me. thanks
basically my mod for TX as same as your but have some different
i can send to you all relate files for modding this, could you take a look to it. thanks
devilmaycry2020 said:
i dont think so because i've modded this before and it work great but the only i missed was when i choose reboot or recovery it didn't show "Reboot" or "Recovery" tittle but only Power off. could you help me. thanks
basically my mod for TX as same as your but have some different
i can send to you all relate files for modding this, could you take a look to it. thanks
Click to expand...
Click to collapse
Actually this tutorial is for 2011 Xperia phones. I didn't try in newer phones yet. But I will give it a try in my SP when times allow me.

Categories

Resources