Related
Guide: Adding/Removing Quick Settings to Stock Sense 2.1 SystemUI.apk On The ThunderBolt
Written by orkillakilla
Thanks to Ihtpf69 for his work on the extra quick settings and helping me add them.
Thanks also to Thunderstick for his help in showing me how to add them.
THIS IS NOT FOR BEGINNERS!!!!!
NOTE: This will not work on the newest MR4 leak, which has Sense 3.0. I'm am currently working on getting the quick settings added to that, but is taking some time to figure things out and work out the kinks. I will update the guide when I have everything working.
I will be using apktool for this guide. I don’t like apkmanager. I will be demonstraighting how to add Flashlight and Reboot. (7n1 Volume, Task Manager, Auto-Rotate, and Brightness are enabled by some edits already made to the modded QuickSettings.smali)
Prerequisites:
apktool (and knowledge of how to use it)
SystemUI.apk
xml editor (i use gedit)
ADB (to push apk for testing)
Quick Settings smali files and graphics:
http://thisismyandroid.com/?dir=orkillakilla/Quick Setting Files (please note that these files are the work of Ihtpf69 of TeamBAMF and he has given me permission to mirror the files for this guide)
Important
To have the Task Manager quick setting work properly, you must install the HTC Task Manager apk which is available at the quicksetting files link above (easiest way is to push via adb to /system/app or to add to /system/app when cooking a ROM)
To have the reboot options work correctly, you must be on a ROM that has the extended reboot options already enabled, or add the additional reboot smali files found with the other quick settings files you downloaded earlier to android.policy.jar:
replace PhoneWindowManager.smali and PhoneWindowManager$Reboot Receiver.smali found in /smali/android/internal/policy/impl/ with the ones you downloaded.
The section for removing quick settings is located at the very bottom of the post. (Thanks to Thunderstick for showing me how)
Step One:
First you will need to decompile SystemUI.apk Once you have that done, navigate to /res/drawable-hdpi. This is where all the icons for the notification bar and pulldown menu are stored.
You will need to place all the pgn files for Flashlight and Volume. No need to add anything for the other quicksettings as they are already there, just not implemented.
Step Two:
You will now navigate to /res/layout/quick_settings.xml and open it. What you are going to work with is this section:
Code:
<include android:id="@id/volume" layout="@layout/status_bar_preference" />
<include android:id="@id/brightness" layout="@layout/status_bar_preference" />
<include android:id="@id/rotation" layout="@layout/status_bar_preference" />
<include android:id="@id/wifi" layout="@layout/status_bar_preference" />
<include android:id="@id/hotspot" layout="@layout/status_bar_preference" />
<include android:id="@id/network" layout="@layout/status_bar_preference" />
<include android:id="@id/wimax" layout="@layout/status_bar_preference" />
<include android:id="@id/bluetooth" layout="@layout/status_bar_preference" />
<include android:id="@id/gps" layout="@layout/status_bar_preference" />
<include android:id="@id/settings" layout="@layout/status_bar_preference" />
<include android:id="@id/task_manager" layout="@layout/status_bar_preference" />
This determined which options are shown where. You can move them around to your preference. Say if you want the brightness above the volume, simply move the brightness entry above the volume entry.
To add the flashlight and reboot, you will need to manually add them, keeping the same style that is already there:
Code:
<include android:id="@id/flashlight" layout="@layout/status_bar_preference" />
And the same for reboot. Put them where you want them to show up.
Step Three:
You will now navigate to /res/values/ids.xml
At the bottom right above , you need to add ids for reboot and volume.
Code:
<item type="id" name="flashlight">false</item>
and same for reboot. It doesn’t matter which you add first.
Step Four:
Navigate to /res/values/strings.xml You will need to add a string for Flashlight, so that the word Flashlight appears on the quick setting.
At the bottom, add the following:
Code:
<string name="status_bar_quick_settings_flashlight">Flashlight</string>
Step Five:
Note: The resource ids I will be using are for a stock Sense 2.1 SystemUI.apk. Resource ids must be in acending order, and you cannot skip numbers, or create your own random id.
Navigate to /res/values/public.xml
This is one of the tricky parts. You have to give everthing you’ve added so far (all the drawable icons, the ids, and the string) a resource id.
We will start with the ids. At the very bottom of the xml file, above </resources>, add the id’s for reboot and flashlight:
Code:
<public type="id" name="flashlight" id="0x7f0a0055" />
the id number is an example.
You will need to make the flashlight id number one more than the previous. For example:
If the id “close” has and id number of 0x7f0a0054, then flashlight needs to be 0x7f0a0055, and reboot needs to be 0x7f0a0056. You cannot skip numbers, or make your own.
Now we will give the string and id number. Scroll to the last string entry, and add flashlight right below it:
Code:
<public type="string" name="status_bar_quick_settings_flashlight" id="0x7f080034" />
Again, if the string above the new flashlight string’s id is 0x7f080033, then flashlight must be 0x7f080034
Here is the tedious part. We must give all the drawable icons a resource id.
Scroll to the last drawable entry, and begin adding your icons. The name must be the exa
Reason for Editing:
ct name of the icons file name.
Begin with the flashlight icons:
Code:
<public type="drawable" name="widget_flashlight_off" id="0x7f020190" />
<public type="drawable" name="widget_flashlight_on" id="0x7f020191" />
Now the Volume icons:
Code:
<public type="drawable" name="widget_icon_sound_alarm" id="0x7f020192" />
<public type="drawable" name="widget_icon_sound_bluetooth" id="0x7f020193" />
<public type="drawable" name="widget_icon_sound_dtmf" id="0x7f020194" />
<public type="drawable" name="widget_icon_sound_media" id="0x7f020195" />
<public type="drawable" name="widget_icon_sound_notifications" id="0x7f020196" />
<public type="drawable" name="widget_icon_sound_ringtone" id="0x7f020197" />
<public type="drawable" name="widget_icon_sound_settings" id="0x7f020198" />
<public type="drawable" name="widget_icon_sound_voice" id="0x7f020199" />
Step Six:
We will now be moving from the /res folder, to the /smali folder.
Navigate to /smali/com/android/systemui/statusbar/preference
You will now add the smali files you downloaded here. Delete the original QuickSettings.smali and add the modded one, renaming it to QuickSettings.smali
Now open the QuickSettings.smali.
Scroll down to .line 59 You will see under that “new-instance”. When you see that, a new quick settings has started.
Scroll down till you see:
Code:
new-instance v4, Lcom/android/systemui/statusbar/preference/BT;
We are going to use this for our flashlight.
Copy the following to the clipboard:
Code:
new-instance v4, Lcom/android/systemui/statusbar/preference/BT;
iget-object v5, p0, Lcom/android/systemui/statusbar/preference/QuickSettings;->mContext:Landroid/content/Context;
const v6, 0x7f0a001f
invoke-virtual {p0, v6}, Lcom/android/systemui/statusbar/preference/QuickSettings;->findViewById(I)Landroid/view/View;
move-result-object v6
invoke-direct {v4, v5, v6}, Lcom/android/systemui/statusbar/preference/BT;->(Landroid/content/Context;Landroid/view/View;)V
aput-object v4, v2, v3
.line 62
iget-object v2, p0, Lcom/android/systemui/statusbar/preference/QuickSettings;->mSettingItems:[Lcom/android/systemui/statusbar/preference/StatusBarPreference;
const/4 v3, 0x3
Now paste it right below const/4 v3, 0x3
You are now going to change BT to Flashlight (there are two of them). You will also change the following:
const v6, 0x7f0a001f
To the resource id you gave the id flashlight earlier in public.xml. For this example, it will be 0x7f0a0055
Now you will scroll down and find:
Code:
new-instance v4, Lcom/android/systemui/statusbar/preference/Settings;
You will copy this to the clipboard:
Code:
new-instance v4, Lcom/android/systemui/statusbar/preference/Settings;
iget-object v5, p0, Lcom/android/systemui/statusbar/preference/QuickSettings;->mContext:Landroid/content/Context;
const v6, 0x7f0a0021
invoke-virtual {p0, v6}, Lcom/android/systemui/statusbar/preference/QuickSettings;->findViewById(I)Landroid/view/View;
move-result-object v6
invoke-direct {v4, v5, v6}, Lcom/android/systemui/statusbar/preference/Settings;->(Landroid/content/Context;Landroid/view/View;)V
aput-object v4, v2, v3
.line 66
iget-object v2, p0, Lcom/android/systemui/statusbar/preference/QuickSettings;->mSettingItems:[Lcom/android/systemui/statusbar/preference/StatusBarPreference;
const/4 v3, 0x7
Again, you will change Settings to Reboot both times, and change the it to 0x7f0a0056.
Step Seven:
Now navigate to /smali/com/android/systemui/statusbar/preference/Flashlight.smali
Scroll down till you find this:
const v1, 0x7f080032
You will need to change that id to the one you gave your flashlight string. In this case it would be 0x7f080034.
Scroll down a bit more and find:
const v1, 0x7f02004a
and change that id to the id you gave your widget_flashlight_off icon. In this case it would be 0x7f020190.
Now near the bottom you will see:
const v1, 0x7f080032
again change it to 0x7f080034
Now navigate to /smali/com/android/systemui/statusbar/preference/Flashlight$1.smali
Scroll down till you see:
const v1, 0x7f020049
Change this id to the id you gave widget_flashlight_on. In this case it would be 0x7f020191.
Scroll down a bit more and change
const v1, 0x7f02004a
to const v1, 0x7f020190
Step Eight:
Navigate to /smali/com/android/systemui/statusbar/preference/Volume.smali
This is one of the trickiest parts.
If you scroll down, you will find an array that looks like this:
Code:
0x51t 0x0t 0x2t 0x7ft
0x52t 0x0t 0x2t 0x7ft
0x57t 0x0t 0x2t 0x7ft
0x53t 0x0t 0x2t 0x7ft
0x54t 0x0t 0x2t 0x7ft
0x55t 0x0t 0x2t 0x7ft
0x56t 0x0t 0x2t 0x7ft
0x52t 0x0t 0x2t 0x7ft
0x58t 0x0t 0x2t 0x7ft
These are actually the resource ids for your sound icons you’ve added.
Take the first line of the array, and read it right to left.
0x7ft is the first part of the resource id, (0x7f)020192. 0x2t is the next part 0x7f(02)0192. 0x0 is 0x7f02(00)92, which needs to be changed to 0x1. So now your resource id is 0x7f02(01)92.
The last part is the last 2 digits of the resource id.
So for the first line, if your resource id is 0x7f020192, then that line of the array should look like this:
Code:
0x92 0x1t 0x2t 0x7ft
Also, so you know what order the id's should go in, if you look a few lines up, you'll see this:
Code:
.local v8, res:Landroid/content/res/Resources;
const/4 v1, 0x0
const-string/jumbo v2, "Voice Volume"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string/jumbo v2, "System Volume"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string/jumbo v2, "Ringer Volume"
aput-object v2, v0, v1
const/4 v1, 0x3
const-string/jumbo v2, "Media Volume"
aput-object v2, v0, v1
const/4 v1, 0x4
const-string/jumbo v2, "Alarm Volume"
aput-object v2, v0, v1
const/4 v1, 0x5
const-string/jumbo v2, "Notification Volume"
aput-object v2, v0, v1
const/4 v1, 0x6
const-string/jumbo v2, "Bluetooth Volume"
aput-object v2, v0, v1
const/4 v1, 0x7
const-string/jumbo v2, "System Volume"
aput-object v2, v0, v1
const/16 v1, 0x8
const-string/jumbo v2, "DTMF Volume"
aput-object v2, v0, v1
That is the order in which the resource id's should read.
Step Nine:
Compile your app with apktool. If you followed this to the t, you shouldn’t get any errors.
If you don't want to sign the apk, take the Meta-INF and AndroidManifest.xml from the ORIGINAL apk and add them to the /SystemUI/build/apk folder, and recompile again. This ensures the apk is signed properly.
Now push your modded SystemUI.apk to your phone through adb.
Reboot.
When you boot up, you should have your additional quick settings.
How To Remove Quick Settings:
I prefer to remove some quick settings that I don't ever use, like the hotspot and bluetooth. I will now show you how to remove them. It's pretty simple.
Step One:
Navigate to /res/layout and open quick_settings.xml
Remove the line of the quick setting(s) you would like to remove.
Example: If you want the Hotspot quick setting removed, you would remove the following line:
Code:
<include android:id="@id/hotspot" layout="@layout/status_bar_preference" />
You may remove however many you wish.
Step Two:
Now you will navigate to /smali/com/android/systemui/statusbar/preference and open QuickSettings.smali
At the top, you will remove the entry for whatever quick settings you're removing.
Example:
Code:
.field private static final HOTSPOT:I = 0x5
Now search for Hotspot, or whatever quick setting your removing, and remove the following lines of code:
Code:
iget-object v2, p0, Lcom/android/systemui/statusbar/preference/QuickSettings;->mSettingItems:[Lcom/android/systemui/statusbar/preference/StatusBarPreference;
new-instance v3, Lcom/android/systemui/statusbar/preference/HotSpot;
iget-object v4, p0, Lcom/android/systemui/statusbar/preference/QuickSettings;->mContext:Landroid/content/Context;
const v5, 0x7f0a001c
invoke-virtual {p0, v5}, Lcom/android/systemui/statusbar/preference/QuickSettings;->findViewById(I)Landroid/view/View;
move-result-object v5
invoke-direct {v3, v4, v5}, Lcom/android/systemui/statusbar/preference/HotSpot;-><init>(Landroid/content/Context;Landroid/view/View;)V
aput-object v3, v2, v9
Save and recompile and your quick settings are gone. Enjoy!
Great write up man much thanks!
Awesome write up!!!
The steps should be the same for Sense 3.5 (still Gingerbread), correct?
I just got my Rezound and miss the CM7 notification bar to change settings, so I thought modifying the "Quick Settings" section would be the easiest. There are a lot of options in there I don't need, and many more I plan to add.
spitzaf said:
The steps should be the same for Sense 3.5 (still Gingerbread), correct?
I just got my Rezound and miss the CM7 notification bar to change settings, so I thought modifying the "Quick Settings" section would be the easiest. There are a lot of options in there I don't need, and many more I plan to add.
Click to expand...
Click to collapse
I haven't tried then on sense 3.5 but I would imagine it would be he same. Note that the resource ids would probably be different.
Sent from my HTC ThunderBolt powered by KillaSense 3.6
Thank you very much, orkillakilla! I own a Desire and have been trying to fix a bug with our port of quicksettings. Your guide proved invaluable to me, as i had problems with signing the SystemUI.apk.
Glad I can help devs of other devices!
orkillakilla said:
Glad I can help devs of other devices!
Click to expand...
Click to collapse
Hey man excellent writeup...I do have a couple questions regarding this.
I went through all the steps verbatim and my SystemUI would not rebuild. Then I figured I would further investigate. It seems that most, if not all roms with this built in, there is an error decompiling and then it will not recompile. The errors are always as follows:
Code:
Error occured while disassembling class Lcom.android.systemui.statusbar.preference.Reboot$1$1; - skipping class
java.lang.ArrayIndexOutOfBoundsException: 8
at org.jf.dexlib.Debug.DebugInstructionIterator.DecodeInstructions(DebugInstructionIterator.java:199)
at org.jf.baksmali.Adaptors.MethodDefinition.addDebugInfo(MethodDefinition.java:495)
at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:297)
at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:130)
at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:322)
at org.jf.baksmali.Adaptors.ClassDefinition.writeVirtualMethods(ClassDefinition.java:307)
at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:136)
at brut.androlib.mod.BaksmaliMod.disassembleDexFile(BaksmaliMod.java:188)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:48)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)
at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)
at brut.apktool.Main.cmdDecode(Main.java:120)
at brut.apktool.Main.main(Main.java:57)
I am using apktool 1.4.2 and have also tried 1.4.1 no luck. I am also using baksmali/smali 1.3.2 .I want to know if you try to re-decompile the SystemUI.apk from a rom that you have done this to, if you run into these areas. I am trying to find out if my smali/baksmali is out of date or what the issue is.
Thanks
dhemke17 said:
Hey man excellent writeup...I do have a couple questions regarding this.
I went through all the steps verbatim and my SystemUI would not rebuild. Then I figured I would further investigate. It seems that most, if not all roms with this built in, there is an error decompiling and then it will not recompile. The errors are always as follows:
Code:
Error occured while disassembling class Lcom.android.systemui.statusbar.preference.Reboot$1$1; - skipping class
java.lang.ArrayIndexOutOfBoundsException: 8
at org.jf.dexlib.Debug.DebugInstructionIterator.DecodeInstructions(DebugInstructionIterator.java:199)
at org.jf.baksmali.Adaptors.MethodDefinition.addDebugInfo(MethodDefinition.java:495)
at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:297)
at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:130)
at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:322)
at org.jf.baksmali.Adaptors.ClassDefinition.writeVirtualMethods(ClassDefinition.java:307)
at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:136)
at brut.androlib.mod.BaksmaliMod.disassembleDexFile(BaksmaliMod.java:188)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:48)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)
at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)
at brut.apktool.Main.cmdDecode(Main.java:120)
at brut.apktool.Main.main(Main.java:57)
I am using apktool 1.4.2 and have also tried 1.4.1 no luck. I am also using baksmali/smali 1.3.2 .I want to know if you try to re-decompile the SystemUI.apk from a rom that you have done this to, if you run into these areas. I am trying to find out if my smali/baksmali is out of date or what the issue is.
Thanks
Click to expand...
Click to collapse
Yeah, apktool doesn't like a few of the added smali files, so you can't properly decompile a SystemUI.apk with these already implemented. It is best to keep the working folder, that way if you want to make changes, you can.
Updated step nine to be more specific with the icon array in Volume.smali
Guide updated. I streamlined the process by removing a step that isn't necessary. Also added how to remove quick settings located at the bottom of the OP. Also fixed a few code bits that mysteriously disappeared...
Hello
I used your tutorial an now i have flashlight in quick settings.
But also i have 2 problems and maybe you can help me:
1) The text under the flashlight is not "on or off" it is "enter and space" . Screenshot in attach.
2) SystemUI.apk i took from user "m1ndh4x8r" who posted in his rom but it has a bug: when the gps is locked instead of a gps icon appears a charging battery icon!
Also great tutorial! Keep up the good work!
efl2009 said:
Hello
I used your tutorial an now i have flashlight in quick settings.
But also i have 2 problems and maybe you can help me:
1) The text under the flashlight is not "on or off" it is "enter and space" . Screenshot in attach.
2) SystemUI.apk i took from user "m1ndh4x8r" who posted in his rom but it has a bug: when the gps is locked instead of a gps icon appears a charging battery icon!
Also great tutorial! Keep up the good work!
Click to expand...
Click to collapse
For the flashlight, you'll need to change a few resource id's in flashlight smali, and instead of digging through the framework to find the strings, you should just add them to the public.xml and string.xml in the SystemUI.apk
In strings.xml, add the following:
Code:
<string name="status_bar_quick_settings_flashlight_off">OFF</string>
<string name="status_bar_quick_settings_flashlight_on">ON</string>
Then head on over to public.xml and register them underneath the flashlight string you had previously entered.
Now go into flashlight.smali. Your going to have to play around with them a little bit, but the resource id's that look like:
const v1, 0x10402f2
are the ones your going to be changing. You'll change I think 5 of them throughout Flashlight.smali and Flashlight$1.smali
The first should be OFF, then next ON, then OFF, then ON then OFF, but I'd have to actually play around with them to figure out which is which.
As far as the battery icon instead of the GPS Icon, I would look in HtcCdmaStatusBar.smali and search for line 117. There is a resource ID below it that might be the one for the icon, in which case you would just have to replace it with the correct one.
However, if the ROM your using is stock Sense 2.1, then you can just start from scratch with your own and it will work.
Thank you for the info. I also added with success Volume option.
I sorry if I'm buzzing but I don't have anyone else to ask about this kind o things.
So can you tell me how i can enable Recent Apps in notification statusbar in Sense 2.1? Or how ca i enable hotspot if it is disabled?
Yeah ill send you a pm later today about it, I've got a lot of stuff to do right now
Sent from my ADR6400L using xda premium
Hi
I solved GPS bug by changing 1 id from StatusBarPolicy.smali. It was wrong and I looked for the right one in the framework-res.apk.
Flashlight text is ok now cause i changed 0x10402f2 with 0x1040315 and 0x10402f1 with 0x10402f2.
So if you can help me to enable recent apps and hotspot it will be great.
Thank you for your help!
P.S. I also I thanked you on my thread.
efl2009 said:
Hi
I solved GPS bug by changing 1 id from StatusBarPolicy.smali. It was wrong and I looked for the right one in the framework-res.apk.
Flashlight text is ok now cause i changed 0x10402f2 with 0x1040315 and 0x10402f1 with 0x10402f2.
So if you can help me to enable recent apps and hotspot it will be great.
Thank you for your help!
P.S. I also I thanked you on my thread.
Click to expand...
Click to collapse
Sorry I haven't gotten back to you. I can definitely help you with the hotspot. I don't know how to do the recent apps, but I know someone who can so I'll find out and let you know.
Sent from my ADR6400L using xda premium
Hi
So finally I enabled recent apps but now the problem that I can't solve at all is adding Silent Mode. I mean I added to quick setting but the text is wrong and is not working to enable or disable. I thing the ids are not correct but i don't know what it each means.
Can you help me please?
Wow amazing work
Sent from my HTC ThunderBolt using Tapatalk
efl2009 said:
Hi
So finally I enabled recent apps but now the problem that I can't solve at all is adding Silent Mode. I mean I added to quick setting but the text is wrong and is not working to enable or disable. I thing the ids are not correct but i don't know what it each means.
Can you help me please?
Click to expand...
Click to collapse
What I always do is look at the smali file for, in this case silent mode, and look at the resource ids. Copy then and search in public.xml for it. Look at what is actually there, then look on your status bar. This will kinda show you what is where, and what you need to change. If you have to, add some strings to strings.xml and public.xml and put them in the smali.
Sent from my ADR6400L using xda premium
WARNING: Use the apks at your own risk!!!
I am not responsible for any bricked devices
You'll need root for this to work
To backup original camera apk
Code:
adb pull /system/app/OppoGallery2.apk
adb pull /system/app/OppoGallery2.odex
To Install (after you backed up the older version):
Download the version, rename it to OppoGallery2.apk
Code:
adb push OppoGallery2.apk /sdcard/
adb shell
su
mount -o remount,rw /system
#remove older version
rm /system/app/OppoGallery2.apk
#if the file below exists
rm /system/app/OppoGallery2.odex
cp /sdcard/OppoGallery2.apk /system/app/
To revert to older version(or stock firmware version)
Code:
adb push OppoGallery2.apk /sdcard/
#if reverting to stock firmware version
adb push OppoGallery2.odex /sdcard/
adb shell
su
mount -o remount,rw /system
cp /sdcard/OppoGallery2.apk /system/app/
#if reverting to stock firmware version
cp /sdcard/OppoGallery2.odex /system/app/
Releases:
v2 - 2013-4-6
v1 - 2013-4-6
Changelog
v2 - 2013-4-6 - Based off the X909EN_13_130328 firmware, svn2611
Code:
Changelog:
- Enabled more values for timer(3, 5, 10, 20)s
- Known bugs:
---- GUI Icons for all timers will have a 5 in upper right corner
---- During countdown, if timeleft > 5s, it'll flash a "5" Icon. If timeleft < 5s, it'll flash the correct Icon (eg 4s left = "4" icon)
Compatibility: should work with any rom
[url=http://d-h.st/knx]Download[/url] | [url=http://files.ngvincent.com/android/oppo-find-5/misc/mods/camera/OppoGallery2.v2.apk]Mirror[/url]
[url=http://files.ngvincent.com/android/oppo-find-5/misc/mods/camera/v2.camera.timer.diff]Smali Code Diffs[/url]
v1 - 2013-4-6 - Based off the X909EN_13_130328 firmware, svn2611
Code:
Changelog:
- Enabled ISO toggle for camera (Settings for them were present, but not enabled)
<string name="pref_camera_iso_title">Select ISO</string>
<string name="pref_camera_iso_entry_auto">AUTO</string>
<string name="pref_camera_iso_entry_isodeblur">ISO Auto(HJR)</string>
<string name="pref_camera_iso_entry_iso100">ISO100</string>
<string name="pref_camera_iso_entry_iso200">ISO200</string>
<string name="pref_camera_iso_entry_iso400">ISO400</string>
<string name="pref_camera_iso_entry_iso800">ISO800</string>
<string name="pref_camera_iso_entry_iso1600">ISO1600</string>
Compatibility: should work with any rom
[url=http://d-h.st/3ER]Download[/url] | [url=http://files.ngvincent.com/android/oppo-find-5/misc/mods/camera/OppoGallery2.v1.apk]Mirror[/url]
[url=http://files.ngvincent.com/android/oppo-find-5/misc/mods/camera/v1.camera.iso.diff]Smali Code Diffs[/url]
Version 1:
I don't know why Oppo didn't enable ISO selection in the camera app
they added the string values and icons, but didn't add the code to display the menu system
The selection of ISO values seem to work: ISO 1600 seems grainer than any other mode... but isn't as grainy as I thought 1600 would be
Great Mod!
Thanks!
Today I was trying to decompile this APK with APK Manager v5. but i get error:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Can you give me any tips? Thanks in advance.
I guess I have to pull res framework?
Update:
I Pulled framework-res.apk, and went with "10.Decompile APK (With Dependences)" using framework-res.apk but still get this error....
NODO-GT said:
Great Mod!
Thanks!
Today I was trying to decompile this APK with APK Manager v5. but i get error:
Can you give me any tips? Thanks in advance.
I guess I have to pull res framework?
Update:
I Pulled framework-res.apk, and went with "10.Decompile APK (With Dependences)" using framework-res.apk but still get this error....
Click to expand...
Click to collapse
I use linux tools... maybe my guide will be a little useful.
don't think I had any problems with apktool
https://git.ngvincent.com/projects/oppo-x909-cm10/wiki/Decompile-apk
EDIT: did you pull framework-res.odex ?
paperWastage said:
I use linux tools... maybe my guide will be a little useful
https://git.ngvincent.com/projects/oppo-x909-cm10/wiki/Decompile-apk
Click to expand...
Click to collapse
I switched APK Manager to APK Tool...
When I decompile, I don't get smali folder... Will keep looking how to decompile this properly.
NODO-GT said:
I switched APK Manager to APK Tool...
When I decompile, I don't get smali folder... Will keep looking how to decompile this properly.
Click to expand...
Click to collapse
the firmware isn't deoxed.... so apktool decompile won't give you the .smali
as I mentioned in my edited post, for the framework, you'll need to copy the .odex as well (and use baksmali to decompile odex to .smail, then use smali to compile .smali to .dex)
same for decompiling any applications
can you please remove the "low battery check" that disable flash if the battery is lower than 20%? Thanks.
badworker said:
can you please remove the "low battery check" that disable flash if the battery is lower than 20%? Thanks.
Click to expand...
Click to collapse
hmm, they changed some stuff since the last time I decompiled their Gallery apk
give me a few hours to reupdate everything
EDIT: here is a build that I haven't tested (I'm using CM10.1-based roms)
this is taken from the latest stock oppo beta rom - X909EN_11_130629_Beta
contains only your requested change. let me know if it works? (same instructions on my original post)
(original file allows flash if battery >= 15%. I've set it to allow flash if battery > 0%)
http://d-h.st/wQT
paperWastage said:
hmm, they changed some stuff since the last time I decompiled their Gallery apk
give me a few hours to reupdate everything
EDIT: here is a build that I haven't tested (I'm using CM10.1-based roms)
this is taken from the latest stock oppo beta rom - X909EN_11_130629_Beta
contains only your requested change. let me know if it works? (same instructions on my original post)
(original file allows flash if battery >= 15%. I've set it to allow flash if battery > 0%)
http://d-h.st/wQT
Click to expand...
Click to collapse
Thanks! I'll give it a try asap.
Btw, I was trying to enable the ISO selection in the newer firmware (>=130531) but they are so different from the 130328 where you made modification. I am able to remove the flash check (with a lot of work, i'm learning ) but when I put your modification at the .smali files (with attenction to the .line and so on) the application force close itself. It's frustrating but i must try and retry till I get it working. So the request is: have you some usefull advices for me?
Thanks again for your work!
Tapatalked via Oppo Find 5
badworker said:
Thanks! I'll give it a try asap.
Btw, I was trying to enable the ISO selection in the newer firmware (>=130531) but they are so different from the 130328 where you made modification. I am able to remove the flash check (with a lot of work, i'm learning ) but when I put your modification at the .smali files (with attenction to the .line and so on) the application force close itself. It's frustrating but i must try and retry till I get it working. So the request is: have you some usefull advices for me?
Thanks again for your work!
Tapatalked via Oppo Find 5
Click to expand...
Click to collapse
smali sucks .... it's hard to apply patches for smali. these guys manage to auto-patch smali code, but usually the target is roughly the same (~android AOSP/AOKP/CM10.1 base with the same code)... if I have time, I'll take a look to see how they organize the smali patcher
you need to understand assembly (smali opcodes), know how to read it, and how java code relates to it
maybe a small tutorial would help: the flash check disabler code . Not sure how you modified the code, but here's how my thought process went
after decompiling to source code, you'll figure out how to solve the problem: have this function return false all the time
you want the function to return false (i.e. flash IS NOT forbidden)
I decide to target that (if i>=15) check (it checks if you have at least 15% battery left)
com/android/camera/Camera.java
Code:
private boolean isForbidFlash()
{
boolean flag = true;
File file = new File("/sys/class/power_supply/battery/capacity");
if(!file.exists())
return false;
FileReader filereader;
int i;
char c;
filereader = new FileReader(file);
char ac[] = new char[3];
filereader.read(ac);
i = Integer.valueOf(String.valueOf(ac).substring(0, 2)).intValue();
if(ac[0] != '1' || ac[1] != '0')
break MISSING_BLOCK_LABEL_98;
c = ac[2];
if(c == '0')
i = 100;
try
{
filereader.close();
}
catch(Exception exception1)
{
try
{
exception1.printStackTrace();
}
catch(Exception exception)
{
exception.printStackTrace();
Log.e("OppoCamera", (new StringBuilder()).append("isForbidFlash: e = ").append(exception).toString());
return false;
}
}
[B]if(i >= 15)[/B]
flag = false;
return flag;
}
smali code equivalent of the function above
Code:
.method private isForbidFlash()Z
.registers 9
.prologue
const/16 v7, 0x30
const/4 v0, 0x1
const/4 v1, 0x0
.line 4942
:try_start_4
new-instance v2, Ljava/io/File;
const-string v3, "/sys/class/power_supply/battery/capacity"
invoke-direct {v2, v3}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 4943
invoke-virtual {v2}, Ljava/io/File;->exists()Z
move-result v3
if-nez v3, :cond_12
.line 4969
:goto_11
return v1
.line 4946
:cond_12
new-instance v3, Ljava/io/FileReader;
invoke-direct {v3, v2}, Ljava/io/FileReader;-><init>(Ljava/io/File;)V
.line 4947
const/4 v2, 0x3
new-array v4, v2, [C
.line 4948
invoke-virtual {v3, v4}, Ljava/io/FileReader;->read([C)I
.line 4950
invoke-static {v4}, Ljava/lang/String;->valueOf([C)Ljava/lang/String;
move-result-object v2
.line 4951
const/4 v5, 0x0
const/4 v6, 0x2
invoke-virtual {v2, v5, v6}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v2
invoke-static {v2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I
move-result v2
.line 4952
const/4 v5, 0x0
aget-char v5, v4, v5
const/16 v6, 0x31
if-ne v5, v6, :cond_42
const/4 v5, 0x1
aget-char v5, v4, v5
if-ne v5, v7, :cond_42
const/4 v5, 0x2
aget-char v4, v4, v5
:try_end_3e
.catch Ljava/lang/Exception; {:try_start_4 .. :try_end_3e} :catch_50
if-ne v4, v7, :cond_42
.line 4953
const/16 v2, 0x64
.line 4956
:cond_42
:try_start_42
invoke-virtual {v3}, Ljava/io/FileReader;->close()V
:try_end_45
.catch Ljava/lang/Exception; {:try_start_42 .. :try_end_45} :catch_4b
.line 4961
:goto_45
const/16 v3, 0xf
if-ge v2, v3, :cond_6d
:goto_49
move v1, v0
goto :goto_11
.line 4957
:catch_4b
move-exception v3
.line 4959
:try_start_4c
invoke-virtual {v3}, Ljava/lang/Exception;->printStackTrace()V
:try_end_4f
.catch Ljava/lang/Exception; {:try_start_4c .. :try_end_4f} :catch_50
goto :goto_45
.line 4963
:catch_50
move-exception v0
.line 4965
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
.line 4966
const-string v2, "OppoCamera"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "isForbidFlash: e = "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-static {v2, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_11
:cond_6d
move v0, v1
.line 4961
goto :goto_49
.end method
if you look at the smali code and walk through/compare it with the java code, you'll see different ways to tackling the problem
A) just simply return v1 (=FALSE) on the first line. side effects: you bypass the try/catch statements, dunno if you'll break anything
B) - my approach
the (if i>= 15) check). 0xf hex is the same as 15 decimal.
Change 0xf to 0x0, so it'll check if (i >= 0), i.e. at least 0% battery
Code:
.line 4961
:goto_45
const/16 v3, [B]0xf[/B]
if-ge v2, v3, :cond_6d
C) you could also target the assignment of the flag inside the if/else statement.
#assignments of the registers at the beginning of function
Code:
const/4 v0, 0x1 # true
const/4 v1, 0x0 # false
#what happens inside the condition=true block, until the return statement. condition = enough battery
the "#" lines are my comments
Code:
if-ge v2, v3, :cond_6d
#jump to :cond_6d
:cond_6d
move v0, v1 #v0 = v1 , both = FALSE(since v1 was initialize to FALSE)
.line 4961
goto :goto_49
#jump to the :goto_49 tag
:goto_49
move v1, v0 # v1 = v0, both = FALSE
goto :goto_11
#jump to the :goto_11 tag
:goto_11
return v1 # return v1 = FALSE <- result we want
#what happens inside the condition=false block, until the return statement. condition = not enough battery
Code:
if-ge v2, v3, :cond_6d # we don't jump, since condition failed. follow the next line
:goto_49
move v1, v0 # v1 = v0, both = TRUE(since v0 was initialized to TRUE)
goto :goto_11
#jump to the :goto_11 tag
:goto_11
return v1 # return v1 = TRUE <- flash forbidden
you could change v0 to initialize to FALSE as well... not sure about the side effects though
(I thought they enabled ISO selection in the latest firmware anyway?)
for the ISO selection, here's how I did it
the compiled apk already had the values, arrays, setup for the ISO.
Code:
res/xml/camera_preferences.xml:16: <IconListPreference camera:title="@string/pref_camera_iso_title" camera:key="[U][B]pref_camera_iso_key[/B][/U]" camera:defaultValue="@string/pref_camera_iso_default" camera:entryValues="@array/pref_camera_iso_entryvalues" camera:entries="@array/pref_camera_iso_entries" camera:singleIcon="@drawable/oppo_ic_iso" />
they just didn't enable the list preference in the code.
So, I looked at where they initialized that settings page, and add the pref_camera_iso_key into that array.
com/android/camera/Camera.java
Code:
as1 = (new String[] {
"pref_camera_picturesize_key", "pref_camera_time_lapse_key", "pref_camera_sound_key", "pref_camera_smile_key", "pref_camera_recordlocation_key", "pref_camera_guideline_key", "pref_camera_restore_default"
});
I need one new element inside that list
smali change
Code:
- const/4 v0, 0x7
+ const/16 v0, 0x8 #need to increase size of the list from 0x7 to 0x8
new-array v0, v0, [Ljava/lang/String;
@@ -3838,6 +3838,12 @@
const/4 v2, 0x6
+ const-string v3, "pref_camera_iso_key" # put the inserted value before pref_camera_restore_default
+
+ aput-object v3, v0, v2
+
+ const/4 v2, 0x7
+
const-string v3, "pref_camera_restore_default"
aput-object v3, v0, v2
For the timer change:
you want to change this function
Camera.java
Code:
public void onSharedPreferenceChanged()
{
Debugger.d("OppoCamera", "onSharedPreferenceChanged");
if(super.mPaused)
return;
if("[B]on[/B]".equals(mPreferences.getString("pref_camera_time_lapse_key", getString(0x7f0b0177))))
mTimerSnapShotManager.setTime([B]5[/B]);
instead of just one if statement that checks if "on" selected-> 5 second, you want
if "3" -> 3 seconds
if "5" -> 5 seconds
if "10" -> 10 seconds
if "20" -> 20 seconds
(i mean ideally, you want a slider bar on the preferences page that allows you to set any time you want... but that change is extremely difficult, as you need to touch multiple parts of the java class)
therefore, you need two things
smali: duplicate the entire [if statement and mTimerSnapShotManager.setTime()] section, modify "on" and "5" variables accordingly
arrays.xml and other *.xml changes: add in entries for the 3, 5, 10, 20, remove the "on" entry
then you go test... then you find out the app crashes.
you debug, and figure out that the program flashes the "5" icon when 5s left, "4" icon when 4s left..... if there are 20s left, it fails to load the "20" icon (since it doesn't exist), and crashes
it's too much trouble to make your own 6-20.jpg, insert into the package... it's extremely difficult to replace the [load "x" icon when x seconds left] with [somehow display the text "x" when x seconds left, instead of loading an icon]
so, for the icon-loading part, check if it's more than 5. If it is, set the variable to 5, load the 5 icon
Code:
+ add-int/lit8 v2, v0, -0x5
+
+ if-ltz v2, :cond_reset
+
+ const/4 v0, 0x4
+
+ :cond_reset
GREAT!! for the flash check the 'B way' si exactly what I did. I have a basic knowledge of assembly programming (I'm also a C,C# developer) but how the hell did you get the java code? I deodexed the apk with universal deodexer and decompiled with apktool, it's not the right way to do it?
Thanks for the very detailed explaination! It helps me so much!
Tapatalked via Oppo Find 5
badworker said:
GREAT!! for the flash check the 'B way' si exactly what I did. I have a basic knowledge of assembly programming (I'm also a C,C# developer) but how the hell did you get the java code? I deodexed the apk with universal deodexer and decompiled with apktool, it's not the right way to do it?
Thanks for the very detailed explaination! It helps me so much!
Tapatalked via Oppo Find 5
Click to expand...
Click to collapse
there are smali -> java source code decompilers. typcially, they don't give you a clean source code that actually compiles (some stuff fails to decompile properly), but it's good enough to read (better than reading smali)
(after doing deodex + apktool decompile)i use d2j-dex2jar to convert from smali-> jar
then either decompile-jad or jd-gui to convert from jar-> java source code. Sometimes, one of the tool fails to convert and I'll have to use the other
other decompilers: androguard (haven't tried this one yet)
with the source code, you can
1) read it, and make changes correspondingly in smali (this is what I do)
2) try to make the entire thing compilable, and then make modifications in java source code
3) make relevant parts of it compilable (easier than (2), make changes, compare the diffs in smali, merge the diffs into the original smali
I haven't tried steps 2, 3. those two steps are probably useful if you are making major changes(more than 10 lines)
Any chance that i can use the Oppo Camera ona Rom like Illusion?
Bump. Is this dead also?
Sent from my Find 5 using Tapatalk
killerskincanoe said:
Bump. Is this dead also?
Sent from my Find 5 using Tapatalk
Click to expand...
Click to collapse
probably
still have my Find 5, but not really using it... haven't kept up with the latest CM/ColorOS releases, so this apk probably doesn't work on the new releases
If the new APKs don't contain these features, do it yourself? I've posted how to do this hack in smali...
I will be compiling all my mods and other folks mods in this thread!!
[Guide How-to] Verizon Note 4 Remove CD Installer & ASEC
This removes the annoying CD installer that pops up when you plug into your computer and your phone will go straight to MTP.
Enjoy!!
Remove CD Installer Download: http://d-h.st/Wm7
Just flash with TWRP
[Guide How-to] Verizon Note 4 Enable Native Call Recording
Smali edit for InCallUI.apk:
com/android/services/telephony/common/PhoneFeature.smali
Add the lines that are highlighted in RED
Code:
const-string v3, "CscFeature_VoiceCall_ConfigRecording"
invoke-virtual {v0, v3}, Lcom/sec/android/app/CscFeature;->getString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
[COLOR="Red"]const-string v0, "RecordingAllowed"[/COLOR]
.line 1693
sget-object v3, Lcom/android/services/telephony/common/PhoneFeature;->mFeatureList:Ljava/util/HashMap;
const-string v6, "voice_call_recording"
const-string v7, "RecordingAllowed"
const-string v3, "CscFeature_VoiceCall_ConfigRecording"
invoke-virtual {v0, v3}, Lcom/sec/android/app/CscFeature;->getString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
const-string v0, "RecordingAllowed"
.line 1693
sget-object v3, Lcom/android/services/telephony/common/PhoneFeature;->mFeatureList:Ljava/util/HashMap;
const-string v6, "voice_call_recording"
const-string v7, "RecordingAllowed"
For those not capable of doing smali edits just flash this via TWRP. Enable Call Recording
[Guide How-to] Remove Lockscreen Carrier
This removes the lockscreen carrier text.
Keyguard.apk smali edit:
smali/com/android/keyguard/CarrierText.smali:
Change if-nez to if-eqz in the indicated edit in BLUE:
Code:
.method private static concatenate(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
.locals 5
.param p0, "plmn" # Ljava/lang/CharSequence;
.param p1, "spn" # Ljava/lang/CharSequence;
.prologue
const/4 v2, 0x1
const/4 v3, 0x0
.line 310
invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v4
[COLOR="Blue"]if-eqz[/COLOR] v4, :cond_1
move v0, v2
For those of you not capable of smali edit's, just flash this via TWRP Remove Lock Screen Carrier Text
[Guide How-to] Remove Safe Volume Warning
This removes the safe volume warning that pops up when you turn up the volume beyond a certain point
This mod requires modifying framework.jar
Edit smali/android/media/AudioService.smali:
Changes are in .method private checkSafeMediaVolume(III)Z
, new lines are in BLUE:
Code:
iget-object v6, p0, Landroid/media/AudioService;->mSafeMediaVolumeState:Ljava/lang/Integer;
invoke-virtual {v6}, Ljava/lang/Integer;->intValue()I
move-result v6
[COLOR="Blue"]goto :goto_td[/COLOR]
if-ne v6, v7, :cond_4
Code:
goto :goto_1
.line 6873
.end local v0 # "e":Ljava/lang/Exception;
.end local v1 # "pm":Landroid/os/PowerManager;
.end local v3 # "wl":Landroid/os/PowerManager$WakeLock;
[COLOR="Blue"]:goto_td[/COLOR]
:cond_4
monitor-exit v5
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
goto :goto_0
.end method
For those not capable of smali edit's just flash this in TWRP Remove Safe Volume Warning
[Guide How-To] Enable Call & MSG Blocking
This enables call and msg blocking natively.
Simple CSC edit.
system/csc/feature.xml edit
Must be inserted BEFORE
</FeatureSet>
</SamsungMobileFeature>
(** please note that feature.xml can be overwritten so this may not stick if using a third party software like Xposed)
Code:
<CscFeature_Setting_EnableMenuBlockCallMsg>TRUE</CscFeature_Setting_EnableMenuBlockCallMsg>
For those of you not capable of this edit, just flash this with TWRP Native Call & Message Block
[Guide How-to] Replace Recents with Menu
Keylayout edits:
system/usr/keylayout/Generic.kl
Change key 254 from APP_SWITCH to MENU
key 254 MENU
Download: Generic.kl
Now Recent Apps capacitive key is Menu (single-press) and Search (long-press).
However, we have now lost access to recent apps via a hardware key.
[Guide How-to] VZW Note 4 4 Way Reboot Power Menu EPM
This will work with Odex or Deodexed Rom. To see the 4 way Menu you must hit restart on the Primary Menu!!!
First grab your Deodexed android.policy.jar from system/framework
Decompile it with APKTOOL. Look in smali\com\android\internal\policy\impl\
Find GlobalActions$SinglePressAction.smali and open with NotePad++
Look for this:
Code:
.class abstract Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.super Ljava/lang/Object;
.source "GlobalActions.java"
# interfaces
.implements Lcom/android/internal/policy/impl/GlobalActions$Action;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/GlobalActions;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x40a
name = "SinglePressAction"
.end annotation
# instance fields
.field public customAction:I
.field public isKnoxCustom:Z
.field private final mIcon:Landroid/graphics/drawable/Drawable;
.field private final mIconResId:I
.field mLayoutId:I
.field private final mMessage:Ljava/lang/CharSequence;
.field private final mMessageResId:I
# direct methods
.method protected constructor <init>(II)V
.locals 2
.param p1, "iconResId" # I
.param p2, "messageResId" # I
Add in the Red Text to look like this:
Code:
.class abstract Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.super Ljava/lang/Object;
.source "GlobalActions.java"
# interfaces
.implements Lcom/android/internal/policy/impl/GlobalActions$Action;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/GlobalActions;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x40a
name = "SinglePressAction"
.end annotation
[COLOR="Red"]# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;[/COLOR]
# instance fields
.field public customAction:I
.field public isKnoxCustom:Z
.field private final mIcon:Landroid/graphics/drawable/Drawable;
.field private final mIconResId:I
.field mLayoutId:I
.field private final mMessage:Ljava/lang/CharSequence;
.field private final mMessageResId:I
# direct methods
[COLOR="Red"].method static constructor <clinit>()V
.locals 3
const/4 v0, 0x4
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, "Hot Boot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Download"
aput-object v2, v0, v1
const/4 v1, 0x3
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]
.method protected constructor <init>(II)V
.locals 2
.param p1, "iconResId" # I
.param p2, "messageResId" # I
Save file and look for GlobalActions.smali in the same folder.
Find this:
Code:
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 1126
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$8;
const-string v2, "VZW"
sget-object v4, Lcom/android/internal/policy/impl/GlobalActions;->mSalesCode:Ljava/lang/String;
invoke-virtual {v2, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_3
const v2, 0x1080b2d
:goto_2
const v4, 0x10401cf
move-object/from16 v0, p0
invoke-direct {v3, v0, v2, v4}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 1164
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$9;
Change the red text to look like this:
Code:
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 1126
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$[COLOR="Red"]99[/COLOR];
const-string v2, "VZW"
sget-object v4, Lcom/android/internal/policy/impl/GlobalActions;->mSalesCode:Ljava/lang/String;
invoke-virtual {v2, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_3
const v2, 0x1080b2d
:goto_2
const v4, 0x10401cf
move-object/from16 v0, p0
invoke-direct {v3, v0, v2, v4}, Lcom/android/internal/policy/impl/GlobalActions$[COLOR="Red"]99[/COLOR];-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 1164
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$9;
Save file.
Add the 3 smali files in this zip to the same folder: Smali-Files-Zip
Now recompile. That's it.
For those of you not able to edit smali. Here is a zip flashable with TWRP. VZW Note 4 4 Way EPM Menu
To see the 4 way Menu you must hit restart on the Primary Menu!!!
Enjoy!!!
Framework Mods- Note 4 Native WiFi Tether, All Rotations, Safe Media Volume Disabled, Dreams enabled, Battery Critical Warnings lowered to 1%.
Here is the download: Framework Mods
Here is the download to return to stock: Stock Framework
Enjoy!!!
[Guide How-to] Remove NFC notification icon in status bar
First grab your Features.xml from /system/csc/
Open with Notepad++ and look for following text:
Code:
<!-- NFC -->
<CscFeature_NFC_SetSecureEventType>ISIS</CscFeature_NFC_SetSecureEventType>
<CscFeature_NFC_StatusBarIconType>Vzw</CscFeature_NFC_StatusBarIconType>
<CscFeature_SmartcardSvc_SetAccessControlType>GPAC, MODE1</CscFeature_SmartcardSvc_SetAccessControlType>
<CscFeature_SmartcardSvc_HideTerminalCapability>eSE</CscFeature_SmartcardSvc_HideTerminalCapability>
<CscFeature_NFC_CardModeRoutingTypeForUicc>ROUTE_ON_WHEN_SCREEN_UNLOCK</CscFeature_NFC_CardModeRoutingTypeForUicc>
<CscFeature_NFC_EnableSecurityPromptPopup>all</CscFeature_NFC_EnableSecurityPromptPopup>
<CscFeature_NFC_EnableInvalidTagPopup>true</CscFeature_NFC_EnableInvalidTagPopup>
<CscFeature_NFC_ConfigAdvancedSettings>Disable</CscFeature_NFC_ConfigAdvancedSettings>
<CscFeature_NFC_DefaultCardModeConfig>DH:UICC</CscFeature_NFC_DefaultCardModeConfig>
Change the red text to look like this:
Code:
<!-- NFC -->
<CscFeature_NFC_SetSecureEventType>ISIS</CscFeature_NFC_SetSecureEventType>
<CscFeature_NFC_StatusBarIconType>[COLOR="Red"]none[/COLOR]</CscFeature_NFC_StatusBarIconType>
<CscFeature_SmartcardSvc_SetAccessControlType>GPAC, MODE1</CscFeature_SmartcardSvc_SetAccessControlType>
<CscFeature_SmartcardSvc_HideTerminalCapability>eSE</CscFeature_SmartcardSvc_HideTerminalCapability>
<CscFeature_NFC_CardModeRoutingTypeForUicc>ROUTE_ON_WHEN_SCREEN_UNLOCK</CscFeature_NFC_CardModeRoutingTypeForUicc>
<CscFeature_NFC_EnableSecurityPromptPopup>all</CscFeature_NFC_EnableSecurityPromptPopup>
<CscFeature_NFC_EnableInvalidTagPopup>true</CscFeature_NFC_EnableInvalidTagPopup>
<CscFeature_NFC_ConfigAdvancedSettings>Disable</CscFeature_NFC_ConfigAdvancedSettings>
<CscFeature_NFC_DefaultCardModeConfig>DH:UICC</CscFeature_NFC_DefaultCardModeConfig>
Save file and copy back to /system/csc, reboot and boom its gone!!!
Enjoy!!
[Guide How-to] Enable Private Mode with a deodexed Rom and SecureStorage=false
First thing you need to do is grab PersonalPageService.apk from system/priv-app
Decompile with APKTOOL
Find PersonalPageService\smali\com\samsung\android\personalpage\service\util\SecureProperties.smali open with Notepad++
Find the follow code:
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 2
.param p1, "context" # Landroid/content/Context;
.prologue
const/4 v1, 0x1
.line 61
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 54
const/4 v0, 0x0
iput-object v0, p0, Lcom/samsung/android/personalpage/service/util/SecureProperties;->mImpl:Lcom/samsung/android/personalpage/service/util/SecureProperties$PropertiesImpl;
.line 63
invoke-static {}, Landroid/os/Debug;->isProductShip()I
move-result v0
if-nez v0, :cond_3
.line 64
invoke-static {}, Lcom/sec/android/securestorage/SecureStorage;->isSupported()Z
move-result v0
if-nez v0, :cond_2
.line 65
const/4 v0, 0x0
sput-boolean v0, Lcom/samsung/android/personalpage/service/util/SecureProperties;->SUPPORT_SECURE_STORAGE_FEATURE:Z
.line 72
:goto_0
sget-boolean v0, Lcom/samsung/android/personalpage/service/util/SecureProperties;->SUPPORT_SECURE_STORAGE_FEATURE:Z
if-eqz v0, :cond_0
Replace the items in Red like this:
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 2
.param p1, "context" # Landroid/content/Context;
.prologue
const/4 v1, 0x1
.line 61
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 54
const/4 v0, 0x0
iput-object v0, p0, Lcom/samsung/android/personalpage/service/util/SecureProperties;->mImpl:Lcom/samsung/android/personalpage/service/util/SecureProperties$PropertiesImpl;
.line 63
invoke-static {}, Landroid/os/Debug;->isProductShip()I
move-result v0
[COLOR="Red"]if-nez v0, :cond_0[/COLOR]
.line 64
invoke-static {}, Lcom/sec/android/securestorage/SecureStorage;->isSupported()Z
move-result v0
[COLOR="Red"]if-nez v0, :cond_0[/COLOR]
.line 65
const/4 v0, 0x0
sput-boolean v0, Lcom/samsung/android/personalpage/service/util/SecureProperties;->SUPPORT_SECURE_STORAGE_FEATURE:Z
.line 72
:goto_0
sget-boolean v0, Lcom/samsung/android/personalpage/service/util/SecureProperties;->SUPPORT_SECURE_STORAGE_FEATURE:Z
if-eqz v0, :cond_0
Save file and compile apk. Push to system/priv-app
For those not capable of changing smali files here is a flashable zip: PersonalPageService.apk
Enjoy!!!
[Guide How-To] Enable Lockscreen Rotation
First grab Keyguard.apk from system/priv-app
Decompile with APKTOOL.
Open smali file smali/com/android/keyguard/KeyguardViewManager.smali
Look for the following:
Code:
.method private shouldEnableScreenRotation()Z
.locals 3
.prologue
const/4 v1, 0x0
.line 249
iget-object v2, p0, Lcom/android/keyguard/KeyguardViewManager;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
.line 250
.local v0, "res":Landroid/content/res/Resources;
const-string v2, "lockscreen.rot_override"
invoke-static {v2, v1}, Landroid/os/SystemProperties;->getBoolean(Ljava/lang/String;Z)Z
move-result v2
Replace the Red text to look like this:
Code:
Code:
.method private shouldEnableScreenRotation()Z
.locals 3
.prologue
[COLOR="Red"]const/4 v1, 0x1[/COLOR]
.line 249
iget-object v2, p0, Lcom/android/keyguard/KeyguardViewManager;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
.line 250
.local v0, "res":Landroid/content/res/Resources;
const-string v2, "lockscreen.rot_override"
invoke-static {v2, v1}, Landroid/os/SystemProperties;->getBoolean(Ljava/lang/String;Z)Z
move-result v2
Compile and push to system/priv-app
For those that are unable to edit smali here is a flashable zip: LockSceen Rotation
Enjoy!!
[Guide How-to] Disable Screen Wake Plugged/Unplugged
First grab your services.jar from system/framework and decompile with APKTOOL
Find smali\com\android\server\power\PowerManagerService .smali and open PowerManagerService with Notepad++
Look for the following:
Code:
.method private shouldWakeUpWhenPluggedOrUnpluggedLocked(ZIZ)Z
.locals 4
.param p1, "wasPowered" # Z
.param p2, "oldPlugType" # I
.param p3, "dockedOnWirelessCharger" # Z
.prologue
const/4 v1, 0x1
const/4 v0, 0x0
.line 2216
iget-boolean v2, p0, Lcom/android/server/power/PowerManagerService;->mWakeUpWhenPluggedOrUnpluggedConfig:Z
if-nez v2, :cond_1
Change to Red text to look like this:
Code:
.method private shouldWakeUpWhenPluggedOrUnpluggedLocked(ZIZ)Z
.locals 4
.param p1, "wasPowered" # Z
.param p2, "oldPlugType" # I
.param p3, "dockedOnWirelessCharger" # Z
.prologue
[COLOR="Red"]const/4 v1, 0x0[/COLOR]
const/4 v0, 0x0
.line 2216
iget-boolean v2, p0, Lcom/android/server/power/PowerManagerService;->mWakeUpWhenPluggedOrUnpluggedConfig:Z
if-nez v2, :cond_1
That's it. Compile and push to system/framework
For those of you not capable of editing smali files here is a flashable zip: Disable Screen Wake Plug/unpluged
Enjoy!!!
[Guide How-to] Bluetooth Scan Dialog Removal
First grab your SecSettings.apk from system/priv-app and decompile with APKTOOL
Find smali/com/android/settings/Bluetooth/BluetoothScanDialog.smali
Look for the follow in .method private initialize()V method:
Code:
.line 79
new-instance v4, Lcom/android/settings/bluetooth/BluetoothScanDialog$3;
invoke-direct {v4, p0, v0}, Lcom/android/settings/bluetooth/BluetoothScanDialog$3;-><init>(Lcom/android/settings/bluetooth/BluetoothScanDialog;Landroid/app/AlertDialog;)V
invoke-virtual {v0, v4}, Landroid/app/Dialog;->setOnCancelListener(Landroid/content/DialogInterface$OnCancelListener;)V
.line 86
[COLOR="Red"]invoke-virtual {v0}, Landroid/app/Dialog;->show()V[/COLOR]
.line 87
return-void
.end method
Delete the text in Red, save file and compile. That's it. push to system/priv-app
Enjoy!!!
Flashlight Toggle & Battery Stats Toggle Mod Flashable-Settings-About Phone-Status-OFFICIAL Zip Updated 12-3-2014
Here is the flashable Flashlight Toggle Mod: VZW Flash Light Battery Stats Toggle Mod-Official Status
YOU MUST WAIT AT LEAST 5-10 MINS AFTER FLASHING FOR THE MOD TO WORK.
Some of you might also have to add "Flashlight" to your settings DB via SQLite. To see the toggle.
1) Download sqlite editor app. I got it from here.
2) Open the app and give it root permissions. It should populate a list.
3) Scroll and Tap the "Settings Storage"
4) Tap "Settings.db"
5) Tap "System"
6) Scroll down until you find "notification_panel_active_app_list", tap to highlight it. I noticed its a little hard to get it highlighted because it seems to want to highlight the one under it. So you might have to tap the one right above it to get it highlighted. Make sure its the notification_panel_active_app_list, and I also updated my notification_panel_active_app_list_reset NOT the notification_panel_default_active_app_list. I picked the wrong one the first time and it didnt work.
7) Once it is highlighted tap the phones menu button.
8) Tap "Edit Record"
9) You'll see a list of all the toggles that are currently enabled to show in notification area.
10) At the bottom of the list or anywhere else in the list add ; and the words Flashlight and Battery then another ;. So it will look like this at the end. ;TouchSensitivity;Flashlight;Battery; Then press Save.
11) Reboot and you should have a Flashlight and a Battery Stats toggle now. You can now use the edit feature and move it anywhere you want in the list of toggles.
This might also have a positive side effect of the following:
When you go to Settings-About Phone-Status it might say OFFICIAL!!!
Enjoy!!!
Enable Tab view in Settings
First grab your SecSettings.apk from system/priv-app
Decompile with APKTOOL and open res.values/bools with Notepad++
look for the following 2 lines:
Code:
<bool name="settings_list">false</bool>
<bool name="settings_grid">true</bool>
Change them to look like this:
Code:
<bool name="settings_list">[COLOR="Red"]true[/COLOR]</bool>
<bool name="settings_grid">[COLOR="Red"]false[/COLOR]</bool>
That's it. Compile and push to System/priv-app
Enjoy!!
How to enable Flashlight operation with Volume
First grab your SecSettings.apk from system/priv-app and decompile with APKTOOL.
Look in res/xml for display_settings_2014.xml and open with Notepad++
Add the following line in Red. When you are done look in settings-Display and you will see Torch Light options menu
Code:
<CheckBoxPreference android:title="@string/led_indicator_settings" android:key="key_simple_led_indicator_settings" android:summary="@string/led_indicator_settings_summary" android:widgetLayout="@touchwiz:layout/preference_widget_twcheckbox" />
[COLOR="Red"]<PreferenceScreen android:title="@string/torchlight_settings" android:key="torchlight" android:fragment="com.android.settings.torchlight.TorchlightSettings" />[/COLOR]
<ListPreference android:persistent="false" android:entries="@array/touch_key_light_entries" android:title="@string/touch_key_light" android:key="touch_key_light" android:summary="@string/touch_key_light_summary" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/touch_key_light_values" />
Compile and push to system/priv-app
That's it.
Enjoy!!!!
How to Enable add Apps Ops to Settings.
First grab SecSettings.apk from system/priv-app and decompile with APKTOOL
Get gridlist_settings_headers.xml from res/xml and edit with Notepad++
Look for:
Code:
<header android:icon="@drawable/ic_setting_grid_powersaving" android:id="@id/power_saving" android:title="@string/power_saving_mode_title_k" android:fragment="com.android.settings.powersavingmode.MenuPowerSavingModeSettings" />
and add right below it the following:
Code:
<header android:icon="@drawable/ic_settings_applicationpermissions" android:title="@string/app_ops_settings" android:fragment="com.android.settings.applications.AppOpsSummary" />
Save file and compile. That's it.
Push to system/priv-app
Enjoy!!!
Thanks EMSpilot looking forward to the list!
EMSpilot said:
I will be compiling all my mods and other folks mods in this thread!!
Verizon Note 4 Dev Phone Only Remove CD Installer & ASEC
This removes the annoying CD installer that pops up when you plug into your computer and your phone will go straight to MTP.
Enjoy!!
Remove CD Installer Download: http://d-h.st/Wm7
Just flash with TWRP
Click to expand...
Click to collapse
Great start!! Thanks. Hopefully many more will appear.
Works perfectly -- thanks!
Added a few new ones today!! Enjoy!!
Added a few new mods today!!!
Enjoy!!!
EMSpilot said:
Added a few new mods today!!!
Enjoy!!!
Click to expand...
Click to collapse
Thanks for the new mods, going to flash a few in a moment. as for the recents menu switcher, can something like gravitybox be used to restore the recents to a long press of the home button? or is this mod going to prevent that?
*nevermind im stupid and realized i could just do it myself. yes it does work that way*
EMSpilot said:
Added a few new mods today!!!
Enjoy!!!
Click to expand...
Click to collapse
Thanks man, good work.
@EMSpilot, thanks so much for posting these mods/guides. I just want to mention that, with respect to the guide to replace Recents with Menu, that you can leave that button alone and get the menu on pretty much any app by long-pressing the Recents button; and you can set your Home button to go to Search on long-press, without any mods. That way, you get to keep your Recents hardware key function.
By the way, I had a Note 3 where the Menu button was where that Recents button now is, and I have to admit the change in button configuration took some getting used to.
I will be doing recents to menu button as soon as i get my developer edition!!!
oneandroidnut said:
I will be doing recents to menu button as soon as i get my developer edition!!!
Click to expand...
Click to collapse
Same here.
Hey guys,
Can you give me more info on how to edit the generic.kl file to switch out the recent apps button to the menu button? I SuperSU installed, and the phone is rooted, but when trying to save the file it always errors out. I am using ES file explorer with the included ES note editor.
Nice work EMS Thank!!
Polishzx said:
Hey guys,
Can you give me more info on how to edit the generic.kl file to switch out the recent apps button to the menu button? I SuperSU installed, and the phone is rooted, but when trying to save the file it always errors out. I am using ES file explorer with the included ES note editor.
Click to expand...
Click to collapse
I posted a Download in the OP.
Here it is!!
http://d-h.st/vuk
EMSpilot said:
I will be compiling all my mods and other folks mods in this thread!!
[Verizon Note 4 Enable Native Call Recording
Thank you for the mod. I installed the zip with TWRP and rebooted the phone. On the dial screen, the former "+" button is now a "Record" button. When not on a call, it is grayed out, and when a call is initiated, it becomes black / active. When pressed, shows press, but nothing happens. Seems to do nothing in Native mode.
When I try to use TWRecord from xposed (made for a Note 3) nothing works, When I try Wanam (through drop down mwnu, button was switched back to "+"), I get a "can't record while a media search is running" popup. I look through running apps but can find no applicable app to be responsible for a media search. Have I done something wrong?
Once native call recording is enabled, do I need to install an app to manage the recording, or is there an internal app that will do so? What directory do the recordings go in if managed natively? What might be running a media search and how do I stop it?
Couldn't figure it out -- I must have unbloated the wrong things. Used a TWRP restore and now it works fine. Thank you very much!
Thank you very much for your patience and help in advance.
Click to expand...
Click to collapse
EMSpilot said:
I posted a Download in the OP.
Here it is!!
http://d-h.st/vuk
Click to expand...
Click to collapse
WOW... I can't believe I missed that. Thank you! The tweaks are fantastic. :good:
EMSpilot said:
I posted a Download in the OP.
Here it is!!
http://d-h.st/vuk
Click to expand...
Click to collapse
Hi,
Thank you for the bunch of downloads to modify the phone!
I saw that you mentioned a way you found to not show the phone was rooted..
Would you be able to post up a download to show normal as your phone shows now?
Thank you for your help,
Bryan
Official Status
trapperjohn said:
Hi,
Thank you for the bunch of downloads to modify the phone!
I saw that you mentioned a way you found to not show the phone was rooted..
Would you be able to post up a download to show normal as your phone shows now?
Thank you for your help,
Bryan
Click to expand...
Click to collapse
I will not be posting this mod until I have fully tested it.
Thanks
EMSpilot said:
I will not be posting this mod until I have fully tested it.
Thanks
Click to expand...
Click to collapse
Ok do you think it will be awhile would like to have it b4 I get my N4 so I can do it right in the beginning.
Not trying to rush at all but thus is a big deal showing normal if needing to send it back for warranty.
Thank you for your help,
Bryan
EMSpilot said:
I will not be posting this mod until I have fully tested it.
Thanks
Click to expand...
Click to collapse
Probably for the best, haha. Curious, from what you've tested so far, does this avoid tripping Knox as well, effectively leaving your device under warranty in the event of a hardware failure? That's my only hang-up with rooting this, is that Samsung kills your warranty. Which I totally get for software, but if my power or home button stops working in a couple months, I'd like to be able to have it fixed...
Thanks for all of your work!
Any ideas how to disable the warning when Fingerprint scanning is enabled for the lockscreen? If I screw up, I'd like to just try again, but at the moment, the phone insists on forcing me to click "ok" first, reminding me that I only have 4 more attempts before I have to enter the backup password.
-Thanks
Hey there,
first off, I am neither an experienced android-developer in any way nor am I able to support any questions regarding to this tutorial. Im new to this stuff, but kinda good in figuring stuff out, and I made it work. All Props go out to venkat kamesh, a guy over in aSony-Forum, who did a great job in implementing a "Show/Hide Brightness Slider"-Feature; one of the features I wait for the most when it comes to cm13.- The static slider is useless to me, cause I use the "cm hidden slider", this feature where you just swype over the status bar to adjust brigthness.
This workflow was reproducable on 2 international m8 devices running cm13 from Jan. 25, besides the Team M8 Kernel. In the following I will fullquote the original developer, with red comments in brackets on the spots where something differs to the cm13 m8 version of the guide.
As I said, Im not very experienced, and dont really understand everything what is happening there (especially regarding security when it comes to private/protected methods and stuff), so please be kind and feel free to optimize my work as much as you want/can
venkat kamesh said:
Hello guys
Happy new Year for first
This is my first tut in This new year 2016
All you need is Deodexed SystemUI.apk and Settings.apk
1. Decompile SystemUI.apk
2. Open SystemUI.apk/smali/com/android/systemui/qs/QSPanel.smali
3. Find this code (just look for the method name, for me the method was protected, not private)
Code:
.field private mBrightnessPaddingTop:I
Below that add this code
Code:
.field private mBrightnessSliderEnabled:Z
4. Search for this Method
Code:
.method private setDetailRecord(Lcom/android/systemui/qs/QSPanel$Record;)V
and above that method add this complete method
Code:
.method private isBrightnessSliderEnabled()I
.locals 4
const/4 v3, 0x0
iget-object v0, p0, Lcom/android/systemui/qs/QSPanel;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "brightness_slider_show"
const/4 v2, 0x1
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-eqz v0, :cond_0
const/4 v3, 0x1
:cond_0
iput-boolean v3, p0, Lcom/android/systemui/qs/QSPanel;->mBrightnessSliderEnabled:Z
return v3
.end method
5. Search for this method (just look for the method name, for me the method was protected, not private)
Code:
.method private showDetail(ZLcom/android/systemui/qs/QSPanel$Record;)V
Above that method, add this method (for me, there already was a method called "showBrightnessSlider", but I wasnt able to get it to work with the default one, so here, you have to delete the whole existing "showBrightnessSlider" method and paste the new one. Also, the guide states a private method here, but as the following steps include an invoke-virtual, we have to change it to protected)
Code:
.method private [COLOR="red"](protected)[/COLOR] showBrightnessSlider()Z
.locals 5
const/16 v3, 0x8
const/4 v2, 0x0
const v1, 0x7f10012e (for me, as there already was a method called "showBrightnessSlider", I didnt use this hex value here, but instead looked my own actual id up in SystemUI:/res/value/public, then search for "brightness_slider" and use this id)
invoke-direct {p0}, Lcom/android/systemui/qs/QSPanel;->isBrightnessSliderEnabled()I
move-result v4
invoke-virtual {p0, v1}, Lcom/android/systemui/qs/QSPanel;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Lcom/android/systemui/settings/ToggleSlider;
if-eqz v4, :cond_0
iget-boolean v1, p0, Lcom/android/systemui/qs/QSPanel;->mBrightnessSliderEnabled:Z
if-eqz v1, :cond_0
iget-object v1, p0, Lcom/android/systemui/qs/QSPanel;->mBrightnessView:Landroid/view/View;
invoke-virtual {v1, v2}, Landroid/view/View;->setVisibility(I)V
invoke-virtual {v0, v2}, Lcom/android/systemui/settings/ToggleSlider;->setVisibility(I)V
:goto_0
invoke-virtual {p0}, Lcom/android/systemui/qs/QSPanel;->updateResources()V
iget-boolean v1, p0, Lcom/android/systemui/qs/QSPanel;->mBrightnessSliderEnabled:Z
return v1
:cond_0
iget-object v1, p0, Lcom/android/systemui/qs/QSPanel;->mBrightnessView:Landroid/view/View;
invoke-virtual {v1, v3}, Landroid/view/View;->setVisibility(I)V
invoke-virtual {v0, v3}, Lcom/android/systemui/settings/ToggleSlider;->setVisibility(I)V
goto :goto_0
.end method
6. Now Look for this Code (for me the whole code from step 6 was already there, so dont change anything here)
Code:
if-eqz p1, :[COLOR="red"]cond_3[/COLOR]
.line 216
iget-object [COLOR="Red"]v2[/COLOR], p0, Lcom/android/systemui/qs/QSPanel;->mBrightnessController:Lcom/android/systemui/settings/BrightnessController;
Add the code above the .line 216 ( this .line 216 will not be same with all devices ) (as stated above, the here included invoke was already there for me, but with a virtual invoke; but I didnt change a thing here)
Code:
invoke-direct [COLOR="red"][/COLOR]{p0}, Lcom/android/systemui/qs/QSPanel;->showBrightnessSlider()Z
move-result [COLOR="red"]v2[/COLOR]
if-eqz [COLOR="red"]v2[/COLOR], :[COLOR="red"]cond_3[/COLOR]
Finally it looks like
Code:
if-eqz p1, [COLOR="blue"]:cond_3[/COLOR]
[COLOR="Red"] invoke-direct (invoke-virtual){p0}, Lcom/android/systemui/qs/QSPanel;->showBrightnessSlider()Z
move-result [COLOR="blue"]v2[/COLOR]
if-eqz [COLOR="blue"]v2[/COLOR], [COLOR="blue"]:cond_3[/COLOR][/COLOR]
.line 216
iget-object [COLOR="Blue"]v2[/COLOR], p0, Lcom/android/systemui/qs/QSPanel;->mBrightnessController:Lcom/android/systemui/settings/BrightnessController;
After adding that
replace this Public id
<public type="id" name="brightness_slider" id="0x7f10012e" />
6. Now compile the SystemUI.apk and sign it and replace
Now time to add in the settings look for post #2
Click to expand...
Click to collapse
venkat kamesh said:
Welcome to easy part on adding the option to hide/show in settings
Method 1
1. Decompile the settings.apk
2. Download this View attachment 3617395 and merge to your settings
3. Add the below code to your settings ( i had added to my own settings ) and your wish
Code:
<PreferenceScreen android:title="Statusbar Mod" android:key="statusmod" android:fragment="com.android.settings.rz.Statusmod" />
4. Compile it and Decompile and open
Settings.apk/smali/com/android/settings/rz/Statusmod.smali
5. Compare the Public ID and replace it and recompile
6. God you did man,,, now replace and have fun
Method 2 (actually, this method worked like a charm for me, didnt even had to download his file merge the settings)
1. Decompile the Settings.apk
2. Download this View attachment 3606026 and merge to your settings
3. Add the below code to your settings ( i had added to my own settings.xml )
you can add in settings.apk/res/xml/Dispaly_settings.xml
HTML:
<com.android.settings.cyanogenmod.SystemSettingSwitchPreference android:title="Brightness Slider" android:key="brightness_slider_show" android:defaultValue="0" android:summaryOn="Brightness Slider Shown" android:summaryOff="Brightness Slider Hidden" />
and then compile/sign and replace your settings
OR
Try download this ROM Control application (View attachment 3616872 ) where you can Easily control
All you is just install and have fun
Thanks to @daxgirl for the app source
now have fun guys
Thanks to cyanogenmod
Dont Forget to mention me if you used my work
that feels me happy
Click to expand...
Click to collapse
And for the noobies like me: If you dont know anything about compiling/decompiling apks, get a can of coffee and make yourself ready to learn, I had fun debugging all this stuff and get this running, and I think now I know a little bit more, and you also will!
Some keywords for you, so you can spare yourself the googling (the parts I as a beginner struggled with): use apktools for de-/compiling, remember to download and install your frameworks from your phone, and for "signing", you have to copy the META-INF folder and the AndroidManifest.xml from the compiled old apk to the compiled new apk (with something like 7zip).
Have fun with it
Hallo guys
Today i will share you a guides to disable signature your devices. I have test it and its work fine !
Disable signature is very important for the modder or Developers, and will be more flexible to edit the system files.
Ok.. Lest check it out
Whats you need?
- DEODEXED
Your rom must have been deodexed. Or you can just deodex a services.jar, but I think it's better to deodexing it all (framework & app)
- Apktool or Apkmultitool
I use a Apktool from this thread
https://forum.xda-developers.com/showthread.php?t=2195680
Don't forget to hit thanks button to him
- Text Editor
I use Notepad++
- services.jar (you can found in system/framework)
- Knowlodge about editing .smali files
Click to expand...
Click to collapse
How to Disable Signatures?
- Decompile services.jar
- Go to /smali/com/android/server/pm and open PackageManagerService.smali
- Search this code
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
then replace that method with this code from .method to the .end method
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.locals 7
const-string p0, "DSA:"
const-string p1, "Skip signatures check"
invoke-static {p0, p1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
const/4 v6, 0x0
return v6
.end method
- Save, Recompile, Sign and push to System :laugh:
Click to expand...
Click to collapse
Easy right?
Any question? Just ask to me in this thread
Credit and thanks to:
- Archiveandroid
- Uncle Dug
- [email protected]