#!/bin/bash
oldifs=$IFS
IFS=$'\n'
sdcard="/storage/emulated/0"

adb shell find $sdcard/mark || adb shell touch -d 1970-01-0100:00:00 $sdcard/mark
for dir in $(adb shell find  /storage -type d -newer $sdcard/mark | sed 's/^/./g')
do
	mkdir -p $dir
done
for file in $(adb shell find  /storage -type f -newer $sdcard/mark)
do
	echo $file
	filename=$(basename $file)
	dest=$(echo $file|sed 's/^/./g');
	adb pull $file 
	mv "$filename" "$dest"
done
for dir in $(adb shell find  $sdcard -type d -newer $sdcard/mark | sed 's/^/./g')
do
	mkdir -p $dir
done
for file in $(adb shell find  $sdcard -type f -newer $sdcard/mark)
do
	echo $file
	filename=$(basename $file)
	dest=$(echo $file|sed 's/^/./g');
	adb pull $file 
	mv "$filename" "$dest"
done
adb shell rm $sdcard/mark
adb shell touch $sdcard/mark
IFS="$oldifs"

