To expand on this for any administrators using JAMF, here's how I'm patching these in the field:
1) Create Extension Attribute called "Adium Patched", type string, input type script, with the following script:
Code: Select all
#!/bin/sh
grep "return 1;" /Applications/Adium.app/Contents/Resources/Template.html
if [ $? -eq 1 ];
then
echo "<result>false</result>"
else
echo "<result>true</result>"
fi
2) Create a Smart Computer Group called "Adium Not Patched" with the following criteria:
- Application Title is Adium.app
Adium Patched is false
Operating System Version greater than or equal 10.15
3) Create a Computer Management Script called "Adium Scrolling Patch" with the following code:
Code: Select all
#!/bin/sh
tmpfile=$(mktemp)
cat <<PATCH > "$tmpfile"
diff -ur Contents.old/Resources/Template.html Contents/Resources/Template.html
--- Contents.old/Resources/Template.html 2017-04-27 04:31:20.000000000 -0500
+++ Contents/Resources/Template.html 2019-10-31 05:58:26.000000000 -0500
@@ -214,10 +214,12 @@
//Auto-scroll to bottom. Use nearBottom to determine if a scrollToBottom is desired.
function nearBottom() {
- return ( document.body.scrollTop >= ( document.body.offsetHeight - ( window.innerHeight * 1.2 ) ) );
+ //return ( document.body.scrollTop >= ( document.body.offsetHeight - ( window.innerHeight * 1.2 ) ) );
+ return 1;
}
function scrollToBottom() {
- document.body.scrollTop = document.body.offsetHeight;
+ window.scrollTo(0, document.body.scrollHeight);
+ //document.body.scrollTop = document.body.offsetHeight;
}
//Dynamically exchange the active stylesheet
PATCH
cd /Applications/Adium.app
patch -p0 < "$tmpfile"
if [ $? -eq 0 ];
then
echo "Adium patched successfully."
rm "$tmpfile"
else
echo "Adium patch failed - patch stored in $tmpfile"
fi
4) Create a computer policy to push the patch, set scope to your smart computer group "Adium Not Patched".
5) Profit?
/var/log/jamf.log wrote:Mon Nov 25 10:07:04 meow jamf[21771]: Checking for policies triggered by "recurring check-in" for user "ecrist"...
Mon Nov 25 10:07:06 meow jamf[21771]: Executing Policy Auto: Adium Scroll Patch
Mon Nov 25 10:07:07 meow jamf[21771]: Checking for patches...
Mon Nov 25 10:07:07 meow jamf[21771]: No patch policies were found.