Default Keeping Xposed installed after CyanogenMod updates

Quote:
Originally Posted by chrisaw View Post
Care to share?

I already have a flashable ZIP that I flash after every nightly - updates the DPI, switched the language from US to GB. Installs openssl and curl for a tasker profile I'm running and adds browser2ram. Adding this script would be no problem and would certainly resolve the 'issue'.
Ok, here is what I did. I'm using CM10.1 and update the nightlies via CyanDelta. I don't wipe /data, so the only thing that gets overwritten by the new version is /system/bin/xposed. I read somewhere that /system/addon.d/ contains scripts to backup and restore files. So I just copied 50-cm.sh to 90-xposed.sh and changed two lines and the comment:
Code:
#!/sbin/sh
#
# /system/addon.d/90-xposed.sh
# During an upgrade, this script backs up /system/bin/app_process,
# /system is formatted and reinstalled, then the file is restored.
#

. /tmp/backuptool.functions

list_files() {
cat <<EOF
bin/app_process
bin/app_process.orig
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
  ;;
  pre-backup)
    # Stub
  ;;
  post-backup)
    # Stub
  ;;
  pre-restore)
    # Stub
  ;;
  post-restore)
    # Stub
  ;;
esac
I think this should work on any CyanogenMod-based ROM. If you have a /system/addon.d/ and it contains similar files, there are good chances it works. I suggest you copy one of the existing files and adjust it (instead of using the example above). If no such folder exists, it will not work.

One risk with this procedure: I don't know if the restore of these files can be prevented. So if for whatever reason Xposed's app_process executable becomes incompatible with a new CM version, you would have a hard time restoring the original executable.
Tired of updating your mod for every new ROM release?
You want give users the possibility to combine different mods without creating tons of different files for all possible combinations?
Then have a look at my Xposed framework - modifications without APK changes!