[MOD] Remove "Your phone will shut down" prompt - Galaxy S II Android Development

Okay, here is how to remove the annoying "confirm shutdown message".
I did this with KH4, but should work with most roms.
ALWAYS MAKE A BACKUP BEFORE MODIFYING YOUR ROM...JUST IN CASE THINGS GO TERRIBLY WRONG.
1 - Decompile framework.jar
2 - Open /com/android/internal/app/ShutdownThread.smali
3 - In .method public static shutdown(Landroid/content/Context;Z)V
look for the following:
.line 159
const-string v2, "ShutdownThread"
const-string v2, "Notifying thread to start radio shutdown"
invoke-static {v4, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/StringI
.line 161
if-eqz p1, :cond_2
4 - at about .line 161, comment out: if-eqz p1, :cond_2 as follows
# if-eqz p1, :cond_2 (make sure # is at beginning of line)
5 - then add the following after the above commented line:
goto :cond_2
the 2 lines should look like this:
# if-eqz p1, :cond_2
goto :cond_2
6 - recompile framework.jar
7 - use adb to push it to your sdcard
8 - then do the following:
adb shell
cd /sdcard/
stop
cp framework.jar /system/framework/
reboot
That's it - no more shutdown prompt!

amazing find

Thanks a lot
Sent from my GT-I9100 using xda premium

Good find but alternatively why not just download http://www.appbrain.com/app/quick-boot-(reboot)/com.siriusapplications.quickboot
i cant remember the last time i DIDN'T use this app to shut down or reboot my phone.

jonny68 said:
Good find but alternatively why not just download http://www.appbrain.com/app/quick-boot-(reboot)/com.siriusapplications.quickboot
i cant remember the last time i DIDN'T use this app to shut down or reboot my phone.
Click to expand...
Click to collapse
I prefer use the power menu for this and i will be pleased to skip the confirmation step

sicopat said:
I prefer use the power menu for this and i will be pleased to skip the confirmation step
Click to expand...
Click to collapse
i don't think it really matters to be honest, it shuts down quicker actually using the app i posted but each to their own

I prefer clean shutdowns to ensure all buffers are flushed and processes are cleanly stopped. I doubt you will have any problems with a quick shutdown but you never know - could end up with some data loss. I even shutdown my Ubuntu pc cleanly to ensure no problems.
Sent from my GT-I9100 Photon-based, Laser-accelerated 24-core I128 CPU

gcrutchr said:
I prefer clean shutdowns to ensure all buffers are flushed and processes are cleanly stopped. I doubt you will have any problems with a quick shutdown but you never know - could end up with some data loss. I even shutdown my Ubuntu pc cleanly to ensure no problems.
Sent from my GT-I9100 Photon-based, Laser-accelerated 24-core I128 CPU
Click to expand...
Click to collapse
I've been using that app now for a long time and have never once had any problems

sicopat said:
I prefer use the power menu for this and i will be pleased to skip the confirmation step
Click to expand...
Click to collapse
I agree 100%. This works exactly as I wanted.
gcrutchr said:
I prefer clean shutdowns to ensure all buffers are flushed and processes are cleanly stopped. I doubt you will have any problems with a quick shutdown but you never know - could end up with some data loss. I even shutdown my Ubuntu pc cleanly to ensure no problems.
Click to expand...
Click to collapse
Thank you for sharing this.

mostyle said:
I agree 100%. This works exactly as I wanted.
Thank you for sharing this.
Click to expand...
Click to collapse
You're welcome!

Thanks mate

Cool find. Thanks

s7
Does this mod work on an Nougat s7? If so, how do I decompile then recompile the .jar file?

tech927 said:
Does this mod work on an Nougat s7? If so, how do I decompile then recompile the .jar file?
Click to expand...
Click to collapse
I think probably not. This thread was written in 2011 and android Gingerbread is the latest android version then. Gingerbread is still known for the easiest android version to mod. Now, android nougat and oreo are taking place but they're damn hard to make any modification BUT you can try to decompile with apktool and see if it works

Related

[MOD][REF] Froyo Camera.apk Power Button->Shutter Key; Disable Low Batt

Current Functionality over stock Camera.apk:
Optional Geotagging (thanks to Adrynalyne or whoever he got it from)
Power Button in Camera mode becomes functionally the same as the touchscreen Shutter Key
Power Button in Camcorder mode becomes functionally the same as the touchscreen Shutter Key for starting recording
Removed Low Battery restriction
Removed In-Call restriction
This camera has been included with Super Clean since v2.2 until v2.9, and is included in some other ROMs as well. If you installed any of these roms, then you do not need to install this camera.
[Size=+1]Froyo Camera Mod v2.1 - APK version[/Size]
Camera.apk - Download @ MediaFire.com
Installation: Since this is a system app, it cannot be installed using the Package Installer. Camera.apk must replace /system/app/Camera.apk. You can accomplish this many different ways. Two common methods are: 1) use ADB to push it ("adb push Camera.apk /system/app/Camera.apk"); or 2) copy Camera.apk to your SD card, then use a program like Root Explorer to move it to "/system/app/". If you are running a Stock Froyo rom, you will want to delete any camera.odex files in /system/app/, clear dalvik cache and reboot. For most deodexed roms, a reboot is only necessary if the camera is not working correctly after installation.​
Thanks to s44, there is now a CWM flashable upgrade version:
[Size=+1]Froyo Camera Mod v2.1 - ClockworkMod ZIP version[/Size]
cameramodv2.1-install.zip - Download @ xdaDevelopers.com
s44 said:
The attached Clockwork zip *should* do all the above (delete the odex if it exists, clear the Camera's dalvik cache entry, and install the Camera apk into /system/app)
Click to expand...
Click to collapse
Installation: Copy zip file to sdcard. Boot into CWM, and select "Install zip from sd card". Select the file, then confirm the flash. When finished, reboot.​
Disclaimer: This should work on any of the Froyo roms/kernels, but maybe not your's. Be sure to make a backup of your current Camera.apk for easily switching it back if you have problems.
Feedback: If it doesn't work right, let me know your setup, and what the problem is. If you see an error in my description, or if you know of a better way to do something, let me know. It's my goal to both be as unobtrusive to the original code as possible, while increasing functionality/efficiency. I am *slightly* open to suggestions on future features (I can't promise much since I'm in school and don't have too much time).
Future Features/Fixes:
In camcorder mode, Power Button second press->Pause Key
Optimize PNG's
User Requested Features/Reported Bugs:
On long press of the Power Button, Enable Auto Focus before taking picture (i.e. disable the Power Menu from popping up).
Home Key short press does not follow OS setting after using the Power Button to take a picture (happens after every odd # of Power Button presses)
Previous Versions
[Size=-1]Camera Mod v1
Camera.apk - Download @ MediaFire.com
[/size]
Changelog
v2.1
-Added "Unable to start camera while in a call" Alert Disable
-Added Remap Power Button to Shutter Key for Camcorder (start only)
v2
-Corrupted Upload... Sorry!
v1
-Initial Release
Thanks:
-Adrynalyne for providing the deodexed, froyo Camera.apk with optional geotagging added.
-The author of that forum post I read that pointed me to the "camera.smali" file. I'm sorry, I have no idea who you are.
-Whoever wrote this Dalvik VM cheatsheet
-S44 for putting together the CWM flash file
[SIZE=+1]Process - How I Made It[/SIZE]
I extracted the Camera.apk from SuperClean 2.0. From there, I extracted "classes.dex" using 7-zip. Then, I decompiled "classes.dex" using baksmali. I edited the Dalvik bytecode in the Camera.smali and AbstractCameraActivity.smali files using Notepad++. I recompiled "classses.dex" using smali. I overwrote the "classes.dex" in the Camera.apk using 7-zip. Finally, I zipaligned the resulting APK.
I did not mod the camcorder files (v2.1 - I have half of the camcorder part done), but the process would be similar. Also, if you understand the general rules of bytecode, you could adapt this to other versions of the APK fairly quickly.
The commands I used for decompiling and recompiling are as follows:
java -jar baksmali-1.2.1.jar -x classes.dex
java -Xmx512m -jar smali-1.2.1.jar -o classes.dex c:\out
Remap Power Button to Shutter Key for Camera
In com\sec\android\app\camera\Camera.smali, the red lines are the ones I modified:
Code:
.line 728
:cond_45
const/16 v1, 0x1a
[COLOR="red"]goto :cond_52[/COLOR]
.line 729
invoke-virtual {p0}, Lcom/sec/android/app/camera/Camera;->isCaptureEnabled()Z
Code:
.line 736
:sswitch_data_fc
.sparse-switch
0x4 -> :sswitch_61
0x17 -> :sswitch_69
0x18 -> :sswitch_b7
0x19 -> :sswitch_b7
[COLOR="red"] 0x1a -> :sswitch_69[/COLOR]
0x1b -> :sswitch_69
0x42 -> :sswitch_69
0x50 -> :sswitch_63
0x52 -> :sswitch_61
0x54 -> :sswitch_61
.end sparse-switch
.end method
Code:
.line 828
:cond_3a
const/16 v0, 0x1a
[COLOR="red"]goto :cond_57[/COLOR]
.line 830
invoke-direct {p0}, Lcom/sec/android/app/camera/Camera;->resetFocusDueToZoom()V
Code:
.line 848
nop
:sswitch_data_e8
.sparse-switch
0x4 -> :sswitch_83
0x17 -> :sswitch_b5
0x18 -> :sswitch_e4
0x19 -> :sswitch_e4
[COLOR="red"]0x1a -> :sswitch_b5[/COLOR]
0x1b -> :sswitch_b5
0x42 -> :sswitch_b5
0x52 -> :sswitch_b2
0x54 -> :sswitch_e4
.end sparse-switch
.end method
There you have it. You only have to modify 4 lines, and now your power button should perfectly emulate the shutter key on the screen.
Low Battery Alert Disable
In com\sec\android\app\camera\AbstractCameraActivity.smali, add the red line:
Code:
.line 855
:cond_14
invoke-virtual {p0}, Lcom/sec/android/app/camera/AbstractCameraActivity;->hideAllDlg()V
[COLOR="Red"]goto :goto_13[/COLOR]
.line 857
new-instance v0, Landroid/app/AlertDialog$Builder;
"Unable to start camera while in a call" Alert Disable - Added in v2.1
In com\sec\android\app\camera\AbstractCameraActivity.smali, add the red line:
Code:
.line 613
const/4 v2, 0x0
[COLOR="Red"]goto :goto_1a[/COLOR]
iput-boolean v2, p0, Lcom/sec/android/app/camera/AbstractCameraActivity;->mCheckCalling:Z
Excellent!
I don't suppose you could further edit the camera to disable Geotagging?
s44 said:
Excellent!
I don't suppose you could further edit the camera to disable Geotagging?
Click to expand...
Click to collapse
It's not enabled by default. It's just an option in the menu.
I really needed this, great work! I hope devs start including this standard in future ROMs.
Amazing job. I've been waiting for something like this.
I'm almost. As excited about this as I am froyo.
Sent from my SCH-I500 using XDA App
Wow this is really cool and is flawlessly working.. You da man
Sent from my SCH-I500 using XDA App
yuuup you the MAN
any chance there's a way to remap the search button to bring up the camera?
I currently use the power remap mod and it's pretty useful but having a quick camera button would be awesome
djlim4 said:
yuuup you the MAN
any chance there's a way to remap the search button to bring up the camera?
I currently use the power remap mod and it's pretty useful but having a quick camera button would be awesome
Click to expand...
Click to collapse
I have done this mod, just search forum
thatdudebutch said:
I have done this mod, just search forum
Click to expand...
Click to collapse
I can't seem to get this to install. Any help would be greatly appreciated.
I don't know what's cooler, the fact that you hacked this up and released it, or that you released a detailed HOW-TO on the process.
Oh wait, it's definitely the HOW-TO. That's going the extra-mile for sure, and helping the community grow.
You're awesome!
Doesn't install for me. I select the apk, says it's a system app and do I want to replace, click yes, install, then it says "Installing.." for a few seconds before jumping to "Application not installed." No other errors. Any ideas?
You don't install system apps, you drop them into /system/app with adb or Root Explorer. Don't forget to delete Camera.odex if you're running stock, and clear Dalvik after no matter what.
edit -- the attached Clockwork zip *should* do all the above (delete the odex if it exists, clear the Camera's dalvik cache entry, and install the Camera apk into /system/app)
edit2 -- attached zip now has v2 of the mod
edit2.1 -- attached zip now has uncorrupted v2.1 of the mod
Wow, nice job!
I would be *very* interested if you could point me in any direction that might help understand how you knew what lines to change, and what to change them to.
I'm trying to modify a few apks, and I've been digging through all the smali files, but I can't seem to find anything that makes any sense. I see a lot of things that might be what I need to change, but it's not obvious enough to know for sure if, or how, to change it.
s44 said:
You don't install system apps, you drop them into /system/app with adb or Root Explorer. Don't forget to delete Camera.odex if you're running stock, and clear Dalvik after no matter what.
edit -- the attached Clockwork zip *should* do all the above (delete the odex if it exists, clear the Camera's dalvik cache entry, and install the Camera apk into /system/app)
Click to expand...
Click to collapse
Thanks. Putting it in /system/app worked.
Updated OP with v2.
Let me know if everything is fully functional. Thanks!
I'm getting FC with v2
Edit: I tried both the .zip and manually replacing the apk
Sent from my SCH-I500 using XDA App
Joshuaboyzn said:
I'm getting FC with v2
Sent from my SCH-I500 using XDA App
Click to expand...
Click to collapse
Does v1 work?
GizmoDroid said:
Does v1 work?
Click to expand...
Click to collapse
Yes. V1 worked for me.
Sent from my SCH-I500 using XDA App
Will you try installing s44's zip file through CWM?
-deleted because my v2 upload was corrupted-

[MOD][HOWTO] Disabling Autorotation in Call and Alarm Clock

Hi
After study Phone.apk and ClockPackage.apk I've found how to disable properly the autorotation:
Disable autorotation in Phone.apk (only in callscreen)
Decompile Phone.apk
Locate com/android/phone/InCallScreen.smali
Locate method onConfigurationChanged
Search:
Code:
invoke-super {p0, p1}, Landroid/app/Activity;->onConfigurationChanged(Landroid/content/res/Configuration;)V
.line 6650
iget v0, p0, Lcom/android/phone/InCallScreen;->mOrientation:I
iget v1, p1, Landroid/content/res/Configuration;->orientation:I
if-ne v0, v1, [B][SIZE="4"]:cond_2[/SIZE][/B]
Replace by:
Code:
invoke-super {p0, p1}, Landroid/app/Activity;->onConfigurationChanged(Landroid/content/res/Configuration;)V
# .line 6650
# iget v0, p0, Lcom/android/phone/InCallScreen;->mOrientation:I
# iget v1, p1, Landroid/content/res/Configuration;->orientation:I
# if-ne v0, v1, [B][SIZE="4"]:cond_2[/SIZE][/B]
const/4 v0, 0x1
invoke-virtual {p0, v0}, Lcom/android/phone/InCallScreen;->setRequestedOrientation(I)V
goto [B][SIZE="4"]:cond_2[/SIZE][/B]
Noticie :cond_2 . You have to use same condition number, maybe when you decompile then you will get another number, in last baksmali I get another number
Compile new Phone.apk and zipalign
Replace classes.dex from new Phone.apk to original Phone.apk and replace it in your phone
You can install manually using adb in recovery mode
Extract Phone.apk from zip file and follow next steps in a command shell
Code:
adb root
adb push Phone.apk /system/app/Phone.apk
adb shell mount -o rw -t ext4 /dev/block/mmcblk0p10 /data
adb shell rm -f /data/dalvik-cache/*phone*
adb shell rm -f /data/dalvik-cache/*Phone*
adb shell sync
Now Autorotation is disabled in call screen
Modified Phone.apk ONLY FOR LITENING 6.1 (CMW)
http://www.mediafire.com/?wvhxynux1v3e83u
Disable autorotation in ClockPackage.apk (only when alarm is running)
Decompile ClockPackage.apk
Locate com/sec/android/app/clockpackage/alarm/AlarmAlert.smali
Locate method onConfigurationChanged
Search:
Code:
.end local v0 #config:Landroid/content/res/Configuration;
.end local v4 #r:Landroid/content/res/Resources;
:cond_1
iget-object v5, p0, Lcom/sec/android/app/clockpackage/alarm/AlarmAlert;->mItem:Lcom/sec/android/app/clockpackage/alarm/AlarmItem;
iget v5, v5, Lcom/sec/android/app/clockpackage/alarm/AlarmItem;->activate:I
Replace by:
Code:
.end local v0 #config:Landroid/content/res/Configuration;
.end local v4 #r:Landroid/content/res/Resources;
:cond_1
const/4 v5, 0x1
invoke-virtual {p0, v5}, Lcom/sec/android/app/clockpackage/alarm/AlarmAlert;->setRequestedOrientation(I)V
iget-object v5, p0, Lcom/sec/android/app/clockpackage/alarm/AlarmAlert;->mItem:Lcom/sec/android/app/clockpackage/alarm/AlarmItem;
iget v5, v5, Lcom/sec/android/app/clockpackage/alarm/AlarmItem;->activate:I
Modified ClockPackage.apkONLY FOR LITENING 6.1 (CMW)
http://www.mediafire.com/?cj8k0ieck6sd3vv
hello,
installed by CMW, tested and ok for me.
Thanks for your good job
vadatte said:
hello,
installed by CMW, tested and ok for me.
Thanks for your good job
Click to expand...
Click to collapse
Thks for your report
rodries said:
Hi
Attached modified Phone.apk ONLY FOR LITENING 6.1 (CMW) Probably you will have to clean dalvik cache
Click to expand...
Click to collapse
Thank u very much !!! Workin well ! No dalvik cache cleenin!
It`s working only on Litening 6.1????
Is there solution for alarm clock ? I can't catch the arrow while its ringing
--------------------------------
Sent From ® Galaxy S II using Tapatalk
Остап said:
Is there solution for alarm clock ? I can't catch the arrow while its ringing
--------------------------------
Sent From ® Galaxy S II using Tapatalk
Click to expand...
Click to collapse
if you explain me the problem exactly i can try to fix it
078gregory said:
It`s working only on Litening 6.1????
Click to expand...
Click to collapse
Not sure but if you attach your phone.apk i can try to fix it for you
rodries said:
if you explain me the problem exactly i can try to fix it
Click to expand...
Click to collapse
A problem is the same. Autorotation while alarm is ringing.
rodries said:
Another Change:
- Adjust buttons properly if you receive the call in landscape mode
Click to expand...
Click to collapse
I see the some bug here. It's difficult to explain and very difficult to get screenshot because it occurs not every time ...
I'll try. Sometimes at the end of conversation or at time of it but while putting down the telephone and landscaping him ( when proximity sensor do not sense an ear ) all buttons shrinking. It's looking ugly. You need to try some playing with it and you'll see
I hope it helps to understand what i meen ....
Остап said:
I see the some bug here. It's difficult to explain and very difficult to get screenshot because it occurs not every time ...
I'll try. Sometimes at the end of conversation or at time of it but while putting down the telephone and landscaping him ( when proximity sensor do not sense an ear ) all buttons shrinking. It's looking ugly. You need to try some playing with it and you'll see
I hope it helps to understand what i meen ....
Click to expand...
Click to collapse
Uhmm, I can't reproduce, but I know what you mean.
I'm going to do a little change for testing.
rodries said:
Uhmm, I can't reproduce, but I know what you mean.
I'm going to do a little change for testing.
Click to expand...
Click to collapse
Yeah. Good if you are understanding
It's like 5-6 buttons in the row from gorizontal ( landscape ) position suddenly place themselves on vertical position. And the ugly effect of it - that the buttons appear to be very thin
Остап said:
A problem is the same. Autorotation while alarm is ringing.
Click to expand...
Click to collapse
Ok test this CMW zip file (ony for Litening 6.1) (Always make a backup before test)
http://www.mediafire.com/?cj8k0ieck6sd3vv
If works feel free to redistribute
Остап said:
Yeah. Good if you are understanding
It's like 5-6 buttons in the row from gorizontal ( landscape ) position suddenly place themselves on vertical position. And the ugly effect of it - that the buttons appear to be very thin
Click to expand...
Click to collapse
Try this new mod & comment
http://www.mediafire.com/?wvhxynux1v3e83u
Thanks for quick reply !!! Downloaded ( BOTH )and i'll test it and report !
rodries said:
Ok test this CMW zip file (ony for Litening 6.1) (Always make a backup before test)
http://www.mediafire.com/?cj8k0ieck6sd3vv
If works feel free to redistribute
Click to expand...
Click to collapse
Works perfect !!! Thank u very much !
Остап said:
Works perfect !!! Thank u very much !
Click to expand...
Click to collapse
OK
Waiting your report about buttons problem in call screen, if you think is working fine I'll update main post with the changes
rodries said:
OK
Waiting your report about buttons problem in call screen, if you think is working fine I'll update main post with the changes
Click to expand...
Click to collapse
I've a 3 only conversations today and haven't seen any issues about shrinking buttons. I hope it solved. I'll continue to supervise this. I suppose you can update your code.
And if it possible to release code of ClockPackage.apk at the first post
And if you want to change the name of this thread a little bit for easyest searching.
You are great ! Thanks !
Остап said:
I've a 3 only conversations today and haven't seen any issues about shrinking buttons. I hope it solved. I'll continue to supervise this. I suppose you can update your code.
And if it possible to release code of ClockPackage.apk at the first post
And if you want to change the name of this thread a little bit for easyest searching.
You are great ! Thanks !
Click to expand...
Click to collapse
Thks for report
Ok, I'll try to update the first post, my problem is that my english is not very good
Another problem is that I don't remember the ClockPackage changes p but I'll do a diff
Can you recommend me a thread name?
rodries said:
Thks for report
Ok, I'll try to update the first post, my problem is that my english is not very good
Another problem is that I don't remember the ClockPackage changes p but I'll do a diff
Can you recommend me a thread name?
Click to expand...
Click to collapse
You are coder, no ? ALWAYS wrap your code with comment !
Code:
# Begin Rodries No Rotation
....
# End Rodries No Rotation
It's simple to find the changes after )))
My english is the same
"[MOD][HOWTO] Disabling Autorotation in Call and Alarm Clock"

[HOW TO] [4.1.2] [LS8] Proper disable HOME BUTTON LAG (Apex support)(improved)

Hello xda'ers,
someone reading the title may say: but we still have no home button lag!
You could link me Oliwe's mod but this is a different thing.
His fix or mod consist to disable mHomeKeyDoubleClickConcept launching directly launchHomeFromHotKey()V method.
Nothing bad until you hate to have double click feature to launch vlingo (or voice commands).
If you want NO LAG and keep the double click feature?
Now there s a real fix to the home button lag, no workaround, no disabling samsung features! :victory:
We need to place a single line into a .smali file inside our android.policy.jar called PhoneWindowManager.smali.
This mod it s really simple to do, there s no :cond_xx to replace, add or remove.
Simply add green part
JELLY BEAN LS8
Code:
.line 3267
.end local v38 #statusbar:Lcom/android/internal/statusbar/IStatusBarService;
:cond_304
:goto_304
const/16 v46, 0x0
move/from16 v0, v46
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
[COLOR="DarkGreen"]invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->launchHomeFromHotKey()V[/COLOR]
Now we launch home before double click is recognized, but.. we re doing this twice, so we need to delete the second launch.
In fact if we take a look at PhoneWindowManager$HomeKeyDoubleClickConcept.smali we can see, at the end of singleClickJob()V method (red lines)
Code:
[COLOR="Red"]if-eqz v7, :cond_93[/COLOR]
const-string v7, "HomeKeyDoubleClick"
const-string v8, " in singleClickJob(), mSentHomeDownToApp is false. Now call launchHomeFromHotKey()"
invoke-static {v7, v8}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 8201
[COLOR="Red"] :cond_93
iget-object v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
invoke-virtual {v7}, Lcom/android/internal/policy/impl/PhoneWindowManager;->launchHomeFromHotKey()V
[/COLOR] goto :goto_48
.line 8203
:cond_99
iget-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->DEBUG:Z
if-eqz v7, :cond_48
const-string v7, "HomeKeyDoubleClick"
const-string v8, " in singleClickJob(), mSentHomeDownToApp is true. now set mSentHomeDownToApp to false and do nothing."
invoke-static {v7, v8}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_48
.end method
that we re launching again "launchhomefromhotkey" method, so we need to delete the red lines.
This will fix home button lag, won t let u return on default homescreen (but u will get the homescreen u were before) and no more problem with apex or other non touchwiz launchers.
it s so easy that maybe samsung someday will implement it this way lol
that s all.
Easy to do
recompile and enjoy your no lag home button with double click feature.
need a zip? Send me your android.policy.jar or request this mod to your rom maker.
ICS
Search: .line 2232, you will get:
Code:
.line 2232
:cond_207
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
move/from16 v39, v0
if-eqz v39, :cond_2b3
if-nez v8, :cond_2b3
.line 2233
const/16 v39, 0x0
move/from16 v0, v39
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
at the end of this code add:
Code:
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->launchHomeFromHotKey()V
So it will looks like this:
Code:
.line 2232
:cond_207
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
move/from16 v39, v0
if-eqz v39, :cond_2b3
if-nez v8, :cond_2b3
.line 2233
const/16 v39, 0x0
move/from16 v0, v39
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->launchHomeFromHotKey()V
that s all.
Easy to do
recompile and enjoy your no lag homebutton with double click feature.
Awesome
Sent from my S II ( "Jelly Bean'd Monster" )
As always, great job Mirko :good:
Hi, This method is successful for Lockscreen Home button lag on Stock rom 4,04 ?
Nasty_z said:
Awesome
Sent from my S II ( "Jelly Bean'd Monster" )
Click to expand...
Click to collapse
Thanks
salesale said:
As always, great job Mirko :good:
Click to expand...
Click to collapse
thx mate, did u try?
pnhsp said:
Hi, This method is successful for Lockscreen Home button lag on Stock rom 4,04 ?
Click to expand...
Click to collapse
What u mean?
Inviato dal mio GT-I9100 con Tapatalk 2
Great job as always mirko. :good:
I was wondering if u could write a similar guide on creating expandable volume controls. Saw it in the github sometimes ago. I tried comparing files to no result.
kamdev said:
Great job as always mirko. :good:
I was wondering if u could write a similar guide on creating expandable volume controls. Saw it in the github sometimes ago. I tried comparing files to no result.
Click to expand...
Click to collapse
yup, it s pretty hard to compare expandable volume controls, there are lots of diffs.
I will look into a simpler way, and maybe posting the how to, but i l need time.
So.. This requires a deodexed ROM. huh?
Hi folks,
Can someone modify my android.policy.jar ? (attached file)
The home button lag makes me sick
I've tried but I was unable to find the required file to modify it.
Thanks in advance
KcLKcL said:
So.. This requires a deodexed ROM. huh?
Click to expand...
Click to collapse
sure
dany__ said:
Hi folks,
Can someone modify my android.policy.jar ? (attached file)
The home button lag makes me sick
I've tried but I was unable to find the required file to modify it.
Thanks in advance
Click to expand...
Click to collapse
thread is for devs or people who can use tools and for help
No requests please
tutorial updated to jelly bean leak LSJ
There is a built in setting in jb leak in the voice command app to disable the double home button press.
Sent from my GT-I9100 using Tapatalk 2
hikarugo said:
There is a built in setting in jb leak in the voice command app to disable the double home button press.
Sent from my GT-I9100 using Tapatalk 2
Click to expand...
Click to collapse
Hello hikarugo. I don t wanna disable voice command, i wanna disable the lag xD.
Have both, that s the mod
Hi Mirko, thanks for the guide, but there is a different behavior at least in MIUI ICS if I use your guide.
Lets assume there is 3 home screen pages and the second one is set to home screen. If I start an app from the first screen page and then pressing home button, it will go to the second page instead staying in the current page which is the first page.
The only thing to make stay on the current page is to remove the "PhoneWindowManager$HomeKeyDoubleClickConcept;->addAction(IIZ)V" like in the Oliwe guide.
If you have another workaround, I'll be appreciate it. Thanks.
mirko are you going to relase a new rom or what?
fusionjack said:
Hi Mirko, thanks for the guide, but there is a different behavior at least in MIUI ICS if I use your guide.
Lets assume there is 3 home screen pages and the second one is set to home screen. If I start an app from the first screen page and then pressing home button, it will go to the second page instead staying in the current page which is the first page.
The only thing to make stay on the current page is to remove the "PhoneWindowManager$HomeKeyDoubleClickConcept;->addAction(IIZ)V" like in the Oliwe guide.
If you have another workaround, I'll be appreciate it. Thanks.
Click to expand...
Click to collapse
yes buddy, same behaviour here too.
but i really prefer to back in my homescreen soon and preserve a samsung feature instead of disabling voice command (erasing that line u will erase the feature), and wouldn t be any reason to make a tutorial after Oliwe's one, right?
anyway, if u are on miui there s no reason to use this tutorial, since miui shouldn t have doubleclick feature, or am i missing something? (i m not a miui user )
reply back
malavan said:
mirko are you going to relase a new rom or what?
Click to expand...
Click to collapse
hello mal
sincerely i thought to make it with legendk95 as before, but in the last times we re going wrong.. so i don t know, probably yes.
Mirko ddd said:
yes buddy, same behaviour here too.
but i really prefer to back in my homescreen soon and preserve a samsung feature instead of disabling voice command (erasing that line u will erase the feature), and wouldn t be any reason to make a tutorial after Oliwe's one, right?
anyway, if u are on miui there s no reason to use this tutorial, since miui shouldn t have doubleclick feature, or am i missing something? (i m not a miui user )
reply back
Click to expand...
Click to collapse
LOL..sure.
MIUI basically is using manufacture ROM for each device, so I see similar code in MIUI and yes, it has also lag by pressing home button.
I never use voice command, therefore I don't know if MIUI for Galaxy S2 really supports this double-click feature.
fusionjack said:
LOL..sure.
MIUI basically is using manufacture ROM for each device, so I see similar code in MIUI and yes, it has also lag by pressing home button.
I never use voice command, therefore I don't know if MIUI for Galaxy S2 really supports this double-click feature.
Click to expand...
Click to collapse
lol!! so disable directly the doubletap feature following Oliwe's tutorial
mh i gotta update the code, i made it wrong lol

[MOD] Enable Double Press Power for Camera on stock ROM

This will enable the double press power for camera gesture on the stock ROM. On MiFavor 5.0 this will only work when the screen is on due to some zte service preventing it from working when screen is off (not surprised).
Decompile Settings_ZTE and open res/xml/display_settings.xml
Change
Code:
<SwitchPreference android:title="@string/camera_gesture_title" android:key="camera_gesture" android:summary="@string/camera_gesture_desc" />
to
Code:
<SwitchPreference android:title="@string/camera_double_tap_power_gesture_title" android:key="camera_double_tap_power_gesture" android:summary="@string/camera_double_tap_power_gesture_desc" />
Open smali/com/android/settings/DisplaySettings.smali
Go to
Code:
.method private updateState()V
Everywhere you see
Code:
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mCameraGesturePreference:Lcom/zte/mifavor/support/v7/preference/SwitchPreference;
Change to
Code:
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mCameraDoubleTapPowerGesturePreference:Lcom/zte/mifavor/support/v7/preference/SwitchPreference;
Change
Code:
const-string/jumbo v6, "camera_gesture_disabled"
to
Code:
const-string/jumbo v6, "camera_double_tap_power_gesture_disabled"
Go to
Code:
.method public onCreate(Landroid/os/Bundle;)V
Change
Code:
const-string/jumbo v6, "camera_double_tap_power_gesture"
invoke-virtual {p0, v6}, Lcom/android/settings/DisplaySettings;->removePreference(Ljava/lang/String;)V
to
Code:
const-string/jumbo v6, "camera_double_tap_power_gesture"
invoke-virtual {p0, v6}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Lcom/zte/mifavor/support/v7/preference/Preference;
move-result-object v6
check-cast v6, Lcom/zte/mifavor/support/v7/preference/SwitchPreference;
iput-object v6, p0, Lcom/android/settings/DisplaySettings;->mCameraDoubleTapPowerGesturePreference:Lcom/zte/mifavor/support/v7/preference/SwitchPreference;
iget-object v6, p0, Lcom/android/settings/DisplaySettings;->mCameraDoubleTapPowerGesturePreference:Lcom/zte/mifavor/support/v7/preference/SwitchPreference;
invoke-virtual {v6, p0}, Lcom/zte/mifavor/support/v7/preference/SwitchPreference;->setOnPreferenceChangeListener(Lcom/zte/mifavor/support/v7/preference/Preference$OnPreferenceChangeListener;)V
For MiFavor 5.0 use v0 instead of p0.
Go to
Code:
.method public onPreferenceChange(Lcom/zte/mifavor/support/v7/preference/Preference;Ljava/lang/Object;)Z
Change
Code:
iget-object v8, p0, Lcom/android/settings/DisplaySettings;->mCameraGesturePreference:Lcom/zte/mifavor/support/v7/preference/SwitchPreference;
to
Code:
iget-object v8, p0, Lcom/android/settings/DisplaySettings;->mCameraDoubleTapPowerGesturePreference:Lcom/zte/mifavor/support/v7/preference/SwitchPreference;
Change
Code:
const-string/jumbo v11, "camera_gesture_disabled"
to
Code:
const-string/jumbo v11, "camera_double_tap_power_gesture_disabled"
You may need to change the register numbers (v#) based on the surrounding code.
Recompile Settings_ZTE.
Huge thanks to @raystef66 for testing for me.
Can you make this steps for B32?
WesTD said:
Can you make this steps for B32?
Click to expand...
Click to collapse
This should work for any variant and any build
bkores said:
This should work for any variant and any build
Click to expand...
Click to collapse
I've couldn't get 3rd step. what should be new line?
WesTD said:
I've couldn't get 3rd step. what should be new line?
Click to expand...
Click to collapse
Code:
<item type="integer" name="zte_config_screenBrightnessDoze">17</item>
Doesn't work. No ambient display
WesTD said:
Doesn't work. No ambient display
Click to expand...
Click to collapse
Does it show up in settings or it just doesn't work?
Check to the OP and make sure you changed all the values. I added one that I forgot.
bkores said:
Does it show up in settings or it just doesn't work?
Check to the OP and make sure you changed all the values. I added one that I forgot.
Click to expand...
Click to collapse
No in settings
WesTD said:
No in settings
Click to expand...
Click to collapse
Did you make sure you modified all the values in the OP? Like I said I added one I forgot.
If you did try removing the following from Settings_ZTE/smali/com/android/settings/DisplaySettings.smali
Code:
.line 594
invoke-static {v2}, Lcom/android/settings/zte/MFVSysResource;->getResId(I)I
move-result v2
bkores said:
Did you make sure you modified all the values in the OP? Like I said I added one I forgot.
If you did try removing the following from Settings_ZTE/smali/com/android/settings/DisplaySettings.smali
Click to expand...
Click to collapse
Did you try and worked on b32?
BTW, I've make all steps
WesTD said:
Did you try and worked on b32?
BTW, I've make all steps
Click to expand...
Click to collapse
No I didn't try it because I just assumed it would work since those modifications have worked on every ROM I've used them on. But of course ZTE messed something up, as usual.
@WesTD I updated the OP with a new method that should work.
So this requires a root?
could you send us the modificated apk?
so we could replace it manually without decompiling and compiling the apk since i dont know how to do it.
Better yet, maybe teach a man to fish.. I wouldn't mind learning this
JackTheBest said:
could you send us the modificated apk?
so we could replace it manually without decompiling and compiling the apk since i dont know how to do it.
Click to expand...
Click to collapse
I'm sorry but I will not as the point is to do it yourself.
bkores said:
I'm sorry but I will not as the point is to do it yourself.
Click to expand...
Click to collapse
Could you at least tell us what tools we should use?
And what compiler you used since there's more than just one.
JackTheBest said:
Could you at least tell us what tools we should use?
And what compiler you used since there's more than just one.
Click to expand...
Click to collapse
I used APKTool and oat2dex. I'll write a guide on using these tools in general to modify apks on the Axon 7.
@JackTheBest I made a guide here: https://forum.xda-developers.com/axon-7/how-to/guide-modifying-apk-jar-files-axon-7-t3697945
Sorry guys I updated the OP with an extra step that I forgot. ZTE really went to extreme lengths to disable this function. Instead of just removing the one line in the display_settings.xml file they chose to disable it in the code itself. ZTE really needs better engineers because this is pissing me off.
My rant of the day

[MOD][GUIDE] Enable ro.config.media_vol_steps Functionality in HiFi Mode

A little while ago I made this mod that lets you set a custom value to apply to all volume sliders. I found it pretty handy, but it got a little annoying how every slider was affected, and a lot would move extremely slowly because of their tiny scaling.
Well I'm back, this time with a slightly different mod. This one only affects the HiFi volume step count, but it does it in a standard way. You might know about the build.prop key AOSP uses (ro.config.media_vol_steps) to customize the number of volume steps allowed. For whatever reason, LG disabled this behavior for the media volume (laziness? who knows...), including HiFi. I figured out how to simultaneously make the HiFi steps be 1 and have LG actually listen to that build.prop value.
Right now, I have `ro.config.media_vol_steps=100` in my build.prop and can confirm the slider does actually have 100 steps now.
I'm attaching two JARs. The US version should work with most variants, while the 990DS version is for the H990 variants, assuming the US version doesn't work.
Do It Manually:
- As before, I'm not going to give instructions on decompiling JARs and ODEXes. You'll have to do that yourself.
- If you applied my previous mod, RESTORE YOUR BACKUP before proceeding!
- Decompile your services.jar and open the following file in a text editor (I use Sublime because it has a Smali highlighting plugin):
Code:
- com/android/server/audio/AudioService.smali
- Find the following block of code (it may not be exactly the same, so just search for the string you see at the top):
Code:
const-string/jumbo v2, "ro.config.media_vol_steps"
.line 743
sget-object v3, Lcom/android/server/audio/AudioService;->MAX_STREAM_VOLUME:[I
const/4 v4, 0x3
aget v3, v3, v4
.line 742
invoke-static {v2, v3}, Landroid/os/SystemProperties;->getInt(Ljava/lang/String;I)I
move-result v13
.line 744
sget-object v2, Lcom/android/server/audio/AudioService;->MAX_STREAM_VOLUME:[I
const/4 v3, 0x3
aget v2, v2, v3
if-eq v13, v2, :cond_1
.line 745
sget-object v2, Lcom/android/server/audio/AudioService;->MAX_STREAM_VOLUME:[I
const/4 v3, 0x3
aput v13, v2, v3
.line 746
sget-object v2, Landroid/media/AudioSystem;->DEFAULT_STREAM_VOLUME:[I
mul-int/lit8 v3, v13, 0x3
div-int/lit8 v3, v3, 0x4
const/4 v4, 0x3
aput v3, v2, v4
.line 750
:cond_1
- At the bottom, right above .line ***, add this:
Code:
sget-object v3, Lcom/android/server/audio/AudioService;->MAX_STREAM_VOLUME:[I
const/4 v4, 0x3
aget v3, v3, v4
sput v3, Lcom/android/server/audio/AudioService;->MAX_MUSIC_STREAM_VOLUME:I
- About 24 lines or so down, look for this block:
Code:
if-eqz v2, :cond_2
.line 751
const/4 v2, 0x1
sput-boolean v2, Lcom/android/server/audio/AudioService;->mHifiDacSupported:Z
.line 752
const/4 v2, 0x5
sput v2, Lcom/android/server/audio/AudioService;->HIFI_MEDIA_VOLUME_OFFSET:I
.line 754
:cond_2
- At the bottom, you'll notice a const/4 v2 variable, with a value of 0x5. Change the value to 0x1.
- Recompile, copy in, set permissions, and it should be good to go.
@Zacharee1 working great, thanks! I do notice that now when the volume is raised to 11 that I get the warning about hearing damage... is it possible to change that to maybe 15 or 16?
also is it possible to also do this for Bluetooth? seems like it's either too loud or too low when I use with earbuds
@Zacharee1
Working good on my H990DS
I think H990DS uses a different approach..
When i replaced the service jar file.. I could see only 15 steps for Hifi Volume.
The behaviour is same for HIFI or without HIFI
When build.prop value is changed to 100
it now has 100 steps. with or without HIFI with 1 increment
Warning for high volume is triggers on 10
Screenshot added
Can some one confirm the stock value. For other sliders. I am just confused..
All other sliders have 15 steps right..?
I don't see ro.congig.media_vol_steps in build.prop
Sent from my LG-H990 using Tapatalk
Squadala said:
I don't see ro.congig.media_vol_steps in build.prop
Click to expand...
Click to collapse
You have to add this line
damonthegreat said:
dammit! even the h990ds jar makes my h990ds bootlop. is there any hope?
Click to expand...
Click to collapse
Is your system modified..?
DS service jar is based on 10g.
Can you confirm the stock volume steps for ringtone/notification is it 15.?
ahmedyar91 said:
Screenshot added
Can some one confirm the stock value. For other sliders. I am just confused..
All other sliders have 15 steps right..?
Click to expand...
Click to collapse
The HiFi slider is normally up to 75 with 5 increment steps. With this mod, the steps are 1 increment, so the default max becomes 15. If I force it to 75, ARISE breaks, and it might even be broken still. If it's broken anyway, I'll set the default to 75.
Zacharee1 said:
The HiFi slider is normally up to 75 with 5 increment steps. With this mod, the steps are 1 increment, so the default max becomes 15. If I force it to 75, ARISE breaks, and it might even be broken still. If it's broken anyway, I'll set the default to 75.
Click to expand...
Click to collapse
Its not a big deal though.
After changing in build.prop..
The slider has 100 value with 1 increment and thats perfectly fine..
But the problem here is that it changes the media slider (without HIFI) to 100 as well..
ahmedyar91 said:
Its not a big deal though.
After changing in build.prop..
The slider has 100 value with 1 increment and thats perfectly fine..
But the problem here is that it changes the media slider (without HIFI) to 100 as well..
Click to expand...
Click to collapse
That's intended.
Zacharee1 said:
This one only affects the HiFi volume step count, but it does it in a standard way.
Click to expand...
Click to collapse
May be I got confused because of this line..
BTW in your previous MOD the increment value without earphones was 5,
I think 1 incremental value for HIFI is perfect, but without earphones it should be 5.
ahmedyar91 said:
May be I got confused because of this line..
BTW in your previous MOD the increment value without earphones was 5,
I think 1 incremental value for HIFI is perfect, but without earphones it should be 5.
Click to expand...
Click to collapse
I don't think I can do that.
Zacharee1 said:
I don't think I can do that.
Click to expand...
Click to collapse
Its not an issue
Thanks a ton Zac..
Cheers, working excellent on a H990DS running latest v11i!
To disable the volume warning, use this command from a computer:
Code:
adb shell settings put global audio_safe_volume_state 1
1 means disabled.
2 means inactive.
3 means enabled.
damonthegreat said:
if you are refering to the line "ro.config.vc_call_vol_steps" then no, it's actually 7.
and how can you get 10g if you can't get past December 2016 firmware on a rooted h990ds?
Click to expand...
Click to collapse
Use KDZ writer to update to the latest firmware
ahmedyar91 said:
Use KDZ writer to update to the latest firmware
Click to expand...
Click to collapse
How? Step by step
Sent from my LG-H990 using Tapatalk
---------- Post added at 08:49 PM ---------- Previous post was at 08:40 PM ----------
ahmedyar91 said:
Use KDZ writer to update to the latest firmware
Click to expand...
Click to collapse
Do I need to update? Can't I just change it to 15?
Sent from my LG-H990 using Tapatalk
Squadala said:
How? Step by step
Click to expand...
Click to collapse
Go to KDZ writer thread.. There's a step by step guide..
Yes you should update.. The service jar based on the latest firmware
damonthegreat said:
i'm downloading the middle east 10g. is that good? would downloading from other regions mess up my phone?
---------- Post added at 10:08 PM ---------- Previous post was at 09:46 PM ----------
i'm using this guide but it's still confusing which command to use:
https://forum.xda-developers.com/v20/development/tool-kdz-writer-t3649818
any help?
Click to expand...
Click to collapse
You can use other region's firmware.. But its recommended to use your default region..
Yeah it is a little confusing..
Ask me I'll help
@Zacharee1 I just updated my US996 to 10n and noticed this mod now causes my device to reboot if I change my brightness to auto. would you be able to look into this? let me know what you need from me
Anyone using WakeBlock, update to the services.jar in the latest post of my Miscellaneous Mods threads ASAP!!!

Categories

Resources