Ich versuche, ein Bash-Skript in /system/addon.d/ zu haben, das unerwünschte APKs aus einer nächtlichen Installation von Android 5.1 (CM12.1) für mein Galaxy Nexus-Telefon entfernt. Bei jedem neuen nächtlichen Reflash werden einige System-Apps neu installiert. Deshalb möchte ich, dass ein Skript diese Aktion umkehrt, damit ich sie nicht manuell ausführen muss.
Es gibt einige Backup-Skripte, die gut laufen (SU, GApps), aber mein eigenes Skript funktioniert nicht. Es ist unten zu finden.
Ich habe das Skript in /system/addon.d/ mit den Berechtigungen -rwxr-xr-x abgelegt (die gleichen Berechtigungen wie für andere Skripte in addon.d). Beim Flashen sehe ich das Echo nicht und die Apps werden nicht entfernt.
Ich habe Google ausprobiert und andere Skripte recherchiert, aber ich kann nicht herausfinden, was ich hier falsch mache. Hilfe ist willkommen!
#!/sbin/sh
#
# /system/addon.d/80-autoclean.sh
#
. /tmp/backuptool.functions
list_files() {
cat <<EOF
AudioFX
BackupRestoreConfirmation
BasicDreams
Browser
CMAccount
CMBugReport
Calendar
CyanogenSetupWizard
DeskClock
Eleven
Email
Exchange2
Galaxy4
HTMLViewer
HoloSpiralWallpaper
LatinIME
LiveWallpapers
LiveWallpapersPicker
LockClock
NoiseField
PhaseBeam
PhotoPhase
PhotoTable
Tag
Terminal
ThemeChooser
ThemesProvider
UserDictionaryProvider
VisualizationWallpapers
VpnDialogs
EOF
}
case "$1" in
backup)
# Stub
;;
restore)
# Stub
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
list_files | while read FILE; do
rm -rf /system/app/$FILE.apk
rm -rf /system/priv-app/$FILE.apk
rm -rf /system/app/$FILE
rm -rf /system/priv-app/$FILE
echo "Removed $FILE"
done
;;
esac
#!/sbin/sh
#
# /system/addon.d/77-MyApps.sh
#
# During a dirty flash, this script will backup files and apps at /system/*
# /system is formatted and reinstalled, then the files are restored.
#
. /tmp/backuptool.functions
list_files() {
cat <<EOF
app/ActionLauncher/base.apk
app/Dropbox/lib/arm/libblasV8.so
app/Dropbox/lib/arm/libDummyArchIndicator.so
app/Dropbox/lib/arm/librsjni.so
app/Dropbox/lib/arm/libRSSupport.so
app/Dropbox/base.apk
app/Eventbrite/base.apk
app/Flud/lib/arm/libclient.so
app/Flud/base.apk
app/GCalendar/base.apk
app/GMail/base.apk
app/GoogleCamera/lib/arm/libgcam.so
app/GoogleCamera/lib/arm/libgcam_swig_jni.so
app/GoogleCamera/lib/arm/libjni_pegutil.so
app/GoogleCamera/lib/arm/libjni_tinyplanet.so
app/GoogleCamera/lib/arm/libjpeg.so
app/GoogleCamera/lib/arm/liblightcycle.so
app/GoogleCamera/lib/arm/libnativehelper_compat_libc++.so
app/GoogleCamera/lib/arm/librefocus.so
app/GoogleCamera/lib/arm/librs.layered_filter_fast_f32.so
app/GoogleCamera/lib/arm/librsjni.so
app/GoogleCamera/lib/arm/libRSSupport.so
app/GoogleCamera/base.apk
app/GPlus/lib/arm/libcrashreporter.so
app/GPlus/lib/arm/libcronet.so
app/GPlus/lib/arm/libframesequence.so
app/GPlus/lib/arm/libphotoeditor_native.so
app/GPlus/lib/arm/libwebp_android.so
app/GPlus/base.apk
app/GPSStatus/base.apk
app/Greenify/base.apk
app/HereMaps/lib/arm/libCertResourcesPkg.so
app/HereMaps/lib/arm/libcrypto_here.so
app/HereMaps/lib/arm/libdatabase_sqlcipher.so
app/HereMaps/lib/arm/gnustl_shared.so
app/HereMaps/lib/arm/libLohitIndicFontPkg.so
app/HereMaps/lib/arm/libMapsEngineResourcePkg.so
app/HereMaps/lib/arm/libMAPSJNI.so
app/HereMaps/lib/arm/libNanumGothicFontPkg.so
app/HereMaps/lib/arm/libNuanceVocalizer.so
app/HereMaps/lib/arm/libposclient.so
app/HereMaps/lib/arm/libPureArabicFontPkg.so
app/HereMaps/lib/arm/libPureChineseFontPkg.so
app/HereMaps/lib/arm/libPureIndicSouthFontPkg.so
app/HereMaps/lib/arm/libPureThaiFontPkg.so
app/HereMaps/lib/arm/libSdkResourcePkg.so
app/HereMaps/lib/arm/libsqlcipher_android.so
app/HereMaps/lib/arm/libssl_here.so
app/HereMaps/lib/arm/libstlport_shared.so
app/HereMaps/base.apk
app/Keep/lib/arm/libsketchology_native.so
app/Keep/base.apk
app/KernelAdiutor/base.apk
app/Orbot/lib/arm/libtun2socks.so
app/Orbot/base.apk
app/Photos/lib/arm/libcrashreporterer.so
app/Photos/lib/arm/libfilterframework_jni.so
app/Photos/lib/arm/libcronet.so
app/Photos/lib/arm/libnative.so
app/Photos/lib/arm/framesequence.so
app/Photos/lib/arm/moviemaker-jni.so
app/Photos/base.apk
app/PlayGames/lib/arm/libgames_rtmp_jni.so
app/PlayGames/base.apk
app/PlayMusic/base.apk
app/Shuttle/base.apk
app/Polycon/base.apk
app/SEftp/base.apk
app/SolidExplorer/lib/arm/lib7z.so
app/SolidExplorer/lib/arm/libgif.so
app/SolidExplorer/base.apk
app/Webview/lib/arm/libwebviewchromium.so
app/Webview/base.apk
app/XDALabs/lib/arm/librealm-jni.so
app/XDALabs/base.apk
app/Xposed/base.apk
app/Youtube/lib/arm/libambisonic_audio_renderer.so
app/Youtube/lib/arm/libcronet.so
app/Youtube/lib/arm/libfilterframework_jni.so
app/Youtube/lib/arm/libluajit.so
app/Youtube/lib/arm/libm2ts_player.so
app/Youtube/lib/arm/libmoxie.so
app/Youtube/lib/arm/libmoxieclient.so
app/Youtube/lib/arm/librsjni.so
app/Youtube/lib/arm/libRSSupport.so
app/Youtube/lib/arm/libvpx.so
app/Youtube/lib/arm/libvpxJNI.so
app/Youtube/lib/arm/libvrtoolkit.so
app/Youtube/lib/arm/libwebp_android.so
app/Youtube/base.apk
EOF
}
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
rm -rf /system/app/Chromium
rm -rf /system/app/Email
rm -rf /system/app/Calendar
rm -rf /system/app/webview
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac
Ich habe dieses Skript zusammengeschustert, um mein Skript zu sichern (nach vielen Umflash- und Wiederherstellungsvorgängen) und einige AOSP-Alternativen zu entfernen. Es scheint, dass Sie den Code schreiben müssen, der nach dem Flashen dort ausgeführt werden soll ( webview
ist von älterem AOSP, während Webview
es ein schlankeres Durcheinander ist). Die Vorlage stammt von XDA in Bezug auf grinder777. Wenn das funktioniert, schenken Sie sich eine Tafel Schokolade und schicken Sie ihm (ihr?) ein Dankeschön. Wenn dies nicht der Fall ist, habe ich keine Ahnung, was passieren wird, abgesehen von dem, was @Android Dev gesagt hat, aber das ist nicht dauerhaft.
BEARBEITEN: Wie YouKnowNothingJohn sagte, benötigen Sie mindestens einen Sicherungsbefehl. Dieser Befehl könnte alles sein, sogar eine Dummy-Datei (zumindest in >4.4). Danke Herr Schnee.
Du bist AGitForNotUsingGit