yashsingh1/xdaforums huggingface dataset:
[Sprint Samsung Galaxy S III] Gunthermic:
I 100% agree with you normally sir. However the Tablet does not toggle the same way as other Kit-Kat devices is the point I was getting at.

Yes all public ID's are correct.

I have tried all the examples in this thread, several times and several ways. Each time ensure public id match...

At this point I would do anything. Yes if i revert back to the S5 FlashLightQuickSettingsButton, the flashlight would click on/off.. But as post 333 showed the Images were all screwy.. The tablet uses a total of 5 images for toggles. On, Off, Dim, Rounded On, Rounded Off..

Edit: Went back and reread what you said. I never did edit the onClick. I did exactly what you said. I edited the constructor to make the images show correctly... that it self broke the onClick method..
[Sprint Samsung Galaxy S III] Gunthermic:
Here is the current catlog sir!!
[Sprint Samsung Galaxy S III] PaulPizz:
After moding both files i get a message saying unfortunately setup wizard has stopped then a blank screen. This is on a stock deodexed 4.4.2 rom for the Verizon galaxy s3.
[Sprint Samsung Galaxy S III] :
Same here on a Verizon S5 with the G900VVRU1ANE9 firmware. It was working on the NCG firmware, I think the flashlight smali file needs to be recoded.
[Sprint Samsung Galaxy S III] thisisapoorusernamechoice:
YES!

Thank you so much I had gotten so used to having this handy little short cut on my phone I was dying without it. The guide was great and everything's working perfectly.
[Sprint Samsung Galaxy S III] Chad The Pathfinder:
Have you tried this? http://xdaforums.com/showthread.php?t=2770869 I'm not sure if it'll work on a Verizon phone or not but you can try it.
[Sprint Samsung Galaxy S III] PaulPizz:
Ill check it out. Thanks!
[Sprint Samsung Galaxy S III] Austtin:
...raGe
[Sprint Samsung Galaxy S III] deuce_biggins:
It's not a secret, and the "param" vs "parameter" has nothing to do with kitkat. It is dependent on which version of apktool you are using to decompile/recompile. apktool 1.5.2 vs apktool 2.0, it's just a preference as to which one you like to use...but you need to be familiar with both
[Sprint Samsung Galaxy S III] tdunham:
Also, commandline preferences have effect on the outcome of the decompiled smali as well. I prefer the -b switch with apktool which strips out a lot of code like line numbers and if I'm not mistaken removes that "param" code as well. It's all in how you use it.
[Sprint Samsung Galaxy S III] deuce_biggins:
Good point [MENTION=1042140]tdunham[/MENTION]..

Also, [MENTION=5523110]Austtin[/MENTION]...if you would like to be more familiar with tdunham's explanation you can refer to this link: https://code.google.com/p/android-apktool/wiki/ApktoolOptions
[Sprint Samsung Galaxy S III] tdunham:
Additionally, this comment was uncalled for. Please show a little more respect here in the XDA forums.
[Sprint Samsung Galaxy S III] Austtin:
https://www.dropbox.com/s/wnuie963fmewwsm/2014-09-01-11-44-21.txt?dl=0

this is a logcat I have in android multitool, so after making it using apktool v1.5.2 it's not showing the parameter error, so don't have any idea lol
[Sprint Samsung Galaxy S III] tdunham:
I do not know what version of android you are trying to make this work on but you might want to read through the thread for possible fix and not rely on OP for everything. I posted how to make this work properly in a post not on the OP for android 4.4.2 and others have posted additional helpful things within this thread as well.

If I do not understand you completely because English is not your first language, I apologize, but your first comment is not considered very nice to us.

I will not warn you again about using bad comments in this thread. If you misunderstand because of language translation issues I will let this go but you must abide by the rules of this forum no matter where you are from.

Edit: I see you already edited your post, thank you. :)
[Sprint Samsung Galaxy S III] marcran75:
After compiling and decompiling again I'm only finding three values to change in public/xml instead of 5. One each of ...on...off and ...text. What am I missing?

