android-custom/dist-google/cm-data/99-perso-google-clean.sh.addon

72 lines
2.4 KiB
Bash
Executable File

#!/sbin/sh
#
# ADDOND_VERSION=3
#
# /system/addon.d/99-perso-google-clean.sh
#
# we partially use the script at install, if so, $SYSTEM, $PRODUCT, $SYSTEM_EXT are defined
if [ -z $SYSTEM ]; then
. /tmp/backuptool.functions
# build missing $PRODUCT and $SYSTEM_EXT from $S. Keep them inside system, real path is computed after using the get_output_path function
# see https://github.com/LineageOS/android_vendor_lineage/commit/c63fa8441bb5ad1fc4fb68155a5e5166aa25cac0#diff-9cf467ef8562a8e65ef885b33fe3f29cee408bb251fb05aed28661f08bfe0c64
SYS=$S
PRODUCT="$S/product"
SYSTEM_EXT="$S/system_ext"
else
# install in recovery, script assume $S and $SYS defined
S=$SYSTEM
SYS=$SYSTEM
# PRODUCT AND SYSTEM_EXT defined from recovery
get_output_path() {
# In recovery we mounted all partitions in the right place, so we can rely on symlinks
echo "$1"
}
fi
# path is needed when running from recovery (at install)
export PATH="${PATH}:$S/bin:$S/xbin"
case "$1" in
backup)
# Stub
;;
restore)
# Stub
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# remove google bloat from pico opengapps
rm -rf $(get_output_path $SYS/priv-app/GoogleBackupTransport)
rm -rf $(get_output_path $SYS/priv-app/GoogleFeedback)
rm -rf $(get_output_path $SYS/priv-app/GooglePartnerSetup)
rm -rf $(get_output_path $SYS/priv-app/GooglePackageInstaller)
#rm -rf $(get_output_path $SYS/priv-app/SetupWizard)
#rm -rf $(get_output_path $SYS/app/GoogleTTS)
rm -rf $(get_output_path $SYS/app/SoundPickerPrebuilt)
rm -f $(get_output_path $SYS/etc/permissions/com.google.android.dialer.support.xml)
rm -f $(get_output_path $SYS/framework/com.google.android.dialer.support.jar)
# MindTheGapps
rm -rf $(get_output_path $PRODUCT/app/PrebuiltExchange3Google)
rm -rf $(get_output_path $PRODUCT/app/MarkupGoogle)
rm -rf $(get_output_path $PRODUCT/app/talkback)
rm -rf $(get_output_path $PRODUCT/app/Tycho)
rm -rf $(get_output_path $PRODUCT/priv-app/AndroidMigratePrebuilt)
rm -rf $(get_output_path $PRODUCT/priv-app/SetupWizardPrebuilt)
rm -rf $(get_output_path $PRODUCT/priv-app/CarrierServices)
rm -rf $(get_output_path $PRODUCT/priv-app/DevicePersonalizationPrebuiltPixel4)
rm -rf $(get_output_path $PRODUCT/priv-app/SCONE)
rm -rf $(get_output_path $PRODUCT/priv-app/Velvet)
rm -rf $(get_output_path $SYSTEM_EXT/priv-app/GoogleFeedback)
;;
esac