added logcat command to .smali method brakes OPSystemUI.apk - Android Q&A, Help & Troubleshooting

Hello everyone, I have recently started doing modifications in the .smali world. I have already successfully modified my first application by converting the .apk to (almost) .java and then analyzing the method I needed to change. Then, going through the .smali code and modifying it there and compiling the .apk again.
This last one was a non-system apk, but I am currently working on a system apk, more explicitly OPSystemUI.apk.
Since it is odexed (.odex), I had to decompile this into a classes.dex and from there to (almost) .java to analyze the code.
Then, after decompiling the .dex to .smali, I found the function from the .java that I wanted to change.
Here is where the problem starts:
The function in .java I am modifying is (com\android\systemui\statusbar\policy\SignalController.class):
Code:
public int getCurrentIconId()
{
if (this.mCurrentState.connected) {
return getIcons().mSbIcons[this.mCurrentState.inetCondition][this.mCurrentState.level];
}
if (this.mCurrentState.enabled) {
return getIcons().mSbDiscState;
}
return getIcons().mSbNullState;
}
This same function in .smali is (SignalController.smali):
Code:
.method public getCurrentIconId()I
.registers 3
.prologue
.line 137
.local p0, "this":Lcom/android/systemui/statusbar/policy/SignalController;, "Lcom/android/systemui/statusbar/policy/SignalController<TT;TI;>;"
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/SignalController;->mCurrentState:Lcom/android/systemui/statusbar/policy/SignalController$State;
iget-boolean v0, v0, Lcom/android/systemui/statusbar/policy/SignalController$State;->connected:Z
if-eqz v0, :cond_19
.line 138
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/SignalController;->getIcons()Lcom/android/systemui/statusbar/policy/SignalController$IconGroup;
move-result-object v0
iget-object v0, v0, Lcom/android/systemui/statusbar/policy/SignalController$IconGroup;->mSbIcons:[[I
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/SignalController;->mCurrentState:Lcom/android/systemui/statusbar/policy/SignalController$State;
iget v1, v1, Lcom/android/systemui/statusbar/policy/SignalController$State;->inetCondition:I
aget-object v0, v0, v1
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/SignalController;->mCurrentState:Lcom/android/systemui/statusbar/policy/SignalController$State;
iget v1, v1, Lcom/android/systemui/statusbar/policy/SignalController$State;->level:I
aget v0, v0, v1
.line 142
:goto_18
return v0
.line 139
:cond_19
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/SignalController;->mCurrentState:Lcom/android/systemui/statusbar/policy/SignalController$State;
iget-boolean v0, v0, Lcom/android/systemui/statusbar/policy/SignalController$State;->enabled:Z
if-eqz v0, :cond_26
.line 140
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/SignalController;->getIcons()Lcom/android/systemui/statusbar/policy/SignalController$IconGroup;
move-result-object v0
iget v0, v0, Lcom/android/systemui/statusbar/policy/SignalController$IconGroup;->mSbDiscState:I
goto :goto_18
.line 142
:cond_26
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/SignalController;->getIcons()Lcom/android/systemui/statusbar/policy/SignalController$IconGroup;
move-result-object v0
iget v0, v0, Lcom/android/systemui/statusbar/policy/SignalController$IconGroup;->mSbNullState:I
goto :goto_18
.end method
and I modify it by adding a logcat command in the beginning to see when this is executed, so it looks like so:
Code:
.method public getCurrentIconId()I
.registers 3
.prologue
.line 137
.local p0, "this":Lcom/android/systemui/statusbar/policy/SignalController;, "Lcom/android/systemui/statusbar/policy/SignalController<TT;TI;>;"
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/SignalController;->mCurrentState:Lcom/android/systemui/statusbar/policy/SignalController$State;
iget-boolean v0, v0, Lcom/android/systemui/statusbar/policy/SignalController$State;->connected:Z
[COLOR="Red"] const-string v3, "getCurrentIconId SIM"
const-string v4, "Beginning of function SIM"
invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I[/COLOR]
if-eqz v0, :cond_19
. . .
- If I try to recompile the .apk from this .smali code, without the .odex, it works perfect (so recompiling should not be the problem)
-However, if I add the logcat command, my phone does not execute OPSystemUI properly (the logcat command is just to modify in some way the code and see its result, it shouldn't change the apk behavior, right?)
Is my added code for logcat wrong? Else, what could it be? I am out of ideas
Overall, the final goal is to remove an icon from the statusbar (the NoSIM icon), and this was a start.

Try changing the .registers 3 to .registers 5

ANIKETultimate said:
Try changing the .registers 3 to .registers 5
Click to expand...
Click to collapse
Thanks for the suggestion!
I tried changing it to 5 and it still failed by looping in the keyguard (first encryption after starting the phone)

rauleeros said:
Thanks for the suggestion!
I tried changing it to 5 and it still failed by looping in the keyguard (first encryption after starting the phone)
Click to expand...
Click to collapse
Hmm. Try moving the lines just before the .local p0 line

Related

[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] Samsung KeyBoard Swipe Color Change Found! - Updated Instructions

Okay, alot of dev's/themers been looking for this one...
If you use, please give credit, I spent many hours finding this Mod... Dont take credit for someone else's work...
This Mod will allow you to change the Samsung KeyBoard Swipe Color..(SamsungIME.apk)
Look for:
smali\com\diotek\ime\framework\view\AbstractKeyBoardView.smali
Search for -> .method private setTracePaintOptionsWithSettings()V
Click to see Org Code
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
.prologue
const/16 v4, 0xff
const/4 v1, 0x1
const/4 v3, 0x0
.line 9829
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 9830
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
.line 9832
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 9833
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 9835
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 9836
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 9837
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 9838
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0xa5
const/16 v2, 0xf3
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
Click to see what to change:
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
.prologue
const/16 v4, [B][U][COLOR="Blue"]0xff[/COLOR][/U][/B] [B][COLOR="seagreen"]Change for Alpha Value - "0xff" [/COLOR][/B]
const/4 v1, 0x1
const/4 v3, [B][U][COLOR="Blue"]0x0[/COLOR][/U][/B] [B][COLOR="seaGreen"] - Change for Red Value - "0x0"[/COLOR][/B]
.line 9829
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 9830
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
.line 9832
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 9833
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 9835
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 9836
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 9837
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 9838
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, [B][U][COLOR="Blue"]0xa5[/COLOR][/U][/B] [COLOR="seagreen"]- Change for Green Value - "0xa5"[/COLOR]
const/16 v2, [B][U][COLOR="Blue"]0xf3[/COLOR][/U][/B] [COLOR="seagreen"] - Change for Blue Value - "0xf3"[/COLOR]
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
So what it boils down to is that the Swipe Color is what we call RGB color coding. I suggest a site like this to see values you can use:
Hex to RGB Color converter
Thats it folks.. swipe color squashed!!!!
Verified to work on N3 KeyBoards
A Little clarification on Instructions.
I was swamped with questions on how to edit and such.. So with @strongsteve help we dug more and here is an easier way to get your colors instead of trying to use RGB values..
change code:
Code:
const/16 v1, 0xa5
const/16 v2, 0xf3
to
Code:
const v3, 0x33
const v1, 0x66
const v2, 0xcc
Then just use any normal Hex Color code you would normally use!!!
In the above example I used 3366cc which is DarkHorse Blue..
I hope that helps
Thanks been looking for this myself. Great job!
Sent from my SCH-I545 using XDA Premium 4 mobile app
This has been long sought after....thanks for this and great work my friend! :highfive::good:
ALL Users must be reminded to give credit for this share, as, unless I am mistaken, it is not too many other places!
Sorry... can someone post what those lines should look like once they have been changed to a diff color? I'm not sure exactly what in those lines I should be changing (I do understand the color codes).
Sorry for the noobish question.
TheCelt said:
Sorry... can someone post what those lines should look like once they have been changed to a diff color? I'm not sure exactly what in those lines I should be changing (I do understand the color codes).
Sorry for the noobish question.
Click to expand...
Click to collapse
You would be changing the codes themselves.
i.e ff or a5, or whatever...
I will write up more in a bit..
Gunthermic said:
You would be changing the codes themselves.
i.e ff or a5, or whatever...
I will write up more in a bit..
Click to expand...
Click to collapse
Thanks for clarifying the coding changes.... one last (what I am sure if dumb) question. where does one find that file. I am rooted and searched the device for both "smali" and "diotek" using ES file Explorer and have not found the file referenced above.
TheCelt said:
Thanks for clarifying the coding changes.... one last (what I am sure if dumb) question. where does one find that file. I am rooted and searched the device for both "smali" and "diotek" using ES file Explorer and have not found the file referenced above.
Click to expand...
Click to collapse
Its contained inside the SamsungIME apk itself. It has to be decompiled and MODed
Gunthermic said:
Its contained inside the SamsungIME apk itself. It has to be decompiled and MODed
Click to expand...
Click to collapse
Got it. Thanks Gunthermic. Much appreciated.

[Q&A] [GUIDE][SMALI]Understanding and Creating Smali Mods & General Smali Questions

[Q&A] [GUIDE][SMALI]Understanding and Creating Smali Mods & General Smali Questions
Q&A for [GUIDE][SMALI]Understanding and Creating Smali Mods & General Smali Questions
Some developers prefer that questions remain separate from their main development thread to help keep things organized. Placing your question within this thread will increase its chances of being answered by a member of the community or by the developer.
Before posting, please use the forum search and read through the discussion thread for [GUIDE][SMALI]Understanding and Creating Smali Mods & General Smali Questions. If you can't find an answer, post it here, being sure to give as much information as possible (firmware version, steps to reproduce, logcat if available) so that you can get help.
Thanks for understanding and for helping to keep XDA neat and tidy!
Help me. I die inside.
Hello, I'm stuck.
I've managed to copy the smali models and information here (thanks) and elsewhere to insert info into the sharedPreferences database. I'm testing with checkbox booleans.
What I'm trying to do is call these values back in random places in the smali so I can compare if the checkbox is on, do xxx. I'm working within kik8.2.
I am attempting to return the boolean value directly to the chat text so I can visually see the return and understand better how to use the functions.
Here is where the chat is returned:
a/b/a/g.smali
Code:
.class public Lkik/a/b/a/g;
.super Lkik/a/b/a/f;
.source "SourceFile"
# instance fields
.field private a:Ljava/lang/String;
# direct methods
.method public constructor <init>(Ljava/lang/String;)V
.locals 2
.prologue
const/4 v1, 0x1
.line 9
const/16 v0, 0xf
invoke-direct {p0, v1, v1, v1, v0}, Lkik/a/b/a/f;-><init>(IZZI)V
.line 10
iput-object p1, p0, Lkik/a/b/a/g;->a:Ljava/lang/String;
.line 11
return-void
.end method
# virtual methods
.method public final a()Ljava/lang/String;
.locals 1
.prologue
.line 15
iget-object v0, p0, Lkik/a/b/a/g;->a:Ljava/lang/String;
return-object v0
.end method
Now here are some of the things I've tried to do:
Code:
.class public Lkik/a/b/a/g;
.super Lkik/a/b/a/f;
.source "SourceFile"
# instance fields
.field private a:Ljava/lang/String;
[COLOR="Red"]
.field private c:Landroid/content/SharedPreferences;[/COLOR]
# direct methods
.method public constructor <init>(Ljava/lang/String;)V
.locals 2
.prologue
const/4 v1, 0x1
.line 9
const/16 v0, 0xf
invoke-direct {p0, v1, v1, v1, v0}, Lkik/a/b/a/f;-><init>(IZZI)V
.line 10
iput-object p1, p0, Lkik/a/b/a/g;->a:Ljava/lang/String;
.line 11
return-void
.end method
# virtual methods
.method public final a()Ljava/lang/String;
.locals [COLOR="Red"]4[/COLOR]
.prologue
.line 15
[COLOR="Red"] iget-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
const-string v1, "kik.enterbutton.sends"
const/4 v2, 0x0
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
move-result-object v0
# return v0
#
# iget-object v0, p0, Lkik/a/b/a/g;->a:Ljava/lang/String;[/COLOR]
return-object v0
.end method
logcat shows me I don't have access to /a/a.smali.c->. I'm not very familiar with java so this doesn't exactly help the cause but I've come this far ... so...
This is what is inside /a/a.smali
Code:
.class public Lkik/android/chat/a/a;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field private static final a:Ljava/lang/Long;
# instance fields
.field private b:Lkik/a/h/o;
.field private c:Landroid/content/SharedPreferences;
.field private d:Lkik/a/c/q;
.field private e:Lcom/kik/d/p;
# direct methods
.method static constructor <clinit>()V
.locals 2
.prologue
.line 20
const-wide/16 v0, 0x3e8
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v0
sput-object v0, Lkik/android/chat/a/a;->a:Ljava/lang/Long;
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Lkik/a/h/o;Lcom/kik/d/p;Lkik/a/c/q;)V
.locals 2
.prologue
.line 29
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 26
new-instance v0, Lcom/kik/d/p;
invoke-direct {v0}, Lcom/kik/d/p;-><init>()V
iput-object v0, p0, Lkik/android/chat/a/a;->e:Lcom/kik/d/p;
.line 30
iput-object p2, p0, Lkik/android/chat/a/a;->b:Lkik/a/h/o;
.line 31
const-string v0, "KikPreferences"
const/4 v1, 0x0
invoke-virtual {p1, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object v0
iput-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
.line 32
iput-object p4, p0, Lkik/android/chat/a/a;->d:Lkik/a/c/q;
.line 33
new-instance v0, Lkik/android/chat/a/b;
invoke-direct {v0, p0}, Lkik/android/chat/a/b;-><init>(Lkik/android/chat/a/a;)V
invoke-virtual {p3, v0}, Lcom/kik/d/p;->a(Lcom/kik/d/r;)Lcom/kik/d/r;
.line 40
return-void
.end method
.method static synthetic a(Lkik/android/chat/a/a;)V
.locals 3
.prologue
.line 17
iget-object v0, p0, Lkik/android/chat/a/a;->d:Lkik/a/c/q;
const-string v1, "kik.android.chat.preferences.UserPreferenceManager.restored"
const/4 v2, 0x1
invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v2
invoke-interface {v0, v1, v2}, Lkik/a/c/q;->a(Ljava/lang/String;Ljava/lang/Boolean;)Z
return-void
.end method
.method static synthetic b(Lkik/android/chat/a/a;)Lcom/kik/d/p;
.locals 1
.prologue
.line 17
iget-object v0, p0, Lkik/android/chat/a/a;->e:Lcom/kik/d/p;
return-object v0
.end method
.method private e()Lcom/kik/j/a/j/a;
.locals 2
.prologue
.line 59
new-instance v0, Lcom/kik/j/a/j/a;
invoke-direct {v0}, Lcom/kik/j/a/j/a;-><init>()V
.line 60
invoke-virtual {p0}, Lkik/android/chat/a/a;->a()Z
move-result v1
invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v1
invoke-virtual {v0, v1}, Lcom/kik/j/a/j/a;->a(Ljava/lang/Boolean;)Lcom/kik/j/a/j/a;
.line 61
invoke-virtual {p0}, Lkik/android/chat/a/a;->b()Lcom/kik/j/a/j/a$a;
move-result-object v1
invoke-virtual {v0, v1}, Lcom/kik/j/a/j/a;->a(Lcom/kik/j/a/j/a$a;)Lcom/kik/j/a/j/a;
.line 62
return-object v0
.end method
# virtual methods
.method public final a(Lcom/kik/j/a/j/a$a;)V
.locals 4
.prologue
.line 44
if-nez p1, :cond_0
.line 49
:goto_0
return-void
.line 47
:cond_0
iget-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "kik.chat.bubble.id"
iget v2, p1, Lcom/kik/j/a/j/a$a;->w:I
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 48
iget-object v0, p0, Lkik/android/chat/a/a;->b:Lkik/a/h/o;
const-string v1, "user_preferences"
const/4 v2, 0x0
invoke-direct {p0}, Lkik/android/chat/a/a;->e()Lcom/kik/j/a/j/a;
move-result-object v3
invoke-interface {v0, v1, v2, v3}, Lkik/a/h/o;->b(Ljava/lang/String;Ljava/lang/String;Lcom/b/a/n;)Lcom/kik/d/p;
goto :goto_0
.end method
.method public final a(Z)V
.locals 5
.prologue
.line 53
iget-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "kik.enterbutton.sends"
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 54
iget-object v0, p0, Lkik/android/chat/a/a;->b:Lkik/a/h/o;
const-string v1, "user_preferences"
const/4 v2, 0x0
invoke-direct {p0}, Lkik/android/chat/a/a;->e()Lcom/kik/j/a/j/a;
move-result-object v3
sget-object v4, Lkik/android/chat/a/a;->a:Ljava/lang/Long;
invoke-interface {v0, v1, v2, v3, v4}, Lkik/a/h/o;->b(Ljava/lang/String;Ljava/lang/String;Lcom/b/a/n;Ljava/lang/Long;)Lcom/kik/d/p;
.line 55
return-void
.end method
.method public final a(Z)V
.locals 5
.prologue
.line 53
iget-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "kik.pikik1"
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 54
iget-object v0, p0, Lkik/android/chat/a/a;->b:Lkik/a/h/o;
const-string v1, "user_preferences"
const/4 v2, 0x0
invoke-direct {p0}, Lkik/android/chat/a/a;->e()Lcom/kik/j/a/j/a;
move-result-object v3
sget-object v4, Lkik/android/chat/a/a;->a:Ljava/lang/Long;
invoke-interface {v0, v1, v2, v3, v4}, Lkik/a/h/o;->b(Ljava/lang/String;Ljava/lang/String;Lcom/b/a/n;Ljava/lang/Long;)Lcom/kik/d/p;
.line 55
return-void
.end method
.method public final a(Z)V
.locals 5
.prologue
.line 53
iget-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "kik.pikik2"
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 54
iget-object v0, p0, Lkik/android/chat/a/a;->b:Lkik/a/h/o;
const-string v1, "user_preferences"
const/4 v2, 0x0
invoke-direct {p0}, Lkik/android/chat/a/a;->e()Lcom/kik/j/a/j/a;
move-result-object v3
sget-object v4, Lkik/android/chat/a/a;->a:Ljava/lang/Long;
invoke-interface {v0, v1, v2, v3, v4}, Lkik/a/h/o;->b(Ljava/lang/String;Ljava/lang/String;Lcom/b/a/n;Ljava/lang/Long;)Lcom/kik/d/p;
.line 55
return-void
.end method
.method public final a()Z
.locals 3
.prologue
.line 67
iget-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
const-string v1, "kik.enterbutton.sends"
const/4 v2, 0x0
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
move-result v0
return v0
.end method
.method public final b()Lcom/kik/j/a/j/a$a;
.locals 3
.prologue
.line 72
iget-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
const-string v1, "kik.chat.bubble.id"
const/4 v2, -0x1
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
move-result v0
invoke-static {v0}, Lcom/kik/j/a/j/a$a;->a(I)Lcom/kik/j/a/j/a$a;
move-result-object v0
return-object v0
.end method
.method public final c()V
.locals 3
.prologue
.line 87
iget-object v0, p0, Lkik/android/chat/a/a;->d:Lkik/a/c/q;
const-string v1, "kik.android.chat.preferences.UserPreferenceManager.restored"
invoke-interface {v0, v1}, Lkik/a/c/q;->j(Ljava/lang/String;)Ljava/lang/Boolean;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z
move-result v0
if-eqz v0, :cond_0
.line 89
iget-object v0, p0, Lkik/android/chat/a/a;->e:Lcom/kik/d/p;
invoke-virtual {v0}, Lcom/kik/d/p;->e()V
.line 107
:goto_0
return-void
.line 92
:cond_0
iget-object v0, p0, Lkik/android/chat/a/a;->b:Lkik/a/h/o;
const-string v1, "user_preferences"
const-class v2, Lcom/kik/j/a/j/a;
invoke-interface {v0, v1, v2}, Lkik/a/h/o;->d(Ljava/lang/String;Ljava/lang/Class;)Lcom/kik/d/p;
move-result-object v0
new-instance v1, Lkik/android/chat/a/c;
invoke-direct {v1, p0}, Lkik/android/chat/a/c;-><init>(Lkik/android/chat/a/a;)V
invoke-virtual {v0, v1}, Lcom/kik/d/p;->a(Lcom/kik/d/r;)Lcom/kik/d/r;
goto :goto_0
.end method
.method public final d()Lcom/kik/d/p;
.locals 1
.prologue
.line 111
iget-object v0, p0, Lkik/android/chat/a/a;->e:Lcom/kik/d/p;
return-object v0
.end method
I was successfully able to insert using a.smali function copy and associating it throughout xml and where necessary in the other referencing smali to set its value to 1 before login. The "kik.pikik1" and "kik.pikik2" are the fields I've inserted and I'm trying to read out of the SharedPrefs. Any help is greatly appreciated.
I have tried many things in the g.smali to return the value (1/0, true/false) directly into the chat. Setting as object and regular return. I'm using "enterbuttonsends" because it's native.
Can anyone please help me im a nood at all of this and im not sure which ADB
Notepad ++
A good image editor like Photoshop or GIMP app on the play store will be the best ones that fit listed tools can anyone please help me ???
hello I'm your follower, I wanted to ask if you could explain how you created onclicklistener to change from Celsius to Fahrenheit because I wanted to adapt it to a clock change from analog to digital. I hope you can help me. I await your answer thanks sorry for my english but I'm Italian ... you can also write on telegram @Pirrotto. happy to follow you

[GUIDE] [TUT] GUIDE Omni Switch

GUIDE Omni Switch
Work and Tested - CM 12.1 & LP Based
​
1. Decompile settings.apk
At the files:
Settings\res\xml\Display_Settings.xml
Looking for:
Add this line
<PreferenceScreen android:title="@string/omniswitch_settings_title" android:fragment="com.android.settings.ahmednhk.RecentsPanel.OmniSwitch" />
Click to expand...
Click to collapse
ADD ALL THIS LINES.
Settings\res\values\strings.xml
<string name="omniswitch_settings_title">OmniSwitch</string>
<string name="recents_use_omniswitch_title">Use for recents</string>
<string name="recents_use_omniswitch_summary">Use OmniSwitch instead of default recents view</string>
<string name="omniswitch_start_settings_title">Settings</string>
<string name="omniswitch_start_settings_summary">Open OmniSwitch settings</string>
<string name="omniswitch_first_time_title">Information</string>
<string name="omniswitch_first_time_message">Make sure you have enabled OmniSwitch. You can do this by using "Settings" below</string>
Click to expand...
Click to collapse
*compile and decompile again to assign the ID to a file*
PHP:
Settings\smali\com\android\settings\ahmednhk\RecentsPanel\OmniSwitch.smali
<public type="string" name="omniswitch_first_time_title"
LINE 73
<public type="string" name="omniswitch_first_time_message"
LINE 87
0x104000a
LINE 97
<public type="xml" name="ahmednhk_recents_omniswitch"
LINE 126>
*Compile Settings.apk DONE*
2. Decompile framework.jar in files u will download i make misatke and forget this part
framework.jar.out\smali\android\provider\Settings$System.smali
PHP:
Looking for:
.field public static final RECENTS_SHOW_SEARCH_BAR:Ljava/lang/String; = "recents_show_search_bar"
following inserted :
.field public static final RECENTS_USE_OMNISWITCH:Ljava/lang/String; = "recents_use_omniswitch"
** Now proceed to complex of instructions **
3. Decompile SystemUI.apk
SystemUI\smali\com\android\systemui\statusbar\BaseStatusBar.smali
PHP:
Looking for:
.method static sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V
following inserted :
.method private isOmniSwitchEnabled()Z
.locals 6
.prologue
const/4 v1, 0x1
const/4 v2, 0x0
.line 1196
iget-object v3, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "recents_use_omniswitch"
const/4 v5, -0x2
invoke-static {v3, v4, v2, v5}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
.line 1199
.local v0, "settingsValue":I
if-ne v0, v1, :cond_0
:goto_0
return v1
:cond_0
move v1, v2
goto :goto_0
.end method
----------------------------------------------------------------
Looking for:
.method protected cancelPreloadingRecents()V
Changing it completely with:
.method protected cancelPreloadingRecents()V
.locals 1
.prologue
.line 1246
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z
move-result v0
if-nez v0, :cond_0
.line 1247
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
if-eqz v0, :cond_0
.line 1248
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
invoke-interface {v0}, Lcom/android/systemui/RecentsComponent;->cancelPreloadingRecents()V
.line 1251
:cond_0
return-void
.end method
----------------------------------------------------------------
Looking for:
.method protected hideRecents(ZZ)V
Changing it completely with:
.method protected hideRecents(ZZ)V
.locals 3
.param p1, "triggeredFromAltTab" # Z
.param p2, "triggeredFromHomeKey" # Z
.prologue
.line 1215
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z
move-result v1
if-eqz v1, :cond_1
.line 1216
new-instance v0, Landroid/content/Intent;
const-string v1, "org.omnirom.omniswitch.ACTION_HIDE_OVERLAY"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 1217
.local v0, "showIntent":Landroid/content/Intent;
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
sget-object v2, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;
invoke-virtual {v1, v0, v2}, Landroid/content/Context;->sendBroadcastAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)V
.line 1223
.end local v0 # "showIntent":Landroid/content/Intent;
:cond_0
:goto_0
return-void
.line 1219
:cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
if-eqz v1, :cond_0
.line 1220
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
invoke-interface {v1, p1, p2}, Lcom/android/systemui/RecentsComponent;->hideRecents(ZZ)V
goto :goto_0
.end method
----------------------------------------------------------------
Looking for:
.method protected preloadRecents()V
Changing it completely with:
.method protected preloadRecents()V
.locals 1
.prologue
.line 1238
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z
move-result v0
if-nez v0, :cond_0
.line 1239
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
if-eqz v0, :cond_0
.line 1240
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
invoke-interface {v0}, Lcom/android/systemui/RecentsComponent;->preloadRecents()V
.line 1243
:cond_0
return-void
.end method
----------------------------------------------------------------
Looking for:
.method protected showRecents(Z)V
Changing it completely with:
.method protected showRecents(Z)V
.locals 3
.param p1, "triggeredFromAltTab" # Z
.prologue
.line 1203
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z
move-result v1
if-eqz v1, :cond_1
.line 1204
new-instance v0, Landroid/content/Intent;
const-string v1, "org.omnirom.omniswitch.ACTION_SHOW_OVERLAY"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 1205
.local v0, "showIntent":Landroid/content/Intent;
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
sget-object v2, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;
invoke-virtual {v1, v0, v2}, Landroid/content/Context;->sendBroadcastAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)V
.line 1212
.end local v0 # "showIntent":Landroid/content/Intent;
:cond_0
:goto_0
return-void
.line 1207
:cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
if-eqz v1, :cond_0
.line 1208
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
const-string v2, "recentapps"
invoke-static {v1, v2}, Lcom/android/systemui/statusbar/BaseStatusBar;->sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V
.line 1209
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
invoke-virtual {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->getStatusBarView()Landroid/view/View;
move-result-object v2
invoke-interface {v1, p1, v2}, Lcom/android/systemui/RecentsComponent;->showRecents(ZLandroid/view/View;)V
goto :goto_0
.end method
----------------------------------------------------------------
Looking for:
.method protected showRecentsNextAffiliatedTask()V
Changing it completely with:
.method protected showRecentsNextAffiliatedTask()V
.locals 1
.prologue
.line 1254
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z
move-result v0
if-nez v0, :cond_0
.line 1255
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
if-eqz v0, :cond_0
.line 1256
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
invoke-interface {v0}, Lcom/android/systemui/RecentsComponent;->showNextAffiliatedTask()V
.line 1259
:cond_0
return-void
.end method
----------------------------------------------------------------
Looking for:
.method protected showRecentsPreviousAffiliatedTask()V
Changing it completely with:
.method protected showRecentsPreviousAffiliatedTask()V
.locals 1
.prologue
.line 1262
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z
move-result v0
if-nez v0, :cond_0
.line 1263
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
if-eqz v0, :cond_0
.line 1264
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
invoke-interface {v0}, Lcom/android/systemui/RecentsComponent;->showPrevAffiliatedTask()V
.line 1267
:cond_0
return-void
.end method
----------------------------------------------------------------
Looking for:
.method protected toggleRecents()V
Changing it completely with:
.method protected toggleRecents()V
.locals 5
.prologue
.line 1226
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z
move-result v1
if-eqz v1, :cond_1
.line 1227
new-instance v0, Landroid/content/Intent;
const-string v1, "org.omnirom.omniswitch.ACTION_TOGGLE_OVERLAY"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 1228
.local v0, "showIntent":Landroid/content/Intent;
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
sget-object v2, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;
invoke-virtual {v1, v0, v2}, Landroid/content/Context;->sendBroadcastAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)V
.line 1235
.end local v0 # "showIntent":Landroid/content/Intent;
:cond_0
:goto_0
return-void
.line 1230
:cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
if-eqz v1, :cond_0
.line 1231
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
const-string v2, "recentapps"
invoke-static {v1, v2}, Lcom/android/systemui/statusbar/BaseStatusBar;->sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V
.line 1232
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
iget-object v2, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mDisplay:Landroid/view/Display;
iget v3, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mLayoutDirection:I
invoke-virtual {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->getStatusBarView()Landroid/view/View;
move-result-object v4
invoke-interface {v1, v2, v3, v4}, Lcom/android/systemui/RecentsComponent;->toggleRecents(Landroid/view/Display;ILandroid/view/View;)V
goto :goto_0
.end method
*Compile framework.jar DONE*
DON'T FORGET TO DRAG THE APK FILE GIVING U IN FOLDER SYSTEM.
DON'T FORGET TO TRANSFER ALL FILES (framework.jar).
Files and Compare Press Me​

[Devs][Guide] Add Reboot Safestrap Recovery to power menu with toggle

Credits goes to @sagitt67 and @daxgirl .
Credits for toggle goes to @tdunham main guide is here and @asc1977 for the guide here big thanks to them.
In this Guide we'll modify framework-res.apk and services.jar
framework-res.apk:
Download framework-res.zip that is attached below, extract and copy it in your decompiled framework-res.apk folder
now open res/values/arrays.xml
find <string-array name="config_globalActionsList"> and add blue
Code:
<string-array name="config_globalActionsList">
<item>power</item>
<item>datamode</item>
<item>airplane</item>
<item>restart</item>
<item>lockdown</item>
<item>bugreport</item>
<item>users</item>
[COLOR="blue"]<item>rebootsafestrap</item>[/COLOR]
<item>emergencymode</item>
<item>subscreen</item>
</string-array>
now go to res/values/strings.xml at very end and add blue
Code:
<string name="wifi_extender_notification_title">Wi-Fi extender on</string>
<string name="wifi_extender_notification_message">Tap here to set up.</string>
<string name="config_tspstate_threshold" />
[COLOR="blue"]<string name="tw_ic_do_restart_safestrap">Reboot Safestrap</string>[/COLOR]
</resources>
done with framework-res.apk recompile
Services.jar:
download services.zip that is attached below, extract and copy it in your decompiled services.jar folder
open smali/com/android/server/policy/GlobalActions.smali
add blue line in # instance fields
Code:
.field private mRestart:Lcom/android/server/policy/GlobalActions$SinglePressAction;
[COLOR="blue"].field private mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;
[/COLOR]
.field mRestartIconResId:I
find .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog;
add blue
Code:
if-eqz v4, :cond_27b
const v4, 0x1080a58
.line 1642
:goto_11c
const v6, 0x104070e
.line 1639
move-object/from16 v0, p0
invoke-direct {v5, v0, v4, v6}, Lcom/android/server/policy/GlobalActions$21;-><init>(Lcom/android/server/policy/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v5, v0, Lcom/android/server/policy/GlobalActions;->mRestart:Lcom/android/server/policy/GlobalActions$SinglePressAction;
[COLOR="Blue"]new-instance v4, Lcom/android/server/policy/GlobalActions$99;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const-string v1, "tw_ic_do_restart_safestrap"
const-string v2, "drawable"
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 v5
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const-string v1, "tw_ic_do_restart_safestrap"
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 v6
move-object/from16 v0, p0
invoke-direct {v4, v0, v5, v6}, Lcom/android/server/policy/GlobalActions$99;-><init>(Lcom/android/server/policy/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v4, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;[/COLOR]
.line 1688
invoke-static {}, Lcom/samsung/android/feature/SemCscFeature;->getInstance()Lcom/samsung/android/feature/SemCscFeature;
move-result-object v4
const-string/jumbo v5, "CscFeature_Common_ConfigBikeMode"
invoke-virtual {v4, v5}, Lcom/samsung/android/feature/SemCscFeature;->getString(Ljava/lang/String;)Ljava/lang/String;
Now next part is tricky, add lines in blue and changes in green
Code:
const/4 v7, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z
.line 1767
new-instance v4, Lcom/android/server/policy/GlobalActions$BugReportAction;
move-object/from16 v0, p0
invoke-direct {v4, v0}, Lcom/android/server/policy/GlobalActions$BugReportAction;-><init>(Lcom/android/server/policy/GlobalActions;)V
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;
[COLOR="blue"]const/16 v6, 0x100
const/4 v7, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;[/COLOR]
const/16 v6, [COLOR="Green"]0x200[/COLOR] [COLOR="Red"]#before was 0x100[/COLOR]
const/4 v7, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z
now search for const-string/jumbo v4, "silent" and add blue line above it and green parts must match orange part
Code:
const-string/jumbo v4, "emergencymode"
invoke-virtual {v4, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_381
.line 1835
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mEmergency:Lcom/android/server/policy/GlobalActions$ToggleAction;
invoke-virtual {v4, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto/16 :[COLOR="orange"]goto_2d9[/COLOR] #look that green part match this
.line 1836
:cond_381
[COLOR="Blue"]const-string/jumbo v4, "rebootsafestrap"
invoke-virtual {v4, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_3da
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;
invoke-virtual {v4, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto/16 :[COLOR="Green"]goto_2d9 [/COLOR]
:cond_3da[/COLOR]
const-string/jumbo v4, "silent"
next part is missing in Android 7 services.jar so we need to readd it for mod
find .method private addCustomDialogItems(Landroid/graphics/drawable/BitmapDrawable;Ljava/lang/String;Landroid/content/Intent;ILjava/util/ArrayListZ
add this above method
Code:
[COLOR="Blue"].method static synthetic access$500(Lcom/android/server/policy/GlobalActions;)Landroid/content/Context;
.locals 1
iget-object v0, p0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
return-object v0
.end method[/COLOR]
thats it, recompile and push to phone
Note: For me one time i get after reboot a loop of phone restarts, only one time happens. If it happen i solved it with wipe dalvik-cache and cache
Credits goes to @TheDriller for this part in this guide
Note: no need to change the code in GlobalActions$99.smali already done
GlobalActions$99.smali:
find .method public onPress()V and replace blue lines with red one
Code:
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
[COLOR="Red"]const-string v1, "recovery"
invoke-virtual {v0, v1}, Landroid/os/PowerManager;->reboot(Ljava/lang/String;)V[/COLOR]
to
Code:
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
[COLOR="Blue"]const-string v1, "su -c echo 1 > /data/.recovery_mode && su -c reboot now"
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v2
invoke-virtual {v2, v1}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process;[/COLOR]
Wow thia makes things so much easier
Sent from my SM-G950U using Tapatalk
This is different on the Note 8 isn't it? I got as far as the services jar .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; I input the blue text that was mentioned but I'm curious why in your sample does it not have .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; before the blue text?
The Second batch of code with the green changes I had no idea where to input that and I couldn't find const/16 v6, 0x100 to change to 200 either
The step after that I was genuinely lost nothing matched what you had in your sample I felt like I was so close to getting it.
Thanks
SM-N950W
dillweedinc said:
This is different on the Note 8 isn't it? I got as far as the services jar .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; I input the blue text that was mentioned but I'm curious why in your sample does it not have .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; before the blue text?
The Second batch of code with the green changes I had no idea where to input that and I couldn't find const/16 v6, 0x100 to change to 200 either
The step after that I was genuinely lost nothing matched what you had in your sample I felt like I was so close to getting it.
Thanks
Click to expand...
Click to collapse
I will check them soon.
Maybe @JavixKGD can help you as he asked for the mod and he got it working on Note 8.
It is important to specify that this mod only applies to Nougat, it needs to be updated for Oreo.
I am using Nougat 7.1.1 on a note 8 sm-n950w with me's samfail firmware bl1 - I sent him a message thanks! I see it built into another firmware that is available but id rather build it into me's samfail firmy since there is some issues to be wrinkled out in the other custom firmwares.
This thread is more currently active than the Safestrap one. I'm just here looking for more information on how to flash ROMS while keeping your others. Like do I activate that slot then start flashing and do you know if it's possible to use Slick ROM as one of the slots? I'm rooted with Partcyborg on bootloader v2
xSl33p said:
This thread is more currently active than the Safestrap one. I'm just here looking for more information on how to flash ROMS while keeping your others. Like do I activate that slot then start flashing and do you know if it's possible to use Slick ROM as one of the slots? I'm rooted with Partcyborg on bootloader v2
Click to expand...
Click to collapse
Dont quote me on this but im pretty sure the slots arent 100% functional yet you can do backups and restore your system flash zips ect. , I know this thread is more active but you should really stick with the topic of the thread, your question would get answered there.
I got an answer from the guy you recommended afaneh92 thanks, it looks like I need to place the smalis in a different folder as they go over the limit, I dont have time right now but he also sent me his services .jar so I can see what the difference is I got some learning to do.
Thanks
Canadian Dilly.
dillweedinc said:
Dont quote me on this but im pretty sure the slots arent 100% functional yet you can do backups and restore your system flash zips ect. , I know this thread is more active but you should really stick with the topic of the thread, your question would get answered there.
I got an answer from the guy you recommended afaneh92 thanks, it looks like I need to place the smalis in a different folder as they go over the limit, I dont have time right now but he also sent me his services .jar so I can see what the difference is I got some learning to do.
Thanks
Canadian Dilly.
Click to expand...
Click to collapse
Im working on update and some fixes for the mod, then will rewrite this guide in the Note 8 section.

Categories

Resources