Edit: Think I found my answer in post #294 but now I'm even more confused. Am I supposed to change the values in SystemUI? I haven't even gotten to the SecSettings part yet. Apparently this isn't meant for someone who still learning. Lol.
[Sprint Samsung Galaxy S III] Austtin:
I really apologize for the bad messages posted here, really sorry guys. I wasn´t in a good moment. sorry.
[Sprint Samsung Galaxy S III] deuce_biggins:
The tablet mystery has been solved, the onClick method is still good that you have provided CNexus. A very minor adjustment to Gunthermic's constructor and it's working flawlessly on the tab pro 8.4.
[Sprint Samsung Galaxy S III] tdunham:
I think my posts and smali's started right around post #283 but somewhere after that I explained how the values have to be obtained from a freshly compiled systemui that have the png files and strings already added.

So add png files, add strings you can add the smali files too if you like but its not important right away.

Compile, then decompile to get the values you need for the smali's out of the new public.xml. I wouldn't do what is suggested in post #294. Its not recommended to edit public.xml directly even though it may work.
[Sprint Samsung Galaxy S III] Gunthermic:
Thanx for taking my constructor I built and debiggin it sir!!!
[Sprint Samsung Galaxy S III] marcran75:
Alright. Making progress. Got the SystemUI and SecSettings edited using [MENTION=1042140]tdunham[/MENTION] method for smali. Signed both and got them to install just fine. Flashed the flashlight.zip. Tile is showing in pulldown panel and working if I select it from there but as soon as I try to add it to quick panel I get settings FC. I followed the instructions to the t for SecSettings.apk but I'm assuming I did something wrong. Stumped again. :eek::confused:
[Sprint Samsung Galaxy S III] tdunham:
Do you know how to get a logcat log of the error. It really helps to pinpoint the problem.
[Sprint Samsung Galaxy S III] marcran75:
I've never done one. I'm a noob at doing these edits. If I use catlog what should I filter for?
[Sprint Samsung Galaxy S III] tdunham:
Try logcat extreme. I think you can filter for anything errors and above. I can't recall exactly. I'm sitting in the dentist chair right now. Lol
[Sprint Samsung Galaxy S III] tdunham:
How are you making out?

Did you add the set of png files to SecSettings as well btw? Its the only thing I can think of that maybe you missed that would cause settings to FC.
[Sprint Samsung Galaxy S III] marcran75:
Still no luck. Modded SecSettings 4-5x and keep getting the same results. There's only one png file for SecSettings. Should there be more?
[Sprint Samsung Galaxy S III] tdunham:
Which build are you modifying? Still on ND8?
[Sprint Samsung Galaxy S III] marcran75:
Yes
[Sprint Samsung Galaxy S III] CNexus:
That, or you can add it to your features.xml

That's why this guide is mainly for devs to incluide in their rom, becasue the csc edit most consistently goes through on a clean install
[Sprint Samsung Galaxy S III] Negan:
i just wanted to clarify one small thing. For part two when we search for the missing code in the method, you've said to add whichever lines are missing to the end of the method (in my case i have four as expected) before return-void. so is it safe to assume that i also need to put it the line directly above: ".line 504"

i would think that i would
[Sprint Samsung Galaxy S III] smaw51:
I put that directly below that line and it worked for me, so right above the return void line.
[Sprint Samsung Galaxy S III] Negan:
His instructions definitely did say directly before the return-void. I second guessed myself when I saw all the other code within the .linexxx !

Thanks for the reply. I pushed your thanks button too with my finger like this ?

sent from my JEDI ELITE Note 3

for best xda results, click to enlarge ?

http://img268.imageshack.us/img268/9564/searchitnoob.gif
[Sprint Samsung Galaxy S III] CNexus:
It honestly doesn't matter :)

