[MOD][GUIDE]Enable Heads Up Notifications - Sprint Samsung Galaxy S III

This guide was written based on the Sprint Samsung Galaxy S3 ND8 KitKat stock ROM but with the proper modifications may work for other KitKat ROMs. Please don't ask me to modify this to work with ROM xyz or to compile this for you into a ROM. I won't do it.
Background Info
As you know, Android 4.4 has a heads-up notification feature built in but disabled with no way to enable it from settings. While there are various Xposed modules that will enable this for you as well as give some additional functionality (such as whitelisting), I personally don't use Xposed because it causes conflicts on my ROM so I decided to figure out how to enable it myself. Simply enabling Heads Up notifications caused all sorts of force closes any time an ongoing notification presented itself so that had to be worked out as well.
Requirements
apktool 2.0 beta 9 and the knowledge of how to use it. There are various guides on how to use apktool on XDA. Find one and read it. Make sure to read the information on the apktool site as well since some of the options in 2.0 may be different from the guides you find.
A text editor that supports Unix-style text files. I recommend Notepad++.
Files
You'll be working with the following apks:
SystemUI.apk
SecSettings.apk
SystemUI.apk
Decompile SystemUI.apk using apktool.
Open smali\com\android\systemui\statusbar\BaseStatusBar.smali in your preferred text editor.
Find .method protected shouldInterrupt(Landroid/service/notification/StatusBarNotificationZ.
This method is of no use to us in it's current form and is what causes the force closes/ongoing notification issues so we are going to completely remove it and replace it with the following:
Code:
.method protected shouldInterrupt(Landroid/service/notification/StatusBarNotification;)Z
.locals 12
.param p1, "sbn" # Landroid/service/notification/StatusBarNotification;
.prologue
const/4 v8, 0x0
const/4 v9, 0x1
.line 1292
invoke-virtual {p1}, Landroid/service/notification/StatusBarNotification;->isOngoing()Z
move-result v4
if-nez v4, :cond_0
iget-object v10, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mPowerManager:Landroid/os/PowerManager;
invoke-virtual {v10}, Landroid/os/PowerManager;->isScreenOn()Z
move-result v1
:goto_0
return v1
:cond_0
move v1, v8
goto :goto_0
.end method
Save the file and recompile SystemUI using apktool. Don't forget to re-sign the APK (either use an APK signer if you have a ROM that has 3rd-party system app signatures enabled or copy the AndroidManifest.xml file and META-INF folder from the original to the new APK).
That's it for SystemUI.apk.
SecSettings.apk
Decompile SecSettings.apk with apktool.
First, we need to add the title and summary for the setting to enable Heads Up notifications. Open res\values\Strings.xml in your preferred text editor.
Add the following lines to the bottom of the file:
Code:
<string name="heads_up">Heads up notifications</string>
<string name="heads_up_desc">Enable heads up notifications</string>
Save the file and close it.
Next we need to add the setting entry. Open res\xml\display_settings.xml in your preferred text editor.
Add the following line underneath your preferred setting category (I chose to place it under "General" in my ROM):
Code:
<CheckBoxPreference android:title="@string/heads_up" android:key="heads_up_setting" android:widgetLayout="@touchwiz:layout/preference_widget_twcheckbox" />
Save the file and close it.
Finally, we will add the code to enable/disable Heads Up notifications. Open smali\com\android\settings\DisplaySettings.smali in your preferred text editor.
Find # instance fields and add the following line (on a new line) somewhere before # direct methods:
Code:
.field private mHeadsUp:Landroid/preference/CheckBoxPreference;
Find .method private updateState()V, then locate the section of code that looks similar to this:
Code:
:cond_0
invoke-direct {p0}, Lcom/android/settings/DisplaySettings;->updateInformativeScreenSummary()V
.line 1374
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_2
move v0, v1
:goto_0
invoke-virtual {v3, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
Your variables (v#'s), conditionals (cond_#'s), gotos (goto_#'s), and .line #'s may differ. Under the line invoke-virtual {v3, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V, add:
Code:
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mHeadsUp:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v4, "heads_up_enabled"
invoke-static {v0, v4, v2}, Landroid/provider/Settings$Global;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-eqz v0, :cond_8
move v0, v1
:goto_6
invoke-virtual {v3, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
You'll want to change the variables to match the ones in the prior code section if they are different for you. Also make sure to change the conditional and goto labels to one hexadecimal numeral higher than the highest one already present in the method (for example, in stock ND8, the highest conditional is cond_7 so we choose cond_8 for the conditional here and the highest goto is goto_5 so we chose goto_6).
Scroll down to the end of the method and add the following above .end method:
Code:
:cond_8
move v0, v2
goto/16 :goto_6
Make sure to change v2 to whatever variable is defined at the beginning of the method as 0x0 (ie. const/4 v2, 0x0 in this case).
Find .method public onCreate(Landroid/os/BundleV, then locate the section of code that looks similar to the following:
Code:
const-string v0, "display_battery_level"
invoke-virtual {p0, v0}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v0
check-cast v0, Landroid/preference/CheckBoxPreference;
iput-object v0, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
Again, your variables (v#'s) may differ. Beneath the line iput-object v0, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;, add the following:
Code:
const-string v0, "heads_up_setting"
invoke-virtual {p0, v0}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v0
check-cast v0, Landroid/preference/CheckBoxPreference;
iput-object v0, p0, Lcom/android/settings/DisplaySettings;->mHeadsUp:Landroid/preference/CheckBoxPreference;
Make sure to change the variable #'s to match the ones in the prior code section.
Find .method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/PreferenceZ and locate the section of code that looks similar to:
Code:
:cond_a
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_c
.line 1530
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1531
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v4, "display_battery_percentage"
if-eqz v0, :cond_b
move v3, v2
:cond_b
invoke-static {v1, v4, v3}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_3
.line 1533
:cond_c
As usual, your variables (v#'s), conditionals (cond_#'s), gotos (goto_#'s), and .line #'s may differ. Under :cond_c, add the following:
Code:
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mHeadsUp:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_2b
.line 1530
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mHeadsUp:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1531
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v4, "heads_up_enabled"
if-eqz v0, :cond_2c
move v3, v2
:cond_2c
invoke-static {v1, v4, v3}, Landroid/provider/Settings$Global;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_3
:cond_2b
Again, you'll want to change the variables to match the ones in the prior code section if they are different for you and make sure to change the conditional labels to one hexadecimal numeral higher than the highest one already present in the method. Change the goto/16 :goto_3 to match the one in the previous code section.
Save the file and close it.
That's it for SecSettings.apk. Recompile and re-sign it.
Install both files to your phone using your preferred method. You should already know this but I'll say it anyway, THESE FILES CANNOT BE INSTALLED LIKE NORMAL SIDE-LOADED APKs. I prefer to reboot to recovery and use ADB to push the files to the system, but you can use whatever method is easiest for you (ie. Aroma file manager, flashable zip, etc.).

So I guess those of us that aren't very good at this will have to wait then? Lol
Sent from my SPH-L710 using Tapatalk

Great tutorial man! Thank you looking forward to add this to all my releases soon. Great job!

Great, it compiles without mistakes with Dn3 4.4.2 for N7105, but I was playing with my 4 years old daughter and I'm sure something will be wrong, lol!
I just had to use cond 8 instead of 7, but I will report very likely my failure... It will take longer for me to let it work.
Anyway, it is a very useful tutorial and it's the only one here.

Mismatch?
I think there is a typo in the code for statusbar, it says mismatched input "p1" expecting END_METHOD_DIRECTIVE
I took this one from your original code (the one inside your rom) and it compiles fine
.method protected shouldInterrupt(Landroid/service/notification/StatusBarNotificationZ
.locals 12
.parameter "sbn"
.prologue
const/4 v8, 0x0
const/4 v9, 0x1
.line 1292
invoke-virtual {p1}, Landroid/service/notification/StatusBarNotification;->isOngoing()Z
move-result v4
if-nez v4, :cond_0
iget-object v10, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mPowerManager:Landroid/os/PowerManager;
invoke-virtual {v10}, Landroid/os/PowerManager;->isScreenOn()Z
move-result v1
:goto_0
return v1
:cond_0
move v1, v8
goto :goto_0
.end method
I will re-check the next steps, because last night I was unable to get everything working (I am not a dev).
Thanks again.

lucaoldb said:
I think there is a typo in the code for statusbar, it says mismatched input "p1" expecting END_METHOD_DIRECTIVE
I took this one from your original code (the one inside your rom) and it compiles fine
.method protected shouldInterrupt(Landroid/service/notification/StatusBarNotificationZ
.locals 12
.parameter "sbn"
.prologue
const/4 v8, 0x0
const/4 v9, 0x1
.line 1292
invoke-virtual {p1}, Landroid/service/notification/StatusBarNotification;->isOngoing()Z
move-result v4
if-nez v4, :cond_0
iget-object v10, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mPowerManager:Landroid/os/PowerManager;
invoke-virtual {v10}, Landroid/os/PowerManager;->isScreenOn()Z
move-result v1
:goto_0
return v1
:cond_0
move v1, v8
goto :goto_0
.end method
I will re-check the next steps, because last night I was unable to get everything working (I am not a dev).
Thanks again.
Click to expand...
Click to collapse
The code in the guide is taken straight from my ROM. All this method does is check to see if the notification is ongoing or not, then check to make sure the screen is on. also, I highly recommend using the latest version of apktool.

First of all, thank you.
I still have to edit the files by myself, but I have tested both your system ui and your secsettings on to the rom I am using (Dn3 4.4.2 for N7105) and they work fine, including heads up notifications... So I will keep these settings for some days, until I have the time to learn more about this matter.
Btw, I will try some of yor themed apps I found inside your rom, which are very good looking.

So what does the hud look like and how does it work? Not familiar with it.
Sent from my SPH-L710 using Tapatalk

Works great. Thank you moonknightus

Deleted

marcran75 said:
Deleted
Click to expand...
Click to collapse
???
Sent from my SPH-L710 using Tapatalk

Just an fyi, I just tried this on the S5 stock touchwiz (which is 4.4.2). I get an error when trying to compile SecSettings.apk.
Code:
I: Smaling smali folder into classes.dex...
..\_WorkArea1\_working\SecSettings.apk\smali\com\android\settings\DisplaySettings.smali[2936,4] There is already a label with that name.
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/settings/DisplaySettings.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:71)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:55)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:358)
at brut.androlib.Androlib.buildSources(Androlib.java:298)
at brut.androlib.Androlib.build(Androlib.java:284)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:240)
at brut.apktool.Main.main(Main.java:89)
It seems like the method or something is already being duplicated. SystemUI recompiled perfectly.

tp2215 said:
Just an fyi, I just tried this on the S5 stock touchwiz (which is 4.4.2). I get an error when trying to compile SecSettings.apk.
Code:
I: Smaling smali folder into classes.dex...
..\_WorkArea1\_working\SecSettings.apk\smali\com\android\settings\DisplaySettings.smali[2936,4] There is already a label with that name.
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/settings/DisplaySettings.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:71)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:55)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:358)
at brut.androlib.Androlib.buildSources(Androlib.java:298)
at brut.androlib.Androlib.build(Androlib.java:284)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:240)
at brut.apktool.Main.main(Main.java:89)
It seems like the method or something is already being duplicated. SystemUI recompiled perfectly.
Click to expand...
Click to collapse
Either a goto or a conditional label is being duplicated. Reread the instructions paying attention to the part that says to adjust the labels accordingly. The S3 and S5 use very similar code but by no means is it identical.

Thanks moonknightus for this guide. I manage to apply this mod to my tablet.:good: .Now my only problem is your other mod.

@moonknightus please check your PM sir

Do I actually need to sign the apks our can I just use them once they are modified
Sent from my SPH-L710 using Tapatalk

bigwillyg said:
Do I actually need to sign the apks our can I just use them once they are modified
Sent from my SPH-L710 using Tapatalk
Click to expand...
Click to collapse
Either use an APK signer if you have a ROM that has 3rd-party system app signatures enabled or copy the AndroidManifest.xml file and META-INF folder from the original to the new APK.As stated by moonknightus in his other thread.

filchi756 said:
Either use an APK signer if you have a ROM that has 3rd-party system app signatures enabled or copy the AndroidManifest.xml file and META-INF folder from the original to the new APK.As stated by moonknightus in his other thread.
Click to expand...
Click to collapse
Ah gotcha. Thanks
Sent from my SPH-L710 using Tapatalk

Shouldn't this be :cond_8?
Code:
[COLOR="Red"]:cond_7
[/COLOR] move v0, v2
goto/16 :goto_6

tdunham said:
Shouldn't this be :cond_8?
Code:
[COLOR="Red"]:cond_7
[/COLOR] move v0, v2
goto/16 :goto_6
Click to expand...
Click to collapse
Yup

Related

[FIX][HOWTO] Lockscreen loading Bug

This mod (JVU/JW4/JW5/JW6) fixes bug when battery is below 20 % in lockscreen displayed "charging %" instead of "Please connect charger".
HOWTO
1. Decompile android.policy.jar
For beginers here is a guide by pantrif13 : http://forum.xda-developers.com/show...1&postcount=16
2. Edit android.policy\smali\com\android\internal\policy\impl\ClockWidget.smali
Search
.method public setBatteryInfo()V
Change line:
Code:
invoke-virtual {v3}, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->shouldShowBatteryInfo()Z
by
Code:
invoke-virtual {v3}, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->shouldShowBatteryInfo1()Z
3. Edit android.policy\smali\com\android\internal\policy\impl\KeyguardUpdateMonitor.smali
Search
Code:
.line 360
new-instance v1, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$3;
invoke-direct {v1, p0}, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$3;-><init>(Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;)V
invoke-virtual {p1, v1, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
Add bellow
Code:
new-instance v1, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$4;
invoke-direct {v1, p0}, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$4;-><init>(Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;)V
invoke-virtual {p1, v1, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
And add to end of file
Code:
.method public shouldShowBatteryInfo1()Z
.locals 1
.prologue
.line 962
iget v0, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mBatteryStatus:I
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->isPluggedIn(I)Z
move-result v0
if-nez v0, :cond_0
iget v0, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mBatteryLevel:I
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->isBatteryLow(I)Z
move-result v0
if-eqz v0, :cond_1
:cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_1
const/4 v0, 0x0
goto :goto_0
.end method
4. Copy the file KeyguardUpdateMonitor$4.smali attached in "android.policy\smali\com\android\internal\policy\impl\" and recompile
Thanks, I hope to see your fix in some ROM now !
Sent from my GT-I9000 using XDA
.Slane. said:
Thanks, I hope to see your fix in some ROM now !
Sent from my GT-I9000 using XDA
Click to expand...
Click to collapse
S A U R O M - Projekt---> JW5/JW4/JVU/JW1/JVZ for I9000
Good news and good job. thanks
I'm just curious how ppl find something like that out. And what does the smileys mean?
What changes did you make to this fix in your jw6 rom?
Yes,jw6 aviable
Sent from my GT-I9000 using xda app-developers app
dark_knight35 said:
I'm just curious how ppl find something like that out. And what does the smileys mean?
Click to expand...
Click to collapse
The smileys ar ;/) (w/out "/" ) and the forum rules are the smileys are activated
Sent from my GT-I9000 using Tapatalk 2
Is there a chance for us with the lack of skills to get this as a flashable zip?
This bug is gone in 2.3.6 ZSJW4 for chinese market. I think it is the only version of JW...firmware that comes with this fixed.
Hey there lirik0.
I tried your guide so as to fix this bug for the Samsung Galaxy S Plus (i9001).
I have made all the changes to the files that you describe (with some differences on the 3rd - it was a different line number).
But i probably need a different attachment file to download and recompile.
Could you please help all the i9001 community to resolve this issue cause?
Thanks in advance!
PS: I have also attached our android.policy.jar from XXKQH ROM.

[HOW TO] AOSP Lock + Toggle| 3 Way Ext. Power Menu| CRT-OFF| Long Menu Press to Kill

Hy Guys! in my request to isolate all the codes in Smali files to enable Extended Power Menu, CRT-OF, Long Menu Press To Kill and AOSP Lockscreen working separately to implement in my ROM (crDroid ROM) i manage to found how to do it!
Updated 19.01.2013 = Working in latest XXELLC
Requirements :
- You need to know how to work with apktool, smali and baksmali stuffs.
- Notepad++
- 7-zip
WE WILL USE FOLLOING STEPS IN ALL 4 MODS
1 - You need to extract from inside the stock framework/ a file called android.policy.jar;
2 - Open android.policy.jar with 7-zip;
3 - Extract classes.dex from it;
2 - Decompile using baksmail commands;
3 - Once it's done Recompile using smali commands:
Click to expand...
Click to collapse
== AOSP Lockscreen with Toggle ==
Decompile android.policy.jar
Go to: com\android\internal\policy\impl\LockPatternKeyguardView.smali
Click to expand...
Click to collapse
Find this method
Code:
.method createLockScreen()Landroid/view/View;
And switch completely with this (Same method with new codes inside)
Code:
[left][color="blue"].method createLockScreen()Landroid/view/View;
.registers 7
.prologue
.line 1254
iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "aosp_lock"
const/4 v2, 0x0
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-nez v0, :cond_1f
new-instance v0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/sec/CircleLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
goto :goto_2e
.line 1260
:cond_1f
new-instance v0, Lcom/android/internal/policy/impl/LockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
.local v0, lockView:Landroid/view/View;
:goto_2e
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V
.line 1261
return-object v0
.end method[/color][/left]
It will create the AOSP lockscreen but with one issue. Adding only this "new" method will made the lockscreen unlockable using menu button;
So let's made some changes to fix this. There are 2 ways to fix it
1st way
Go to: com\android\internal\policy\impl\LockScreen.smali
Click to expand...
Click to collapse
Find and delete the red one
Code:
.field private mCreationOrientation:I
[color="red"]--- .field private mEnableMenuKeyInLockScreen:Z[/color]
.field private mEnableRingSilenceFallback:Z
Find and delete the red ones
Code:
[left].line 447
iput-object p5, p0, Lcom/android/internal/policy/impl/LockScreen;->mCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
.line 448
[color="red"]--- invoke-direct {p0}, Lcom/android/internal/policy/impl/LockScreen;->shouldEnableMenuKey()Z
--- move-result v0
--- iput-boolean v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mEnableMenuKeyInLockScreen:Z[/color]
.line 449
iget v0, p2, Landroid/content/res/Configuration;->orientation:I[/left]
Find the method and delete completely
Code:
[left][color="red"].method public onKeyDown(ILandroid/view/KeyEvent;)Z
.registers 4
.parameter "keyCode"
.parameter "event"
.prologue
.line 541
const/16 v0, 0x52
if-ne p1, v0, :cond_d
iget-boolean v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mEnableMenuKeyInLockScreen:Z
if-eqz v0, :cond_d
.line 542
iget-object v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-interface {v0}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
.line 544
:cond_d
const/4 v0, 0x0
return v0
.end method[/color][/left]
Recompile android.policy.jar and it's done!
AOSP Lockscreen Properly working
2nd way (Thanks to jimbo77)
Using this method we will need to decompile framework-res.apk
Go to: res/values/bools
Click to expand...
Click to collapse
Find and switch
Code:
[color="red"]--- <bool name="config_disableMenuKeyInLockScreen">false</bool>[/color]
[color="blue"]+++ <bool name="config_disableMenuKeyInLockScreen">true</bool>[/color]
Recompile framework-res.apk and it's done.
Lets put toggle in SecSettings.apk
decompile SecSettings.apk
Go to:res/values/strings
Click to expand...
Click to collapse
Add this at the end of the file, before close resources</resources>.
This 2 string bellow will be shown in settings, so feel free to change.
Code:
[left][color="blue"]+++ <string name="aosp">Jelly Bean (AOSP) Lockscreen</string>
+++ <string name="aosp_summary">Enable Original Jelly Bean Lockscreen</string>[/color]
[/left]
Go to: res/xml/Lockscreen_Settings.xml
Click to expand...
Click to collapse
Find and add
Code:
[left]<SwitchPreferenceScreen android:title="@string/lock_screen_shortcut_title" android:key="lock_screen_shortcut" android:summary="@string/lock_screen_shortcut_summary">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.lockscreenshortcut.LockScreenShortcutSettings" />
</SwitchPreferenceScreen>
[color="blue"]+++ <CheckBoxPreference android:title="@string/aosp" android:key="say_your_wakeup" android:summary="@string/aosp_summary" />[/color]
<SwitchPreferenceScreen android:title="@string/information_ticker" android:key="information_ticker" android:summary="@string/information_ticker_summary" android:fragment="com.android.settings.InformationTicker" />
[/left]
Go to: smali\com\android\settings\LockScreenSettings.smali
Click to expand...
Click to collapse
Find and add
Code:
[left].field private isWeatherEnabled:Z
[color="blue"]+++ .field private mAospLock:Landroid/preference/CheckBoxPreference;[/color]
.field private mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;[/left]
Find and Switch
Code:
[left]iput-object v0, p0, Lcom/android/settings/LockScreenSettings;->mMotionDialog:Landroid/app/AlertDialog;
[color="red"]--- const/16 v0, 0x8[/color]
[color="blue"]+++ const/16 v0, 0x11[/color]
new-array v0, v0, [I[/left]
Find and Switch
Code:
[left]invoke-virtual {v6, v3}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 294
:cond_3
[color="red"]--- iget-object v3, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iget-object v3, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
if-eqz v3, :cond_4
.line 295
[color="red"]--- iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
[color="red"]--- const-string v7, "wake_up_lock_screen"[/color]
[color="blue"]+++ const-string v7, "aosp_lock"[/color]
invoke-static {v3, v7, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I[/left]
Find and Switch
Code:
[left]const-string v8, "say_your_wakeup"
invoke-virtual {p0, v8}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v8
check-cast v8, Landroid/preference/CheckBoxPreference;
[color="red"]--- iput-object v8, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iput-object v8, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
.line 212
iget-object v8, p0, Lcom/android/settings/LockScreenSettings;->mRippleEffect:Landroid/preference/CheckBoxPreference;
if-eqz v8, :cond_8[/left]
Find and Switch
Code:
[left]goto :goto_4
:cond_9
[color="red"]--- iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_0
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
[color="red"]--- const-string v5, "wake_up_lock_screen"[/color]
[color="blue"]+++ const-string v5, "aosp_lock"[/color]
[color="red"]---iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_a[/left]
Find Switch and delete
Code:
[left]
invoke-interface {v1}, Ljava/util/List;->size()I
move-result v8
if-ge v8, v9, :cond_f
.line 240
[color="red"]--- iget-object v8, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iget-object v8, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
if-eqz v8, :cond_e
[color="red"]--- invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;[/color]
[color="red"]--- move-result-object v8[/color]
[color="red"]--- iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="red"]--- invoke-virtual {v8, v9}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z[/color]
:cond_e
if-eqz v6, :cond_f
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;[/left]
Recompile SecSettings.apk and it's done!
== 3 Way Extended Power Menu ==
Go to: com/android/internal/policy/impl/GlobalActions.smali
Click to expand...
Click to collapse
Find this
Code:
[LEFT].line 368
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$5;[/LEFT]
And switch with this
Code:
[LEFT][COLOR="Blue"].line 368
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$99;[/COLOR][/LEFT]
Find this
Code:
[LEFT]invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$5;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V[/LEFT]
And switch with this
Code:
[LEFT][COLOR="Blue"]invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V[/COLOR][/LEFT]
Now go to
com/android/internal/policy/impl/GlobalActions$SinglePressAction.smali
Click to expand...
Click to collapse
Find this
Code:
[LEFT].end annotation
# instance fields
.field private final mIconResId:I
.field private final mMessage:Ljava/lang/CharSequence;
.field private final mMessageResId:I
[/LEFT]
And between .end annotation and # instance fields, add this
Code:
[LEFT][COLOR="Blue"]# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;[/COLOR][/LEFT]
Find this
Code:
[LEFT]# direct methods
.method protected constructor <init>(II)V
.registers 4
.parameter "iconResId"
.parameter "messageResId"
[/LEFT]
And between # direct methods and .method protected constructor <init>(II)V, add this
Code:
[LEFT][COLOR="Blue"].method static constructor <clinit>()V
.registers 3
const/4 v0, 0x3
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Reboot"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Download"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Recovery"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method[/COLOR][/LEFT]
To finalize Extended Power Menu you need to copy tree smali files (GlobalActions$99$1.smali, GlobalActions$99$2, and GlobalActions$1.smali) and paste then inside -> com/android/internal/policy/impl/
Recompile android.policy.jar using smali commands it's DONE!
== CRT OFF Animation ==
Follow the same procedure as android.policy.jar to decompile and extract classes.dex
Go to
Go to: com/android/internal/policy/impl/PhoneWindowManager.smali
Click to expand...
Click to collapse
find this
Code:
[LEFT]# interfaces
.implements Landroid/view/WindowManagerPolicy;
# annotations
[/LEFT]
Between .implements Landroid/view/WindowManagerPolicy and # annotations, add this
Code:
[LEFT][COLOR="Blue"].implements Ljava/lang/Runnable;[/COLOR][/LEFT]
find this
Code:
[LEFT].line 5938
.end local v9 #isAllowed:Z
.end local v16 #kioskMode:Landroid/app/enterprise/kioskmode/KioskMode;
:cond_66
:goto_66
return v19[/LEFT]
Between :goto_66 and return v19, add this
Code:
[LEFT][COLOR="Blue"]and-int/lit8 v0, v19, 0x4
if-eqz v0, :cond_71
and-int/lit8 v19, v19, -0x5
move-object/from16 v0, p0
invoke-virtual {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->sleepDelay()V
:cond_71[/COLOR][/LEFT]
Go to the Bottom of the file and add this hole code
Code:
[LEFT][COLOR="Blue"].method public sleepDelay()V
.locals 10
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
const-wide v2, 0x64
check-cast p0, Ljava/lang/Runnable;
invoke-virtual {v0, p0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
.end method
.method public run()V
.locals 10
.prologue
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const-string v1, "power"
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v2
const-wide/16 v6, 0x3e8
add-long/2addr v2, v6
invoke-virtual {v0, v2, v3}, Landroid/os/PowerManager;->goToSleep(J)V
return-void
.end method[/COLOR][/LEFT]
Now you can recompile android.policy.jar using smali commands.
Now
Extract services.jar from inside framework folder and follow the same procedure extract classes.dex and decompile it.
Go to
Go to: com/android/server/PowerMangerService$ScreenBrightnessAnimator.smali
Click to expand...
Click to collapse
find this
Code:
[LEFT]#getter for: Lcom/android/server/PowerManagerService;->mScreenBrightnessHandler:Landroid/os/Handler;
invoke-static {v7}, Lcom/android/server/PowerManagerService;->access$7300(Lcom/android/server/PowerManagerService;)Landroid/os/Handler;
move-result-object v7
const/16 v9, 0xa[/LEFT]
Between move-result-object v7 and const/16 v9, 0xa, add this
Code:
[LEFT][COLOR="Blue"]if-eqz p2, :cond_75
const/16 v9, 0xb
const/4 v10, 0x0
const v2, 0x10
invoke-virtual {v7, v9, v2, v10}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;
move-result-object v9
invoke-virtual {v9}, Landroid/os/Message;->sendToTarget()V
:cond_75[/COLOR][/LEFT]
Now you can recompile services.jar using apktool and smali commands
== Long Menu Press to Kill App ==
Follow the same procedure as android.policy.jar and services.jar to decompile and extract classes.dex again from android.policy.jar
Go to: com/android/internal/policy/impl/PhoneWindowManager.smali
Click to expand...
Click to collapse
find this
Code:
.line 1455
[COLOR="Red"]new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$8;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$8;-><init (Lcom/android/internal/policy/impl/PhoneWindowManager;)V[/COLOR]
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mMenuLongPress:Ljava/lang/Runnable;
change the red ones for blues under
Code:
[COLOR="Blue"]+ new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$MenuLongPress;
+ invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$MenuLongPress;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V[/COLOR]
Extract the PhoneWindowManager-file.zip attached, extract the file int it and copy to com/android/internal/policy/impl/
Recompile android.policy.jar using smali commands and it's done!
With this we will be able to add or remove this 4 mods from inside any other
CREDITS
For CRT OFF Animation method all the credits goes to Sorg. I've just follow his tutorial.
For part Extended Power Menu i like to thanks mgn2o
For part of AOSP Lockscreen i like to thanks Didact74
Nice, an EPM whitout Hot Reboot (mgn2o) thanks for reference ....
Enviado de meu GT-I9300 usando o Tapatalk 2
Excellent guide! Would love one for lockscreen media skip !! I cant find the source/guide anywhere !
Great guide.
It will be great:
Can you add how to decompile .odex such that we obtain .smali for editing ??
Thanks in advance mate.
Post updated with Long Menu Press to Kill for XXELK4
Akshay (Aky) said:
Great guide.
It will be great:
Can you add how to decompile .odex such that we obtain .smali for editing ??
Thanks in advance mate.
Click to expand...
Click to collapse
You can try to deodex a file, made the changes and re-odex.
I never try with odex. I only use roms deodexed and my (crDroid) in development is surely deodexed.
Take a look in here: CLICK
how to Inkeffect tutorial
One more thing, how to add the function "Long press volume key to jump muisc" in lockscreen mode? Thanks.
I'll definitely use this to add crt animation to the 4.1.2 ROM I have for the Sprint S2. Thanks!
Sent from my SPH-D710 using xda premium
Great job, Hoping this will become a central hub for source code ! Bookmarked for future use.. looking forward to future sources!
Would you please also add the mod for "long press volume key to skip song"? Thanks.
dongfangri said:
Would you please also add the mod for "long press volume key to skip song"? Thanks.
Click to expand...
Click to collapse
I'm working on this. Trying some kind of "reverse engineering" to spot the codes.
Great tutorial, for my first attempt at these types of edits, it made life very easy. Although i have a small problem. Ive made the edits so i can have extended power menu, crt off and any app multi window in my rom. Everything went smoothly but it seems that crt off is erratic. Sometimes it works and sometimes it does not. Any ideas?
Sent from my GT-I9300 using Tapatalk 2
anaraxia said:
Great tutorial, for my first attempt at these types of edits, it made life very easy. Although i have a small problem. Ive made the edits so i can have extended power menu, crt off and any app multi window in my rom. Everything went smoothly but it seems that crt off is erratic. Sometimes it works and sometimes it does not. Any ideas?
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Well a never had this kind of problem.
Using Kernle Perseus, by the way? It seems to broke CRT.
Cristiano Matos said:
Well a never had this kind of problem.
Using Kernle Perseus, by the way? It seems to broke CRT.
Click to expand...
Click to collapse
No... Stock kernel. Keeping in simple
Sent from my GT-I9300 using Tapatalk 2
anaraxia said:
No... Stock kernel. Keeping in simple
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
There's a problem with the Stock kernel on the newest JB update (For both leak and official)
Try using Siyah's 1.8.3 and use the CRT Fix in the STweaks application.
---------- Post added at 11:15 AM ---------- Previous post was at 10:29 AM ----------
Thanks alot for this tutorial, very simple and straight to the point!
Lost.soul said:
There's a problem with the Stock kernel on the newest JB update (For both leak and official)
Try using Siyah's 1.8.3 and use the CRT Fix in the STweaks application.
Thanks for the help. Downloaded, flashed and tested. Works perfectly now. Will have to add it to my next release. Thanks again :thumbup:
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Loved your post, but i have a question: is it possible to do this with gingerbread rom? is it the same procedure?
Também sou brasileiro, hehehe. Tem como tu me ajudar com algumas coisas?
Click to expand...
Click to collapse
Note II InkEffect Lockscreen
It is not compatible with Note II InkEffect Lockscreen Mod.
When I flash this mod (extended menu) the ink effect lockscreen stop working
thank you
anaraxia said:
Great tutorial, for my first attempt at these types of edits, it made life very easy. Although i have a small problem. Ive made the edits so i can have extended power menu, crt off and any app multi window in my rom. Everything went smoothly but it seems that crt off is erratic. Sometimes it works and sometimes it does not. Any ideas?
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Can you confirm it works ONLY with Wifi On ? Seams like that on my try
in the service.jar...i have 2 times those codes...234, 264 something, so how do you choose where to insert your part ?
later edit:
Makes no diff where i add those it seams. Still CRT only works with WIFI on, its like a CRT SWICH haha...suppose "stuff" should be inserted differently on 4.1.2.

[Q] DEV REQUEST: In-Call Screen Rotation

I've scoured these forums and come up with nothing so far on this (other than apps that don't work!). Here's what I'm looking to do:
I drive FREQUENTLY for work and have my ATT Note 2 in a dash mount in landscape position. I would like my in-call screen to rotate to landscape, and actually be able to see my Caller ID photo as well as the standard dial pad.
I've tried Ultimate Rotation Control (and several other apps), and they DO rotate the screen, but the buttons are abnormally large and cover 90% of the screen. This covers up caller id as well as the dialer pad if you try to use it.
I found a mod and how-to for the S2 (links below) that does EXACTLY what I want, so I'm pretty sure someone with coding experience can figure this out. I can't figure out how to decompile-recompile my SecPhone.apk without errors, so I can't test this myself.
Is there anyone who can try to make this happen? If so, I'd be happy to make a donation for your time/effort. Thanks!
http://forum.xda-developers.com/showthread.php?t=2018583 - Mod for S2
http://forum.xda-developers.com/showthread.php?t=1705215 - How to for S2
Mods, is it possible for one of you to move this to the dev section? I feel like this is a pretty significant issue and would like to get the attention of someone who can actually sit down and decipher the proper code settings for this. I've tried doing it myself, but can't get the apk to recompile without errors.
Bump
Ultimate Rotation Control. Lets you auto rotate per app, as well as lock screen. I set the phone app to auto rotate and it does it in landscape mode.
BlackPhantomX said:
Ultimate Rotation Control. Lets you auto rotate per app, as well as lock screen. I set the phone app to auto rotate and it does it in landscape mode.
Click to expand...
Click to collapse
I appreciate the reply, but please read OP. Ultimate Rotation Control and all other rotation mods from the app store do NOT work properly. Yes, they will rotate the screen, but for some reason they force the buttons to take up 90% of the screen covering the dial pad (if I try to open it) and any caller ID information / photos.
I'm looking for someone who can make some coding changes to secphone.apk to fix the problem. See OP for examples done on the S2. I've tried this myself and can't figure it out, since I don't really know what I'm doing.
Any other feedback on this? I can't be the only one that this bugs the crap out of...
BUMP
obviously, none of the devs are interested....and, I know that has not been possible on several of the Android phones I have had over the last 5 years..
I guess you will either have to live with this, or learn about development, and try it yourself..
Just seems like a relatively simple fix since the legwork was already done for the GS2. I have tried doing this on my own, but keep running into issues when trying to re-compile.
Did you try deleting these 3 directories from the directory \secphone\res:
values-es
values-es-rUS
values-it
I did not have any compile issues when I compiled with Beans Build 1o
---------- Post added at 02:29 PM ---------- Previous post was at 02:24 PM ----------
MothChewMoth said:
Just seems like a relatively simple fix since the legwork was already done for the GS2. I have tried doing this on my own, but keep running into issues when trying to re-compile.
Click to expand...
Click to collapse
I have been working with MothChewMoth on the side and came up with the below:
Making the Note 2 TW Dialer Rotate based on phone orientation
First Note: I am not an android developer or a developer at all for that matter. I make no warranty for these changes and do so at your own risk. I have been running this for 2 days on my Verizon Note 2 running Beans Build 10 with no issues.
Thanks to Mirko ddd for posting how to do this on the Galaxy S2 which gave me a start for the Note 2
The instructions below were built off of CleanRom 4.5 ACE as that is what MothChewMoth was running.
DeCompile the SecPhone.apk and go to
apk and go to smali/com/android/phone/
You will need to edit two files:
InCallScreen.smali (this allows for rotation changes while on the phone)
CallCard.smali (this allows for rotation changes when a call is coming in)
Open InCallScreen.smali with a text editor and find the code:
Code:
.line 7185
:cond_5
sget-boolean v0, Lcom/android/phone/PhoneApp;->mIsDockConnected:Z
if-nez v0, :cond_6
const-string v0, "hardkeyboardhidden_no"
invoke-static {v0}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_c
iget v0, p1, Landroid/content/res/Configuration;->hardKeyboardHidden:I
if-ne v0, v1, :cond_c
.line 7187
:cond_6
iget v2, p1, Landroid/content/res/Configuration;->orientation:I
Remove the 2 lines:
Code:
If-eqz v0, :cond_c
Code:
If-ne v0, v1, :cond_c
Your new code should look like:
Code:
.line 7185
:cond_5
sget-boolean v0, Lcom/android/phone/PhoneApp;->mIsDockConnected:Z
if-nez v0, :cond_6
const-string v0, "hardkeyboardhidden_no"
invoke-static {v0}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z
move-result v0
iget v0, p1, Landroid/content/res/Configuration;->hardKeyboardHidden:I
.line 7187
:cond_6
iget v2, p1, Landroid/content/res/Configuration;->orientation:I
Save InCallScreen.smali
Open CallCard.smali with a text editor and find the code:
Code:
.line 720
sget-boolean v2, Lcom/android/phone/PhoneApp;->mIsDockConnected:Z
if-nez v2, :cond_0
const-string v2, "hardkeyboardhidden_no"
invoke-static {v2}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_4
iget v2, v0, Landroid/content/res/Configuration;->hardKeyboardHidden:I
if-ne v2, v1, :cond_4
.line 722
:cond_0
iget v0, v0, Landroid/content/res/Configuration;->orientation:I
Remove the 2 lines:
Code:
If-eqz v2, :cond_4
Code:
If-ne v2, v1, :cond_4
Your new code should look like:
Code:
.line 720
sget-boolean v2, Lcom/android/phone/PhoneApp;->mIsDockConnected:Z
if-nez v2, :cond_0
const-string v2, "hardkeyboardhidden_no"
invoke-static {v2}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z
move-result v2
iget v2, v0, Landroid/content/res/Configuration;->hardKeyboardHidden:I
.line 722
:cond_0
iget v0, v0, Landroid/content/res/Configuration;->orientation:I
Save the CallCard.smali
Re-Compile your secphone.apk
Replace your secphone.apk in /system/app and make sure its permissions are rw-r-r
Reboot your phone and enjoy
Second Note: To get past the CleanRom compile errors I ended up deleting these 3 directories from the directory \secphone\res:
values-es
values-es-rUS
values-it
I did not have any compile issues with the Beans Build 10 version of the same fix
Sounds like this was fixed according the forum over at ScottsRoms. Can you post the compiled, correct apk for landscape mode in call?
shaxs said:
Sounds like this was fixed according the forum over at ScottsRoms. Can you post the compiled, correct apk for landscape mode in call?
Click to expand...
Click to collapse
The attached files are built from the following Roms:
Beans Build 10
CleanRom 4.5 ACE (sorry for the 7zip compression format, zip wouldn't compress the file small enough)
I AM NOT A DEVELOPER, just a guy who hacked around until he got things working so please install this at your own risk.
To install:
1) download the proper file
2) Unzip and extract SecPhone.apk
3) Move your current SecPhone.apk from /system/app to a backup location on your phone/sdcard
4) Copy your new SecPhone.apk to /system/app
5) Change permissions on SecPhone.apk to rw-r-r
6) Reboot your phone
View attachment SecPhoneBeans.zip
View attachment SecPhoneCleanRom.7z
samuri28 said:
Did you try deleting these 3 directories from the directory \secphone\res:
values-es
values-es-rUS
values-it
I did not have any compile issues when I compiled with Beans Build 1o
---------- Post added at 02:29 PM ---------- Previous post was at 02:24 PM ----------
I have been working with MothChewMoth on the side and came up with the below:
Making the Note 2 TW Dialer Rotate based on phone orientation
First Note: I am not an android developer or a developer at all for that matter. I make no warranty for these changes and do so at your own risk. I have been running this for 2 days on my Verizon Note 2 running Beans Build 10 with no issues.
Thanks to Mirko ddd for posting how to do this on the Galaxy S2 which gave me a start for the Note 2
The instructions below were built off of CleanRom 4.5 ACE as that is what MothChewMoth was running.
DeCompile the SecPhone.apk and go to
apk and go to smali/com/android/phone/
You will need to edit two files:
InCallScreen.smali (this allows for rotation changes while on the phone)
CallCard.smali (this allows for rotation changes when a call is coming in)
Open InCallScreen.smali with a text editor and find the code:
Code:
.line 7185
:cond_5
sget-boolean v0, Lcom/android/phone/PhoneApp;->mIsDockConnected:Z
if-nez v0, :cond_6
const-string v0, "hardkeyboardhidden_no"
invoke-static {v0}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_c
iget v0, p1, Landroid/content/res/Configuration;->hardKeyboardHidden:I
if-ne v0, v1, :cond_c
.line 7187
:cond_6
iget v2, p1, Landroid/content/res/Configuration;->orientation:I
Remove the 2 lines:
Code:
If-eqz v0, :cond_c
Code:
If-ne v0, v1, :cond_c
Your new code should look like:
Code:
.line 7185
:cond_5
sget-boolean v0, Lcom/android/phone/PhoneApp;->mIsDockConnected:Z
if-nez v0, :cond_6
const-string v0, "hardkeyboardhidden_no"
invoke-static {v0}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z
move-result v0
iget v0, p1, Landroid/content/res/Configuration;->hardKeyboardHidden:I
.line 7187
:cond_6
iget v2, p1, Landroid/content/res/Configuration;->orientation:I
Save InCallScreen.smali
Open CallCard.smali with a text editor and find the code:
Code:
.line 720
sget-boolean v2, Lcom/android/phone/PhoneApp;->mIsDockConnected:Z
if-nez v2, :cond_0
const-string v2, "hardkeyboardhidden_no"
invoke-static {v2}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_4
iget v2, v0, Landroid/content/res/Configuration;->hardKeyboardHidden:I
if-ne v2, v1, :cond_4
.line 722
:cond_0
iget v0, v0, Landroid/content/res/Configuration;->orientation:I
Remove the 2 lines:
Code:
If-eqz v2, :cond_4
Code:
If-ne v2, v1, :cond_4
Your new code should look like:
Code:
.line 720
sget-boolean v2, Lcom/android/phone/PhoneApp;->mIsDockConnected:Z
if-nez v2, :cond_0
const-string v2, "hardkeyboardhidden_no"
invoke-static {v2}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z
move-result v2
iget v2, v0, Landroid/content/res/Configuration;->hardKeyboardHidden:I
.line 722
:cond_0
iget v0, v0, Landroid/content/res/Configuration;->orientation:I
Save the CallCard.smali
Re-Compile your secphone.apk
Replace your secphone.apk in /system/app and make sure its permissions are rw-r-r
Reboot your phone and enjoy
Second Note: To get past the CleanRom compile errors I ended up deleting these 3 directories from the directory \secphone\res:
values-es
values-es-rUS
values-it
I did not have any compile issues with the Beans Build 10 version of the same fix
Click to expand...
Click to collapse
I am very interested in this mod. I think it is very strange that there are no custom roms with this features integrated, because many people use their telephone as GPS in their car, like me.
I understand that it is necessary to modify SecPhone.apk of each rom. So, I am trying to decompile SecPhone.apk with the tools I downloaded from http://forum.xda-developers.com/showthread.php?t=1755243.
I extracted SecPhone.apk and framework-res.apk from the rom zip.
I installed framework-res.apk and when I try to decompile SecPhone.apk, it goes:
- Loading resource table.....
- Loaded....
- Decoding...
- Loading resource table from C:/...
Then, I get an error, which says Exception in thread "main" java.lang.OutOfMemory ...
So, I am stuck.
I get errors, but it somehow succeeded decompiling smalis, and I see the lines to delete. So, I really would like to decompile and recompile.
I have downloaded several different apktools, but some give an empty "SecPhone" folder. Maybe I am doing something wrong, but I don't know where my mistake is. Could you please give me some advice?
Succeeded !! but a problem!!
Hello, since my last post above, I have been trying to decompile SecPhone.apk, but none of apktools I tried worked for me. BUT, finally, with APK multi-Tool from the great post below, I was able to decompile and recompile SecPhone.apk.
http://forum.xda-developers.com/showthread.php?t=1310151
I installed framework-res.apk and twframework-res.apk before working with Multi-Tool.
For compiling, I did not chose to keep the original files. (I said "n"). And, after compiling, I copied androidmanifest.xml from the original SecPhone.apk into the compiled apk, replacing the new one. (It did not work the 1st time I did not copy this file.) Certainly, there are other and better ways, but anyway I have a working SecPhone.apk.
However, there is a problem. When I make a call in landscape, I have no buttons on the right side as in the attached photo. (When I make a call in portrait, I have no buttons, neither.) But, I have buttons when I receive a call in landscape and in portrait.
I deleted the 2 lines in each smali (total 4 lines), and I did not change anything else. I am very happy I have a phone, which works in landscape, too, but I would like to have the buttons back. Can you give me some advice?
Thank you for the great thread!!
PS: I am on Scamus V4.
3to4 said:
Hello, since my last post above, I have been trying to decompile SecPhone.apk, but none of apktools I tried worked for me. BUT, finally, with APK multi-Tool from the great post below, I was able to decompile and recompile SecPhone.apk.
http://forum.xda-developers.com/showthread.php?t=1310151
I installed framework-res.apk and twframework-res.apk before working with Multi-Tool.
For compiling, I did not chose to keep the original files. (I said "n"). And, after compiling, I copied androidmanifest.xml from the original SecPhone.apk into the compiled apk, replacing the new one. (It did not work the 1st time I did not copy this file.) Certainly, there are other and better ways, but anyway I have a working SecPhone.apk.
However, there is a problem. When I make a call in landscape, I have no buttons on the right side as in the attached photo. (When I make a call in portrait, I have no buttons, neither.) But, I have buttons when I receive a call in landscape and in portrait.
I deleted the 2 lines in each smali (total 4 lines), and I did not change anything else. I am very happy I have a phone, which works in landscape, too, but I would like to have the buttons back. Can you give me some advice?
Thank you for the great thread!!
PS: I am on Scamus V4.
Click to expand...
Click to collapse
Can you show the code snippet before you made your changes? and highlight the lines you removed?
Also I ended up using the procedures listed here to finally get my de-compile/re-compile to work:
http://forum.xda-developers.com/showthread.php?t=1809649
samuri28 said:
Can you show the code snippet before you made your changes? and highlight the lines you removed?
Also I ended up using the procedures listed here to finally get my de-compile/re-compile to work:
http://forum.xda-developers.com/showthread.php?t=1809649
Click to expand...
Click to collapse
Thank you very much for your reply. Finally, I deleted another line in each file, and it seems to be working now.
I need to use the phone a little while to see if there is really no problem like freezing, but I got my buttons back.
The lines I deleted are in red.
InCallScreen.smali:
.line 7147
:cond_5
sget-boolean v0, Lcom/android/phone/PhoneApp;->mIsDockConnected:Z
if-nez v0, :cond_6
const-string v0, "hardkeyboardhidden_no"
invoke-static {v0}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/StringZ
move-result v0
if-eqz v0, :cond_c
iget v0, p1, Landroid/content/res/Configuration;->hardKeyboardHidden:I
if-ne v0, v1, :cond_c
.line 7149
:cond_6
iget v2, p1, Landroid/content/res/Configuration;->orientation:I
CallCard.smali:
.line 719
if-eqz v0, :cond_4
.line 720
sget-boolean v2, Lcom/android/phone/PhoneApp;->mIsDockConnected:Z
if-nez v2, :cond_0
const-string v2, "hardkeyboardhidden_no"
invoke-static {v2}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/StringZ
move-result v2
if-eqz v2, :cond_4
iget v2, v0, Landroid/content/res/Configuration;->hardKeyboardHidden:I
if-ne v2, v1, :cond_4
.line 722
:cond_0
iget v0, v0, Landroid/content/res/Configuration;->orientation:I
That's all.
Thank you again for your posts.
3to4 said:
Thank you very much for your reply. Finally, I deleted another line in each file, and it seems to be working now.
I need to use the phone a little while to see if there is really no problem like freezing, but I got my buttons back.
The lines I deleted are in red.
InCallScreen.smali:
.line 7147
:cond_5
sget-boolean v0, Lcom/android/phone/PhoneApp;->mIsDockConnected:Z
if-nez v0, :cond_6
const-string v0, "hardkeyboardhidden_no"
invoke-static {v0}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/StringZ
move-result v0
if-eqz v0, :cond_c
iget v0, p1, Landroid/content/res/Configuration;->hardKeyboardHidden:I
if-ne v0, v1, :cond_c
.line 7149
:cond_6
iget v2, p1, Landroid/content/res/Configuration;->orientation:I
CallCard.smali:
.line 719
if-eqz v0, :cond_4
.line 720
sget-boolean v2, Lcom/android/phone/PhoneApp;->mIsDockConnected:Z
if-nez v2, :cond_0
const-string v2, "hardkeyboardhidden_no"
invoke-static {v2}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/StringZ
move-result v2
if-eqz v2, :cond_4
iget v2, v0, Landroid/content/res/Configuration;->hardKeyboardHidden:I
if-ne v2, v1, :cond_4
.line 722
:cond_0
iget v0, v0, Landroid/content/res/Configuration;->orientation:I
That's all.
Thank you again for your posts.
Click to expand...
Click to collapse
Was it this line that you also deleted?
if-nez v0, :cond_6
I wonder if this is a ROM specific change as my secPhone.apk still has that line in it.
samuri28 said:
Was it this line that you also deleted?
if-nez v0, :cond_6
I wonder if this is a ROM specific change as my secPhone.apk still has that line in it.
Click to expand...
Click to collapse
Yes. This may be rom specific, but as I am no programmer, I cannot tell.
The two additional lines I deleted are;
1) if-nez v0, :cond_6 in InCallScreen.smali
2) if-nez v2, :cond_0 in CallCard.smali.
What I don't really understand is this feature (landscape in-call screen) is integrated in android, but disabled somehow, and you have to hack it to profit from the feature!!
3to4 said:
Yes. This may be rom specific, but as I am no programmer, I cannot tell.
The two additional lines I deleted are;
1) if-nez v0, :cond_6 in InCallScreen.smali
2) if-nez v2, :cond_0 in CallCard.smali.
What I don't really understand is this feature (landscape in-call screen) is integrated in android, but disabled somehow, and you have to hack it to profit from the feature!!
Click to expand...
Click to collapse
From the research I did trying to figure out how to get Landscape In-Call it looks like Samsung for some reason intentionally disabled Docking Mode on its phones and in turn disable auto rotation when in a dock (we forced the phone to auto-rotate regardless of in a dock). However in AOSP this feature is a setting within the phone settings menu, so I am assuming another Samsung intentional exclusion.
Hello There
I have P6200 with PAC-Man milestone1 (JB 4.2.1) , and I'm tired to make InCall in Portrait mode post here (http://forum.xda-developers.com/showthread.php?t=2544636)
I follow this post and I can't find SecPhone.apk
is there any help ???

