1#!/bin/bash
2
3for user in `adb $* shell ls /data/system/users | grep -v xml`
4do
5  user=${user/$'\r'/}
6  adb shell mkdir /data/user/${user}/users
7  for photo in `adb $* shell ls /data/system/users | grep -v xml`
8  do
9    photo=${photo/$'\r'/}
10    adb shell mkdir /data/user/${user}/users/${photo}
11    adb pull /data/system/users/${photo}/photo.png
12    adb push photo.png /data/user/${user}/users/${photo}
13  done
14done
15