As long as its somewhere in that method and before the return-void, you should be good
[Sprint Samsung Galaxy S III] Negan:
ok perfect.

looks like i'm starting over again here though. just flashed and got no change whatsoever.
[Sprint Samsung Galaxy S III] CNexus:
No no, it's not supposed to show up instantly. Read the last part of the SystemUI mod section

You need to add it to that sqlite value that controls the toggles that are visible, and you can do this by editing the value directly, or through a csc edit that will go into effect once you clean flash the rom with the modified files
[Sprint Samsung Galaxy S III] Negan:
i do recall seeing that now. short term memory apparently. ok so i know how to use the sqlite app and have done so to enable the so called hidden toggles ie data. however i'm not overly fond of it as i've had a few random systemui fc in the past. hit and miss for whatever reason.

anyway i don't wanna derail this into a q and a but when you say i can edit the value directly, what are you referring to? Basically I'm not making this mod for a rom. I'm adding it to my theme update which I'm working on. Sounds odd to some but there's no rule saying I can't add features and or mods to my theme typically found in roms!!! So the csc option may work. I just need to figure out where to add ``flashlight`` in feature.xml and then i can just add it to the theme. Btw if you prefer me to cease discussing this as it is a dev thread, I get it. But if I can manage to gain some valuable info from you that I can use moving forward, then it would be foolish not to ask!
[Sprint Samsung Galaxy S III] CNexus:
By edit directly, I meant through an sqlite editing app

Otherwise just add these two lines under <!-- Settings --> to your features.xml. They include almost all toggles, and the flashlight toggle

If you want you can also add to the lines below in the same way you would add to the notification_panel_active_app_list database field by adding a ";" and then the toggle name ie "LastToggle;NewToggle;AnotherNewToggle"

Note that the csc addition below will only work reliably on a clean install. Otherwise it's a hit or miss thing if you are dirty flashing

<CscFeature_Setting_DefQuickPanelOrder>Wifi;Location;Bluetooth;SilentMode;AutoRotate;AirplaneMode;DormantMode;PowerSaving;AllShareCast;MultiWindow;WiFiHotspot;SBeam;Nfc;AirGesture;DrivingMode;SmartStay;SmartScroll;Sync;MobileData;SmartPause;Flashlight;SmartNetwork;ToddlerMode</CscFeature_Setting_DefQuickPanelOrder>
<CscFeature_Setting_DefQuickPanelCandidatesOrder>Wifi;Location;Bluetooth;SilentMode;AutoRotate;AirplaneMode;DormantMode;PowerSaving;AllShareCast;MultiWindow;WiFiHotspot;SBeam;Nfc;AirGesture;DrivingMode;SmartStay;SmartScroll;Sync;MobileData;SmartPause;Flashlight;SmartNetwork;ToddlerMode</CscFeature_Setting_DefQuickPanelCandidatesOrder>
[Sprint Samsung Galaxy S III] CNexus:
You could include.an sqlite script that will add the Flashlight toggle to.their current notification_panel_active_app_list

I can help you out with that if you'd like, I already did something very similar
[Sprint Samsung Galaxy S III] Negan:
Absolutely man. That would be awesome! I'll definitely take you up on that

Heres my theme btw

http://xdaforums.com/showthread.php?p=47779412

sent from my JEDI ELITE Note 3

for best xda results, click to enlarge ?

http://img268.imageshack.us/img268/9564/searchitnoob.gif
[Sprint Samsung Galaxy S III] CNexus:
Ok, save the following code into a toggle.sh file that you will run from your updater-script

#!/sbin/sh
/sbin/mount -a
/tmp/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /tmp/flashlight.sql

Then save this into a flashlight.sql that will be extracted to /tmp

UPDATE system SET value = (SELECT value || 'Flashlight;' FROM system WHERE name = 'notification_panel_active_app_list') WHERE name = 'notification_panel_active_app_list';

