[STOCK] MMS Fix for Virgin Mobile - Sprint Samsung Galaxy S III

Posting my results after fixing the problem where MMS comes in as random symbols from the number 9999999999.
Background: I flashed a Sprint Galaxy S3 over to VM. I was able to get voice, SMS, and data working, and even MMS sending, but the only problem was receiving MMS. Not sure how helpful this is since the simpler solution would probably be to flash a custom ROM where the fix is implemented already. I decided to take the hard way and patch the smali code manually
Reference solution implementation in CdmaSMSDispatcher.java: http://review.cyanogenmod.org/#/c/31229/1/src/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java
Steps:
1) Decompile odex where CdmaSMSDispatcher.java is located. In my case, it was in /system/framework/telephony-common.odex
2) Edit CdmaSMSDispatcher.smali. Details below.
3) Recompile into odex and push to phone
Guide to deodex and reodex: http://forum.xda-developers.com/galaxy-s2/themes-apps/how-to-manually-deodex-odex-t1208320
Smali details: Looking at the reference Java code, the first thing we want to do is to find where dispatchNormalMessage is called so we can insert our patch right above it.
In my case, it looked like this:
Code:
.line 456
.end local v2 # "phoneRestriction":Landroid/sec/enterprise/PhoneRestrictionPolicy;
.end local v8 # "e":Ljava/lang/Exception;
:cond_2c0
invoke-virtual/range {p0 .. p1}, Lcom/android/internal/telephony/SMSDispatcher;->dispatchNormalMessage(Lcom/android/internal/telephony/SmsMessageBase;)I
move-result v3
goto/16 :goto_a
Now we can apply our fix here. Compared with the actual implementation in CM, I only chose the most important lines, since coding in smali is pretty annoying.
Updated section:
Code:
:end_patch
invoke-virtual/range {p0 .. p1}, Lcom/android/internal/telephony/SMSDispatcher;->dispatchNormalMessage(Lcom/android/internal/telephony/SmsMessageBase;)I
move-result v3
goto/16 :goto_a
.line 456
.end local v2 # "phoneRestriction":Landroid/sec/enterprise/PhoneRestrictionPolicy;
.end local v8 # "e":Ljava/lang/Exception;
:cond_2c0
invoke-virtual {v14}, Lcom/android/internal/telephony/SmsMessageBase;->getOriginatingAddress()Ljava/lang/String;
move-result-object v1
const-string v5, "9999999999"
invoke-virtual {v1, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :end_patch
:try_start_2z
const/4 v1, 0x1
new-array v7, v1, [I #v7, aMessageRef
invoke-virtual {v14}, Lcom/android/internal/telephony/SmsMessageBase;->getUserData()[B
move-result-object v1 #v1, someEncodedMMSData
new-instance v6, Lcom/android/internal/util/BitwiseInputStream; #v6, ourInputStream
invoke-direct {v6, v1}, Lcom/android/internal/util/BitwiseInputStream;-><init>([B)V
const/16 v4, 0x14
invoke-virtual {v6, v4}, Lcom/android/internal/util/BitwiseInputStream;->skip(I)V
const/16 v4, 0x8
invoke-virtual {v6, v4}, Lcom/android/internal/util/BitwiseInputStream;->read(I)I
move-result v10
shl-int/lit8 v11, v10, 0x8 #v11, int j
invoke-virtual {v6, v4}, Lcom/android/internal/util/BitwiseInputStream;->read(I)I
move-result v9 #v9, int k
const/4 v4, 0x0
or-int v12, v10, v9 #aMessageRef[0] = j | k;
aput v12, v7, v4
const v12, 0xC
invoke-virtual {v6, v12}, Lcom/android/internal/util/BitwiseInputStream;->skip(I)V
const v12, 0x8
invoke-virtual {v6, v12}, Lcom/android/internal/util/BitwiseInputStream;->read(I)I
move-result v13
const v12, 0x2
sub-int v13, v13, v12 #v13, i1
const v12, 0xD
invoke-virtual {v6, v12}, Lcom/android/internal/util/BitwiseInputStream;->skip(I)V
const v12, 0x8
mul-int v13, v13, v12 #v13, desiredBitLength
invoke-virtual {v6, v13}, Lcom/android/internal/util/BitwiseInputStream;->readByteArray(I)[B
move-result-object v15 #v15, ret[]
const v3, 0x0
aget v10, v7, v3
const-string v5, "9999999999"
invoke-virtual {v0, v15, v10, v5}, Lcom/android/internal/telephony/cdma/CdmaSMSDispatcher;->processCdmaWapPdu([BILjava/lang/String;)I
move-result v3
:try_end_2z
.catch Ljava/lang/Exception; {:try_start_2z .. :try_end_2z} :catch_2z
goto/16 :goto_a
:catch_2z
move-exception v3
goto :end_patch
.end method
So that's all there is! I probably could have been more efficient with the registers but I'm just glad it works after spending more than a week on this.
Again, I don't think this will apply for many people, but is an option if someone wants to do the MMS fix without having a flash a custom ROM.

Related

[REQ]Samsung Fascinate lock screen port?

So, I have been looking around in the Framework-res and I see the files needed to have the puzzle lock screen, like on the Fascinate. So, is there a way to use it the I don't know of? If not, could it be ported? Or point me in the right direction to do it myself.
enragedpaza said:
So, I have been looking around in the Framework-res and I see the files needed to have the puzzle lock screen, like on the Fascinate. So, is there a way to use it the I don't know of? If not, could it be ported? Or point me in the right direction to do it myself.
Click to expand...
Click to collapse
Try using the search button. This had been asked since the phone was released.
People have tried porting it and it ends up in a boot loop. Right now we are on a leaked version of froyo so I can bet no one had tried porting the puzzle lock for froyo yet untill we get an official release.
The images have been there since eclair. Just cause the images are there mean we cant use them. Theres a **** load of images that we never see thets in the framework
Sent from my SPH-D700 using Tapatalk
I used search, haha, but thanks for being smart about it.......
Didn't find what you must have seen then, SO SORRY I made one more thread
The ones I mainly found were from the Vibrant, Captivate, and the cross seas version....
They had ports, so I figured I would ask
Check out this thread!
http://forum.xda-developers.com/showthread.php?t=854191
That's interesting.
Sent from my SPH-D700 using Tapatalk
That is why I brought it up..... If people have found out how to do it for other devices, that are froyo, why not some Epic love?
enragedpaza said:
That is why I brought it up..... If people have found out how to do it for other devices, that are froyo, why not some Epic love?
Click to expand...
Click to collapse
I will take a look but I won't spend alot of time knowing we don't got official froyo yet
Sent from my SPH-D700 using Tapatalk
mysteryemotionz said:
I will take a look but I won't spend alot of time knowing we don't got official froyo yet
Sent from my SPH-D700 using Tapatalk
Click to expand...
Click to collapse
I am so limited on time that I can't really look into this. Most of my visits and replies on XDA are from my mobile but it seems that he has included source for this project so that it can be compiled into other roms. I know this would be a big hit for the Epic. I have seen many people asking about the puzzle lock screen. This is nice because you can select from three or four lock screens in your settings!
Sent from my SPH-D700 using XDA App
Thats Easy, No Port needed
Just get an original Fascinate rom. With 7zip find android.policy.jar in the framework folder in the system folder and push it with to one you have in adb
samurai3032 said:
Just get an original Fascinate rom. With 7zip find android.policy.jar in the framework folder in the system folder and push it with to one you have in adb
Click to expand...
Click to collapse
Funny how simple it seems but that will not work! I bet your phone won't even boot. Try it and let me know how it goes!
Sent from my SPH-D700 using XDA App
smoothone said:
Funny how simple it seems but that will not work! I bet your phone won't even boot. Try it and let me know how it goes!
Sent from my SPH-D700 using XDA App
Click to expand...
Click to collapse
You have much to learn young padawan. You can get the services jar for the puzzle lock and port it over which would require changes more just a simple extract and push. On the thread I mentioned there are three lock screens with the ability to change between them in your settings application. This would require you to compile its source into your rom or build it into your rom just as ADW is built into CM6 for example. That way you could go into your settings and actually choose which lock screen you like. It is part of the rom since its source is open and available, hence compiled into CM6. I'm not very good at explaining this so I hope it makes sense :~)
Sent from my SPH-D700 using XDA App
It is ported to the vibrant. So im guessing it can be done to ours aswell. (not saying it would be easy in anyways)
Sent from my SPH-D700 using XDA App
smoothone said:
You have much to learn young padawan. You can get the services jar for the puzzle lock and port it over which would require changes more just a simple extract and push. On the thread I mentioned there are three lock screens with the ability to change between them in your settings application. This would require you to compile its source into your rom or build it into your rom just as ADW is built into CM6 for example. That way you could go into your settings and actually choose which lock screen you like. It is part of the rom since its source is open and available, hence compiled into CM6. I'm not very good at explaining this so I hope it makes sense :~)
Sent from my SPH-D700 using XDA App
Click to expand...
Click to collapse
then why is it that to port the AOSP lock screen all you need to is push the android.policy.jar file in to place without any moding?
http://forum.xda-developers.com/showthread.php?t=862292
samurai3032 said:
then why is it that to port the AOSP lock screen all you need to is push the android.policy.jar file in to place without any moding?
http://forum.xda-developers.com/showthread.php?t=862292
Click to expand...
Click to collapse
Read the whole thread bro.
samurai3032 said:
then why is it that to port the AOSP lock screen all you need to is push the android.policy.jar file in to place without any moding?
http://forum.xda-developers.com/showthread.php?t=862292
Click to expand...
Click to collapse
If you read the entire thread you will see that in order for that AOSP lock screen to work with our rom it had to be compiled. When you port over a mod or app it is not just cut and paste like your saying. You don't always have to recompile certain things you port over, it depends what you are doing but changes still have to be made. This mod has to be ported over and compiled from source. It is not difficult but I don't have the free time right now to do it. I am mostly on this forum by means of my cell. Its hard for me to sit at my computer for a few hours. Just don't have the time. A simple google search on porting in Android will better educate you. Listen if your so adamant about your cut and paste method then try it yourself. Report back but it will not be good news I promise!
Sent from my SPH-D700 using XDA App
Magic Oreo said:
It is ported to the vibrant. So im guessing it can be done to ours aswell. (not saying it would be easy in anyways)
Sent from my SPH-D700 using XDA App
Click to expand...
Click to collapse
Yes it can be ported over. Not extremely difficult if you know what your doing. Anyone with some free time, lol.
Sent from my SPH-D700 using XDA App
samurai3032 said:
then why is it that to port the AOSP lock screen all you need to is push the android.policy.jar file in to place without any moding?
http://forum.xda-developers.com/showthread.php?t=862292
Click to expand...
Click to collapse
Here is some code that was added to the vibrant port to get a two lockscreen port working,
Code:
=====================================================================================================================================
line 26:
=====================================================================================================================================
.field private static final KEY_LOCK_SCREEN:Ljava/lang/String; = "lock_screen"
=====================================================================================================================================
line 62:
=====================================================================================================================================
.field protected mLockPatternUtils:Lcom/android/settings/LockPatternUtils;
.field private mLockScreen:Landroid/preference/ListPreference;
=====================================================================================================================================
line 610:
=====================================================================================================================================
iget-object v11, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockScreen:Landroid/preference/ListPreference;
iget-object v12, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockPatternUtils:Lcom/android/settings/LockPatternUtils;
invoke-virtual {v12}, Lcom/android/settings/LockPatternUtils;->getLockConfig()I
move-result v12
invoke-static {v12}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v12
invoke-virtual {v11, v12}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v11, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockScreen:Landroid/preference/ListPreference;
invoke-virtual {v11}, Landroid/preference/ListPreference;->getValue()Ljava/lang/String;
move-result-object v11
invoke-direct {p0, v11}, Lcom/android/settings/SoundAndDisplaySettings;->updateUnlockScreenSummary(Ljava/lang/Object;)V
====================================================================================================================================
add this method:
====================================================================================================================================
.method private updateUnlockScreenSummary(Ljava/lang/Object;)V
.locals 6
.parameter "value"
.prologue
.line 343
invoke-virtual {p0}, Lcom/android/settings/SoundAndDisplaySettings;->getResources()Landroid/content/res/Resources;
move-result-object v3
const v4, 0x7f050026
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getTextArray(I)[Ljava/lang/CharSequence;
move-result-object v1
.line 344
.local v1, summaries:[Ljava/lang/CharSequence;
iget-object v3, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockScreen:Landroid/preference/ListPreference;
invoke-virtual {v3}, Landroid/preference/ListPreference;->getEntryValues()[Ljava/lang/CharSequence;
move-result-object v2
.line 345
.local v2, values:[Ljava/lang/CharSequence;
const/4 v0, 0x0
.local v0, i:I
:goto_0
array-length v3, v2
if-ge v0, v3, :cond_0
.line 346
const-string v3, "foo"
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;->()V
const-string v5, "Comparing entry "
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
aget-object v5, v2, v0
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v4
const-string v5, " to current "
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
iget-object v5, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockScreen:Landroid/preference/ListPreference;
invoke-virtual {v5}, Landroid/preference/ListPreference;->getValue()Ljava/lang/String;
move-result-object v5
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
invoke-static {v3, v4}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 347
aget-object v3, v2, v0
invoke-virtual {v3, p1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_1
.line 348
iget-object v3, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockScreen:Landroid/preference/ListPreference;
aget-object v4, v1, v0
invoke-virtual {v3, v4}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V
.line 352
:cond_0
return-void
.line 345
:cond_1
add-int/lit8 v0, v0, 0x1
goto :goto_0
.end method
=========================================================================================================================================
line 1111:
=========================================================================================================================================
new-instance v6, Lcom/android/settings/LockPatternUtils;
invoke-virtual {p0}, Lcom/android/settings/SoundAndDisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
invoke-direct {v6, v5}, Lcom/android/settings/LockPatternUtils;->(Landroid/content/ContentResolver;)V
iput-object v6, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockPatternUtils:Lcom/android/settings/LockPatternUtils;
.line 229
const-string v6, "lock_screen"
invoke-virtual {p0, v6}, Lcom/android/settings/SoundAndDisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v6
check-cast v6, Landroid/preference/ListPreference;
iput-object v6, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockScreen:Landroid/preference/ListPreference;
.line 230
iget-object v6, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockScreen:Landroid/preference/ListPreference;
invoke-virtual {v6, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
==================================================================================================================================================
line 1320:
==================================================================================================================================================
const-string v3, "lock_screen"
invoke-virtual {p1}, Landroid/preference/Preference;->getKey()Ljava/lang/String;
move-result-object v4
invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_3
move-object v0, p2
check-cast v0, Ljava/lang/String;
move-object v3, v0
invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v2
.restart local v2 #value:I
:try_start_3
iget-object v3, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockPatternUtils:Lcom/android/settings/LockPatternUtils;
invoke-virtual {v3, v2}, Lcom/android/settings/LockPatternUtils;->setLockConfig(I)V
:goto_2
invoke-direct {p0, p2}, Lcom/android/settings/SoundAndDisplaySettings;->updateUnlockScreenSummary(Ljava/lang/Object;)V
:try_end_3
.catch Ljava/lang/NumberFormatException; {:try_start_3 .. :try_end_3} :catch_1
.end local v2 #value:I
:cond_3
:goto_3
==============================================================================================================================================================
line 1414:
==============================================================================================================================================================
:catch_1
move-exception v3
move-object v1, v3
.line 528
.restart local v1 #e:Ljava/lang/NumberFormatException;
const-string v3, "SoundAndDisplaysSettings"
const-string v3, "could not persist screen unlock setting"
invoke-static {v8, v3, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
goto :goto_3
Just an example of what is involved, well chop chop lets get to work. Were all waiting!
Sent from my SPH-D700 using XDA App
lol i think we will be waiting a long time if hes doing it. his phone prolly wont turn on now cause he wanted to try his cut and paste method.
smoothone said:
Here is some code that was added to the vibrant port to get a two lockscreen port working,
Code:
=====================================================================================================================================
line 26:
=====================================================================================================================================
.field private static final KEY_LOCK_SCREEN:Ljava/lang/String; = "lock_screen"
=====================================================================================================================================
line 62:
=====================================================================================================================================
.field protected mLockPatternUtils:Lcom/android/settings/LockPatternUtils;
.field private mLockScreen:Landroid/preference/ListPreference;
=====================================================================================================================================
line 610:
=====================================================================================================================================
iget-object v11, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockScreen:Landroid/preference/ListPreference;
iget-object v12, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockPatternUtils:Lcom/android/settings/LockPatternUtils;
invoke-virtual {v12}, Lcom/android/settings/LockPatternUtils;->getLockConfig()I
move-result v12
invoke-static {v12}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v12
invoke-virtual {v11, v12}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v11, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockScreen:Landroid/preference/ListPreference;
invoke-virtual {v11}, Landroid/preference/ListPreference;->getValue()Ljava/lang/String;
move-result-object v11
invoke-direct {p0, v11}, Lcom/android/settings/SoundAndDisplaySettings;->updateUnlockScreenSummary(Ljava/lang/Object;)V
====================================================================================================================================
add this method:
====================================================================================================================================
.method private updateUnlockScreenSummary(Ljava/lang/Object;)V
.locals 6
.parameter "value"
.prologue
.line 343
invoke-virtual {p0}, Lcom/android/settings/SoundAndDisplaySettings;->getResources()Landroid/content/res/Resources;
move-result-object v3
const v4, 0x7f050026
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getTextArray(I)[Ljava/lang/CharSequence;
move-result-object v1
.line 344
.local v1, summaries:[Ljava/lang/CharSequence;
iget-object v3, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockScreen:Landroid/preference/ListPreference;
invoke-virtual {v3}, Landroid/preference/ListPreference;->getEntryValues()[Ljava/lang/CharSequence;
move-result-object v2
.line 345
.local v2, values:[Ljava/lang/CharSequence;
const/4 v0, 0x0
.local v0, i:I
:goto_0
array-length v3, v2
if-ge v0, v3, :cond_0
.line 346
const-string v3, "foo"
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;->()V
const-string v5, "Comparing entry "
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
aget-object v5, v2, v0
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v4
const-string v5, " to current "
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
iget-object v5, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockScreen:Landroid/preference/ListPreference;
invoke-virtual {v5}, Landroid/preference/ListPreference;->getValue()Ljava/lang/String;
move-result-object v5
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
invoke-static {v3, v4}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 347
aget-object v3, v2, v0
invoke-virtual {v3, p1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_1
.line 348
iget-object v3, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockScreen:Landroid/preference/ListPreference;
aget-object v4, v1, v0
invoke-virtual {v3, v4}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V
.line 352
:cond_0
return-void
.line 345
:cond_1
add-int/lit8 v0, v0, 0x1
goto :goto_0
.end method
=========================================================================================================================================
line 1111:
=========================================================================================================================================
new-instance v6, Lcom/android/settings/LockPatternUtils;
invoke-virtual {p0}, Lcom/android/settings/SoundAndDisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
invoke-direct {v6, v5}, Lcom/android/settings/LockPatternUtils;->(Landroid/content/ContentResolver;)V
iput-object v6, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockPatternUtils:Lcom/android/settings/LockPatternUtils;
.line 229
const-string v6, "lock_screen"
invoke-virtual {p0, v6}, Lcom/android/settings/SoundAndDisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v6
check-cast v6, Landroid/preference/ListPreference;
iput-object v6, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockScreen:Landroid/preference/ListPreference;
.line 230
iget-object v6, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockScreen:Landroid/preference/ListPreference;
invoke-virtual {v6, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
==================================================================================================================================================
line 1320:
==================================================================================================================================================
const-string v3, "lock_screen"
invoke-virtual {p1}, Landroid/preference/Preference;->getKey()Ljava/lang/String;
move-result-object v4
invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_3
move-object v0, p2
check-cast v0, Ljava/lang/String;
move-object v3, v0
invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v2
.restart local v2 #value:I
:try_start_3
iget-object v3, p0, Lcom/android/settings/SoundAndDisplaySettings;->mLockPatternUtils:Lcom/android/settings/LockPatternUtils;
invoke-virtual {v3, v2}, Lcom/android/settings/LockPatternUtils;->setLockConfig(I)V
:goto_2
invoke-direct {p0, p2}, Lcom/android/settings/SoundAndDisplaySettings;->updateUnlockScreenSummary(Ljava/lang/Object;)V
:try_end_3
.catch Ljava/lang/NumberFormatException; {:try_start_3 .. :try_end_3} :catch_1
.end local v2 #value:I
:cond_3
:goto_3
==============================================================================================================================================================
line 1414:
==============================================================================================================================================================
:catch_1
move-exception v3
move-object v1, v3
.line 528
.restart local v1 #e:Ljava/lang/NumberFormatException;
const-string v3, "SoundAndDisplaysSettings"
const-string v3, "could not persist screen unlock setting"
invoke-static {v8, v3, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
goto :goto_3
Just an example of what is involved, well chop chop lets get to work. Were all waiting!
Sent from my SPH-D700 using XDA App[/QUOTE]
Lol u wrote all of that from your phone, that must be tiring.
Sent from my GT-I9000 using XDA App
Click to expand...
Click to collapse
webstar1 said:
Lol u wrote all of that from your phone, that must be tiring.
Sent from my GT-I9000 using XDA App
Click to expand...
Click to collapse
We DO have copy / paste you know.
And please, people, don't quote large blocks of code, images, or text. Drives me insane.

[MOD][HOW-TO] Display/Hide Alarm icon in real time

This will allow you to hide/display the alarm icon in real time. Useful for users that always have an alarm and don't want the icon constantly in the statusbar.
We're going to be working with the following two files:
SecSettings.apk
SystemUI.apk
KEY
REMOVE what's in BLUE
ADD what's in RED
SecSettings.apk
Navigate to /res/values/strings.xml
Add the following to the end of the file
Code:
<string name="alarm_icon_title">Alarm icon</string>
<string name="alarm_icon_summary">Change alarm in order for it to take effect</string>
Navigate to /xml/display_settings.xml
Add the following line wherever you would like it to show in the menu
Code:
<CheckBoxPreference android:title="@string/alarm_icon_title" android:key="alarm_icon" android:summary="@string/alarm_icon_summary" />
Navigate to /smali/com/android/settings/DisplaySettings.smali
Code:
.field private mAccelerometerSecond:Landroid/preference/CheckBoxPreference;
[COLOR="Red"].field private mAlarmIcon:Landroid/preference/CheckBoxPreference;[/COLOR]
.field private mAnimationHandler:Landroid/os/Handler;
.method private updateState()V
Code:
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v4, "display_battery_percentage"
invoke-static {v0, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-eqz v0, :cond_4
move v0, v1
:goto_1
invoke-virtual {v3, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[COLOR="red"]iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mAlarmIcon:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v4, "alarm_icon"
invoke-static {v0, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-eqz v0, :cond_alarm
move v0, v1
:goto_alarm
invoke-virtual {v3, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR]
Code:
[COLOR="red"]:cond_alarm
move v0, v2
goto/16 :goto_alarm[/COLOR]
:cond_b
move v0, v2
goto :goto_8
:cond_c
move v1, v2
.line 856
goto :goto_9
.end method
.method public onCreate(Landroid/os/BundleV
Code:
const-string v11, "display_battery_level"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
[COLOR="red"]const-string v11, "alarm_icon"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mAlarmIcon:Landroid/preference/CheckBoxPreference;[/COLOR]
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getActivity()Landroid/app/Activity;
move-result-object v11
invoke-static {v11}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z
move-result v11
if-eqz v11, :cond_6
.method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/PreferenceZ
Code:
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 920
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "display_battery_percentage"
if-eqz v0, :cond_5
move v2, v1
:cond_5
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_2
:cond_6
[COLOR="red"]iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mAlarmIcon:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_next
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mAlarmIcon:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "alarm_icon"
if-eqz v0, :cond_alarm
move v2, v1
:cond_alarm
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_2
:cond_next[/COLOR]
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mNotificationPulse:Landroid/preference/CheckBoxPreference;
if-ne p2, v0, :cond_10
.line 923
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mNotificationPulse:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
Compile and test!
Now for SystemUI.apk
Navigate to /smali/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.smali
.method private final updateAlarm(Landroid/content/IntentV
Code:
.method private final updateAlarm(Landroid/content/Intent;)V
[COLOR="Red"].locals 5[/COLOR]
.parameter "intent"
.prologue
.line 194
[COLOR="Red"]const/4 v3, 0x0[/COLOR]
const-string v1, "alarmSet"
const/4 v2, 0x0
invoke-virtual {p1, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v0
[COLOR="red"]iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "alarm_icon"
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-nez v1, :cond_0
move v0, v3[/COLOR]
.line 195
.local v0, alarmSet:Z
[COLOR="red"]:cond_0[/COLOR]
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v2, "alarm_clock"
invoke-virtual {v1, v2, v0}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
.line 196
return-void
.end method
That's it. Compile and test!
On a roll I see. Thanks Loserskater
Worked. Thank you
Sent from my SAMSUNG-SGH-I747 using xda premium
Great mod boss, and very useful!!! :good::highfive:
This works perfectly on my Sprint GS3. Thanks for another great tutorial loserskater. By any chance do you have one for the bluetooth icon?
THX works for me with a hot boot, not in real time (I9100)
Perhaps any solutions for this ?
Thx
If you change, add, or delete an alarm this mod should take effect without a reboot.
metalfan78 said:
If you change, add, or delete an alarm this mod should take effect without a reboot.
Click to expand...
Click to collapse
You´re right THX
You're welcome

[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] 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