[Mod] Signature Control Hack For Signed System Apps - Galaxy S I9000 Android Development

when you do this hack, you can sign a system applications, with fully working.
Just for Samsung Gingerbread Roms
1- *BakSmali the " Services.jar "
Located into /system/framework/ folder
Click to expand...
Click to collapse
2- Open the PackageManagerService.smali file via notepad++
3- Find this method ,
Code:
[B].method checkSignaturesLP([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I[/B]
every method will start with .method and will ends with .end method texts.
Click to expand...
Click to collapse
4- Replace the current method with this method,
Code:
.method checkSignaturesLP([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.registers 10
.parameter "s1"
.parameter "s2"
.prologue
.line 1927
const/4 v6, 0x0
return v6
if-nez p1, :cond_a
.line 1928
if-nez p2, :cond_8
const/4 v6, 0x1
.line 1947
:goto_7
return v6
.line 1928
:cond_8
const/4 v6, -0x1
goto :goto_7
.line 1932
:cond_a
if-nez p2, :cond_e
.line 1933
const/4 v6, -0x2
goto :goto_7
.line 1935
:cond_e
new-instance v3, Ljava/util/HashSet;
invoke-direct {v3}, Ljava/util/HashSet;-><init>()V
.line 1936
.local v3, set1:Ljava/util/HashSet;,"Ljava/util/HashSet<Landroid/content/pm/Signature;>;"
move-object v0, p1
.local v0, arr$:[Landroid/content/pm/Signature;
array-length v2, v0
.local v2, len$:I
const/4 v1, 0x0
.local v1, i$:I
:goto_16
if-ge v1, v2, :cond_20
aget-object v5, v0, v1
.line 1937
.local v5, sig:Landroid/content/pm/Signature;
invoke-virtual {v3, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z
.line 1936
add-int/lit8 v1, v1, 0x1
goto :goto_16
.line 1939
.end local v5 #sig:Landroid/content/pm/Signature;
:cond_20
new-instance v4, Ljava/util/HashSet;
invoke-direct {v4}, Ljava/util/HashSet;-><init>()V
.line 1940
.local v4, set2:Ljava/util/HashSet;,"Ljava/util/HashSet<Landroid/content/pm/Signature;>;"
move-object v0, p2
array-length v2, v0
const/4 v1, 0x0
:goto_28
if-ge v1, v2, :cond_32
aget-object v5, v0, v1
.line 1941
.restart local v5 #sig:Landroid/content/pm/Signature;
invoke-virtual {v4, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z
.line 1940
add-int/lit8 v1, v1, 0x1
goto :goto_28
.line 1944
.end local v5 #sig:Landroid/content/pm/Signature;
:cond_32
invoke-virtual {v3, v4}, Ljava/util/HashSet;->equals(Ljava/lang/Object;)Z
move-result v6
if-eqz v6, :cond_3a
.line 1945
const/4 v6, 0x0
goto :goto_7
.line 1947
:cond_3a
const/4 v6, -0x3
goto :goto_7
.end method
5- Save the PackageManagerService.smali file.
6- do **Smali for the folder , and copy the modded services.jar file into your phone.
----------------------------
* Baksmali : decompiling the dex files
** Smali : recompiling the dex files
------------------------------
External Links:
Original thread
# 2
Click to expand...
Click to collapse
----------------------------------
Credits:
Code:
LOTR TEAM

Related

[GUIDE][How-to] Music Skip Mod for JB

Music Skip Mod for JB
Credits to Mirko DDD in i9100 thread for the original guide for this.
Android.policy.jar changes
Add attached files to:
com/android/internal/policy/impl/
Smali edit:
com/android/internal/policy/impl/PhoneWindowManager.smali
Before:
Code:
.field private mIsVisibleSPenGestureView:Z
.field mKeyboardTapVibePattern:[J
After:
Code:
.field private mIsVisibleSPenGestureView:Z
[COLOR="Red"].field mIsVolumeAction:Z
.field mIsVolumeBlocking:Z
[/COLOR]
.field mKeyboardTapVibePattern:[J
Before:
Code:
.field private mVolumeDownKeyTriggered:Z
.field private final mVolumeKeyLongPressforOneTouchReport:Ljava/lang/Runnable;
After:
Code:
.field private mVolumeDownKeyTriggered:Z
[COLOR="Red"].field mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR]
.field private final mVolumeKeyLongPressforOneTouchReport:Ljava/lang/Runnable;
Before:
[CODE .line 7619
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$35;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$35;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManagerV
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenLockTimeout:Ljava/lang/Runnable;
.line 8566
return-void
.end method][/CODE]
After:
Code:
.line 7619
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$35;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$35;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenLockTimeout:Ljava/lang/Runnable;
[COLOR="Red"] .line 8130
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$SkipNext;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$SkipNext;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
.line 8131
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$SkipPrev;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$SkipPrev;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
[/COLOR]
.line 8566
return-void
.end method
Before:
Code:
.method handleVolumeKey(II)V
.registers 8
.parameter "stream"
.parameter "keycode"
.prologue
.line 5724
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getAudioService()Landroid/media/IAudioService;
move-result-object v0
.line 5725
.local v0, audioService:Landroid/media/IAudioService;
if-nez v0, :cond_7
.line 5750
:goto_0
return-void
After:
Code:
.method handleVolumeKey(II)V
.registers 8
.parameter "stream"
.parameter "keycode"
.prologue
.line 5724
[COLOR="Red"]move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-nez v0, :cond_c[/COLOR]
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getAudioService()Landroid/media/IAudioService;
move-result-object v0
.line 5725
.local v0, audioService:Landroid/media/IAudioService;
if-nez v0, :cond_7
.line 5750
[COLOR="Red"]:cond_c[/COLOR]
:goto_0
return-void
New method. Insert right above:
.method public hasNavigationBar()Z
Code:
[COLOR="Red"].method handleVolumeLongPress(I)V
.registers 6
.parameter "keycode"
.prologue
const/4 v1, 0x1
move-object/from16 v0, p0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
const/4 v1, 0x0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
const/16 v1, 0x18
if-ne p1, v1, :cond_19
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
.local v0, btnHandler:Ljava/lang/Runnable;
:goto_e
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
invoke-static {}, Landroid/view/ViewConfiguration;->getTapTimeout()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
.end local v0 #btnHandler:Ljava/lang/Runnable;
:cond_19
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
.restart local v0 #btnHandler:Ljava/lang/Runnable;
goto :goto_e
.end method
.method handleVolumeLongPressAbort()V
.registers 3
.prologue
const/4 v1, 0x0
move-object/from16 v0, p0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
return-void
.end method
[/COLOR]
.method public hasNavigationBar()Z
Before:
Code:
.line 6215
:cond_46b
:goto_46b
if-eqz v5, :cond_547
After:
Code:
.line 6215
:cond_46b
:goto_46b
[COLOR="Red"]if-eqz v5, :cond_55a[/COLOR]
Before:
Code:
.line 6297
.end local v6 #ex:Landroid/os/RemoteException;
:cond_514
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v29, v0
if-nez v29, :cond_6a
After:
Code:
.line 6297
.end local v6 #ex:Landroid/os/RemoteException;
:cond_514
move-object/from16 v0, p0
[COLOR="Red"] iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenOnEarly:Z
if-nez v0, :cond_new
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
move-result v26
if-eqz v26, :cond_new
move-object/from16 v0, p0
move/from16 v14, v18
invoke-virtual {v0, v14}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(I)V
:cond_new
move-object/from16 v0, p0
[/COLOR]
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v29, v0
if-nez v29, :cond_6a
Before:
Code:
.line 6305
.end local v26 #telephonyService:Lcom/android/internal/telephony/ITelephony;
.end local v28 #voipInterfaceService:Landroid/os/IVoIPInterface;
:cond_547
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v29, v0
if-eqz v29, :cond_6a
After:
Code:
.line 6305
.end local v26 #telephonyService:Lcom/android/internal/telephony/ITelephony;
.end local v28 #voipInterfaceService:Landroid/os/IVoIPInterface;
[COLOR="Red"]:cond_55a
[/COLOR] [COLOR="Red"]if-nez v5, :cond_ko
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_ko
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_ko
move-object/from16 v0, p0
const/4 v3, 0x0
move/from16 v14, v18
invoke-virtual {v0, v3, v14}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_ko[/COLOR]
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v29, v0
if-eqz v29, :cond_6a
New method. Insert right above:
.method sendCloseSystemWindows(Ljava/lang/StringV
Code:
[COLOR="Red"].method protected sendMediaButtonEvent(I)V
.registers 15
.parameter "code"
.prologue
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v1
.local v1, eventtime:J
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
.local v11, downIntent:Landroid/content/Intent;
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
.local v0, downEvent:Landroid/view/KeyEvent;
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
.local v12, upIntent:Landroid/content/Intent;
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
.local v3, upEvent:Landroid/view/KeyEvent;
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
const/4 v8, 0x1
move-object/from16 v9, p0
iput-boolean v8, v9, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
return-void
.end method[/COLOR]
.method sendCloseSystemWindows(Ljava/lang/String;)V
Wow. Is this volume rocker music skip?
I got a scrolling finger cramp.
Pp.
sent from a jellybean filled epic touch.
PanchoPlanet said:
Wow. Is this volume rocker music skip?
I got a scrolling finger cramp.
Pp.
sent from a jellybean filled epic touch.
Click to expand...
Click to collapse
Yes, it was a lot of fun to port over.
Sent from my SPH-D710 using xda premium
hey tdunham
I tried your mod on jds gb28 rom, and got this while recompiling the dex file
classout\com\android\internal\policy\impl\PhoneWindowManager$SkipNext.smali[27,4
] Error for input '.parameter': Invalid directive
classout\com\android\internal\policy\impl\PhoneWindowManager$SkipPrev.smali[27,4
] Error for input '.parameter': Invalid directive
classout\com\android\internal\policy\impl\PhoneWindowManager.smali[10932,4] Erro
r for input '.parameter': Invalid directive
classout\com\android\internal\policy\impl\PhoneWindowManager.smali[10932,15] mis
matched input '"keycode"' expecting END_METHOD_DIRECTIVE
classout\com\android\internal\policy\impl\PhoneWindowManager.smali[25318,4] Erro
r for input '.parameter': Invalid directive
classout\com\android\internal\policy\impl\PhoneWindowManager.smali[25318,15] mis
matched input '"code"' expecting END_METHOD_DIRECTIVE
I started tinkering with the .parameter command and switched it to .param p1, and fived the error for the error on (10932,4) error but ave me another regarding btnHanler being invaled.
any thoughts to help?
sickysticky said:
hey tdunham
I tried your mod on jds gb28 rom, and got this while recompiling the dex file
classout\com\android\internal\policy\impl\PhoneWindowManager$SkipNext.smali[27,4
] Error for input '.parameter': Invalid directive
classout\com\android\internal\policy\impl\PhoneWindowManager$SkipPrev.smali[27,4
] Error for input '.parameter': Invalid directive
classout\com\android\internal\policy\impl\PhoneWindowManager.smali[10932,4] Erro
r for input '.parameter': Invalid directive
classout\com\android\internal\policy\impl\PhoneWindowManager.smali[10932,15] mis
matched input '"keycode"' expecting END_METHOD_DIRECTIVE
classout\com\android\internal\policy\impl\PhoneWindowManager.smali[25318,4] Erro
r for input '.parameter': Invalid directive
classout\com\android\internal\policy\impl\PhoneWindowManager.smali[25318,15] mis
matched input '"code"' expecting END_METHOD_DIRECTIVE
I started tinkering with the .parameter command and switched it to .param p1, and fived the error for the error on (10932,4) error but ave me another regarding btnHanler being invaled.
any thoughts to help?
Click to expand...
Click to collapse
I think you didn't add all of the code in one of the sections as it scrolls past what is displayed and you have missing .end method for a section that is expecting it. Double check your work.
And you added the additional files posted at the bottom of post #1?
Also, in case you didn't know, only red code is new. I always add surrounding code as black text so it can be found and matched to existing sections.
hey there
now I double checked, and even re-input the process and still came up with the same errors while using smali. im pretty sure its is the .parameter command.
below is the code in the guide
.method handleVolumeKey(II)V
.registers 8
.parameter "stream"
.parameter "keycode"
and this is the code in the phonewindowmanager.smali
.method handelVolumeKey(II)V
.registers 8
.param p1, "stream" # I
.param p2, "keycode" # I
now down where the input for the code provided in the guide
.method handleVolumeLongPress(I)V
.registers 6
.parameter "keycode"
/|\
|_____this is line 10932, colum 4
so when I switched the code from .parameter "keycode" to .param p1, "keycode" the error is fixed but sends me to a new error a few lines down in the code that contains (.local v0, btnHandler:Ljava/lang/Runnable
so if there is any way to help can you let me know
sickysticky said:
hey there
now I double checked, and even re-input the process and still came up with the same errors while using smali. im pretty sure its is the .parameter command.
below is the code in the guide
so if there is any way to help can you let me know
Click to expand...
Click to collapse
It depends on what you are using to decompile. Some code will change I think.
Zip up 3 things and post them:
1. Stock android.policy.jar
2. decompiled android.policy.jar. stock without any changes
3. your modified decompiled android.policy.jar
Im currently using baksmali beta 2.0.
Ill zip it up n upload it to my dropbox once I get off work.
Sent from my SPH-D710VMUB using Tapatalk
ok ive zip up the android.policy.jar, the modified smali files and the stock smali files in the link below
https://www.dropbox.com/s/d9fdcwjnj3n1fdg/D710-GB28.zip
sickysticky said:
ok ive zip up the android.policy.jar, the modified smali files and the stock smali files in the link below
https://www.dropbox.com/s/d9fdcwjnj3n1fdg/D710-GB28.zip
Click to expand...
Click to collapse
Here is the modified file.
I think you should try using apktool or something else to compile and recompile. I don't see anything obviously wrong with the code but like I said, it is very different because of what you are using to decompile. Can you decompile and recompile the file without making any changes?
Edit: I've use baksmali also but haven't run into any issues with either ICS or JB. The only thing I can think of is maybe the version you're using. I also made a change to the code above as I was getting a minor error when compiling due to a different variable.
awesome thanks for this.
I think ill consider using vts to compile next time.
Sent from my SPH-D710VMUB using Tapatalk

[Q] help with signature check on stock android 4.4.4

so i have been trying to mod the stock android rom 4.4.4. i have edited the packagemangerservice.smali and followed several guides . is the line but anytime i removed or change this. android starts up after optimizing all apps i get force closing like crazy. and using aroma file manager i go into /system and there is only one folder named bin and its empity forcing me to restore with out wiping. any help please? i come from touchwiz 4.1.2 i was able to safely remove it off there following the same guide.
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/SignatureI
.locals 7
.param p0 # [Landroid/content/pm/Signature;
.param p1 # [Landroid/content/pm/Signature;
if-nez p0, :cond_8
if-nez p1, :cond_6
const/4 v6, 0x1
:goto_5
return v6
:cond_6
const/4 v6, -0x1
goto :goto_5
:cond_8
if-nez p1, :cond_c
const/4 v6, -0x2
goto :goto_5
:cond_c
new-instance v3, Ljava/util/HashSet;
invoke-direct {v3}, Ljava/util/HashSet;-><init>()V
move-object v0, p0
array-length v2, v0
const/4 v1, 0x0
:goto_14
if-ge v1, v2, :cond_1e
aget-object v5, v0, v1
invoke-virtual {v3, v5}, Ljava/util/HashSet;->add(Ljava/lang/ObjectZ
add-int/lit8 v1, v1, 0x1
goto :goto_14
:cond_1e
new-instance v4, Ljava/util/HashSet;
invoke-direct {v4}, Ljava/util/HashSet;-><init>()V
move-object v0, p1
array-length v2, v0
const/4 v1, 0x0
:goto_26
if-ge v1, v2, :cond_30
aget-object v5, v0, v1
invoke-virtual {v4, v5}, Ljava/util/HashSet;->add(Ljava/lang/ObjectZ
add-int/lit8 v1, v1, 0x1
goto :goto_26
:cond_30
invoke-virtual {v3, v4}, Ljava/util/HashSet;->equals(Ljava/lang/ObjectZ
move-result v6
if-eqz v6, :cond_38
const/4 v6, 0x0
goto :goto_5
:cond_38
const/4 v6, -0x3
goto :goto_5
.end method
Click to expand...
Click to collapse

[Guide][tut] Enable/Disable Navigation Bar Swipe to sleep/Lock

Hello guys
i had got you a new tut
Which is Swipe on nav bar to sleep/lock
Lets start work
All you need is Deodexed Systemui.apk, settings.apk and Good patience ( if you dont have any of these then just dont try this )
Ok
1. Decompile SystemUI.apk
2. Now download this View attachment SystemUI.zip and merge to your systemui.apk
3. Open com/android/systemui/statusbar/phone/NavigationBarView.smali
Look for this annotation
Code:
Lcom/android/systemui/statusbar/phone/NavigationBarView$OnVerticalChangedListener;,
Below that add this annotation
Code:
Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;,
Now look for
Code:
.field final mDisplay:Landroid/view/Display;
Below that add these definitions
Code:
.field private mDownTime:J
.field private mDownX:F
.field private mDownY:F
.field private mIsDown:Z
.field private mPowerManager:Landroid/os/PowerManager;
.field mSwipe2SleepActive:Z
Now look for this method ( this #1 post will have completely on this method only dont confuse )
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
in that method first Change .locals 4 to .locals 6
after this
Code:
const/4 v3, 0x0
add this
Code:
const/4 v4, 0x1
look for this line
Code:
iput-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mImeSwitcherClickListener:Landroid/view/View$OnClickListener;
Below that add this
Code:
iput-boolean v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mIsDown:Z
Look for this line
Code:
iput-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDisplay:Landroid/view/Display;
Below that add this
Code:
const-string v1, "power"
invoke-virtual {p1, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/os/PowerManager;
iput-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mPowerManager:Landroid/os/PowerManager;
Now look for this line
Code:
iput-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mTaskSwitchHelper:Lcom/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper;
Below that add this
Code:
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->getIcons(Landroid/content/res/Resources;)V
Now look for this line
Code:
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->getIcons(Landroid/content/res/Resources;)V
Replace the above line with this code
Code:
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v3, "navbar_swipe_to_sleep"
invoke-static {v1, v3, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v4, :cond_0
:goto_0
iput-boolean v4, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mSwipe2SleepActive:Z
.line 207
new-instance p1, Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mHandler:Lcom/android/systemui/statusbar/phone/NavigationBarView$H;
invoke-direct {p1, p0, v1}, Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;-><init>(Lcom/android/systemui/statusbar/phone/NavigationBarView;Landroid/os/Handler;)V
.line 208
.local p1, "settingsObserver":Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;
invoke-virtual {p1}, Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;->observe()V
Now in the same method you will find this return-void
Below that add this code
Code:
.end local p1 # "settingsObserver":Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;
:cond_0
move v4, v2
.line 205
goto :goto_0
save and Continued in 2nd and 3rd post
part 2
In the same file
4. continue
Look for this method
Code:
.method private adjustExtraKeyGravity(Landroid/view/View;Z)V
Above that method
add these methods
Code:
.method static synthetic access$200(Lcom/android/systemui/statusbar/phone/NavigationBarView;)Landroid/content/Context;
.locals 1
.param p0, "x0" # Lcom/android/systemui/statusbar/phone/NavigationBarView;
.prologue
.line 64
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mContext:Landroid/content/Context;
return-object v0
.end method
.method static synthetic access$300(Lcom/android/systemui/statusbar/phone/NavigationBarView;)Landroid/content/Context;
.locals 1
.param p0, "x0" # Lcom/android/systemui/statusbar/phone/NavigationBarView;
.prologue
.line 64
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mContext:Landroid/content/Context;
return-object v0
.end method
5. Look for this method
Code:
.method private notifyVerticalChangedListener(Z)V
Above that method add these code
Code:
.method private mySwipeDetector(FFJFFJ)V
.locals 11
.param p1, "e1X" # F
.param p2, "e1Y" # F
.param p3, "e1Time" # J
.param p5, "e2X" # F
.param p6, "e2Y" # F
.param p7, "e2Time" # J
.prologue
.line 276
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mContext:Landroid/content/Context;
invoke-virtual {v6}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v6
invoke-virtual {v6}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;
move-result-object v6
iget v6, v6, Landroid/content/res/Configuration;->orientation:I
const/4 v7, 0x1
if-ne v6, v7, :cond_1
const/4 v2, 0x1
.line 277
.local v2, "isPortrait":Z
:goto_0
sub-float v0, p5, p1
.line 278
.local v0, "distanceX":F
sub-float v1, p6, p2
.line 279
.local v1, "distanceY":F
sub-long v6, p7, p3
long-to-float v6, v6
div-float v6, v0, v6
const/high16 v7, 0x447a0000 # 1000.0f
mul-float v4, v6, v7
.line 280
.local v4, "velocityX":F
sub-long v6, p7, p3
long-to-float v6, v6
div-float v6, v1, v6
const/high16 v7, 0x447a0000 # 1000.0f
mul-float v5, v6, v7
.line 281
.local v5, "velocityY":F
const-string v3, ""
.line 282
.local v3, "summary":Ljava/lang/String;
if-eqz v2, :cond_2
.line 283
invoke-static {v0}, Ljava/lang/Math;->abs(F)F
move-result v6
invoke-static {v1}, Ljava/lang/Math;->abs(F)F
move-result v7
cmpl-float v6, v6, v7
if-lez v6, :cond_0
invoke-static {v0}, Ljava/lang/Math;->abs(F)F
move-result v6
const/high16 v7, 0x43960000 # 300.0f
cmpl-float v6, v6, v7
if-lez v6, :cond_0
const/high16 v6, -0x3db80000 # -50.0f
cmpl-float v6, p6, v6
if-lez v6, :cond_0
invoke-static {v4}, Ljava/lang/Math;->abs(F)F
move-result v6
const/high16 v7, 0x447a0000 # 1000.0f
cmpl-float v6, v6, v7
if-lez v6, :cond_0
.line 285
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mPowerManager:Landroid/os/PowerManager;
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v8
invoke-virtual {v6, v8, v9}, Landroid/os/PowerManager;->goToSleep(J)V
.line 303
:cond_0
:goto_1
return-void
.line 276
.end local v0 # "distanceX":F
.end local v1 # "distanceY":F
.end local v2 # "isPortrait":Z
.end local v3 # "summary":Ljava/lang/String;
.end local v4 # "velocityX":F
.end local v5 # "velocityY":F
:cond_1
const/4 v2, 0x0
goto :goto_0
.line 298
.restart local v0 # "distanceX":F
.restart local v1 # "distanceY":F
.restart local v2 # "isPortrait":Z
.restart local v3 # "summary":Ljava/lang/String;
.restart local v4 # "velocityX":F
.restart local v5 # "velocityY":F
:cond_2
invoke-static {v1}, Ljava/lang/Math;->abs(F)F
move-result v6
invoke-static {v0}, Ljava/lang/Math;->abs(F)F
move-result v7
cmpl-float v6, v6, v7
if-lez v6, :cond_0
invoke-static {v1}, Ljava/lang/Math;->abs(F)F
move-result v6
const/high16 v7, 0x43960000 # 300.0f
cmpl-float v6, v6, v7
if-lez v6, :cond_0
const/high16 v6, -0x3db80000 # -50.0f
cmpl-float v6, p5, v6
if-lez v6, :cond_0
invoke-static {v5}, Ljava/lang/Math;->abs(F)F
move-result v6
const/high16 v7, 0x447a0000 # 1000.0f
cmpl-float v6, v6, v7
if-lez v6, :cond_0
.line 300
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mPowerManager:Landroid/os/PowerManager;
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v8
invoke-virtual {v6, v8, v9}, Landroid/os/PowerManager;->goToSleep(J)V
goto :goto_1
.end method
6. Now Find this
Code:
# virtual methods
Below that add this code
Code:
.method public dp2Px(F)I
.locals 3
.param p1, "dp" # F
.prologue
.line 544
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v1
invoke-virtual {v1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
move-result-object v1
iget v0, v1, Landroid/util/DisplayMetrics;->density:F
.line 545
.local v0, "scale":F
mul-float v1, p1, v0
const/high16 v2, 0x3f000000 # 0.5f
add-float/2addr v1, v2
float-to-int v1, v1
return v1
.end method
7. Look for this method
Code:
.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
In this code Change .locals 3 to .locals 4
Look for this
Code:
.local v1, "intercept":Z
if-nez v1, :cond_[COLOR="Red"]0[/COLOR]
Change to
Code:
.local v1, "intercept":Z
if-nez v1, :cond_[COLOR="red"]1[/COLOR]
Look for this line
Code:
iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDelegateIntercepted:Z
Below that add this code
Code:
iget-boolean v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mSwipe2SleepActive:Z
if-eqz v2, :cond_0
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
move-result v2
if-nez v2, :cond_0
.line 318
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v2
iput-wide v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDownTime:J
.line 319
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v2
iput v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDownX:F
.line 320
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
move-result v2
iput v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDownY:F
.line 321
const/4 v2, 0x1
iput-boolean v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mIsDown:Z
.line 329
:cond_0
After adding this, just below 2 lines you will find this
After return v1 you will find this
:cond_0 to :cond_1
8. Now look for this method
Code:
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
Replace complete method from the below method
Code:
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.locals 11
.param p1, "event" # Landroid/view/MotionEvent;
.prologue
const/4 v10, 0x1
.line 248
iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mSwipe2SleepActive:Z
if-eqz v1, :cond_0
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
move-result v1
if-ne v1, v10, :cond_0
iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mIsDown:Z
if-eqz v1, :cond_0
.line 249
const/4 v1, 0x0
iput-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mIsDown:Z
.line 250
iget v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDownX:F
iget v3, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDownY:F
iget-wide v4, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDownTime:J
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v6
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
move-result v7
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v8
move-object v1, p0
invoke-direct/range {v1 .. v9}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mySwipeDetector(FFJFFJ)V
.line 252
:cond_0
invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->initDownStates(Landroid/view/MotionEvent;)V
.line 217
iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDelegateIntercepted:Z
if-nez v1, :cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mTaskSwitchHelper:Lcom/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper;
invoke-virtual {v1, p1}, Lcom/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper;->onTouchEvent(Landroid/view/MotionEvent;)Z
move-result v1
if-eqz v1, :cond_1
move v1, v10
.line 227
:goto_0
return v1
.line 220
:cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDeadZone:Lcom/android/systemui/statusbar/policy/DeadZone;
if-eqz v1, :cond_2
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
move-result v1
const/4 v2, 0x4
if-ne v1, v2, :cond_2
.line 221
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDeadZone:Lcom/android/systemui/statusbar/policy/DeadZone;
invoke-virtual {v1, p1}, Lcom/android/systemui/statusbar/policy/DeadZone;->poke(Landroid/view/MotionEvent;)V
.line 223
:cond_2
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDelegateHelper:Lcom/android/systemui/statusbar/DelegateViewHelper;
if-eqz v1, :cond_3
iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDelegateIntercepted:Z
if-eqz v1, :cond_3
.line 224
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDelegateHelper:Lcom/android/systemui/statusbar/DelegateViewHelper;
invoke-virtual {v1, p1}, Lcom/android/systemui/statusbar/DelegateViewHelper;->onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
.line 225
.local v0, "ret":Z
if-eqz v0, :cond_3
move v1, v10
goto :goto_0
.line 227
.end local v0 # "ret":Z
:cond_3
invoke-super {p0, p1}, Landroid/widget/LinearLayout;->onTouchEvent(Landroid/view/MotionEvent;)Z
move-result v1
goto :goto_0
.end method
9. Finally save and compile/sign and replace the systemui.apk
10. Now time to add switch from setting
Look for the below 3rd post
settings
Welcome to easy part on adding the option to hide/show in settings
1. Decompile the settings.apk
2. Download this View attachment Settings.zip and merge to your settings
3. Add the below code to your settings ( i had added to my own settings ) and your wish
Code:
<PreferenceScreen android:title="Navigation" android:key="navigation" android:fragment="com.android.settings.rz.Navigation" />
4. Compile it and Decompile and open
Settings.apk/smali/com/android/settings/rz/Navigation.smali
5. Compare the Public ID and replace it and recompile
6. God you did man,,, now replace and have fun
Thanks to atl4ntis for his Awesome rom Cataclysm and Cyanogenmod
I gonna try now ?
Working. ? ?
Works fine bro thanks a lot
woww.good job,thank bro
venkat kamesh said:
Welcome to easy part on adding the option to hide/show in settings
1. Decompile the settings.apk
2. Download this View attachment 3617852 and merge to your settings
3. Add the below code to your settings ( i had added to my own settings ) and your wish
Code:
<PreferenceScreen android:title="Navigation" android:key="navigation" android:fragment="com.android.settings.rz.Navigation" />
4. Compile it and Decompile and open
Settings.apk/smali/com/android/settings/rz/Navigation.smali
5. Compare the Public ID and replace it and recompile
6. God you did man,,, now replace and have fun
Thanks to atl4ntis for his Awesome rom Cataclysm and Cyanogenmod
Click to expand...
Click to collapse
when i recompile,,i have bug with @string/lockscreen_display_category
dark90
brother, give your SystemUI with the mod Enable/Disable Navigation Bar Swipe to sleep/Lock, pliz
Quoclam851995 said:
when i recompile,,i have bug with @string/lockscreen_display_category
Click to expand...
Click to collapse
haha its a dump string
not a deal bro
rename the @string/lockscreen_display_category to any thing like "display"
or remove the line and leave it or add string
nothing is a problem
dark90 said:
Working.
Click to expand...
Click to collapse
can you give me your systemui
Thanks bro.. Works like a charm.. Great tutorial. Expecting more from you..
Rajeev said:
Thanks bro.. Works like a charm.. Great tutorial. Expecting more from you..
Click to expand...
Click to collapse
Can you share with me your system ui
Quoclam851995 said:
Can you share with me your system ui
Click to expand...
Click to collapse
Why?
Rajeev said:
Why?
Click to expand...
Click to collapse
Maybe don't know how to make the tut i think .-.
Rajeev said:
Why?
Click to expand...
Click to collapse
I want compare some code to complete my system ui.
Quoclam851995 said:
I want compare some code to complete my system ui.
Click to expand...
Click to collapse
I am sorry my Friend. I am using 2g and very low signal. With my Samsung Galaxy Y
@Rajeev @venkat kamesh
why is there nobody to explain me how to "merge" a file to another.
in this case (and all other tuts as well from venkat) i don´t unterstand how to merge my public.xml with the downloaded from the OP.
this drives me crazy. i did all steps before but always failed at this point in each tutorial
all other things are clear and replacing the ID after re- and decompiling is no problem, but if nobody explain to me how to merge both public.xml, i
can´t re- and decompile the settings.apk without a failure.
Each dev started like me with little little steps, so come on guys, plz teach me this simple thing
There are tousand of tuts here from hundreds of devs, but nobody explain this thing - very very frustrating....
moonryder said:
@Rajeev @venkat kamesh
why is there nobody to explain me how to "merge" a file to another.
in this case (and all other tuts as well from venkat) i don´t unterstand how to merge my public.xml with the downloaded from the OP.
this drives me crazy. i did all steps before but always failed at this point in each tutorial
all other things are clear and replacing the ID after re- and decompiling is no problem, but if nobody explain to me how to merge both public.xml, i
can´t re- and decompile the settings.apk without a failure.
Each dev started like me with little little steps, so come on guys, plz teach me this simple thing
There are tousand of tuts here from hundreds of devs, but nobody explain this thing - very very frustrating....
Click to expand...
Click to collapse
Bro u don't need to merge the public.xml u only need to search the lines that the files u added to xml, layout etc and then compile and recompile and replace the public id and recompile ,sing and replace bro
moonryder said:
@Rajeev @venkat kamesh
why is there nobody to explain me how to "merge" a file to another.
in this case (and all other tuts as well from venkat) i don´t unterstand how to merge my public.xml with the downloaded from the OP.
this drives me crazy. i did all steps before but always failed at this point in each tutorial
all other things are clear and replacing the ID after re- and decompiling is no problem, but if nobody explain to me how to merge both public.xml, i
can´t re- and decompile the settings.apk without a failure.
Each dev started like me with little little steps, so come on guys, plz teach me this simple thing
There are tousand of tuts here from hundreds of devs, but nobody explain this thing - very very frustrating....
Click to expand...
Click to collapse
You need check the smali file and find 0x7fxxxx code, then search That code in the public(compare).xml and you get a specific líne now search That líne into your public.xml and copy your code 0x7fxxxx from the líne into your public.xml to the smali code.
You can use this to make it easy http://forum.xda-developers.com/showthread.php?p=64160375

[Guide][tut] Volume keys move cursor control

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

[Guide][tut] [Enable/Disable] Navigation bar Tint ( depends on app material )

Hello guys here i am presenting you new guide
a small mod from my Krypton rom
this is for both MM and LP
For MM look for post#2
So i will discuss from LP
First you need
android.policy.jar (deodexed)
settings.apk (deodexed)
1. Decompile android.policy.jar
2. open com/android/internal/policy/impl/PhoneWindow.smali
find this method
Code:
.method private getOptionsPanelGravity()I
before that add these methods
Code:
.method private getNavBarColorMod(I)I
.locals 4
const/high16 v2, -0x1000000
move/from16 v1, p1
iget v3, p0, Lcom/android/internal/policy/impl/PhoneWindow;->mStatusBarColor:I
invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindow;->getNavBarTweak()Z
move-result v0
if-eqz v0, :cond_0
or-int v1, v2, v3
:cond_0
return v1
.end method
.method private getNavBarTweak()Z
.locals 3
const/4 v0, -0x1
invoke-virtual {p0}, Lcom/android/internal/policy/impl/PhoneWindow;->getContext()Landroid/content/Context;
move-result-object v1
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "navbar_color_mod"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-nez v1, :cond_0
const/4 v0, 0x0
:goto_0
return v0
:cond_0
const/4 v0, 0x1
goto :goto_0
.end method
3. now from this method
Code:
.method protected generateLayout(Lcom/android/internal/policy/impl/PhoneWindow$DecorView;)Landroid/view/ViewGroup;
look for this code
Code:
invoke-static {}, Landroid/app/ActivityManager;->isHighEndGfx()Z
move-result v25
if-eqz v25, :cond_1a
.line 3479
if-nez v22, :cond_1a
const/16 v25, 0x22
const/16 v26, 0x0
move/from16 v0, v25
move/from16 v1, v26
invoke-virtual {v4, v0, v1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
move-result v25
if-eqz v25, :cond_1a
Note this :cond_1a (1a may vary with device may not be same )
in that before
Code:
if-eqz v25, :cond_1a
add this code
Code:
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindow;->getNavBarTweak()Z
move-result v0
if-nez v0, :cond_ta
after the same line of
Code:
if-eqz v25, :cond_1a
add this
Code:
:cond_ta
Finally it look like this
Code:
invoke-static {}, Landroid/app/ActivityManager;->isHighEndGfx()Z
move-result v25
if-eqz v25, :cond_1a
.line 3479
if-nez v22, :cond_1a
const/16 v25, 0x22
const/16 v26, 0x0
move/from16 v0, v25
move/from16 v1, v26
invoke-virtual {v4, v0, v1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
move-result v25
[COLOR="red"] invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindow;->getNavBarTweak()Z
move-result v0
if-nez v0, :cond_ta[/COLOR]
if-eqz v25, :cond_1a
[COLOR="Red"] :cond_ta[/COLOR]
4. Now look for this line in same method
Code:
iput v0, v1, Lcom/android/internal/policy/impl/PhoneWindow;->mNavigationBarColor:I
Before that add this code
Code:
invoke-direct {v1, v0}, Lcom/android/internal/policy/impl/PhoneWindow;->getNavBarColorMod(I)I
move-result v0
5. Done.....! save and compile and replace
For settings Go to post #3
Have fun
For MM
First you need
framework.jar (deodexed)
settings.apk (deodexed)
1. Decompile framework.jar
2. open framework.jar/smali/com/android/internal/policy/PhoneWindow.smali
find this method
Code:
.method private getOptionsPanelGravity()I
before that add these methods
Code:
.method private getNavBarColorMod(I)I
.locals 4
const/high16 v2, -0x1000000
move/from16 v1, p1
iget v3, p0, Lcom/android/internal/policy/PhoneWindow;->mStatusBarColor:I
invoke-direct {p0}, Lcom/android/internal/policy/PhoneWindow;->getNavBarTweak()Z
move-result v0
if-eqz v0, :cond_0
or-int v1, v2, v3
:cond_0
return v1
.end method
.method private getNavBarTweak()Z
.locals 3
const/4 v0, -0x1
invoke-virtual {p0}, Lcom/android/internal/policy/PhoneWindow;->getContext()Landroid/content/Context;
move-result-object v1
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "navbar_color_mod"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-nez v1, :cond_0
const/4 v0, 0x0
:goto_0
return v0
:cond_0
const/4 v0, 0x1
goto :goto_0
.end method
3. now from this method
Code:
.method protected generateLayout(Lcom/android/internal/policy/PhoneWindow$DecorView;)Landroid/view/ViewGroup;
look for this code
Code:
invoke-static {}, Landroid/app/ActivityManager;->isHighEndGfx()Z
move-result v21
if-eqz v21, :cond_15
.line 4035
if-nez v19, :cond_15
.line 4036
const/16 v21, 0x22
.line 4037
const/16 v22, 0x0
.line 4035
move/from16 v0, v21
move/from16 v1, v22
invoke-virtual {v3, v0, v1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
move-result v21
if-eqz v21, :cond_15
Note this :cond_15 (15 may vary with device may not be same )
in that before
Code:
if-eqz v21, :cond_15
add this code
Code:
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/PhoneWindow;->getNavBarTweak()Z
move-result v0
if-nez v0, :cond_ta
after the same line of
Code:
if-eqz v21, :cond_15
add this
Code:
:cond_ta
Finally it look like this
Code:
invoke-static {}, Landroid/app/ActivityManager;->isHighEndGfx()Z
move-result v21
if-eqz v21, :cond_15
.line 4035
if-nez v19, :cond_15
.line 4036
const/16 v21, 0x22
.line 4037
const/16 v22, 0x0
.line 4035
move/from16 v0, v21
move/from16 v1, v22
invoke-virtual {v3, v0, v1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
move-result v21
[COLOR="red"] invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/PhoneWindow;->getNavBarTweak()Z
move-result v0
if-nez v0, :cond_ta[/COLOR]
if-eqz v21, :cond_15
[COLOR="Red"] :cond_ta[/COLOR]
4. Now look for this line in same method
Code:
iput v0, v1, Lcom/android/internal/policy/PhoneWindow;->mNavigationBarColor:I
Before that add this code
Code:
invoke-direct {v1, v0}, Lcom/android/internal/policy/PhoneWindow;->getNavBarColorMod(I)I
move-result v0
5. Done.....! save and compile and replace
For settings Go to post #3
Have fun
Settings for MM and LP
hmm
its time for settings part
i had no time to write a new code..
so try to follow guide from here ( click here )
in that you need to replace
Code:
android:key="[COLOR="Red"]navbar_color_mod[/COLOR]"
or Download this Zip (Click here)
merge to settings
in any part of your xml ( example :- settings.apk/res/xml/display_settings.xml )
add this line
Code:
<com.android.settings.cyanogenmod.SystemSettingSwitchPreference android:title="NavBar Tint" android:key="navbar_color_mod" android:defaultValue="0" android:summaryOn="Enabled" android:summaryOff="Disabled"
Save it and compile and have fun
Credits
xpirt for basic mod
Me for MM and LP krypton rom
Dont forget to Mention me if you use my work
Good luck
Not working on stock rom?-
Black Nav on Homescreen 6.0.1
karrouma said:
Not working on stock rom?-
Click to expand...
Click to collapse
this is for both stock and other roms bro
ReadReadz said:
Black Nav on Homescreen 6.0.1
Click to expand...
Click to collapse
new home doesn't support material
so its black bro
venkat kamesh said:
hmm
its time for settings part
i had no time to write a new code..
so try to follow guide from here ( click here )
in that you need to replace
Code:
android:key="[COLOR="Red"]navbar_color_mod[/COLOR]"
or Download this Zip (Click here)
merge to settings
in any part of your xml ( example :- settings.apk/res/xml/display_settings.xml )
add this line
Code:
<com.android.settings.cyanogenmod.SystemSettingSwitchPreference android:title="NavBar Tint" android:key="navbar_color_mod" android:defaultValue="0" android:summaryOn="Enabled" android:summaryOff="Disabled"
Save it and compile and have fun
Credits
xpirt for basic mod
Me for MM and LP krypton rom
Dont forget to Mention me if you use my work
Good luck
Click to expand...
Click to collapse
Can't glash via recovery. Meta file is missing
how to set defaut tinted without edit settings just edit on android.policy.jar?lolipop 5.1.1
Hey bro,
I'm trying to use this with your SwitchPreferences guide. The toggle switch works, but the nav bar is always tinted, it doesn't change. I've changed all the keys and made sure that my XML is good, but nothing happens.
My XML is like this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/wireless_networks_settings_title"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<PreferenceCategory android:title="@string/rm_ui_navbar_resize_category" />
<com.android.settings.rz.MySeekBarPreference android:title="@string/rm_ui_navbar_resize_portrait" android:key="navigation_bar_height" settings:type="15" />
<com.android.settings.rz.MySeekBarPreference android:title="@string/rm_ui_navbar_resize_landscape" android:key="navigation_bar_width" settings:type="16" />
<PreferenceCategory android:title="@string/rm_ui_navbar_tweak_category" />
<SwitchPreference android:title="@string/rm_ui_navbar_tint_toggle" android:key="key_navbar_color_mod" android:defaultValue="false" android:summaryOn="@string/rm_ui_navbar_tint_toggle_on" android:summaryOff="@string/rm_ui_navbar_tint_toggle_off" />
</PreferenceScreen>
And my smali like so:
Code:
.class public Lcom/android/settings/rz/EnableNavBarTint;
.super Lcom/android/settings/SettingsPreferenceFragment;
.source "EnableNavBarTint.java"
# instance fields
.field private mENABLE_NAV_BAR_TINT:Landroid/preference/SwitchPreference;
# direct methods
.method public constructor <init>()V
.locals 0
.prologue
.line 28
invoke-direct {p0}, Lcom/android/settings/SettingsPreferenceFragment;-><init>()V
return-void
.end method
# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
.locals 5
.param p1, "savedInstanceState" # Landroid/os/Bundle;
.prologue
const/4 v3, 0x0
const/4 v2, 0x1
.line 42
invoke-super {p0, p1}, Lcom/android/settings/SettingsPreferenceFragment;->onCreate(Landroid/os/Bundle;)V
.line 43
invoke-virtual {p0}, Lcom/android/settings/rz/EnableNavBarTint;->getActivity()Landroid/app/Activity;
move-result-object v1
invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
.line 44
.local v0, "resolver":Landroid/content/ContentResolver;
const v1, 0x7f08008a # xml public key
invoke-virtual {p0, v1}, Lcom/android/settings/rz/EnableNavBarTint;->addPreferencesFromResource(I)V
.line 46
const-string v1, "key_navbar_color_mod"
invoke-virtual {p0, v1}, Lcom/android/settings/rz/EnableNavBarTint;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/SwitchPreference;
iput-object v1, p0, Lcom/android/settings/rz/EnableNavBarTint;->mENABLE_NAV_BAR_TINT:Landroid/preference/SwitchPreference;
.line 47
iget-object v4, p0, Lcom/android/settings/rz/EnableNavBarTint;->mENABLE_NAV_BAR_TINT:Landroid/preference/SwitchPreference;
const-string v1, "navbar_color_mod"
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v2, :cond_0
move v1, v2
:goto_0
invoke-virtual {v4, v1}, Landroid/preference/SwitchPreference;->setChecked(Z)V
.line 57
return-void
:cond_0
move v1, v3
.line 47
goto :goto_0
.end method
.method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
.locals 5
.param p1, "preferenceScreen" # Landroid/preference/PreferenceScreen;
.param p2, "preference" # Landroid/preference/Preference;
.prologue
const/4 v1, 0x0
const/4 v2, 0x1
.line 61
iget-object v3, p0, Lcom/android/settings/rz/EnableNavBarTint;->mENABLE_NAV_BAR_TINT:Landroid/preference/SwitchPreference;
if-ne p2, v3, :cond_1
.line 62
iget-object v3, p0, Lcom/android/settings/rz/EnableNavBarTint;->mENABLE_NAV_BAR_TINT:Landroid/preference/SwitchPreference;
invoke-virtual {v3}, Landroid/preference/SwitchPreference;->isChecked()Z
move-result v0
.line 63
.local v0, "value":Z
invoke-virtual {p0}, Lcom/android/settings/rz/EnableNavBarTint;->getActivity()Landroid/app/Activity;
move-result-object v3
invoke-virtual {v3}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "navbar_color_mod"
if-eqz v0, :cond_0
move v1, v2
:cond_0
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 78
.end local v0 # "value":Z
:goto_0
return v2
.line 65
:cond_1
invoke-super {p0, p1, p2}, Lcom/android/settings/SettingsPreferenceFragment;->onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
move-result v2
goto :goto_0
.end method
Any ideas bro?
Screenshot please. Thanks

Categories

Resources