sqlite3 binary you will need for your zip is here: https://www.dropbox.com/s/mr94uf0psc4j82m/sqlite3
[Sprint Samsung Galaxy S III] Negan:
Amazing man. Thanks for your help. Once I'm home I'm gonna fire this up

:thumbup::thumbup:

sent from my JEDI ELITE Note 3

for best xda results, click to enlarge ?

http://img268.imageshack.us/img268/9564/searchitnoob.gif
[Sprint Samsung Galaxy S III] CNexus:
Let me know if it worked for you so I can throw it in a zip for others
[Sprint Samsung Galaxy S III] Rushing:
Would this work for 4.2.2? going to try it but if any changes are known to be needed would be cool to know, thanks for this OP
[Sprint Samsung Galaxy S III] CNexus:
I'm not aware of.the quick toggles structure on 4.2.2. It's likely the same or very similar though so try it out and let me know.
[Sprint Samsung Galaxy S III] Rushing:
Okay so I get a compiling error like this ==>

/home/odin/apktool/SystemUI/res/values/public.xml:1533: error: Public resource drawable/tw_quick_panel_icon_flashlight_off has conflicting type codes for its public identifiers (0x2 vs 0x36).

/home/odin/apktool/SystemUI/res/values/public.xml:1534: error: Public resource drawable/tw_quick_panel_icon_flashlight_on has conflicting type codes for its public identifiers (0x2 vs 0x36).

/home/odin/apktool/SystemUI/res/values/public.xml:1535: error: Public resource string/quickpanel_flashlight_text has conflicting type codes for its public identifiers (0xc vs 0x36).

I had to make up The ids as they didn't exist in my s4 SystemUI/res/values/public.xml

question I have is they do exist in 4.3 right? well if so then I didnt have them and I made some up

Navigate to SystemUI/res/values and open the public.xml with your text editor

Now find the lines for the three resources you added (search in the file) and write down the ids for each. The ids will be in the form 0x12345678

Code:

Look for these names and write down the ids for each (make sure you write down the name WITH the id) tw_quick_panel_icon_flashlight_off tw_quick_panel_icon_flashlight_on quickpanel_flashlight_text

these are the one I made up

these are in the smali of course

# toggle text id

const v3, 0x7f369369

# "on" image id

const v4, 0x7f369368

# "off" image id

const v5, 0x7f369367

here is my public.xml file then end of it where I put new additions

<public type="style" name="SystemBarPanelSettingsPanelSeparator" id="0x7f10002a" />

<public type="menu" name="notification_popup_menu" id="0x7f110000" />

<public type="menu" name="recent_popup_menu" id="0x7f110001" />

<public type="drawable" name="tw_quick_panel_icon_flashlight_off" id="0x7f369367" />

<public type="drawable" name="tw_quick_panel_icon_flashlight_on" id="0x7f369368" />

<public type="string" name="quickpanel_flashlight_text" id="0x7f369369" />

</resources>

Thanks =]

Might I need to visit the ids.xml or some other file and update it?

the attached SystemUI.apk is one from my 4.2.2 ROM tmo sgs4
[Sprint Samsung Galaxy S III] Gunthermic:
I add this to my updater script.. And it doesn't seem to add the toggle:

package_extract_file("scripts/toggle.sh", "/tmp/sqlite3/toggle.sh");

package_extract_file("scripts/flashlight.sql", "/tmp/sqlite3/flashlight.sql");

package_extract_file("scripts/sqlite3", "/tmp/sqlite3/sqlite3");

set_perm(0, 0, 0777, "/tmp/sqlite3/toggle.sh");

run_program("/tmp/sqlite3/toggle.sh");

What am I missing?

---------- Post added at 05:07 AM ---------- Previous post was at 04:55 AM ----------

No sir, you dont make them up. You skipped a step sir...

Once you have added the strings etc into the SystemUI, you compile, then decompile the apk you just made. The system then will have added the three public ID's you need to have...

