daily pastebin goal
82%
SHARE
TWEET

Maps

a guest Apr 21st, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app_title="Google Maps"
  2. package_name="com.google.android.apps.maps"
  3. simple_backup_dir="/storage/emulated/0/SimpleBackup"
  4. app_backup_dir="$simple_backup_dir/$app_title"
  5.  
  6. if [ ! -d "$simple_backup_dir" ]; then
  7. mkdir "$simple_backup_dir"
  8. fi
  9.  
  10. if [ ! -d "$app_backup_dir" ]; then
  11. mkdir "$app_backup_dir"
  12. else
  13. rm -rf "$app_backup_dir"
  14. mkdir "$app_backup_dir"
  15. fi
  16.  
  17. mkdir "$app_backup_dir/permissions"
  18.  
  19. cp -rf "/data/data/$package_name" "$app_backup_dir"
  20.  
  21. ls -1Rp /data/data/$package_name > "$app_backup_dir/includedfiles.txt"
  22.  
  23. slash="/"
  24.  
  25. while IFS='' read -r line || [[ -n "$line" ]]; do
  26.   if [ "${line/data/data/$package_name}" = "$line" ] ; then
  27.     if [ "${line/$slash}" = "$line" ] ; then
  28.       mkdir -p "$app_backup_dir/permissions/$cur_dir"
  29.       ls -l $cur_dir/$line | cut -c1-10 > "$app_backup_dir/permissions/$cur_dir/file_$line"
  30.     else
  31.       mkdir -p "$app_backup_dir/permissions/$cur_dir"
  32.       ls -ld $cur_dir/${line/$slash} | cut -c1-10 > "$app_backup_dir/permissions/$cur_dir/dir_${line/$slash}"
  33.     fi
  34.   else
  35.     cur_dir="${line/:}"
  36.   fi
  37. done < "$app_backup_dir/includedfiles.txt"
RAW Paste Data
Top