[MOD][How To] Toggle to Disable Screen On for SecMms.apk - T-Mobile Samsung Galaxy S II SGH-T989

I present the stock 4.1.2 deodexed SecMms.apk with toggle to disable/enable the "Screen On" option when a message is received. Having this option allows the use of BLN without having to install a 3rd party messaging app like SMS Popup.
For those interested in applying the MOD themselves...
Go to: MessagingPreferenceActivity.smali
Located in: \SecMms\smali\com\android\mms\ui\
Delete the red line below @ line 6398
Code:
.local v2, NotiCategory:Landroid/preference/PreferenceCategory;
invoke-static {}, Lcom/android/mms/MmsConfig;->getEnableNotificationBacklight()Z
move-result v11
if-nez v11, :cond_6
.line 789
const-string v11, "pref_key_backlight"
invoke-virtual {p0, v11}, Lcom/android/mms/ui/MessagingPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
[COLOR="Red"] invoke-direct {p0, v2, v11}, Lcom/android/mms/ui/MessagingPreferenceActivity;->removePreference(Landroid/preference/PreferenceGroup;Landroid/preference/Preference;)V[/COLOR]
.line 791
:cond_6
invoke-static {}, Lcom/android/mms/MmsConfig;->getEnableCmas()Z
move-result v11
if-eqz v11, :cond_7
invoke-static {}, Lcom/android/mms/MmsConfig;->getCMASProvider()I
Thanks to shoman94 and this thread http://forum.xda-developers.com/showthread.php?t=2283971for the intel. Figured I would keep passing the knowledge along. This is my first thread and contribution to the XDA community, hope I didn't forget anything. Enjoy!

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.

