[Magisk] ssurell:
Been using NanoDroid for a couple years and MicroG for longer. But here is the glaringly obvious problem:

NanoDroid/doc/GAppsRemoval.md at master · Nanolx/NanoDroid

[MIRROR] See https://gitlab.com/Nanolx/NanoDroid for main repository - Nanolx/NanoDroid

github.com

states "GApps and several location services...are removed during NanoDroid installation using NanoDroid-Overlay."

So first rattle out of the can is bogus information. None of the packages listed in GAppsRemoval.md are found in .nanodroid-overlay! In fact, the overlay configuration file is for everything under the sun except the core gapps and location services. https://github.com/Nanolx/NanoDroid/blob/master/doc/.nanodroid-overlay

I can see how this thread could have been smaller and less messy if the documentation was remotely accurate.

To control what is removed, you have modify the CommonInstaller file starting on line 2067:

##########################################################################################
# Destroy all GApps!
##########################################################################################

gapps_solve_conflicts () {
# first get rid of conflicting packages
print_google_apps | while read app; do
decho " ++ removing app: ${app} [google_apps]"
${NANODROID_BINDIR}/nanodroid-overlay --add ${app}

rm -rf /data/dalvik-cache/*/system"@priv-app@${app}"[@\.]*@classes.*
rm -rf /data/dalvik-cache/*/system"@app@${app}"[@\.]*@classes.*
done

print_google_data | while read app; do
decho " ++ removing data for: ${app} [google_data]"
rm -rf /data/data/${app}
rm -rf /data/user/*/${app}
rm -rf /data/user_de/*/${app}
rm -rf /data/app/${app}-*
rm -rf /mnt/asec/${app}-*
rm -rf ${STORAGE}/Android/data/${app}
done
}

gapps_destroy_artifacts () {
# this removes original Play Services
# only if this is a fresh NanoDroid installation
if [ "${NANODROID_UPGRADE}" -eq 0 ]; then
rm -rf /data/dalvik-cache/*/system"@priv-app@GmsCore"[@\.]*@classes.*

print_google_data_dirty | while read app; do
decho " ++ removing data for: ${app} [google_data_dirty]"
rm -rf /data/data/${app}
rm -rf /data/user/*/${app}
rm -rf /data/user_de/*/${app}
rm -rf /data/app/${app}-*
rm -rf /mnt/asec/${app}-*
rm -rf ${STORAGE}/Android/data/${app}
done

find /data/system* -type f -name 'accounts*db' 2>/dev/null | while read database; do
decho " ++ deleting Google Accounts from ${database} (if any)"
${INSTALLER}/sqlite3.${BIN_ARCH} ${database} \
"DELETE FROM accounts WHERE type='com.google';"
done

find /data/system/users -type f -name 'runtime-permissions.xml' 2>/dev/null | while read file; do
if grep -q "com.google.android" "${file}"; then
decho " ++ resetting permissions: ${file}"
rm -f "${file}"
fi
done

if [ -f /data/system/packages.list ]; then
print_google_data_dirty | while read app; do
decho " ++ de-registering app: ${app} (if installed)"
sed -e "/${app}/d" -i /data/system/packages.list
done
fi
fi
}

##########################################################################################
# GApps debloat list
# mostly by @ale5000
# extended for NanoDroid
##########################################################################################

print_google_apps()
{
cat <<EOF
AMAPNetworkLocation
BaiduNetworkLocation
BlankStore
ConfigUpdater
GCS
GmsCoreSetupPrebuilt
GmsCore_update
GoogleFeedback
GoogleLoginService
GoogleOneTimeInitializer
GoogleServicesFramework
GoogleConnectivityServices
GoogleTTS
LegacyNetworkLocation
MarketUpdater
MarkupGoogle
NetworkLocation
Phonesky
PlayGames
PlayStore
PrebuiltGmsCore
PrebuiltGmsCorePi
PrebuiltGmsCorePix
UnifiedNlp
Velvet
Vending
WhisperPush
EOF
}

print_google_data ()
{
cat <<EOF
com.amap.android.location
com.baidu.location
com.google.android.location
org.microg.nlp
org.microg.unifiednlp
EOF
}

print_google_data_dirty ()
{
cat <<EOF
com.android.vending
com.google.android.gms
com.google.android.gsf
com.google.android.gsf.login
com.google.android.feedback
com.mgoogle.android.gms
EOF
}