[Moto G 2015 Q&A, Help & Troubleshooting] D3V!Lc0r3:
[MENTION=7132115]therealduff1[/MENTION]: I've installed the stock firmware and it's not the first try. On every other device it's working without a problem.

It's not the solution to install a custom firmware. I wanna stay on stock because no custom firmware works correctly

with WiFi.

I've found the file 70-gapps.sh under /system/addon.d

Is that the problem ? I think so ... because the files will be backuped and restored ...

#!/sbin/sh
#
# /system/addon.d/70-gapps.sh
#
. /tmp/backuptool.functions

list_files() {
cat /tmp/gapps.prop
fi

free_tmp_size_kb=$(grep "^free_tmp_size_kb" /tmp/gapps.prop | cut -d= -f2)
if [ ! "$free_tmp_size_kb" ]; then
free_tmp_size_kb=$(df -k /tmp | tail -n 1 | awk '{ print $4 }')
echo "free_tmp_size_kb=$free_tmp_size_kb" >> /tmp/gapps.prop
fi

buffer_size_kb=204800
if [ $((installed_gapps_size_kb + buffer_size_kb)) -ge "$free_tmp_size_kb" ]; then
C=/sdcard/tmp-gapps
fi

case "$1" in
backup)
list_files | while read FILE DUMMY; do
backup_file "$S"/"$FILE"
done
;;
restore)
list_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file "$S"/"$FILE" "$R"
done
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Remove Stock/AOSP apps (from GApps Installer)
rm -rf /system/app/Calculator
rm -rf /system/app/ExactCalculator
rm -rf /system/app/FineOSCalculator
rm -rf /system/app/Calendar
rm -rf /system/app/FineOSCalendar
rm -rf /system/priv-app/Calendar
rm -rf /system/app/DeskClock
rm -rf /system/app/FineOSDeskClock
rm -rf /system/app/Exchange2
rm -rf /system/priv-app/Exchange2
rm -rf /system/app/PackageInstaller
rm -rf /system/priv-app/PackageInstaller
rm -rf /system/priv-app/packageinstaller
rm -rf /system/priv-app/Tag

# Remove 'other' apps (per installer.data)
rm -rf /system/app/CalendarGoogle
rm -rf /system/app/CloudPrint
rm -rf /system/app/DeskClockGoogle
rm -rf /system/app/EditorsDocsStub
rm -rf /system/app/EditorsSheetsStub
rm -rf /system/app/EditorsSlidesStub
rm -rf /system/app/Gmail
rm -rf /system/app/Gmail2
rm -rf /system/app/GoogleCalendar
rm -rf /system/app/GoogleCloudPrint
rm -rf /system/app/GoogleHangouts
rm -rf /system/app/GoogleKeep
rm -rf /system/app/GoogleLatinIme
rm -rf /system/app/GooglePlus
rm -rf /system/app/Keep
rm -rf /system/app/NewsWeather
rm -rf /system/app/NewsstandStub
rm -rf /system/app/PartnerBookmarksProvider
rm -rf /system/app/PrebuiltBugleStub
rm -rf /system/app/PrebuiltKeepStub
rm -rf /system/app/QuickSearchBox
rm -rf /system/app/Vending
rm -rf /system/priv-app/GmsCore
rm -rf /system/priv-app/GmsCore_update
rm -rf /system/priv-app/GoogleHangouts
rm -rf /system/priv-app/GoogleNow
rm -rf /system/priv-app/GoogleSearch
rm -rf /system/priv-app/OneTimeInitializer
rm -rf /system/priv-app/QuickSearchBox
rm -rf /system/priv-app/Velvet_update
rm -rf /system/priv-app/Vending

# Remove 'priv-app' apps from 'app' (per installer.data)
rm -rf /system/app/ConfigUpdater
rm -rf /system/app/GoogleBackupTransport
rm -rf /system/app/GoogleFeedback
rm -rf /system/app/GoogleLoginService
rm -rf /system/app/GoogleOneTimeInitializer
rm -rf /system/app/GooglePartnerSetup
rm -rf /system/app/GoogleServicesFramework
rm -rf /system/app/OneTimeInitializer
rm -rf /system/app/Phonesky
rm -rf /system/app/PrebuiltGmsCore
rm -rf /system/app/SetupWizard
rm -rf /system/app/Velvet

# Remove 'required' apps (per installer.data)
rm -rf /system/app/LatinIME/lib/arm/libjni_latinimegoogle.so
rm -rf /system/lib/libjni_latinimegoogle.so
rm -rf /system/lib64/libjni_latinimegoogle.so

# Remove 'user requested' apps (from gapps-config)

;;
post-restore)
# Recreate required symlinks (from GApps Installer)
install -d "/system/app/FaceLock/lib/arm"
ln -sfn "/system/lib/libfacelock_jni.so" "/system/app/FaceLock/lib/arm/libfacelock_jni.so"
install -d "/system/app/LatinIME/lib/arm"
ln -sfn "/system/lib/libjni_latinimegoogle.so" "/system/app/LatinIME/lib/arm/libjni_latinimegoogle.so"

# Remove any empty folders we may have created during the removal process
for i in /system/app /system/priv-app /system/vendor/pittpatt /system/usr/srec /system/vendor/pittpatt; do
find $i -type d | xargs -r rmdir -p --ignore-fail-on-non-empty;
done;
# Fix ownership/permissions and clean up after backup and restore from /sdcard
find /system/vendor/pittpatt -type d -exec chown 0:2000 '{}' \; # Change pittpatt folders to root:shell per Google Factory Settings
for i in $(list_files); do
chown root:root "/system/$i"
chmod 644 "/system/$i"
chmod 755 $(dirname "/system/$i")
done
rm -rf /sdcard/tmp-gapps
;;
esac