Hey guys! Today I'll be showing you how to add the Flashlight toggle to your quick toggles:
UPDATE: Once you have completed the mod below, you (and your users) can enable the flashlight toggle by flashing the zip HERE. It uses busybox and an included binary to add the toggle to notification_panel_active_app_list, so it will work with all devices that this mod applies to. Again, feel free to share this but give credits where due!
Now before we get started, download the attachment with the files you will need for this mod (attached to this post...make sure you grab the right version for the system you are modifying)
Now lets get started!
UPDATE: Once you have completed the mod below, you (and your users) can enable the flashlight toggle by flashing the zip HERE. It uses busybox and an included binary to add the toggle to notification_panel_active_app_list, so it will work with all devices that this mod applies to. Again, feel free to share this but give credits where due!
Items you will need
- SystemUI.apk from the rom you are modding
- SecSettings.apk from the rom you are modding
- Notepad++ or another text editor of your choice (NOT regular Notepad, it messes up the encoding)
- apktool or baksmali+smali or VTS, etc
Now before we get started, download the attachment with the files you will need for this mod (attached to this post...make sure you grab the right version for the system you are modifying)
Now lets get started!
[size=+1]Step 1: Modding SystemUI.apk[/size]
- Decompile SystemUI.apk and navigate to com/android/systemui/statusbar/policy/quicksetting in your file browser
- Copy and paste FlashlightQuickSettingButton.smali from inside the zip you downloaded (flashlight_files.zip/SystemUI/FlashlightQuickSettingButton.smali) into this folder
- Navigate to SystemUI/res/drawable-xhdpi (or SystemUI/res/drawable-xxhdpi depending on your device)
- Copy and paste the two pngs (tw_quick_panel_icon_flashlight_off.png and tw_quick_panel_icon_flashlight_on.png) from the SystemUI folder of the attachment into the decompiled drawable folder you opened above
- Now navigate to SystemUI/res/values and open the strings.xml with your text editor
- Search for "quickpanel_flashlight_text". If it does not exist anywhere in the file, add this to the bottom of your strings.xml file:
PHP:<string name="quickpanel_flashlight_text">Flashlight</string>
- That's it or SystemUI! Now recompile SystemUI.apk and move on to step 2. At this point, the toggle will show up in the full toggles view (when you add ";Flashlight" to the CscFeature... or to the notification_panel_active_app_list in /data/data/com.android.providers.settings/settings.db) in the status bar, but Settings will FC if you try to go into edit mode/rearrange toggles mode
Attachments
Last edited: