It boosts the torch on SONY Xperia Z2 / Z3 / Z3c devices by replacing system/etc/flashled_calc_parameters.cfg with a file that sets if_torch_vr = 500000 instead of just 25000, which is the default value by SONY.
By doing this, the flash LED is operated at 500 mA instead of just 25 mA.
In my experiences, 500 mA is a sweet spot which provides good brightness, but at the same time doesn't heat the LED too much. Still, I would advice you to not use the torch for more than about 5 minutes at a time. You use this module at your own risk. If you want to set a lower brightness, then you can edit system/etc/flashled_calc_parameters.cfg in the zip and change if_torch_vr to a value lower than 500000 before installing the module. Of course you can also use a higher value, but I wouldn't exceed 1000000 (this is also the value that SONY set in the line # Max current for Torch (uA) i_batt_max_torch of the flashled_calc_parameters.cfg file.)
The method I used was first described in a thread by @olokos which you can find here. For comparison: The extreme version you can download there (which is a flashable zip and not a Magisk module obviously) sets if_torch_vr to 1000000, which corresponds to 1000 mA or 1 A. As users reported, even at this setting the torch can be used for 5 minutes before temperature increases significantly, but I want to keep it safe by using just half of that value. If you want to know more about the user experience with different settings, I recommend you to read the above mentioned thread, as well as @antkalaitzakis96's thread, who uses the same method, which you can find here.
This module should work on any SONY Xperia Z2 / Z3 / Z3c device running on Android 5.0 - 8.1.0, rooted with Magisk. I'm quite sure about this since I compared the flashled_calc_parameters.cfg files from Android 4.4 (SONY stock KitKat ROM) with Android 6.0.1 (SONY stock Marshmallow ROM) and also with Android 7.1.2 (LineageOS and Carbon Nougat ROMs) and the files were always completely identical! If you still want to check if the module will be compatible with your system before installing it, grab system/etc/flashled_calc_parameters.cfg from your system by using a root file explorer and then compare it with the flashled_calc_parameters.cfg file from the module zip file. The only difference between the two files should be the if_torch_vr line.
Please leave some feedback if the module works for you.
Many thanks to @topjohnwu for the ingenious Magisk universal systemless interface and to @olokos for the initial torch boost mod.
v1.0 - Initial release
v1.1 - Updated to Magisk Module Template 1500