I'm about to switch my outdated Samsung tablet and smartphones to LineageOS. But I want to make a backup of my device, including the OS and everything, in case something goes wrong and I need to flash the original OS back into the device.

How do I proceed? I think I need to do a Nandroid backup or something? Is that correct?

you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 1 month ago (2 children)

May I ask what the current tools of choice are for newer Androids? I currently still back up my apps using TitaniumBackup and I can even restore them, they just need manually fixing SELinux permissions on the restored files via a root shell. But I assume there are better alternatives out there nowadays.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 1 month ago (1 child)

    i've heard good stuff about Swift Backup and Neo Backup. but personally i'm on android 8 and 11, still using titanium backup since it works well enough.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 1 month ago

    Thanks, I'll take a look.

    If you ever want to restore on a newer Android (at least I needed this on lineageos with android 15 or 16), you need to fix SELinux permissions on the data files. This is the script I use after restoring, but before starting the app. Maybe it helps.

    #!/bin/bash
    # Fix restored file permissions by copying permissions from parent directory
    set -euo pipefail
    
    if [ "$#" -ne 1 ]; then
        echo "Usage: $0 /data/user/0/<appname>"
        exit 1
    fi
    
    APP_DIR=$1
    SEL_CONFIG=$(getfattr -d -n 'security.selinux' $APP_DIR | grep security.selinux | cut -d'=' -f2- | tr -d '"')
    find $APP_DIR -exec setfattr -n security.selinux -v "$SEL_CONFIG" {} \;
    
  • source
  • parent