How to add a script to direct download link

hi, how if i want to add a script like this to direct download page.

i want to convert original direct download to my shortener link

in wordpress i just need to add that code to widget

<script type="text/javascript" src=""></script> <script type="text/javascript"> protected_links = ""; auto_safelink(); </script>

page i try to edit is public.php from ../apps/files_sharing/templates

i add that code above <footer>

im using v7.0

here my complete code from github mycode
from line 81-85 is my code