If you try to make up public ID's you will get those errors.
[Sprint Samsung Galaxy S III] CNexus:
You need to set 777 permissions on all the /tmp/sqlite3/* files as they will all be executed from toggle.sh at some point

toggle.sh

flashlight.sql

sqlite3

All need at least 755 permissions for it to work

Just replace the single set perm you have with the line below:

set_perm_recursive(0, 0, 0777, 0777, "/tmp/sqlite3");
[Sprint Samsung Galaxy S III] tdunham:
Send me the files in PM. Send me both before you modified it and after so I can compare them and I will see if I can find anything.
[Sprint Samsung Galaxy S III] DarkAngel:
Quick question to see if anyone may know right off. I did the flashlight mod for 4.4 on the L600 Mega. Both SecSettings and SystemUI compiled correctly and had no errors. I can view it in the notification panel where I can modify the tabs in the order I want but when it comes to the pull down it does not show. Everything has been modded including the settings.db as well. I am trying to see what else I can probably do to make it show. Any suggestions?
[Sprint Samsung Galaxy S III] tdunham:
Did you try the smali file from post 283 yet?
[Sprint Samsung Galaxy S III] DarkAngel:
Will do in a bit. I must have skimmed through that portion and not noticed the S5 notation at the bottom as well.
[Sprint Samsung Galaxy S III] DarkAngel:
Finally! Thank you tdunham. I needed a nudge on the final steps. Been busting my brains on this for some time now. I did what you suggested of course but found that I also needed to do what Versatile1 also had done on post#289. After, I compiled and pushed over to the Mega. There was about a 30 second to 1 minutes delay before the light turned on for the first time but after, it switched on and off at every toggle there after.

Also working on the S5 Launcher. Everything works except one thing on the S5 Launcher which is in the "Edit Page" mode. Need to figure out the values to increase the dp and why I can not add pages. Last pic shows it. After, the S5 Launcher with Theme Chooser and all it's perks will be working perfectly.

Thank you all for the great tuts and info. The SPH-L600 on NE4 KitKat officially has the Flashlight Mod now to also include the 4-way Reboot Menu that I ported as well.
[Sprint Samsung Galaxy S III] mxmr:
[Troubleshooting] Help getting toggle to show

Perhaps one of you can shed some light on the issue I'm having...Cooking a personal custom NG2 rom for the Sprint Galaxy S4.

Modded SecSettings and SystemUI according to OP and post #283 (and the few that followed).

Compiled, decompiled, edited the references, recompiled. Everything seems to be good.

Put the two APKs in /system/priv-app and built a test version of the rom. SystemUI doesn't load (no status bar and settings appear to fc).

So I pulled the logcat and it fails signature verification. Did some googling and edited services.jar to skip signature verification.

Pushed that and rebooted. This time systemui loads fine, the status bar is there and notifications all work. But there is no flashlight toggle. So I tried flashing the enabletogglezip in the Update portion of the OP, but to no avail - it did not add the toggle.

Frustrated, I flashed this mod, and interestingly enough two flashlight toggles are added (both work fine). This leads me to believe the apks compiled correctly and have the new images and smali where it needs to be. But it's not getting added to the notification toggles.

Thoughts? Any tips are appreciated.
[Sprint Samsung Galaxy S III] bombaybadboy:
Hi guys i wanted to ask how to fix a problem with adding this mod to a theme. I have made this mod a few times without any problems but i built a s5 themed version and lost toggle text and wondered if anyone has any advice how to fix. Im building for i9500 i should add and works fine except text

Sent from my GT-I9500
[Sprint Samsung Galaxy S III] tdunham:
I can't remember. Did you add both entries together in notificationpanelmenu.smali where one of them is reversed?

---------- Post added at 04:12 AM ---------- Previous post was at 04:11 AM ----------

Oh, check your quicksetting flashlight smali for the text public value too. I think that's where it really is.
[Sprint Samsung Galaxy S III] bombaybadboy:
Yes m8 i added both entries in notificationpanelmenu.smali and its worked normally in a number of the mods i built. I will take a look at the flashlight smali thanks also i did make some edits in value/drawable. xml but i would have thought if thats the problem i would lose all text.

Sent from my GT-I9500
[Sprint Samsung Galaxy S III] mxmr:
So after starting from scratch and re-doing everything, hoping I made a simple error, I am getting the same result.

So instead of adding the flashlight toggle, I figured I'd experiment and try REPLACING one of the standard toggles with the flashlight toggle to see if that made any difference. So in SystemUI and SecSettings I replaced all of the Reading Mode strings with the corresponding flashlight toggle strings (but I did not remove reading mode images in drawable-xxhpi). After I compiled, decompiled, edited references, and recompiled, I pushed to system/priv-app and flashed the zip in the OP to add the toggles to system.db. Nothing changed! it still is displaying a working reading mode icon in the quicksetting toggles :(

Thoughts? I am determined to break this horse despite my lack of knowledge and skill. Any feedback or tips are appreciated.
[Sprint Samsung Galaxy S III] :
I'm trying to do this mod on the VZW S5 and the toggles do not show correctly and are not labeled correctly. It works but it looks funny. Everything compiled correctly but this is what I get. Where it says device overheating is where the flashlight toggle should be. The other shows up fine, I just need to change my ping image to match. Can anyone help please, I would love to share the completed mod with the VZW community.

View attachment 2943337 View attachment 2943338 View attachment 2943339
[Sprint Samsung Galaxy S III] deuce_biggins:
Did you read through all the posts, there's another smali posted by tdunham (I think around post 283) that was tailored for the S5. Glad to see you here Misterxtc...
[Sprint Samsung Galaxy S III] :
Good to see you around too. Yes, I tried that one a couple updates ago and it didn't work so I ended up using this one from Versatile1 because I'm using apktool 2.0.0rc1. It got me this far anyway. Now VZW threw another monkey wrench at us by using .qmq files instead of png files but the one png shows up so that might not be a issue. We have been through three updates within the last month or so with the S5.
[Sprint Samsung Galaxy S III] deuce_biggins:
Check this thread out, may solve your qmg issue, possibly letting you use the mod as is. I don't have an S5 so I cannot confirm

http://xdaforums.com/showthread.php?p=55573948
[Sprint Samsung Galaxy S III] :
Thanks but sorry to say it only made the flashlight icon that was mismatched in the add menu match. The other two still say "device overheating" but it dose turn the flashlight on. Maybe I'll just rename the mod to match the button and call it a day... lol. Ah oh well, I'll keep trying until I run out of options.
[Sprint Samsung Galaxy S III] Gunthermic:
Which update u on?

From sounds of it, looks like a publicID mismatch?

Sent from my SM-T320 using Xparent BlueTapatalk 2
[Sprint Samsung Galaxy S III] :
I'm on the newest NI2 update and I believe you are correct. I never tried messing with the publicIDs but now looks like a good time to try and learn. I saw it posted here before what to look for so I'll see if I can find it again and try. I'm definitely a newb at this but I have to start somewhere. Thanks for the info.
[Sprint Samsung Galaxy S III] :
Thank you so much for the tip, it's working well now. The only thing is the icons don't match 100%, the one in the add menu is bigger than the other two. I think I know how to fix that. That's not a big deal at all, I'm happy.:victory:

EDIT: Icon is now fixed.
[Sprint Samsung Galaxy S III] sudhamana:
please upload flashlight png files

Hi,

I made successfully the flashlight toggles as per the tutorial.

Working fine.

Thanks for the author of this tutorial.

But I have different image files in system ui and edit notification drawer.

Can you please upload here the png files for flashlight?

Thanks.
[Sprint Samsung Galaxy S III] Chad The Pathfinder:
The pngs are included in the files you dled in the op...
[Sprint Samsung Galaxy S III] oneleft.ak:
EDIT- Looks like the answer is in post #289. Had to change the smali for apktool2