[Guide] Add toggle settings to hide clock/AM/PM

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
****** For ICS 4.0.4, the code has changed a bit. Instead of changing the original tutorial, I'm providing a known working patch I did for an i9100 XWLPT build ******
(there's also a 2nd patch below to ignore regular swipe actions while using AOSP lockscreen)
https://github.com/shoman94/SHOstock2-XWLPT/commit/523075aac1730883a14e365e29c58eb8cce03248
https://github.com/shoman94/SHOstock2-XWLPT/commit/a55fb9b42a5f3f0c0c840c72e68372ab6a199cc2
This tutorial will be a bit involved, you've been warned! It was more of a learning experience, so here are the things you will see:
1. Add toggle settings via xml
2. Add global settings that are retained
3. Add code support for your toggles
4. Have your toggles be smart, and enable/disable other related toggles
5. Add a debug message using Slog, this is invaluable for any project!
Based on 4.0.3 LP3 base..Adjust resource IDs (bolded) for your base!!
--------------------------------------------------------------------------
Step 1. Adding the toggles to Settings/Date & Time (the easy part)
Decompile Settings.apk, modify the following:
public.xml, add:
Code:
<public type="string" name="disable_ampm" id="[b]0x7f0b0923[/b]" />
<public type="string" name="disable_ampm_text" id="[b]0x7f0b0924[/b]" />
<public type="string" name="disable_time" id="[b]0x7f0b0925[/b]" />
<public type="string" name="disable_time_text" id="[b]0x7f0b0926[/b]" />
strings.xml, add:
Code:
<string name="disable_time">Hide Time</string>
<string name="disable_time_text">Remove time from status bar</string>
<string name="disable_ampm">Hide AM/PM</string>
<string name="disable_ampm_text">Remove AM/PM from time in status bar</string>
xml/date_time_prefs.xml, add:
Code:
<CheckBoxPreference android:title="@string/disable_time" android:key="hide_time" android:summary="@string/disable_time_text" />
<CheckBoxPreference android:title="@string/disable_ampm" android:key="hide_ampm" android:summary="@string/disable_ampm_text" />
Compile settings.apk, u/l and reboot. Make sure the toggles are added!
Step 2. Adding code for the settings (the not so easy part). This code gets a bit involved since we have to handle the new settings, and also add 'toggle logic' for different combinations to enable/disable them.
Still in settings.apk, DateTimeSettings.smali:
At top, add:
Code:
.field private mHideTime:Landroid/preference/Preference;
.field private mHideAmPm:Landroid/preference/Preference;
Then in the '.method private initUI()V', find 'return-void' and add this code above it:
Code:
const-string v6, "hide_time"
invoke-virtual {p0, v6}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v6
check-cast v6, Landroid/preference/Preference;
iput-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
const-string v6, "hide_ampm"
invoke-virtual {p0, v6}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v6
check-cast v6, Landroid/preference/Preference;
iput-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
if-eqz v0, :no_disablebtns
const/4 v0, 0x0
iget-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v6, v0}, Landroid/preference/Preference;->setEnabled(Z)V
iget-object v6, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
invoke-virtual {v6, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:no_disablebtns
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
if-eqz v0, :no_disableampm
const/4 v0, 0x0
iget-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v6, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:no_disableampm
Now search for '.method public onPreferenceTreeClick' and on the line below, change .locals 2 to:
Code:
.locals 6
Now search for:
:cond_2
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
if-ne p2, v0, :cond_0
change the last line to:
Code:
if-ne p2, v0, :cond_new
About 10 lines below that, you will see 'invoke-direct {p0, v0}, Lcom/android/settings/DateTimeSettings;->set24Hour(Z)V', add this below that line:
Code:
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
if-nez v0, :cond_hideampm
const/4 v0, 0x1
goto :set_ampm
:cond_hideampm
const/4 v0, 0x0
:set_ampm
invoke-virtual {v1, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:cond_updatetime
Then search for 'goto :goto_0' about 10 lines below and add this before '.end method':
Code:
:cond_new
const-string v3, "hide_ampm"
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
if-ne p2, v0, :cond_new2
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v2
:save_ampm
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "hide_ampm"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :cond_updatetime
:cond_new2
const-string v3, "hide_time"
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
if-ne p2, v0, :goto_0
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v2
:save_time
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "hide_time"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
if-nez v2, :cond_hidebtns
const/4 v2, 0x1
goto :cond_setbtns
:cond_hidebtns
const/4 v2, 0x0
:cond_setbtns
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v1, v2}, Landroid/preference/Preference;->setEnabled(Z)V
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
invoke-virtual {v1, v2}, Landroid/preference/Preference;->setEnabled(Z)V
goto :cond_updatetime
And that's it for Settings! Recompile and upload and check everything looks right in Settings/Date and Time and the toggles work.
Step 3. Modifying the clock code to handle new changes (kinda easy =)
Decompile SystemUI and open Clock.smali.
Search for the following in func getSmallTime:
.local v3, context:Landroid/content/Context;
invoke-static {v3}, Landroid/text/format/DateFormat;->is24HourFormat(Landroid/content/ContextZ
Then add this code BEFORE the invoke-static .. line above (NOTE: there's a constant below that refers to the clock resource in public.xml [<public type="id" name="clock" id="0x7f0e0027" />], be sure it matches!):
Code:
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v7, "hide_time"
const/4 v0, 0x0
invoke-static {v2, v7, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v7
const/4 v0, 0x0
if-eqz v7, :cond_nohide
const/16 v0, 0x8
:cond_nohide
const v1, [b]0x7f0e0027[/b]
invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v1
invoke-virtual {v1, v0}, Landroid/view/View;->setVisibility(I)V
About 20 lines below that, you will see:
.local v1, MAGIC2:C
invoke-virtual {v3, v5}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v4
Add this directly after:
Code:
if-nez v2, :cond_continue
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "hide_ampm"
const/4 v0, 0x0
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v7
########### Start of debug msg, can be removed #######
const-string v0, "ampm"
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "getint returned="
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
########### End of debug msg ###########
move v2, v7
if-eqz v2, :cond_continue
const-string v4, "h:mm"
:cond_continue
That's it for Clock.smali.
Step 4. Almost there, now we just have to make one more change to SystemUI in PhoneStatusBar.smali.
Find '.method public showClock' and change .locals 2 to:
Code:
.locals 3
Find:
if-eqz p1, :cond_1
const/4 v0, 0x0
and insert this code after it:
Code:
iget-object v2, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "hide_time"
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, :goto_0
const/16 v0, 0x8
Recompile SystemUI and reboot. Now try out the new feature =)
Excellent.... built into my rom. Thanks !
...or just use 24h format which is shorter and more natural
sorg said:
...or just use 24h format which is shorter and more natural
Click to expand...
Click to collapse
Ummm You can use this to remove the clock completely....
I just updated to OP to include Step 4. I didn't realize the lock screen was interfering with the feature since I don't use one..Fixed now.
Building into mine as well, tonight if I don't fall asleep.
And a few moments of disagreeing with smali, got it going...thanks a bunch Jeboo!
nice, welldone!
but it s better to leave public.xml, add only the others xml and recompile once.
then decompile again to get the public xml
it s safer, and then match the smali changes with the new public values.
Anyway great guide
if your decompiling with smali/baksmali directly make sure to use the -l flag (thats a L) so you have local varibles instead of registers, learned this the hard way lol
This mod is amazing, thank you very much my friend works fabulously
Add a toggle for CRT Animation
Building upon the same theme from the OP, we can now add another toggle under display settings for CRT animation. This feature is controlled by the boolean animateScreenLights in framework-res.apk (thanks to whomever the original author was!).
Since adding the setting is pretty much identical to the procedure in the OP, I will just discuss the relevant code needed to access the new setting (I leave adding the setting up to you!). The only requirement is you name your setting 'crt_animation'.
Our patch point will be inside services.jar, specifically PowerManagerService$BrightnessState.smali (this is based on LP7):
Code:
iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
iget-boolean v6, v6, Lcom/android/server/PowerManagerService;->mAnimateScreenLights:Z
if-nez v6, :cond_19
NOTE: cond_19 may differ depending on your decompiler.
So we need to delete the 3 lines above. In its place, add our new code:
Code:
iget-object v0, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
invoke-static {v0}, Lcom/android/server/PowerManagerService;->access$4300(Lcom/android/server/PowerManagerService;)Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "crt_animation"
const/4 v4, 0x0
invoke-static {v0, v1, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v6
if-eqz v6, :cond_19
NOTE: Again, if cond_19 is different, fix the last line above!
Recompile settings.apk & services.jar, u/l and reboot!
Porting this mod to the skyrocket
Hey jeboo, as i told you I am trying to port this over to my rom but need some guidance in clock.smali and PhoneStatusBar.smali Thanks I appreciate the help I am attaching the smali files...
adding toggle CRT animation settings
jeboo said:
Building upon the same theme from the OP, we can now add another toggle under display settings for CRT animation. This feature is controlled by the boolean animateScreenLights in framework-res.apk (thanks to whomever the original author was!).
Since adding the setting is pretty much identical to the procedure in the OP, I will just discuss the relevant code needed to access the new setting (I leave adding the setting up to you!). The only requirement is you name your setting 'crt_animation'.
Our patch point will be inside services.jar, specifically PowerManagerService$BrightnessState.smali (this is based on LP7):
Code:
iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
iget-boolean v6, v6, Lcom/android/server/PowerManagerService;->mAnimateScreenLights:Z
if-nez v6, :cond_19
NOTE: cond_19 may differ depending on your decompiler.
So we need to delete the 3 lines above. In its place, add our new code:
Code:
iget-object v0, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
invoke-static {v0}, Lcom/android/server/PowerManagerService;->access$4300(Lcom/android/server/PowerManagerService;)Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "crt_animation"
const/4 v4, 0x0
invoke-static {v0, v1, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v6
if-eqz v6, :cond_19
NOTE: Again, if cond_19 is different, fix the last line above!
Recompile settings.apk & services.jar, u/l and reboot!
Click to expand...
Click to collapse
hi Mr Jeboo.. could u specify the settings in the strings.xml and public.xml in settings.apk? i assume u have got this mod to work.. I couldn't get what to add in this files.. thanks..
Apparently when I was redoing the whole thing to do AOSP/CRT toggle I placed the step 4 in the wrong spot.
How would we disable Weather in Lockscreen when AOSP is checked?
Clock.smali
Ok so I found out that the the statusbarservices is where I look instead of phonestatusbar.smali
however I'm having trouble with the Clock.smali inserts.
Could someone take a look, who knows, and make any suggestions or point me where i need to edit?
jeboo said:
...
Find:
if-eqz p1, :cond_1
const/4 v0, 0x0
and insert this code after it:
Code:
iget-object v2, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "hide_time"
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, [B][COLOR="DarkOrange"]:goto_0[/COLOR][/B]
const/16 v0, 0x8
Recompile SystemUI and reboot. Now try out the new feature =)
Click to expand...
Click to collapse
On LPD, instead of :goto_0, use :goto_e
Robobob1221 said:
Ok so I found out that the the statusbarservices is where I look instead of phonestatusbar.smali
however I'm having trouble with the Clock.smali inserts.
Could someone take a look, who knows, and make any suggestions or point me where i need to edit?
Click to expand...
Click to collapse
I took a quick look at your clock.smali, GB sure made things complicated (24 registers vs 9 in ICS). When the registers change that much, unfortunately you're going to have to track them, it sucks.
One major problem I see is the return value from is24hourfmt in your ver uses v9, so you need to update the line 'if-nez v2, :cond_continue' to use v9 as well. Try that and let me know.
Thanks to the others for helping with the other changes lately..I must admit I use a much shorter patch for personal use, so I can fall behind with the latest code changes =)
jeboo
jeboo said:
I took a quick look at your clock.smali, GB sure made things complicated (24 registers vs 9 in ICS). When the registers change that much, unfortunately you're going to have to track them, it sucks.
One major problem I see is the return value from is24hourfmt in your ver uses v9, so you need to update the line 'if-nez v2, :cond_continue' to use v9 as well. Try that and let me know.
Thanks to the others for helping with the other changes lately..I must admit I use a much shorter patch for personal use, so I can fall behind with the latest code changes =)
jeboo
Click to expand...
Click to collapse
Thanks for checking out my file.
So you mean that the line should be 'if-nez v2, v9 :cond_continue' or just replace v2 with v9?
Thanks for the help
私はローボーボブ。 Haro!!
Robobob1221 said:
Thanks for checking out my file.
So you mean that the line should be 'if-nez v2, v9 :cond_continue' or just replace v2 with v9?
Thanks for the help
私はローボーボブ。 Haro!!
Click to expand...
Click to collapse
if-nez v9, :cond_continue
Basically if you're using military time, there's no need to worry about am/pm.
Still no compiling
jeboo said:
if-nez v9, :cond_continue
Basically if you're using military time, there's no need to worry about am/pm.
Click to expand...
Click to collapse
In plain English it seems so simple! Lol!
Thanks again. I'll check it out and see if it works. I hope it does Thanks again for the help.
Ok I tried the change you suggested and it still won't compile
I tried a few other changes but it results in the same error '
Could not smali file: [email protected]'. Sometimes the numbers ate end vary but its the same result.
another set is this
[email protected]
私はローボーボブ。 Haro!!
jeboo said:
if-nez v9, :cond_continue
Basically if you're using military time, there's no need to worry about am/pm.
Click to expand...
Click to collapse
Hello Jeboo!
Weird to say but.. with ur tutorial I ve been able to make a toggle to choose Samsung lockscreen or the AOSP one credits for u in my next Simplistic Disaster III Rom
whoa!

[DEV] [MOD] [HOW-TO] Enable PRL Write & Remove ##DEBUG# lock code prompt - Note2 MA7

[DEV] [MOD] [HOW-TO] Enable PRL Write & Remove ##DEBUG# lock code prompt - Note2 MA7
Please give thanks/credit if you use this in your ROM - Donations are also appreciated!
Enable the PRL Write option in the ##DATA# menu (please do not abuse this and write VZW PRLs to end your contract as this will just lead to the permanent removal of this where it can't be added back in)
Decompile HiddenMenu.apk
Modify HiddenMenu/smali/com/android/hiddenmenu/hdata.smali
Code:
[COLOR="Red"] --const-string v2, "SPR"[/COLOR]
[COLOR="Green"] ++const-string v2, "SPX"[/COLOR]
sget-object v3, Lcom/android/hiddenmenu/hdata;->mSalesCode:Ljava/lang/String;
invoke-virtual {v2, v3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v2
if-nez v2, :cond_3
const-string v2, "MSM7630_SURF"
sget-object v3, Lcom/android/hiddenmenu/hdata;->cpuPreCode:Ljava/lang/String;
invoke-virtual {v2, v3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v2
if-nez v2, :cond_3
const-string v2, "VMU"
sget-object v3, Lcom/android/hiddenmenu/hdata;->mSalesCode:Ljava/lang/String;
invoke-virtual {v2, v3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v2
if-nez v2, :cond_3
.line 79
invoke-virtual {p0}, Lcom/android/hiddenmenu/hdata;->getPreferenceManager()Landroid/preference/PreferenceManager;
move-result-object v2
invoke-virtual {v2, p0}, Landroid/preference/PreferenceManager;->createPreferenceScreen(Landroid/content/Context;)Landroid/preference/PreferenceScreen;
move-result-object v2
.line 80
const-string v3, "PRL Write"
NAM Block (not sure if this useful)
Code:
.line 85
:cond_3
[COLOR="Red"] --const-string v2, "SPR"[/COLOR]
[COLOR="Green"] ++const-string v2, "SPX"[/COLOR]
sget-object v3, Lcom/android/hiddenmenu/hdata;->mSalesCode:Ljava/lang/String;
invoke-virtual {v2, v3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v2
if-nez v2, :cond_4
const-string v2, "MSM7630_SURF"
sget-object v3, Lcom/android/hiddenmenu/hdata;->cpuPreCode:Ljava/lang/String;
invoke-virtual {v2, v3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v2
if-nez v2, :cond_4
const-string v2, "VMU"
sget-object v3, Lcom/android/hiddenmenu/hdata;->mSalesCode:Ljava/lang/String;
invoke-virtual {v2, v3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v2
if-nez v2, :cond_4
.line 86
invoke-virtual {p0}, Lcom/android/hiddenmenu/hdata;->getPreferenceManager()Landroid/preference/PreferenceManager;
move-result-object v2
invoke-virtual {v2, p0}, Landroid/preference/PreferenceManager;->createPreferenceScreen(Landroid/content/Context;)Landroid/preference/PreferenceScreen;
move-result-object v2
.line 87
const-string v3, "NAM Block"
Remove the ##DEBUG# lock code prompt (Samsung, you shouldn't lock this in the first place as it does no harm)
Modify HiddenMenu/smali/com/android/hiddenmenu/HiddenmenuBroadcastReceiver.smali
Code:
.line 169
[COLOR="Red"] --const-class v0, Lcom/android/hiddenmenu/DebugMenu_Check;[/COLOR]
[COLOR="Green"] ++const-class v0, Lcom/android/hiddenmenu/DEBUGMENU;[/COLOR]
invoke-virtual {v3, p1, v0}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;
move-result-object v0
[COLOR="Red"] --const-string v1, "keyString"
--invoke-virtual {v0, v1, v5}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
[/COLOR]
move v0, v2
If you like this MOD and would like to see others please consider a donation via my profile. I encourage other developers to share their work in How-To's as well.
Re: [DEV] [MOD] [HOW-TO] Enable PRL Write & Remove ##DEBUG# lock code prompt - Note2
Thanks Digi!
Sent from my SPH-L900 using Tapatalk 2
Does this post accurately explain how to write the PRL once its enabled for the Note 2? Just wondering if the process is the same or if I need to do something different.
http://forum.xda-developers.com/showthread.php?p=35576100
Sent from my Nexus 7 using Tapatalk HD
kelvinnotcalvin said:
Does this post accurately explain how to write the PRL once its enabled for the Note 2? Just wondering if the process is the same or if I need to do something different.
http://forum.xda-developers.com/showthread.php?p=35576100
Sent from my Nexus 7 using Tapatalk HD
Click to expand...
Click to collapse
Did you try it?
Sent from my little Note2
digiblur said:
Did you try it?
Sent from my little Note2
Click to expand...
Click to collapse
Not yet. I haven't been able to get my grubby hands on my gfs note 2 to try this!
Sent from my HTC6435LVW using Tapatalk 2

[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

[MOD][HOW-TO] Change Volume Panel Timeout

Tired of the volume panel sitting on the screen for what seems like way too long? You can now change the timeout so it hides much quicker.
We're going to be working with the following two files:
SecSettings.apk
framework.jar
KEY
ADD what's in RED
SecSettings.apk
Navigate to /res/values/arrays.xml
Add the following to the end of the file
Code:
<string-array name="volume_panel_timeout_entries">
<item>0.5s</item>
<item>1s</item>
<item>1.5s</item>
<item>2s</item>
<item>2.5s</item>
<item>3s (Default)</item>
</string-array>
<string-array name="volume_panel_timeout_values">
<item>500</item>
<item>1000</item>
<item>1500</item>
<item>2000</item>
<item>2500</item>
<item>3000</item>
</string-array>
Navigate to /res/values/strings.xml
Add the following to the end of the file
Code:
<string name="volume_panel_timeout_title">Volume Panel Timeout</string>
<string name="volume_panel_timeout_summary">%s</string>
Navigate to /xml/display_settings.xml
Add the following line wherever you would like it to show in the menu
Code:
<ListPreference android:persistent="false" android:entries="@array/volume_panel_timeout_entries" android:title="@string/volume_panel_timeout_title" android:key="volume_panel_timeout" android:summary="@string/volume_panel_timeout_summary" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/volume_panel_timeout_values" />
Navigate to /smali/com/android/settings/DisplaySettings.smali
Code:
.field mSupportFolderType:Z
.field private mTouchKeyLight:Landroid/preference/ListPreference;
[COLOR="Red"].field mVolumePanel:Landroid/preference/ListPreference;[/COLOR]
.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 v0, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "volume_panel_timeout"
const/16 v5, 0x5
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
invoke-virtual {v3}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;
move-result-object v3
invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V[/COLOR]
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mTouchKeyLight:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "button_key_light"
.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, "volume_panel_timeout"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/ListPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V[/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 onPreferenceChange(Landroid/preference/Preference;Ljava/lang/ObjectZ
Code:
:catch_2
move-exception v0
.line 1038
const-string v1, "DisplaySettings"
const-string v2, "could not persist Touch key light setting"
invoke-static {v1, v2, v0}, Landroid/util/Log;->secE(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
goto/16 :goto_4
.line 1040
:cond_9
[COLOR="red"]const-string v2, "volume_panel_timeout"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_next
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "volume_panel_timeout"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V
goto/16 :goto_4
:cond_next[/COLOR]
const-string v2, "quick_launch"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
That's it for SecSettings. Compile.
framework.jar
Navigate to /smali/android/view/VolumePanel.smali
Find .method private resetTimeout()V
and replace the entire thing with this:
Code:
.method private resetTimeout()V
.locals 5
.prologue
const/4 v4, 0x5
.line 16
iget-object v1, p0, Landroid/view/VolumePanel;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
.line 17
const-string v2, "volume_panel_timeout"
const/4 v3, 0x0
.line 16
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
.line 18
.local v0, temp:I
invoke-virtual {p0, v4}, Landroid/view/VolumePanel;->removeMessages(I)V
.line 19
if-eqz v0, :cond_0
.line 20
invoke-virtual {p0, v4}, Landroid/view/VolumePanel;->obtainMessage(I)Landroid/os/Message;
move-result-object v1
int-to-long v2, v0
invoke-virtual {p0, v1, v2, v3}, Landroid/view/VolumePanel;->sendMessageDelayed(Landroid/os/Message;J)Z
.line 24
:goto_0
return-void
.line 22
:cond_0
invoke-virtual {p0, v4}, Landroid/view/VolumePanel;->obtainMessage(I)Landroid/os/Message;
move-result-object v1
const-wide/16 v2, 0xbb8
invoke-virtual {p0, v1, v2, v3}, Landroid/view/VolumePanel;->sendMessageDelayed(Landroid/os/Message;J)Z
goto :goto_0
.end method
Now compile framework.jar (Make sure you compile it correctly adding back the META-INF and preloaded-classes files)
First. (;
Sent from my SGH-I747 using Tapatalk 4
Sajoeee said:
First. (;
Sent from my SGH-I747 using Tapatalk 4
Click to expand...
Click to collapse
First thanks
awesome mod man
Danvdh said:
First thanks
awesome mod man
Click to expand...
Click to collapse
(; ah, man. should have done that. Second thanks. (;
Sent from my SGH-I747 using Tapatalk 4
Nice work....how about some array detail? Looks like you forgot to post up your res/arrays info.
Thanks man.
Didact74 said:
Nice work....how about some array detail? Looks like you forgot to post up your res/arrays info.
Thanks man.
Click to expand...
Click to collapse
Awkward... will do that right now
Sent from my SAMSUNG-SGH-I747
EDIT: Done. Here's what needs to be added:
Navigate to /res/values/arrays.xml
Add the following to the end of the file
Code:
<string-array name="volume_panel_timeout_entries">
<item>0.5s</item>
<item>1s</item>
<item>1.5s</item>
<item>2s</item>
<item>2.5s</item>
<item>3s (Default)</item>
</string-array>
<string-array name="volume_panel_timeout_values">
<item>500</item>
<item>1000</item>
<item>1500</item>
<item>2000</item>
<item>2500</item>
<item>3000</item>
</string-array>
You're a king with this stuff buddy, great work still not really sure what this mod does, is it the timeout for the volume sliders? but definately gonna do it
loserskater said:
Awkward... will do that right now
Sent from my SAMSUNG-SGH-I747
Click to expand...
Click to collapse
Thanks man!
sbreen94 said:
You're a king with this stuff buddy, great work still not really sure what this mod does, is it the timeout for the volume sliders? but definately gonna do it
Click to expand...
Click to collapse
When you press the volume buttons and the slider pops up, this changes how long that is displayed for.
loserskater said:
When you press the volume buttons and the slider pops up, this changes how long that is displayed for.
Click to expand...
Click to collapse
Alright very cool, Lol this is a very general question, but how the heck did you find where that was located in the framework files lol
sbreen94 said:
Alright very cool, Lol this is a very general question, but how the heck did you find where that was located in the framework files lol
Click to expand...
Click to collapse
I decompiled framework and searched for volume. Luckily it was in framework.jar, otherwise I would have just kept decompiling different files until I found it.
Sent from my SAMSUNG-SGH-I747
loserskater said:
I decompiled framework and searched for volume. Luckily it was in framework.jar, otherwise I would have just kept decompiling different files until I found it.
Sent from my SAMSUNG-SGH-I747
Click to expand...
Click to collapse
Ahh so you just have a general idea of what you want to do for a mod and then you search for corresponding files for it.
Mod Works like a charm. Easy to do for the Galaxy S4
Hi! Thanks for this usefull mod Just one small question - is there any way how to set some value as default? After apply this mod and after restart, there wasn't any timeout selected and after volume change volume panel was still visible.
somin.n said:
Hi! Thanks for this usefull mod Just one small question - is there any way how to set some value as default? After apply this mod and after restart, there wasn't any timeout selected and after volume change volume panel was still visible.
Click to expand...
Click to collapse
I just updated this on my rom. I'll edit the OP with the changes.
EDIT: Updated. You'll just have to change the framework.jar
loserskater said:
I just updated this on my rom. I'll edit the OP with the changes.
EDIT: Updated. You'll just have to change the framework.jar
Click to expand...
Click to collapse
Once again thanks for your mods and effort :good:
loserskater said:
Tired of the volume panel sitting on the screen for what seems like way too long? You can now change the timeout so it hides much quicker.
We're going to be working with the following two files:
SecSettings.apk
Click to expand...
Click to collapse
I want volume panel timeout, so i did all other things except in DisplaySettings.smali, actually i cant find those lines in here, so requested to you, i am given here my DisplaySettings.smali, you check please and put those edit in the file and give.
Thanks ☺
Link- https://drive.google.com/file/d/0B-yQqsVcgEKWOXFzc1lxVHh3X2c/view?usp=drivesdk

Categories

Resources