Quote:
Originally Posted by thomass
Could you share this script?
|
Sure. It is actually just a composite of several of the hacks that usually require the USBNetwork hack to perform, that I have adapted into individual scripts to easily install via a Launchpad shortcut, all in one. Kindlet apps/games keystore, Screensavers Hack (remove ad-sponsored banner and screensavers), Kindlesec Hack (disable Amazon.com logging), Search Indexing Disabling/Enabling Hack, K3MusicManager, and ReadabilityMod are all included in it. And as for all that is in my Launchpad folder, I just keep one huge ini file with shortcuts to all that I have, which is basically most of the programs/games found on this site.
customizations.ini
Code:
[Actions]
; Customizations (Kindlet apps/games, Remove ad-sponsored banner/screensavers, Disable Amazon.com logging, Search Indexing disabling, K3MusicManager, ReadabilityMod)
C I = !source /mnt/us/launchpad/customizations_install.sh
C U = !source /mnt/us/launchpad/customizations_uninstall.sh
customizations_install.sh
Code:
#!/bin/sh
##################################################
# Check to see if Customization Hacks are already#
# installed and in use #
##################################################
if [ -f /mnt/us/.customizations_installed ]
then
echo "Customizations are already installed"
else
##################################################
# Add /mnt/us/.customizations_installed file #
##################################################
touch /mnt/us/.customizations_installed
##################################################
# Actual Hacks #
##################################################
###### Kindlet apps/games keystore
# backup the old one if exist:
if [ -f /var/local/java/keystore/developer.keystore ]
then
cp /var/local/java/keystore/developer.keystore /mnt/us/launchpad/developer.keystore.bkp_orig
fi
# move the new one and keep a backup of it, just in case:
if [ -f /mnt/us/launchpad/developer.keystore ]
then
cp /mnt/us/launchpad/developer.keystore /var/local/java/keystore/
mv /mnt/us/launchpad/developer.keystore /mnt/us/launchpad/developer.keystore.bkp
fi
###### Screensavers Hack (remove ad-sponsored banner and screensavers)
/etc/init.d/framework stop
if [ -d /var/local/adunits ]
then
mv /var/local/adunits /var/local/adunits.bkp
touch /var/local/adunits
fi
/etc/init.d/framework start
###### Kindlesec Hack (disable Amazon.com logging)
if [ -d /mnt/us/.kindlesec/ ]
then
rmdir -r /mnt/us/.kindlesec/
mkdir /mnt/us/.kindlesec/
fi
if [ -f /usr/sbin/syslog-ng ]
then
cp /usr/sbin/syslog-ng /mnt/us/.kindlesec/
fi
if [ -f /usr/sbin/loginfo ]
then
cp /usr/sbin/loginfo /mnt/us/.kindlesec/
fi
if [ -f /usr/sbin/tinyrot ]
then
cp /usr/sbin/tinyrot /mnt/us/.kindlesec/
fi
if [ -f /usr/bin/showlog ]
then
cp /usr/bin/showlog /mnt/us/.kindlesec/
fi
mntroot rw
ln -s -b /dev/null /usr/sbin/syslog-ng
ln -s -b /dev/null /usr/sbin/loginfo
ln -s -b /dev/null /usr/sbin/tinyrot
ln -s -b /dev/null /usr/bin/showlog
###### Search Indexing Disabling/Enabling Hack
if [ -f /opt/amazon/ebook/bin/start.sh ]
then
cp /opt/amazon/ebook/bin/start.sh /opt/amazon/ebook/bin/start.sh.bkp
sed -i 's/-DENABLE_SEARCH_INDEXING_THREAD=true/-DENABLE_SEARCH_INDEXING_THREAD=false/' /opt/amazon/ebook/bin/start.sh
fi
###### K3MusicManager
# backup the old one if exist:
if [ -f /opt/amazon/ebook/security/external.policy ]
then
cp /opt/amazon/ebook/security/external.policy /mnt/us/launchpad/external.policy.bkp_orig
fi
# move the new one and keep a backup of it, just in case:
if [ -f /mnt/us/launchpad/external.policy ]
then
cp /mnt/us/launchpad/external.policy /opt/amazon/ebook/security/
mv /mnt/us/launchpad/external.policy /mnt/us/launchpad/external.policy.bkp
fi
###### ReadabilityMod
# backup the old ones if exist:
if [ -f /usr/share/browser/readability/readability_min_utf16.css ]
then
mv /usr/share/browser/readability/readability_min_utf16.css /usr/share/browser/readability/readability_min_utf16.css.bkp
fi
if [ -f /usr/share/browser/readability/readability_min_utf16.js ]
then
mv /usr/share/browser/readability/readability_min_utf16.js /usr/share/browser/readability/readability_min_utf16.js.bkp
fi
# copy the new ones:
if [ -f /mnt/us/launchpad/readability_min_utf16.css ]
then
cp /mnt/us/launchpad/readability_min_utf16.css /usr/share/browser/readability/
fi
if [ -f /mnt/us/launchpad/readability_min_utf16.js ]
then
cp /mnt/us/launchpad/readability_min_utf16.js /usr/share/browser/readability/
fi
mntroot ro
fi
exit
customizations_uninstall.sh
Code:
#!/bin/sh
##################################################
# Check to see if Customization Hacks are already#
# installed and in use #
##################################################
if [ -f /mnt/us/.customizations_installed ]
then
##################################################
# Add /mnt/us/.customizations_installed file #
##################################################
rm /mnt/us/.customizations_installed
##################################################
# Actual Hacks #
##################################################
###### Kindlet apps/games keystore
# remove new one and its backup:
mv /var/local/java/keystore/developer.keystore /mnt/us/launchpad/
rm /mnt/us/launchpad/developer.keystore.bkp
# restore the old one if exist:
if [ -f /mnt/us/launchpad/developer.keystore.bkp_orig ]
then
mv /mnt/us/launchpad/developer.keystore.bkp_orig /var/local/java/keystore/developer.keystore
fi
###### Screensavers Hack (remove ad-sponsored banner and screensavers)
/etc/init.d/framework stop
rm /var/local/adunits
if [ -d /var/local/adunits.bkp ]
then
mv /var/local/adunits.bkp /var/local/adunits
fi
/etc/init.d/framework start
###### Kindlesec Hack (disable Amazon.com logging)
mntroot rw
mv /usr/sbin/syslog-ng~ /usr/sbin/syslog-ng
mv /usr/sbin/loginfo~ /usr/sbin/loginfo
mv /usr/sbin/tinyrot~ /usr/sbin/tinyrot
mv /usr/bin/showlog~ /usr/bin/showlog
###### Search Indexing Disabling/Enabling Hack
sed -i 's/-DENABLE_SEARCH_INDEXING_THREAD=false/-DENABLE_SEARCH_INDEXING_THREAD=true/' /opt/amazon/ebook/bin/start.sh
rm /opt/amazon/ebook/bin/start.sh.bkp
###### K3MusicManager
# remove new one and its backup:
mv /opt/amazon/ebook/security/external.policy /mnt/us/launchpad/
rm /mnt/us/launchpad/external.policy.bkp
# restore the old one if exist:
if [ -f /mnt/us/launchpad/external.policy.bkp_orig ]
then
mv /mnt/us/launchpad/external.policy.bkp_orig /opt/amazon/ebook/security/external.policy
fi
###### ReadabilityMod
# restore the old ones:
rm /usr/share/browser/readability/readability_min_utf16.css
rm /usr/share/browser/readability/readability_min_utf16.js
mv /usr/share/browser/readability/readability_min_utf16.css.bkp /usr/share/browser/readability/readability_min_utf16.css
mv /usr/share/browser/readability/readability_min_utf16.js.bkp /usr/share/browser/readability/readability_min_utf16.js
mntroot ro
else
echo "Customizations are not installed, so nothing to remove"
fi
exit
What would be ideal is to figure out how to incorporate all of the hacks that use a install.bin/uninstall.bin file to install/uninstall, into this script (Well, aside from having to install the Jailbreak hack, and then the Launchpad Hack, first). I looked into it, but haven't figured out how to yet. It would be grande to make it as easy as a script to install/uninstall the Font Hack, the Picture Album Viewer Fullscreen Hack, the USBNetwork Hack, the Usertts Hack, and even the Custom Screensavers Hack as well.