[Guide/Tut]Adding 5 way reboot menu lollipop

Hello guys Here is a small tut on how to add 5 way advanced reboot menu
This is only for Deodexed files
The Files which need work are
Framework-res.apk
android.policy.jar
framework.jar
services.jar
Things You need are Baksmali version of 1.5
Here you can get it Click here
Apktool
signer tool
Thinking Brain and Patience
First We start with Framework-res.apk
Decompile it
Add these lines here in file /res/values/strings.xml
Code:
<string name="apm_reboot">Reboot</string>
<string name="apm_hotreboot">Hot reboot</string>
<string name="apm_recovery">Recovery</string>
<string name="apm_bootloader">Bootloader</string>
<string name="apm_safemode">Safe mode</string>
Then add these files to images to framework-res.apk View attachment drawable-hdpi.zip
Then Compile and Decompile again ( for public ids )
Ok Now Decompile android.policy.jar ( using Baksmali )
After Decompile Place the files to ( com/android/internal/policy/impl ) path View attachment android.policy.jar.zip
Now After Placing These 7 files open them in NotePad++ ( all 7 files )
Look For the .method private constructor <init> now Replace the Public Ids as per framework-res.apk created ( dont confuse everything was written )
Now Look For GlobalActions.smali and open it on notepad++
Look for
Code:
Lcom/android/internal/policy/impl/GlobalActions$PowerAction;
Then add these lines Above that
Code:
Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsReceiver;,
Lcom/android/internal/policy/impl/GlobalActions$PowerActionBootloader;,
Lcom/android/internal/policy/impl/GlobalActions$PowerActionHotReboot;,
Lcom/android/internal/policy/impl/GlobalActions$PowerActionReboot;,
Lcom/android/internal/policy/impl/GlobalActions$PowerActionRecovery;,
Lcom/android/internal/policy/impl/GlobalActions$PowerActionSafemode;,
Look For
Code:
.field private mHandler:Landroid/os/Handler;
Add Below
Code:
.field private mGlobalActionsReceiver:Landroid/content/BroadcastReceiver;
Look For
Code:
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$7;
invoke-direct {v4, p0}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;
Add After That These lines
Code:
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsReceiver;
invoke-direct {v4, p0}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsReceiver;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mGlobalActionsReceiver:Landroid/content/BroadcastReceiver;
Look for
Code:
iget-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {p1, v4, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
Add after that code These lines
Code:
new-instance v1, Landroid/content/IntentFilter;
invoke-direct {v1}, Landroid/content/IntentFilter;-><init>()V
const-string v4, "android.intent.action.GLOBAL_ACTION_DIALOG"
invoke-virtual {v1, v4}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
iget-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mGlobalActionsReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {p1, v4, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
Look For
Code:
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$PowerAction;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$PowerAction;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
Add After that
Code:
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/GlobalActions;->getSysAPMTweak()Z
move-result v2
if-eqz v2, :cond_skip
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialogAdv;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialogAdv;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
:cond_skip
Find this Method
Code:
.method private createDialog()Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
After that Add this method ( meant after .end method )
Code:
.method private createDialogAdv()Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
.locals 13
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$1;
const v2, 0x1080377 #drawable ic_lock_airplane_mode
const v3, 0x1080379 #drawable ic_lock_airplane_mode_off
const v4, 0x10400fe #string global_actions_toggle_airplane_mode
const v5, 0x10400ff #string global_actions_airplane_mode_on_status
const v6, 0x1040100 #string global_actions_airplane_mode_off_status
move-object v1, p0
invoke-direct/range {v0 .. v6}, Lcom/android/internal/policy/impl/GlobalActions$1;-><init>(Lcom/android/internal/policy/impl/GlobalActions;IIIII)V
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$PowerActionReboot;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$PowerActionReboot;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$PowerActionHotReboot;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$PowerActionHotReboot;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$PowerActionBootloader;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$PowerActionBootloader;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$PowerActionRecovery;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$PowerActionRecovery;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$PowerActionSafemode;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$PowerActionSafemode;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;
const/4 v1, 0x0
invoke-direct {v0, p0, v1}, Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAdapter:Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;
new-instance v12, Lcom/android/internal/app/AlertController$AlertParams;
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-direct {v12, v0}, Lcom/android/internal/app/AlertController$AlertParams;-><init>(Landroid/content/Context;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAdapter:Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;
iput-object v0, v12, Lcom/android/internal/app/AlertController$AlertParams;->mAdapter:Landroid/widget/ListAdapter;
iput-object p0, v12, Lcom/android/internal/app/AlertController$AlertParams;->mOnClickListener:Landroid/content/DialogInterface$OnClickListener;
const/4 v0, 0x1
iput-boolean v0, v12, Lcom/android/internal/app/AlertController$AlertParams;->mForceInverseBackground:Z
new-instance v10, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-direct {v10, v0, v12}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;-><init>(Landroid/content/Context;Lcom/android/internal/app/AlertController$AlertParams;)V
const/4 v0, 0x0
invoke-virtual {v10, v0}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;->setCanceledOnTouchOutside(Z)V
invoke-virtual {v10}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;->getListView()Landroid/widget/ListView;
move-result-object v0
const/4 v1, 0x1
invoke-virtual {v0, v1}, Landroid/widget/ListView;->setItemsCanFocus(Z)V
invoke-virtual {v10}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;->getListView()Landroid/widget/ListView;
move-result-object v0
invoke-virtual {v10}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;->getWindow()Landroid/view/Window;
move-result-object v0
const/16 v1, 0x7d9
invoke-virtual {v0, v1}, Landroid/view/Window;->setType(I)V
invoke-virtual {v10, p0}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;->setOnDismissListener(Landroid/content/DialogInterface$OnDismissListener;)V
return-object v10
.end method
Now find
Code:
# virtual methods
Add after this below code
Code:
.method public getSysAPMTweak()Z
.locals 4
const/4 v0, -0x1
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "tweaks_apm"
const/4 v3, -0x2
invoke-static {v1, v2, v0, v3}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v1
if-nez v1, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x1
goto :goto_0
.end method
Now Find this method
Code:
.method public showDialog(ZZ)V
After that Add this method (after .end method )
Code:
.method public showDialogAdv()V
.locals 2
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->createDialogAdv()Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
move-result-object v0
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDialog:Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->prepareDialog()V
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDialog:Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
invoke-virtual {v0}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;->show()V
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDialog:Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
invoke-virtual {v0}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;->getWindow()Landroid/view/Window;
move-result-object v0
invoke-virtual {v0}, Landroid/view/Window;->getDecorView()Landroid/view/View;
move-result-object v0
const/high16 v1, 0x10000
invoke-virtual {v0, v1}, Landroid/view/View;->setSystemUiVisibility(I)V
return-void
.end method
Now recompile Classes and replace the classes.dex with android.policy.jar and sign it
Here it was end with the Android.policy.jar ( be sure with Public ids )
If you have any doubts or conflict as not found just compare my file to fix this ( compile file View attachment compare.zip )
Next step will be in second post (below )
Continue 2 Framwework.jar
Decompile framwork.jar
Find and open WindowManagerPolicy$WindowManagerFuncs.smali
Look for
Code:
.method public abstract rebootSafeMode(Z)V
.end method
Add method before that this method
Code:
.method public abstract reboot(Ljava/lang/String;Z)V
.end method
now recompile and sign the file
Now go for third method in next post ( final )
Final part Service.jar
First Decompile the service.jar
and then disable the signature verification
Tut is here
then look for services\smali\com\android\server\wm\WindowManagerService.smali
open it in notepad++ and find this method
Code:
.method public rebootSafeMode(Z)V
Before that method Add this method
Code:
.method public reboot(Ljava/lang/String;Z)V
.locals 3
iget-object v0, p0, Lcom/android/server/wm/WindowManagerService;->mContext:Landroid/content/Context;
invoke-static {v0, p1, p2}, Lcom/android/server/power/ShutdownThread;->reboot(Landroid/content/Context;Ljava/lang/String;Z)V
return-void
.end method
Now recompile the service.jar
So the compiled files are Framework-re.apk, framework.jar, service.jar, android.policy.jar
Now replace then and reboot and you are done guys
Have fun
Credits:- lyapota and S0bes
Great work bro. Keep up the good work
Awesome Tut RXS bro ^^
Very usefull
Verstuurd vanaf mijn D6603 met Tapatalk
Awesome tutorial bro!!
Was waiting for it
Very cool, thanks!
Is there anyway to stop the reboot menu from showing if the device is locked? It'd be handy if somebody couldn't steal my phone and get into recovery..
Just tested, Aaaaaand it's working
Thanks bro!
venkat kamesh said:
Decompile framwork.jar
Find and open WindowManagerPolicy$WindowManagerFuncs.smali
Look for
Code:
.method public abstract rebootSafeMode(Z)V
.end method
Add method before that this method
Code:
.method public abstract reboot(Ljava/lang/String;Z)V
.end method
now recompile and sign the file
Now go for third method in next post ( final )
Click to expand...
Click to collapse
@venkat kamesh First of all, thank you for sharing this tut! Please mention where this file is so that newbies can find it instead of searching in whole directory.. smali_classes2/android/view/WindowManagerPolicy$WindowManagerFuncs.smali
the images you have given are little blurry so I have created new set of images if you want to share..Please find it in attachments..
Now about my experience, I tried this guide on CM12.1 but ran into some issues like all the buttons were performing only soft reboot (Hot reboot) instead of carrying out their functionality..Don't know the cause though! Will figure it out soon..
venkat kamesh said:
Decompile framwork.jar
Find and open WindowManagerPolicy$WindowManagerFuncs.smali
Look for
Code:
.method public abstract rebootSafeMode(Z)V
.end method
Add method before that this method
Code:
.method public abstract reboot(Ljava/lang/String;Z)V
.end method
now recompile and sign the file
Now go for third method in next post ( final )
Click to expand...
Click to collapse
WindowManagerPolicy$WindowManagerFuncs.smali not found
Hi @venkat kamesh first thanks for this tutorial. I ve follow this but i dont get any result. I tried with the files for the z1 firmware .236. could you please have a look? if there is something wrong? I attach the zip i ve made. cheers
advance_power.zip 27.6 MB
https://mega.nz/#!fxB3WLDZ!K46Adp8rvyG3EjUaIYgCk1ePSorO-FgL7Lxs1Obehtg
Someone knows how to change the "Smokkie Reboot Options" string?
http://i.imgur.com/reu88bh.png
BlackMesa123 said:
Someone knows how to change the "Smokkie Reboot Options" string?
http://i.imgur.com/reu88bh.png
Click to expand...
Click to collapse
In framework-res.apk >decompile>res>values>strings>search for "Smokkie Reboot Options", replace to whatever you want.
jitz975 said:
In framework-res.apk >decompile>res>values>strings>search for "Smokkie Reboot Options", replace to whatever you want.
Click to expand...
Click to collapse
Notepad++ says that it hasnt finded it
juanpirulo said:
Hi @venkat kamesh first thanks for this tutorial. I ve follow this but i dont get any result. I tried with the files for the z1 firmware .236. could you please have a look? if there is something wrong? I attach the zip i ve made. cheers
advance_power.zip27.6 MB
https://mega.nz/#!fxB3WLDZ!K46Adp8rvyG3EjUaIYgCk1ePSorO-FgL7Lxs1Obehtg
Click to expand...
Click to collapse
New apktool don't give result of adding codes
Best thing is
Try using baksmali bro
It works
BlackMesa123 said:
Someone knows how to change the "Smokkie Reboot Options" string?
http://i.imgur.com/reu88bh.png
Click to expand...
Click to collapse
Hmm you need to define the header code in smali
:good::good::good:
If i press recovery,bootloader,reboot and etc. buttons,phone hot rebooting. It can't start on recovery ,bootloader mode. Any solution?
Hi @venkat kamesh bro I don't have the code
Code:
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$7;
invoke-direct {v4, p0}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;
in my GlobalActions.smali and the GlobalActions.smali file you provide for comparison
Can you look at it?
venkat kamesh said:
New apktool don't give result of adding codes
Best thing is
Try using baksmali bro
It works
Hmm you need to define the header code in smali
Click to expand...
Click to collapse
Any response to my latest post?
lordriguez said:
Any response to my latest post?
Click to expand...
Click to collapse
hmm that line was not much mandatory bro ( i meant which haven't found )
in this code
Code:
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$[COLOR="Red"]7[/COLOR];
the red value may be varied
you can look for 10 or 12 or what ever there ( this line is example of persists to add new instance )
in my smali i had 7 and other
i had aaded after that line
hope you got what i mean
good luck bro

[Guide][tut] [MM] HeadsUp timeOut / enable / disable settings

Today i am presenting HeadsUp tut
For LP click here
This is For MM only Devices
All you need is Patience
deodexed SystemUI.apk
1. Decompile SystemUI.apk
2. Now Open smali/com/android/systemui/statusbar/policy/HeadsUpManager.smali
In this find this line:
Code:
# instance fields
Add the following lines below this:
Code:
.field private mDefaultHeadsUpNotificationDecay:I
3. Then find the below line and remove delete the part that says “final”:
Code:
.field private final mHeadsUpNotificationDecay:I
So it look like
Code:
.field private mHeadsUpNotificationDecay:I
4. Find this line:
Code:
# direct methods
5. Add these two entire methods below this:
Code:
.method static synthetic -get1(Lcom/android/systemui/statusbar/policy/HeadsUpManager;)Landroid/content/Context;
.locals 1
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/HeadsUpManager;->mContext:Landroid/content/Context;
return-object v0
.end method
.method static synthetic -set0(Lcom/android/systemui/statusbar/policy/HeadsUpManager;I)I
.locals 0
iput p1, p0, Lcom/android/systemui/statusbar/policy/HeadsUpManager;->mHeadsUpNotificationDecay:I
return p1
.end method
6. Find this line:
Code:
iput v1, p0, Lcom/android/systemui/statusbar/policy/HeadsUpManager;->mMinimumDisplayTime:I
Below this, you will see these two lines:
Code:
const v1, 0x7f0d0012
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getInteger(I)I
Delete these two lines and replace them with the following code:
Code:
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/HeadsUpManager;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string/jumbo v2, "heads_up_timeout"
iget-object v3, p0, Lcom/android/systemui/statusbar/policy/HeadsUpManager;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const v4, 0x7f0d0012 #<public type="integer" name="heads_up_notification_decay" id="0x7f0d0012" />
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getInteger(I)I
move-result v3
const/4 v4, -0x3
invoke-static {v1, v2, v3, v4}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
7. Save it and close
8. Now open smali/com/android/systemui/statusbar/policy/HeadsUpManager$HeadsUpEntry.smali
9. Find the following line:
Code:
.method public updateEntry()V
Directly below this line you will find this line:
Code:
.locals 10
10. Take that line and replace it with this entire block of code (make sure to replace the commented public ID):
Code:
.locals 11
iget-object v6, p0, Lcom/android/systemui/statusbar/policy/HeadsUpManager$HeadsUpEntry;->this$0:Lcom/android/systemui/statusbar/policy/HeadsUpManager;
iget-object v7, p0, Lcom/android/systemui/statusbar/policy/HeadsUpManager$HeadsUpEntry;->this$0:Lcom/android/systemui/statusbar/policy/HeadsUpManager;
invoke-static {v7}, Lcom/android/systemui/statusbar/policy/HeadsUpManager;->-get1(Lcom/android/systemui/statusbar/policy/HeadsUpManager;)Landroid/content/Context;
move-result-object v7
invoke-virtual {v7}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v7
const-string/jumbo v8, "heads_up_timeout"
iget-object v9, p0, Lcom/android/systemui/statusbar/policy/HeadsUpManager$HeadsUpEntry;->this$0:Lcom/android/systemui/statusbar/policy/HeadsUpManager;
invoke-static {v9}, Lcom/android/systemui/statusbar/policy/HeadsUpManager;->-get1(Lcom/android/systemui/statusbar/policy/HeadsUpManager;)Landroid/content/Context;
move-result-object v9
invoke-virtual {v9}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v9
const v10, 0x7f0d0012 #<public type="integer" name="heads_up_notification_decay" id="0x7f0d0012" />
invoke-virtual {v9, v10}, Landroid/content/res/Resources;->getInteger(I)I
move-result v9
const/4 v10, -0x3
invoke-static {v7, v8, v9, v10}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v7
invoke-static {v6, v7}, Lcom/android/systemui/statusbar/policy/HeadsUpManager;->-set0(Lcom/android/systemui/statusbar/policy/HeadsUpManager;I)I
11. Save, recompile, and replace
For setting Please go for Next post
Thanks to @Bloodlvst for this tut possible
my respect to you
Settings
Download this setting
Click here
...
If you want to add by settings as default ?
then learn to do guys
follow this guide
[Guide][New Learners Basics] [LP/MM/+] Create settings preferences and subsettings
cause i had limited time brothers
hope you get me
Dont forgot to tag me if you use my work
hello
thank you for this tut
i have edited and compiled SystemUi.apk and it's working
but to control the settings i have added i wanted to install your app from the second post , Right?
the problem is that the app is not installing
i don't have speruser mod
please post a tut on how to add the control app into main setting
PS: am working on my HTC desire 820 (MM 6.0.1)
Thanks in Advance
Edit: after deodexing my rom and got superuser mod the control app is working
please post a tut on how to add the control app into main setting.....

Categories

Resources