Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #tools
- sudo apt install adb fastboot fdroidcl
- ######INSTALL APPS#####
- #attach old phone and get a list of installed apps
- --all apps
- adb shell pm list packages > app.lst
- ---just installed apps
- adb shell pm list packages -3 -f > app.lst
- #attach new phone and install apps from frdoid
- cat app.lst|while read app;do fdroidcl install $app;done
- ##or you can pull all installed packages
- for APP in $(adb shell pm list packages -3 -f)
- do
- adb pull $( echo ${APP} | sed "s/^package://" | sed "s/base.apk=/base.apk /").apk
- done
- ###pull apks from old device###
- for i in $(adb shell pm list packages -3 | awk -F':' '{print $2}'); do
- adb pull "$(adb shell pm path $i | awk -F':' '{print $2}')"
- mv base.apk $i.apk &> /dev/null
- done
- #######COPY APP DATA#######
- #attach old phone and backup app data
- for APP in $(adb shell pm list packages -3)
- do
- APP=$( echo ${APP} | sed "s/^package://")
- adb backup -apk -f ${APP}.backup ${APP}
- done
- #install and grant all permissions
- for app in *.apk;
- do
- echo $app
- adb install -g "$app"
- done
- #restore app data
- adb restore app.backup
- #uninstall unwanted apps
- adb shell pm uninstall --user 0 $(adb shell pm list packages |cut -d\: -f2|fzf)
- ####TERMUX####
- #notes from https://wiki.termux.com/wiki/Backing_up_Termux
- #BACKUP
- tar -zcf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files ./home ./usr
- #restore
- tar -zxf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files --recursive-unlink --preserve-permissions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement